diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index a14970d2eec0..617f70b3dd65 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -539,6 +539,7 @@ com.azure.resourcemanager:azure-resourcemanager-billing-trust;1.0.0-beta.1;1.0.0 com.azure.resourcemanager:azure-resourcemanager-containerservicepreparedimgspec;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-enclave;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-containerserviceaimanager;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-platformvalidation;1.0.0-beta.1;1.0.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-storagesync;1.0.0;1.1.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1 com.azure.tools:azure-sdk-build-tool;1.0.0;1.1.0-beta.1 diff --git a/pom.xml b/pom.xml index 1d30ff40cc35..e0d60d62c2fd 100644 --- a/pom.xml +++ b/pom.xml @@ -205,6 +205,7 @@ sdk/peering sdk/pineconevectordb sdk/planetarycomputer + sdk/platformvalidation sdk/playwright sdk/playwrighttesting sdk/policyinsights diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/CHANGELOG.md b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/CHANGELOG.md new file mode 100644 index 000000000000..b27ca1589339 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/CHANGELOG.md @@ -0,0 +1,8 @@ +# Release History + +## 1.0.0-beta.1 (2026-08-19) + +- Azure Resource Manager Platform Validation client library for Java. This package contains Microsoft Azure SDK for Platform Validation Management SDK. Microsoft.PlatformValidation Resource Provider management API. Package api-version 2026-07-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +### Features Added + +- Initial release for the azure-resourcemanager-platformvalidation Java SDK. diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/README.md b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/README.md new file mode 100644 index 000000000000..193839b02539 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager Platform Validation client library for Java + +Azure Resource Manager Platform Validation client library for Java. + +This package contains Microsoft Azure SDK for Platform Validation Management SDK. Microsoft.PlatformValidation Resource Provider management API. Package api-version 2026-07-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-platformvalidation;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-platformvalidation + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. + +### Authentication + +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. + +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. + +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: + +```java +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +PlatformValidationManager manager = PlatformValidationManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/platformvalidation/azure-resourcemanager-platformvalidation/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide][cg]. + +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/SAMPLE.md b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/SAMPLE.md new file mode 100644 index 000000000000..cf85e38b9146 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/SAMPLE.md @@ -0,0 +1,859 @@ +# Code snippets and samples + + +## CloudValidations + +- [CreateOrUpdate](#cloudvalidations_createorupdate) +- [Delete](#cloudvalidations_delete) +- [GetByResourceGroup](#cloudvalidations_getbyresourcegroup) +- [List](#cloudvalidations_list) +- [ListByResourceGroup](#cloudvalidations_listbyresourcegroup) +- [Update](#cloudvalidations_update) + +## ExecutionPlanRuns + +- [CreateOrUpdate](#executionplanruns_createorupdate) +- [Delete](#executionplanruns_delete) +- [Get](#executionplanruns_get) +- [ListByExecutionPlan](#executionplanruns_listbyexecutionplan) + +## OperationStatus + +- [Get](#operationstatus_get) + +## Operations + +- [List](#operations_list) + +## ValidationExecutionPlans + +- [CreateOrUpdate](#validationexecutionplans_createorupdate) +- [Delete](#validationexecutionplans_delete) +- [Get](#validationexecutionplans_get) +- [ListByResourceGroup](#validationexecutionplans_listbyresourcegroup) +- [Update](#validationexecutionplans_update) + +## ValidationTestCategories + +- [Get](#validationtestcategories_get) +- [List](#validationtestcategories_list) + +## ValidationTestRuns + +- [CreateOrUpdate](#validationtestruns_createorupdate) +- [Delete](#validationtestruns_delete) +- [Get](#validationtestruns_get) +- [ListByExecutionPlanRun](#validationtestruns_listbyexecutionplanrun) + +## ValidationTestVersions + +- [Get](#validationtestversions_get) +- [List](#validationtestversions_list) + +## ValidationTests + +- [Get](#validationtests_get) +- [List](#validationtests_list) +### CloudValidations_CreateOrUpdate + +```java +import com.azure.resourcemanager.platformvalidation.models.CloudValidationOverallState; +import com.azure.resourcemanager.platformvalidation.models.CloudValidationProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudValidations CreateOrUpdate. + */ +public final class CloudValidationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/CloudValidations_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: CloudValidations_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void cloudValidationsCreateOrUpdateMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.cloudValidations() + .define("cvtest01") + .withRegion("byryro") + .withExistingResourceGroup("rgvalidate") + .withTags(mapOf("key2277", "fakeTokenPlaceholder")) + .withProperties(new CloudValidationProperties().withDescription("ezutdlxrzaemjqpqpandwfixfkfk") + .withOverallState(CloudValidationOverallState.ENABLED)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### CloudValidations_Delete + +```java +/** + * Samples for CloudValidations Delete. + */ +public final class CloudValidationsDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/CloudValidations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: CloudValidations_Delete_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void cloudValidationsDeleteMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.cloudValidations().delete("rgvalidate", "cvtest01", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudValidations_GetByResourceGroup + +```java +/** + * Samples for CloudValidations GetByResourceGroup. + */ +public final class CloudValidationsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-07-01-preview/CloudValidations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: CloudValidations_Get_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void + cloudValidationsGetMaximumSet(com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.cloudValidations() + .getByResourceGroupWithResponse("rgvalidate", "cvtest01", com.azure.core.util.Context.NONE); + } +} +``` + +### CloudValidations_List + +```java +/** + * Samples for CloudValidations List. + */ +public final class CloudValidationsListSamples { + /* + * x-ms-original-file: 2026-07-01-preview/CloudValidations_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: CloudValidations_ListBySubscription_MinimumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void cloudValidationsListBySubscriptionMinimumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.cloudValidations().list(null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/CloudValidations_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: CloudValidations_ListBySubscription_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void cloudValidationsListBySubscriptionMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.cloudValidations().list(null, com.azure.core.util.Context.NONE); + } +} +``` + +### CloudValidations_ListByResourceGroup + +```java +/** + * Samples for CloudValidations ListByResourceGroup. + */ +public final class CloudValidationsListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-07-01-preview/CloudValidations_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: CloudValidations_ListByResourceGroup_MinimumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void cloudValidationsListByResourceGroupMinimumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.cloudValidations().listByResourceGroup("rgplatformvalidation", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/CloudValidations_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: CloudValidations_ListByResourceGroup_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void cloudValidationsListByResourceGroupMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.cloudValidations().listByResourceGroup("rgvalidate", null, com.azure.core.util.Context.NONE); + } +} +``` + +### CloudValidations_Update + +```java +import com.azure.resourcemanager.platformvalidation.models.CloudValidation; +import com.azure.resourcemanager.platformvalidation.models.CloudValidationOverallState; +import com.azure.resourcemanager.platformvalidation.models.CloudValidationUpdateProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudValidations Update. + */ +public final class CloudValidationsUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/CloudValidations_Update_MaximumSet_Gen.json + */ + /** + * Sample code: CloudValidations_Update_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void cloudValidationsUpdateMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + CloudValidation resource = manager.cloudValidations() + .getByResourceGroupWithResponse("rgvalidate", "cvtest01", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key3330", "fakeTokenPlaceholder")) + .withProperties(new CloudValidationUpdateProperties().withDescription("ezutdlxrzaemjqpqpandwfixfkfk") + .withOverallState(CloudValidationOverallState.ENABLED)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ExecutionPlanRuns_CreateOrUpdate + +```java +import com.azure.resourcemanager.platformvalidation.models.ExecutionPlanRunProperties; + +/** + * Samples for ExecutionPlanRuns CreateOrUpdate. + */ +public final class ExecutionPlanRunsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ExecutionPlanRuns_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: ExecutionPlanRuns_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void executionPlanRunsCreateOrUpdateMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.executionPlanRuns() + .define("veprun01") + .withExistingValidationExecutionPlan("rgvalidate", "cvtest01", "veptest01") + .withProperties(new ExecutionPlanRunProperties().withDescription("zwakqazgtploz")) + .create(); + } +} +``` + +### ExecutionPlanRuns_Delete + +```java +/** + * Samples for ExecutionPlanRuns Delete. + */ +public final class ExecutionPlanRunsDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ExecutionPlanRuns_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: ExecutionPlanRuns_Delete_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void executionPlanRunsDeleteMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.executionPlanRuns() + .delete("rgvalidate", "cvtest01", "veptest01", "veprun01", com.azure.core.util.Context.NONE); + } +} +``` + +### ExecutionPlanRuns_Get + +```java +/** + * Samples for ExecutionPlanRuns Get. + */ +public final class ExecutionPlanRunsGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ExecutionPlanRuns_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ExecutionPlanRuns_Get_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void + executionPlanRunsGetMaximumSet(com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.executionPlanRuns() + .getWithResponse("rgvalidate", "cvtest01", "veptest01", "veprun01", com.azure.core.util.Context.NONE); + } +} +``` + +### ExecutionPlanRuns_ListByExecutionPlan + +```java +/** + * Samples for ExecutionPlanRuns ListByExecutionPlan. + */ +public final class ExecutionPlanRunsListByExecutionPlanSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ExecutionPlanRuns_ListByExecutionPlan_MaximumSet_Gen.json + */ + /** + * Sample code: ExecutionPlanRuns_ListByExecutionPlan_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void executionPlanRunsListByExecutionPlanMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.executionPlanRuns() + .listByExecutionPlan("rgvalidate", "cvtest01", "veptest01", null, com.azure.core.util.Context.NONE); + } +} +``` + +### OperationStatus_Get + +```java +/** + * Samples for OperationStatus Get. + */ +public final class OperationStatusGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/OperationStatus_Get_MinimumSet_Gen.json + */ + /** + * Sample code: OperationStatus_Get_MaximumSet - generated by [MinimumSet] rule. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void operationStatusGetMaximumSetGeneratedByMinimumSetRule( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.operationStatus() + .getWithResponse("obkgllzbzclv", "mewjfcrlycxuylboqxenpnsxxgcncx", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/OperationStatus_Get_MaximumSet_Gen.json + */ + /** + * Sample code: OperationStatus_Get_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void + operationStatusGetMaximumSet(com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.operationStatus() + .getWithResponse("obkgllzbzclv", "mewjfcrlycxuylboqxenpnsxxgcncx", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void + operationsListMinimumSet(com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void + operationsListMaximumSet(com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### ValidationExecutionPlans_CreateOrUpdate + +```java +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanOverallState; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ValidationExecutionPlans CreateOrUpdate. + */ +public final class ValidationExecutionPlansCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationExecutionPlans_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationExecutionPlans_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationExecutionPlansCreateOrUpdateMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationExecutionPlans() + .define("veptest01") + .withRegion("cqqovjagjsndikbdlpltbtxisptjh") + .withExistingCloudValidation("rgvalidate", "cvtest01") + .withTags(mapOf("key3482", "fakeTokenPlaceholder")) + .withProperties(new ValidationExecutionPlanProperties().withDescription("ortzzlmaoxmwtcjkjkvuxx") + .withPlanConfigurationUri("xsouolufo") + .withPlanConfigurationJson("vmqqmcdpvhgu") + .withOverallState(ValidationExecutionPlanOverallState.ENABLED)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ValidationExecutionPlans_Delete + +```java +/** + * Samples for ValidationExecutionPlans Delete. + */ +public final class ValidationExecutionPlansDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationExecutionPlans_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationExecutionPlans_Delete_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationExecutionPlansDeleteMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationExecutionPlans() + .delete("rgvalidate", "cvtest01", "veptest01", com.azure.core.util.Context.NONE); + } +} +``` + +### ValidationExecutionPlans_Get + +```java +/** + * Samples for ValidationExecutionPlans Get. + */ +public final class ValidationExecutionPlansGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationExecutionPlans_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationExecutionPlans_Get_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationExecutionPlansGetMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationExecutionPlans() + .getWithResponse("rgvalidate", "cvtest01", "veptest01", com.azure.core.util.Context.NONE); + } +} +``` + +### ValidationExecutionPlans_ListByResourceGroup + +```java +/** + * Samples for ValidationExecutionPlans ListByResourceGroup. + */ +public final class ValidationExecutionPlansListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationExecutionPlans_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationExecutionPlans_ListByResourceGroup_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationExecutionPlansListByResourceGroupMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationExecutionPlans() + .listByResourceGroup("rgvalidate", "cvtest01", null, com.azure.core.util.Context.NONE); + } +} +``` + +### ValidationExecutionPlans_Update + +```java +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlan; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanOverallState; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanUpdateProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ValidationExecutionPlans Update. + */ +public final class ValidationExecutionPlansUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationExecutionPlans_Update_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationExecutionPlans_Update_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationExecutionPlansUpdateMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + ValidationExecutionPlan resource = manager.validationExecutionPlans() + .getWithResponse("rgvalidate", "cvtest01", "veptest01", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key145", "fakeTokenPlaceholder")) + .withProperties(new ValidationExecutionPlanUpdateProperties().withDescription("ortzzlmaoxmwtcjkjkvuxx") + .withPlanConfigurationUri("xsouolufo") + .withPlanConfigurationJson("vmqqmcdpvhgu") + .withOverallState(ValidationExecutionPlanOverallState.ENABLED)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### ValidationTestCategories_Get + +```java +/** + * Samples for ValidationTestCategories Get. + */ +public final class ValidationTestCategoriesGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestCategories_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTestCategories_Get_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestCategoriesGetMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestCategories().getWithResponse("olnmhyteecutmvckbt", com.azure.core.util.Context.NONE); + } +} +``` + +### ValidationTestCategories_List + +```java +/** + * Samples for ValidationTestCategories List. + */ +public final class ValidationTestCategoriesListSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestCategories_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: ValidationTestCategories_ListBySubscription_MinimumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestCategoriesListBySubscriptionMinimumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestCategories().list(null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestCategories_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTestCategories_ListBySubscription_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestCategoriesListBySubscriptionMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestCategories().list("yolfvidccdfa", com.azure.core.util.Context.NONE); + } +} +``` + +### ValidationTestRuns_CreateOrUpdate + +```java +import com.azure.resourcemanager.platformvalidation.models.ValidationTestRunProperties; +import java.util.Arrays; + +/** + * Samples for ValidationTestRuns CreateOrUpdate. + */ +public final class ValidationTestRunsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestRuns_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTestRuns_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestRunsCreateOrUpdateMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestRuns() + .define("vtrun01") + .withExistingExecutionPlanRun("rgvalidate", "cvtest01", "veptest01", "veprun01") + .withProperties(new ValidationTestRunProperties().withTestId("validation-test-001") + .withTestCategoryIds(Arrays.asList("cat-network", "cat-security")) + .withInputsJson("{\"region\":\"eastus\",\"sku\":\"standard\"}")) + .create(); + } +} +``` + +### ValidationTestRuns_Delete + +```java +/** + * Samples for ValidationTestRuns Delete. + */ +public final class ValidationTestRunsDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestRuns_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTestRuns_Delete_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestRunsDeleteMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestRuns() + .delete("rgvalidate", "cvtest01", "veptest01", "veprun01", "vtrun01", com.azure.core.util.Context.NONE); + } +} +``` + +### ValidationTestRuns_Get + +```java +/** + * Samples for ValidationTestRuns Get. + */ +public final class ValidationTestRunsGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestRuns_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTestRuns_Get_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestRunsGetMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestRuns() + .getWithResponse("rgvalidate", "cvtest01", "veptest01", "veprun01", "vtrun01", + com.azure.core.util.Context.NONE); + } +} +``` + +### ValidationTestRuns_ListByExecutionPlanRun + +```java +/** + * Samples for ValidationTestRuns ListByExecutionPlanRun. + */ +public final class ValidationTestRunsListByExecutionPlanRunSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestRuns_ListByExecutionPlanRun_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTestRuns_ListByExecutionPlanRun_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestRunsListByExecutionPlanRunMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestRuns() + .listByExecutionPlanRun("rgvalidate", "cvtest01", "veptest01", "veprun01", + com.azure.core.util.Context.NONE); + } +} +``` + +### ValidationTestVersions_Get + +```java +/** + * Samples for ValidationTestVersions Get. + */ +public final class ValidationTestVersionsGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestVersions_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTestVersions_Get_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestVersionsGetMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestVersions().getWithResponse("test1", "1.0.0", com.azure.core.util.Context.NONE); + } +} +``` + +### ValidationTestVersions_List + +```java +/** + * Samples for ValidationTestVersions List. + */ +public final class ValidationTestVersionsListSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestVersions_List_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTestVersions_List_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestVersionsListMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestVersions().list("test1", "yolfvidccdfa", com.azure.core.util.Context.NONE); + } +} +``` + +### ValidationTests_Get + +```java +/** + * Samples for ValidationTests Get. + */ +public final class ValidationTestsGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTests_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTests_Get_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void + validationTestsGetMaximumSet(com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTests().getWithResponse("pgaqtvwrkwboi", com.azure.core.util.Context.NONE); + } +} +``` + +### ValidationTests_List + +```java +/** + * Samples for ValidationTests List. + */ +public final class ValidationTestsListSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTests_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTests_ListBySubscription_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestsListBySubscriptionMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTests().list("yolfvidccdfa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTests_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: ValidationTests_ListBySubscription_MinimumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestsListBySubscriptionMinimumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTests().list(null, com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/pom.xml b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/pom.xml new file mode 100644 index 000000000000..d20153c5dc92 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/pom.xml @@ -0,0 +1,74 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-platformvalidation + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for Platform Validation Management + This package contains Microsoft Azure SDK for Platform Validation Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft.PlatformValidation Resource Provider management API. Package api-version 2026-07-01-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + 0 + 0 + true + + + + com.azure + azure-core + 1.59.0 + + + com.azure + azure-core-management + 1.19.6 + + + com.azure + azure-core-test + 1.27.0-beta.17 + test + + + com.azure + azure-identity + 1.18.4 + test + + + diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/PlatformValidationManager.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/PlatformValidationManager.java new file mode 100644 index 000000000000..c3b9b7d00cf6 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/PlatformValidationManager.java @@ -0,0 +1,413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation; + +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.BearerTokenAuthenticationPolicy; +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.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.platformvalidation.fluent.PlatformValidationManagementClient; +import com.azure.resourcemanager.platformvalidation.implementation.CloudValidationsImpl; +import com.azure.resourcemanager.platformvalidation.implementation.ExecutionPlanRunsImpl; +import com.azure.resourcemanager.platformvalidation.implementation.OperationStatusImpl; +import com.azure.resourcemanager.platformvalidation.implementation.OperationsImpl; +import com.azure.resourcemanager.platformvalidation.implementation.PlatformValidationManagementClientBuilder; +import com.azure.resourcemanager.platformvalidation.implementation.ValidationExecutionPlansImpl; +import com.azure.resourcemanager.platformvalidation.implementation.ValidationTestCategoriesImpl; +import com.azure.resourcemanager.platformvalidation.implementation.ValidationTestRunsImpl; +import com.azure.resourcemanager.platformvalidation.implementation.ValidationTestVersionsImpl; +import com.azure.resourcemanager.platformvalidation.implementation.ValidationTestsImpl; +import com.azure.resourcemanager.platformvalidation.models.CloudValidations; +import com.azure.resourcemanager.platformvalidation.models.ExecutionPlanRuns; +import com.azure.resourcemanager.platformvalidation.models.OperationStatus; +import com.azure.resourcemanager.platformvalidation.models.Operations; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlans; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestCategories; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestRuns; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestVersions; +import com.azure.resourcemanager.platformvalidation.models.ValidationTests; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to PlatformValidationManager. + * Microsoft.PlatformValidation Resource Provider management API. + */ +public final class PlatformValidationManager { + private OperationStatus operationStatus; + + private Operations operations; + + private CloudValidations cloudValidations; + + private ValidationExecutionPlans validationExecutionPlans; + + private ExecutionPlanRuns executionPlanRuns; + + private ValidationTestRuns validationTestRuns; + + private ValidationTests validationTests; + + private ValidationTestVersions validationTestVersions; + + private ValidationTestCategories validationTestCategories; + + private final PlatformValidationManagementClient clientObject; + + private PlatformValidationManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new PlatformValidationManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of Platform Validation service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Platform Validation service API instance. + */ + public static PlatformValidationManager 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 Platform Validation service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Platform Validation service API instance. + */ + public static PlatformValidationManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new PlatformValidationManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create PlatformValidationManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new PlatformValidationManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-platformvalidation.properties"); + + 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 Platform Validation service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the Platform Validation service API instance. + */ + public PlatformValidationManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.platformvalidation") + .append("/") + .append(clientVersion); + 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 BearerTokenAuthenticationPolicy(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 PlatformValidationManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of OperationStatus. + * + * @return Resource collection API of OperationStatus. + */ + public OperationStatus operationStatus() { + if (this.operationStatus == null) { + this.operationStatus = new OperationStatusImpl(clientObject.getOperationStatus(), this); + } + return operationStatus; + } + + /** + * 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 CloudValidations. It manages CloudValidation. + * + * @return Resource collection API of CloudValidations. + */ + public CloudValidations cloudValidations() { + if (this.cloudValidations == null) { + this.cloudValidations = new CloudValidationsImpl(clientObject.getCloudValidations(), this); + } + return cloudValidations; + } + + /** + * Gets the resource collection API of ValidationExecutionPlans. It manages ValidationExecutionPlan. + * + * @return Resource collection API of ValidationExecutionPlans. + */ + public ValidationExecutionPlans validationExecutionPlans() { + if (this.validationExecutionPlans == null) { + this.validationExecutionPlans + = new ValidationExecutionPlansImpl(clientObject.getValidationExecutionPlans(), this); + } + return validationExecutionPlans; + } + + /** + * Gets the resource collection API of ExecutionPlanRuns. It manages ExecutionPlanRun. + * + * @return Resource collection API of ExecutionPlanRuns. + */ + public ExecutionPlanRuns executionPlanRuns() { + if (this.executionPlanRuns == null) { + this.executionPlanRuns = new ExecutionPlanRunsImpl(clientObject.getExecutionPlanRuns(), this); + } + return executionPlanRuns; + } + + /** + * Gets the resource collection API of ValidationTestRuns. It manages ValidationTestRun. + * + * @return Resource collection API of ValidationTestRuns. + */ + public ValidationTestRuns validationTestRuns() { + if (this.validationTestRuns == null) { + this.validationTestRuns = new ValidationTestRunsImpl(clientObject.getValidationTestRuns(), this); + } + return validationTestRuns; + } + + /** + * Gets the resource collection API of ValidationTests. + * + * @return Resource collection API of ValidationTests. + */ + public ValidationTests validationTests() { + if (this.validationTests == null) { + this.validationTests = new ValidationTestsImpl(clientObject.getValidationTests(), this); + } + return validationTests; + } + + /** + * Gets the resource collection API of ValidationTestVersions. + * + * @return Resource collection API of ValidationTestVersions. + */ + public ValidationTestVersions validationTestVersions() { + if (this.validationTestVersions == null) { + this.validationTestVersions + = new ValidationTestVersionsImpl(clientObject.getValidationTestVersions(), this); + } + return validationTestVersions; + } + + /** + * Gets the resource collection API of ValidationTestCategories. + * + * @return Resource collection API of ValidationTestCategories. + */ + public ValidationTestCategories validationTestCategories() { + if (this.validationTestCategories == null) { + this.validationTestCategories + = new ValidationTestCategoriesImpl(clientObject.getValidationTestCategories(), this); + } + return validationTestCategories; + } + + /** + * Gets wrapped service client PlatformValidationManagementClient providing direct access to the underlying + * auto-generated API implementation, based on Azure REST API. + * + * @return Wrapped service client PlatformValidationManagementClient. + */ + public PlatformValidationManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/CloudValidationsClient.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/CloudValidationsClient.java new file mode 100644 index 000000000000..f30d22dd7d81 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/CloudValidationsClient.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.platformvalidation.fluent.models.CloudValidationInner; +import com.azure.resourcemanager.platformvalidation.models.CloudValidationUpdate; + +/** + * An instance of this class provides access to all the operations defined in CloudValidationsClient. + */ +public interface CloudValidationsClient { + /** + * Get a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @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 cloud validation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String cloudValidationName, + Context context); + + /** + * Get a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @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 cloud validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudValidationInner getByResourceGroup(String resourceGroupName, String cloudValidationName); + + /** + * Create or update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudValidationInner> beginCreateOrUpdate(String resourceGroupName, + String cloudValidationName, CloudValidationInner resource); + + /** + * Create or update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudValidationInner> beginCreateOrUpdate(String resourceGroupName, + String cloudValidationName, CloudValidationInner resource, Context context); + + /** + * Create or update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param resource Resource create parameters. + * @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 cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudValidationInner createOrUpdate(String resourceGroupName, String cloudValidationName, + CloudValidationInner resource); + + /** + * Create or update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param resource Resource create parameters. + * @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 cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudValidationInner createOrUpdate(String resourceGroupName, String cloudValidationName, + CloudValidationInner resource, Context context); + + /** + * Update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param properties The resource properties to be 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 the {@link SyncPoller} for polling of cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudValidationInner> beginUpdate(String resourceGroupName, + String cloudValidationName, CloudValidationUpdate properties); + + /** + * Update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CloudValidationInner> beginUpdate(String resourceGroupName, + String cloudValidationName, CloudValidationUpdate properties, Context context); + + /** + * Update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param properties The resource properties to be 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 cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudValidationInner update(String resourceGroupName, String cloudValidationName, CloudValidationUpdate properties); + + /** + * Update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param properties The resource properties to be 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 cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CloudValidationInner update(String resourceGroupName, String cloudValidationName, CloudValidationUpdate properties, + Context context); + + /** + * Delete a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String cloudValidationName); + + /** + * Delete a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String cloudValidationName, + Context context); + + /** + * Delete a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @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 cloudValidationName); + + /** + * Delete a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String cloudValidationName, Context context); + + /** + * List cloud validations by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List cloud validations by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The OData filter expression to apply to the list operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); + + /** + * List cloud validations by 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 the response of a CloudValidation list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List cloud validations by subscription. + * + * @param filter The OData filter expression to apply to the list operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Context context); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ExecutionPlanRunsClient.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ExecutionPlanRunsClient.java new file mode 100644 index 000000000000..76ff83d5643d --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ExecutionPlanRunsClient.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.platformvalidation.fluent.models.ExecutionPlanRunInner; + +/** + * An instance of this class provides access to all the operations defined in ExecutionPlanRunsClient. + */ +public interface ExecutionPlanRunsClient { + /** + * Get a Validation test execution plan run details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @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 Validation test execution plan run details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, Context context); + + /** + * Get a Validation test execution plan run details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @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 Validation test execution plan run details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExecutionPlanRunInner get(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName); + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the properties of the execution plan run. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExecutionPlanRunInner> beginCreateOrUpdate(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String executionPlanRunName, + ExecutionPlanRunInner resource); + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the properties of the execution plan run. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExecutionPlanRunInner> beginCreateOrUpdate(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String executionPlanRunName, + ExecutionPlanRunInner resource, Context context); + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param resource Resource create parameters. + * @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 properties of the execution plan run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExecutionPlanRunInner createOrUpdate(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, ExecutionPlanRunInner resource); + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param resource Resource create parameters. + * @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 properties of the execution plan run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExecutionPlanRunInner createOrUpdate(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, ExecutionPlanRunInner resource, + Context context); + + /** + * Delete a validation test execution plan run resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName); + + /** + * Delete a validation test execution plan run resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, Context context); + + /** + * Delete a validation test execution plan run resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @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 cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName); + + /** + * Delete a validation test execution plan run resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, Context context); + + /** + * List Validation test execution plan runs for an execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ExecutionPlanRun list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByExecutionPlan(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName); + + /** + * List Validation test execution plan runs for an execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param filter The OData filter expression to apply to the list operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ExecutionPlanRun list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByExecutionPlan(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String filter, Context context); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/OperationStatusClient.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/OperationStatusClient.java new file mode 100644 index 000000000000..9bbc611de2e0 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/OperationStatusClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.platformvalidation.fluent.models.OperationStatusResultInner; + +/** + * An instance of this class provides access to all the operations defined in OperationStatusClient. + */ +public interface OperationStatusClient { + /** + * Returns the current status of an async operation. + * + * @param location The name of the Azure region. + * @param operationId The ID of an ongoing async operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String location, String operationId, Context context); + + /** + * Returns the current status of an async operation. + * + * @param location The name of the Azure region. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner get(String location, String operationId); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/OperationsClient.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/OperationsClient.java new file mode 100644 index 000000000000..58451a30ce03 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/OperationsClient.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.platformvalidation.fluent.models.OperationInner; + +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ +public interface OperationsClient { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/PlatformValidationManagementClient.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/PlatformValidationManagementClient.java new file mode 100644 index 000000000000..9607ed51cb6f --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/PlatformValidationManagementClient.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for PlatformValidationManagementClient class. + */ +public interface PlatformValidationManagementClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationStatusClient object to access its operations. + * + * @return the OperationStatusClient object. + */ + OperationStatusClient getOperationStatus(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the CloudValidationsClient object to access its operations. + * + * @return the CloudValidationsClient object. + */ + CloudValidationsClient getCloudValidations(); + + /** + * Gets the ValidationExecutionPlansClient object to access its operations. + * + * @return the ValidationExecutionPlansClient object. + */ + ValidationExecutionPlansClient getValidationExecutionPlans(); + + /** + * Gets the ExecutionPlanRunsClient object to access its operations. + * + * @return the ExecutionPlanRunsClient object. + */ + ExecutionPlanRunsClient getExecutionPlanRuns(); + + /** + * Gets the ValidationTestRunsClient object to access its operations. + * + * @return the ValidationTestRunsClient object. + */ + ValidationTestRunsClient getValidationTestRuns(); + + /** + * Gets the ValidationTestsClient object to access its operations. + * + * @return the ValidationTestsClient object. + */ + ValidationTestsClient getValidationTests(); + + /** + * Gets the ValidationTestVersionsClient object to access its operations. + * + * @return the ValidationTestVersionsClient object. + */ + ValidationTestVersionsClient getValidationTestVersions(); + + /** + * Gets the ValidationTestCategoriesClient object to access its operations. + * + * @return the ValidationTestCategoriesClient object. + */ + ValidationTestCategoriesClient getValidationTestCategories(); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationExecutionPlansClient.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationExecutionPlansClient.java new file mode 100644 index 000000000000..888bdfc7a88b --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationExecutionPlansClient.java @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationExecutionPlanInner; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanUpdate; + +/** + * An instance of this class provides access to all the operations defined in ValidationExecutionPlansClient. + */ +public interface ValidationExecutionPlansClient { + /** + * Get a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @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 validation test execution plan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, Context context); + + /** + * Get a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @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 validation test execution plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidationExecutionPlanInner get(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName); + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidationExecutionPlanInner> beginCreateOrUpdate( + String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + ValidationExecutionPlanInner resource); + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidationExecutionPlanInner> beginCreateOrUpdate( + String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + ValidationExecutionPlanInner resource, Context context); + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param resource Resource create parameters. + * @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 validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidationExecutionPlanInner createOrUpdate(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, ValidationExecutionPlanInner resource); + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param resource Resource create parameters. + * @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 validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidationExecutionPlanInner createOrUpdate(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, ValidationExecutionPlanInner resource, Context context); + + /** + * Update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param properties The resource properties to be 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 the {@link SyncPoller} for polling of validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidationExecutionPlanInner> beginUpdate( + String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + ValidationExecutionPlanUpdate properties); + + /** + * Update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidationExecutionPlanInner> beginUpdate( + String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + ValidationExecutionPlanUpdate properties, Context context); + + /** + * Update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param properties The resource properties to be 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 validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidationExecutionPlanInner update(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, ValidationExecutionPlanUpdate properties); + + /** + * Update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param properties The resource properties to be 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 validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidationExecutionPlanInner update(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, ValidationExecutionPlanUpdate properties, Context context); + + /** + * Delete a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName); + + /** + * Delete a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, Context context); + + /** + * Delete a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @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 cloudValidationName, String validationExecutionPlanName); + + /** + * Delete a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + Context context); + + /** + * List validation test execution plans by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationExecutionPlan list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + String cloudValidationName); + + /** + * List validation test execution plans by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param filter The OData filter expression to apply to the list operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationExecutionPlan list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, + String cloudValidationName, String filter, Context context); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationTestCategoriesClient.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationTestCategoriesClient.java new file mode 100644 index 000000000000..691fdb60cb44 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationTestCategoriesClient.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.platformvalidation.fluent.models.ValidationTestCategoryInner; + +/** + * An instance of this class provides access to all the operations defined in ValidationTestCategoriesClient. + */ +public interface ValidationTestCategoriesClient { + /** + * Get a validation test category catalog entry. + * + * @param validationTestCategoryName The name of the ValidationTestCategory. + * @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 validation test category catalog entry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String validationTestCategoryName, Context context); + + /** + * Get a validation test category catalog entry. + * + * @param validationTestCategoryName The name of the ValidationTestCategory. + * @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 validation test category catalog entry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidationTestCategoryInner get(String validationTestCategoryName); + + /** + * List validation test category catalog entries for 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 the response of a ValidationTestCategory list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List validation test category catalog entries for a subscription. + * + * @param filter Filter expression used to constrain the returned items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestCategory list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Context context); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationTestRunsClient.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationTestRunsClient.java new file mode 100644 index 000000000000..1a2109b742a0 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationTestRunsClient.java @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestRunInner; + +/** + * An instance of this class provides access to all the operations defined in ValidationTestRunsClient. + */ +public interface ValidationTestRunsClient { + /** + * Get a validation test run details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @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 validation test run details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName, Context context); + + /** + * Get a validation test run details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @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 validation test run details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidationTestRunInner get(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, String validationTestRunName); + + /** + * Create or update a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of validation Test Run represents execution instance(s) of a + * Validation Test instance under execution plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidationTestRunInner> beginCreateOrUpdate(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String executionPlanRunName, + String validationTestRunName, ValidationTestRunInner resource); + + /** + * Create or update a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of validation Test Run represents execution instance(s) of a + * Validation Test instance under execution plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ValidationTestRunInner> beginCreateOrUpdate(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String executionPlanRunName, + String validationTestRunName, ValidationTestRunInner resource, Context context); + + /** + * Create or update a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param resource Resource create parameters. + * @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 validation Test Run represents execution instance(s) of a Validation Test instance under execution plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidationTestRunInner createOrUpdate(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName, + ValidationTestRunInner resource); + + /** + * Create or update a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param resource Resource create parameters. + * @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 validation Test Run represents execution instance(s) of a Validation Test instance under execution plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidationTestRunInner createOrUpdate(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName, + ValidationTestRunInner resource, Context context); + + /** + * Delete a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName); + + /** + * Delete a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName, Context context); + + /** + * Delete a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @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 cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, String validationTestRunName); + + /** + * Delete a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, String validationTestRunName, Context context); + + /** + * List validation test runs for an execution plan run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestRun list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByExecutionPlanRun(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName); + + /** + * List validation test runs for an execution plan run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestRun list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByExecutionPlanRun(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, Context context); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationTestVersionsClient.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationTestVersionsClient.java new file mode 100644 index 000000000000..3e4f6b156629 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationTestVersionsClient.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.platformvalidation.fluent.models.ValidationTestVersionInner; + +/** + * An instance of this class provides access to all the operations defined in ValidationTestVersionsClient. + */ +public interface ValidationTestVersionsClient { + /** + * Get a validation test version catalog entry. + * + * @param validationTestName The name of the ValidationTest. + * @param version The name of the ValidationTestVersion. + * @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 validation test version catalog entry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String validationTestName, String version, Context context); + + /** + * Get a validation test version catalog entry. + * + * @param validationTestName The name of the ValidationTest. + * @param version The name of the ValidationTestVersion. + * @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 validation test version catalog entry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidationTestVersionInner get(String validationTestName, String version); + + /** + * List validation test version catalog entries. + * + * @param validationTestName The name of the ValidationTest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String validationTestName); + + /** + * List validation test version catalog entries. + * + * @param validationTestName The name of the ValidationTest. + * @param filter Filter expression used to constrain the returned items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String validationTestName, String filter, Context context); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationTestsClient.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationTestsClient.java new file mode 100644 index 000000000000..a687ece878ab --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationTestsClient.java @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.platformvalidation.fluent.models.ValidationTestInner; + +/** + * An instance of this class provides access to all the operations defined in ValidationTestsClient. + */ +public interface ValidationTestsClient { + /** + * Get a validation test catalog entry. + * + * @param validationTestName The name of the ValidationTest. + * @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 validation test catalog entry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String validationTestName, Context context); + + /** + * Get a validation test catalog entry. + * + * @param validationTestName The name of the ValidationTest. + * @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 validation test catalog entry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ValidationTestInner get(String validationTestName); + + /** + * List validation test catalog entries for 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 the response of a ValidationTest list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List validation test catalog entries for a subscription. + * + * @param filter Filter expression used to constrain the returned items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTest list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String filter, Context context); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/CloudValidationInner.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/CloudValidationInner.java new file mode 100644 index 000000000000..8039bf499166 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/CloudValidationInner.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.platformvalidation.models.CloudValidationProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Cloud Validation Resource. + */ +@Fluent +public final class CloudValidationInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private CloudValidationProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CloudValidationInner class. + */ + public CloudValidationInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public CloudValidationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the CloudValidationInner object itself. + */ + public CloudValidationInner withProperties(CloudValidationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public CloudValidationInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CloudValidationInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudValidationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudValidationInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CloudValidationInner. + */ + public static CloudValidationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudValidationInner deserializedCloudValidationInner = new CloudValidationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCloudValidationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCloudValidationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCloudValidationInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedCloudValidationInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudValidationInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedCloudValidationInner.properties = CloudValidationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCloudValidationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudValidationInner; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ExecutionPlanRunInner.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ExecutionPlanRunInner.java new file mode 100644 index 000000000000..e3dfa550e629 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ExecutionPlanRunInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.platformvalidation.models.ExecutionPlanRunProperties; +import java.io.IOException; + +/** + * The properties of the execution plan run. + */ +@Fluent +public final class ExecutionPlanRunInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private ExecutionPlanRunProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ExecutionPlanRunInner class. + */ + public ExecutionPlanRunInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ExecutionPlanRunProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ExecutionPlanRunInner object itself. + */ + public ExecutionPlanRunInner withProperties(ExecutionPlanRunProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecutionPlanRunInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecutionPlanRunInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExecutionPlanRunInner. + */ + public static ExecutionPlanRunInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecutionPlanRunInner deserializedExecutionPlanRunInner = new ExecutionPlanRunInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedExecutionPlanRunInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedExecutionPlanRunInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExecutionPlanRunInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedExecutionPlanRunInner.properties = ExecutionPlanRunProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedExecutionPlanRunInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedExecutionPlanRunInner; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/OperationInner.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/OperationInner.java new file mode 100644 index 000000000000..2e4f93a239e0 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/OperationInner.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.platformvalidation.models.ActionType; +import com.azure.resourcemanager.platformvalidation.models.OperationDisplay; +import com.azure.resourcemanager.platformvalidation.models.Origin; +import java.io.IOException; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Immutable +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + 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" + */ + private Origin origin; + + /* + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + private 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 Azure Resource Manager/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; + } + + /** + * 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: Extensible 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/OperationStatusResultInner.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/OperationStatusResultInner.java new file mode 100644 index 000000000000..cb92a37c0671 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/OperationStatusResultInner.java @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * The current status of an async operation. + */ +@Immutable +public final class OperationStatusResultInner implements JsonSerializable { + /* + * Fully qualified ID for the async operation. + */ + private String id; + + /* + * Name of the async operation. + */ + private String name; + + /* + * Operation status. + */ + private String status; + + /* + * Percent of the operation that is complete. + */ + private Double percentComplete; + + /* + * The start time of the operation. + */ + private OffsetDateTime startTime; + + /* + * The end time of the operation. + */ + private OffsetDateTime endTime; + + /* + * The operations list. + */ + private List operations; + + /* + * If present, details of the operation error. + */ + private ManagementError error; + + /* + * Fully qualified ID of the resource against which the original async operation was started. + */ + private String resourceId; + + /** + * Creates an instance of OperationStatusResultInner class. + */ + private OperationStatusResultInner() { + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Double percentComplete() { + return this.percentComplete; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the operations property: The operations list. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("percentComplete", this.percentComplete); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeArrayField("operations", this.operations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusResultInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationStatusResultInner. + */ + public static OperationStatusResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusResultInner deserializedOperationStatusResultInner = new OperationStatusResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedOperationStatusResultInner.status = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedOperationStatusResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOperationStatusResultInner.name = reader.getString(); + } else if ("percentComplete".equals(fieldName)) { + deserializedOperationStatusResultInner.percentComplete = reader.getNullable(JsonReader::getDouble); + } else if ("startTime".equals(fieldName)) { + deserializedOperationStatusResultInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedOperationStatusResultInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("operations".equals(fieldName)) { + List operations + = reader.readArray(reader1 -> OperationStatusResultInner.fromJson(reader1)); + deserializedOperationStatusResultInner.operations = operations; + } else if ("error".equals(fieldName)) { + deserializedOperationStatusResultInner.error = ManagementError.fromJson(reader); + } else if ("resourceId".equals(fieldName)) { + deserializedOperationStatusResultInner.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusResultInner; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationExecutionPlanInner.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationExecutionPlanInner.java new file mode 100644 index 000000000000..81f1c52df919 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationExecutionPlanInner.java @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Validation Test Execution Plan. + */ +@Fluent +public final class ValidationExecutionPlanInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private ValidationExecutionPlanProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ValidationExecutionPlanInner class. + */ + public ValidationExecutionPlanInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ValidationExecutionPlanProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ValidationExecutionPlanInner object itself. + */ + public ValidationExecutionPlanInner withProperties(ValidationExecutionPlanProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ValidationExecutionPlanInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ValidationExecutionPlanInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationExecutionPlanInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationExecutionPlanInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidationExecutionPlanInner. + */ + public static ValidationExecutionPlanInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationExecutionPlanInner deserializedValidationExecutionPlanInner = new ValidationExecutionPlanInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedValidationExecutionPlanInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedValidationExecutionPlanInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedValidationExecutionPlanInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedValidationExecutionPlanInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedValidationExecutionPlanInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedValidationExecutionPlanInner.properties + = ValidationExecutionPlanProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedValidationExecutionPlanInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationExecutionPlanInner; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationTestCategoryInner.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationTestCategoryInner.java new file mode 100644 index 000000000000..1a07003c8505 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationTestCategoryInner.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestCategoryProperties; +import java.io.IOException; + +/** + * Validation test category catalog entry. + */ +@Immutable +public final class ValidationTestCategoryInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private ValidationTestCategoryProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ValidationTestCategoryInner class. + */ + private ValidationTestCategoryInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ValidationTestCategoryProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationTestCategoryInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationTestCategoryInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidationTestCategoryInner. + */ + public static ValidationTestCategoryInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationTestCategoryInner deserializedValidationTestCategoryInner = new ValidationTestCategoryInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedValidationTestCategoryInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedValidationTestCategoryInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedValidationTestCategoryInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedValidationTestCategoryInner.properties + = ValidationTestCategoryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedValidationTestCategoryInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationTestCategoryInner; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationTestInner.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationTestInner.java new file mode 100644 index 000000000000..a653d1e0bae7 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationTestInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestProperties; +import java.io.IOException; + +/** + * Validation test catalog entry. + */ +@Immutable +public final class ValidationTestInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private ValidationTestProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ValidationTestInner class. + */ + private ValidationTestInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ValidationTestProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationTestInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationTestInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidationTestInner. + */ + public static ValidationTestInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationTestInner deserializedValidationTestInner = new ValidationTestInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedValidationTestInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedValidationTestInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedValidationTestInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedValidationTestInner.properties = ValidationTestProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedValidationTestInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationTestInner; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationTestRunInner.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationTestRunInner.java new file mode 100644 index 000000000000..bcfb9850125e --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationTestRunInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestRunProperties; +import java.io.IOException; + +/** + * Validation Test Run represents execution instance(s) of a Validation Test instance under execution plan. + */ +@Fluent +public final class ValidationTestRunInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private ValidationTestRunProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ValidationTestRunInner class. + */ + public ValidationTestRunInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ValidationTestRunProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ValidationTestRunInner object itself. + */ + public ValidationTestRunInner withProperties(ValidationTestRunProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationTestRunInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationTestRunInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidationTestRunInner. + */ + public static ValidationTestRunInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationTestRunInner deserializedValidationTestRunInner = new ValidationTestRunInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedValidationTestRunInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedValidationTestRunInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedValidationTestRunInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedValidationTestRunInner.properties = ValidationTestRunProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedValidationTestRunInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationTestRunInner; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationTestVersionInner.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationTestVersionInner.java new file mode 100644 index 000000000000..c627d99c801a --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationTestVersionInner.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestVersionProperties; +import java.io.IOException; + +/** + * Validation test version catalog entry. + */ +@Immutable +public final class ValidationTestVersionInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private ValidationTestVersionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ValidationTestVersionInner class. + */ + private ValidationTestVersionInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ValidationTestVersionProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationTestVersionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationTestVersionInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidationTestVersionInner. + */ + public static ValidationTestVersionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationTestVersionInner deserializedValidationTestVersionInner = new ValidationTestVersionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedValidationTestVersionInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedValidationTestVersionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedValidationTestVersionInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedValidationTestVersionInner.properties + = ValidationTestVersionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedValidationTestVersionInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationTestVersionInner; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/package-info.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/package-info.java new file mode 100644 index 000000000000..2b2add15d08c --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the inner data models for PlatformValidation. + * Microsoft.PlatformValidation Resource Provider management API. + */ +package com.azure.resourcemanager.platformvalidation.fluent.models; diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/package-info.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/package-info.java new file mode 100644 index 000000000000..30fffbbd6df4 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the service clients for PlatformValidation. + * Microsoft.PlatformValidation Resource Provider management API. + */ +package com.azure.resourcemanager.platformvalidation.fluent; diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/CloudValidationImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/CloudValidationImpl.java new file mode 100644 index 000000000000..b848cef1c456 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/CloudValidationImpl.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.platformvalidation.fluent.models.CloudValidationInner; +import com.azure.resourcemanager.platformvalidation.models.CloudValidation; +import com.azure.resourcemanager.platformvalidation.models.CloudValidationProperties; +import com.azure.resourcemanager.platformvalidation.models.CloudValidationUpdate; +import com.azure.resourcemanager.platformvalidation.models.CloudValidationUpdateProperties; +import java.util.Collections; +import java.util.Map; + +public final class CloudValidationImpl implements CloudValidation, CloudValidation.Definition, CloudValidation.Update { + private CloudValidationInner innerObject; + + private final com.azure.resourcemanager.platformvalidation.PlatformValidationManager 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 CloudValidationProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public CloudValidationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String cloudValidationName; + + private CloudValidationUpdate updateProperties; + + public CloudValidationImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public CloudValidation create() { + this.innerObject = serviceManager.serviceClient() + .getCloudValidations() + .createOrUpdate(resourceGroupName, cloudValidationName, this.innerModel(), Context.NONE); + return this; + } + + public CloudValidation create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudValidations() + .createOrUpdate(resourceGroupName, cloudValidationName, this.innerModel(), context); + return this; + } + + CloudValidationImpl(String name, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerObject = new CloudValidationInner(); + this.serviceManager = serviceManager; + this.cloudValidationName = name; + } + + public CloudValidationImpl update() { + this.updateProperties = new CloudValidationUpdate(); + return this; + } + + public CloudValidation apply() { + this.innerObject = serviceManager.serviceClient() + .getCloudValidations() + .update(resourceGroupName, cloudValidationName, updateProperties, Context.NONE); + return this; + } + + public CloudValidation apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudValidations() + .update(resourceGroupName, cloudValidationName, updateProperties, context); + return this; + } + + CloudValidationImpl(CloudValidationInner innerObject, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.cloudValidationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "cloudValidations"); + } + + public CloudValidation refresh() { + this.innerObject = serviceManager.serviceClient() + .getCloudValidations() + .getByResourceGroupWithResponse(resourceGroupName, cloudValidationName, Context.NONE) + .getValue(); + return this; + } + + public CloudValidation refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getCloudValidations() + .getByResourceGroupWithResponse(resourceGroupName, cloudValidationName, context) + .getValue(); + return this; + } + + public CloudValidationImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public CloudValidationImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public CloudValidationImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public CloudValidationImpl withProperties(CloudValidationProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public CloudValidationImpl withProperties(CloudValidationUpdateProperties properties) { + this.updateProperties.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel() == null || this.innerModel().id() == null; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/CloudValidationsClientImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/CloudValidationsClientImpl.java new file mode 100644 index 000000000000..26e3a8522d22 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/CloudValidationsClientImpl.java @@ -0,0 +1,1159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.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.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.platformvalidation.fluent.CloudValidationsClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.CloudValidationInner; +import com.azure.resourcemanager.platformvalidation.implementation.models.CloudValidationListResult; +import com.azure.resourcemanager.platformvalidation.models.CloudValidationUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CloudValidationsClient. + */ +public final class CloudValidationsClientImpl implements CloudValidationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CloudValidationsService service; + + /** + * The service client containing this operation class. + */ + private final PlatformValidationManagementClientImpl client; + + /** + * Initializes an instance of CloudValidationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CloudValidationsClientImpl(PlatformValidationManagementClientImpl client) { + this.service + = RestProxy.create(CloudValidationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PlatformValidationManagementClientCloudValidations to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "PlatformValidationManagementClientCloudValidations") + public interface CloudValidationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CloudValidationInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CloudValidationInner resource, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CloudValidationUpdate properties, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CloudValidationUpdate properties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/cloudValidations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/cloudValidations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cloud validation along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String cloudValidationName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cloud validation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String cloudValidationName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, cloudValidationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @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 cloud validation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String cloudValidationName, Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, accept, context); + } + + /** + * Get a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cloud validation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudValidationInner getByResourceGroup(String resourceGroupName, String cloudValidationName) { + return getByResourceGroupWithResponse(resourceGroupName, cloudValidationName, Context.NONE).getValue(); + } + + /** + * Create or update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Validation Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String cloudValidationName, CloudValidationInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, contentType, accept, resource, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Validation Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String cloudValidationName, + CloudValidationInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, contentType, accept, resource, + Context.NONE); + } + + /** + * Create or update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param resource Resource create parameters. + * @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 cloud Validation Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String cloudValidationName, + CloudValidationInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, contentType, accept, resource, + context); + } + + /** + * Create or update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudValidationInner> + beginCreateOrUpdateAsync(String resourceGroupName, String cloudValidationName, CloudValidationInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, cloudValidationName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CloudValidationInner.class, CloudValidationInner.class, this.client.getContext()); + } + + /** + * Create or update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudValidationInner> + beginCreateOrUpdate(String resourceGroupName, String cloudValidationName, CloudValidationInner resource) { + Response response = createOrUpdateWithResponse(resourceGroupName, cloudValidationName, resource); + return this.client.getLroResult(response, + CloudValidationInner.class, CloudValidationInner.class, Context.NONE); + } + + /** + * Create or update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudValidationInner> beginCreateOrUpdate( + String resourceGroupName, String cloudValidationName, CloudValidationInner resource, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, cloudValidationName, resource, context); + return this.client.getLroResult(response, + CloudValidationInner.class, CloudValidationInner.class, context); + } + + /** + * Create or update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Validation Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String cloudValidationName, + CloudValidationInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, cloudValidationName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudValidationInner createOrUpdate(String resourceGroupName, String cloudValidationName, + CloudValidationInner resource) { + return beginCreateOrUpdate(resourceGroupName, cloudValidationName, resource).getFinalResult(); + } + + /** + * Create or update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param resource Resource create parameters. + * @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 cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudValidationInner createOrUpdate(String resourceGroupName, String cloudValidationName, + CloudValidationInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, cloudValidationName, resource, context).getFinalResult(); + } + + /** + * Update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param properties The resource properties to be 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 cloud Validation Resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String cloudValidationName, CloudValidationUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, contentType, accept, + properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param properties The resource properties to be 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 cloud Validation Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String cloudValidationName, + CloudValidationUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, contentType, accept, properties, + Context.NONE); + } + + /** + * Update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param properties The resource properties to be 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 cloud Validation Resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String cloudValidationName, + CloudValidationUpdate properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, contentType, accept, properties, + context); + } + + /** + * Update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CloudValidationInner> + beginUpdateAsync(String resourceGroupName, String cloudValidationName, CloudValidationUpdate properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, cloudValidationName, properties); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CloudValidationInner.class, CloudValidationInner.class, this.client.getContext()); + } + + /** + * Update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudValidationInner> beginUpdate(String resourceGroupName, + String cloudValidationName, CloudValidationUpdate properties) { + Response response = updateWithResponse(resourceGroupName, cloudValidationName, properties); + return this.client.getLroResult(response, + CloudValidationInner.class, CloudValidationInner.class, Context.NONE); + } + + /** + * Update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CloudValidationInner> beginUpdate(String resourceGroupName, + String cloudValidationName, CloudValidationUpdate properties, Context context) { + Response response = updateWithResponse(resourceGroupName, cloudValidationName, properties, context); + return this.client.getLroResult(response, + CloudValidationInner.class, CloudValidationInner.class, context); + } + + /** + * Update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param properties The resource properties to be 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 cloud Validation Resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String cloudValidationName, + CloudValidationUpdate properties) { + return beginUpdateAsync(resourceGroupName, cloudValidationName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param properties The resource properties to be 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 cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudValidationInner update(String resourceGroupName, String cloudValidationName, + CloudValidationUpdate properties) { + return beginUpdate(resourceGroupName, cloudValidationName, properties).getFinalResult(); + } + + /** + * Update a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param properties The resource properties to be 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 cloud Validation Resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CloudValidationInner update(String resourceGroupName, String cloudValidationName, + CloudValidationUpdate properties, Context context) { + return beginUpdate(resourceGroupName, cloudValidationName, properties, context).getFinalResult(); + } + + /** + * Delete a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cloudValidationName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String cloudValidationName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, Context.NONE); + } + + /** + * Delete a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String cloudValidationName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, context); + } + + /** + * Delete a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String cloudValidationName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, cloudValidationName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudValidationName) { + Response response = deleteWithResponse(resourceGroupName, cloudValidationName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudValidationName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, cloudValidationName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cloudValidationName) { + return beginDeleteAsync(resourceGroupName, cloudValidationName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cloudValidationName) { + beginDelete(resourceGroupName, cloudValidationName).getFinalResult(); + } + + /** + * Delete a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String cloudValidationName, Context context) { + beginDelete(resourceGroupName, cloudValidationName, context).getFinalResult(); + } + + /** + * List cloud validations by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The OData filter expression to apply to the list operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String filter) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List cloud validations by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The OData filter expression to apply to the list operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List cloud validations by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String filter = null; + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List cloud validations by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The OData filter expression to apply to the list operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, String filter) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List cloud validations by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The OData filter expression to apply to the list operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, String filter, + Context context) { + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List cloud validations by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String filter = null; + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, filter), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * List cloud validations by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The OData filter expression to apply to the list operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, filter, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * List cloud validations by subscription. + * + * @param filter The OData filter expression to apply to the list operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List cloud validations by subscription. + * + * @param filter The OData filter expression to apply to the list operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List cloud validations by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List cloud validations by subscription. + * + * @param filter The OData filter expression to apply to the list operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String filter) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List cloud validations by subscription. + * + * @param filter The OData filter expression to apply to the list operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String filter, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List cloud validations by subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + return new PagedIterable<>(() -> listSinglePage(filter), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * List cloud validations by subscription. + * + * @param filter The OData filter expression to apply to the list operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(() -> listSinglePage(filter, context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/CloudValidationsImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/CloudValidationsImpl.java new file mode 100644 index 000000000000..c0250cc01b47 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/CloudValidationsImpl.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.platformvalidation.fluent.CloudValidationsClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.CloudValidationInner; +import com.azure.resourcemanager.platformvalidation.models.CloudValidation; +import com.azure.resourcemanager.platformvalidation.models.CloudValidations; + +public final class CloudValidationsImpl implements CloudValidations { + private static final ClientLogger LOGGER = new ClientLogger(CloudValidationsImpl.class); + + private final CloudValidationsClient innerClient; + + private final com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager; + + public CloudValidationsImpl(CloudValidationsClient innerClient, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String cloudValidationName, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, cloudValidationName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CloudValidationImpl(inner.getValue(), this.manager())); + } + + public CloudValidation getByResourceGroup(String resourceGroupName, String cloudValidationName) { + CloudValidationInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, cloudValidationName); + if (inner != null) { + return new CloudValidationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String cloudValidationName) { + this.serviceClient().delete(resourceGroupName, cloudValidationName); + } + + public void delete(String resourceGroupName, String cloudValidationName, Context context) { + this.serviceClient().delete(resourceGroupName, cloudValidationName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudValidationImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, String filter, + Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudValidationImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudValidationImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CloudValidationImpl(inner1, this.manager())); + } + + public CloudValidation getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 cloudValidationName = ResourceManagerUtils.getValueFromIdByName(id, "cloudValidations"); + if (cloudValidationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudValidations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, cloudValidationName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 cloudValidationName = ResourceManagerUtils.getValueFromIdByName(id, "cloudValidations"); + if (cloudValidationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudValidations'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, cloudValidationName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 cloudValidationName = ResourceManagerUtils.getValueFromIdByName(id, "cloudValidations"); + if (cloudValidationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudValidations'.", id))); + } + this.delete(resourceGroupName, cloudValidationName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 cloudValidationName = ResourceManagerUtils.getValueFromIdByName(id, "cloudValidations"); + if (cloudValidationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudValidations'.", id))); + } + this.delete(resourceGroupName, cloudValidationName, context); + } + + private CloudValidationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } + + public CloudValidationImpl define(String name) { + return new CloudValidationImpl(name, this.manager()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ExecutionPlanRunImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ExecutionPlanRunImpl.java new file mode 100644 index 000000000000..8342e5c34d66 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ExecutionPlanRunImpl.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.platformvalidation.fluent.models.ExecutionPlanRunInner; +import com.azure.resourcemanager.platformvalidation.models.ExecutionPlanRun; +import com.azure.resourcemanager.platformvalidation.models.ExecutionPlanRunProperties; + +public final class ExecutionPlanRunImpl + implements ExecutionPlanRun, ExecutionPlanRun.Definition, ExecutionPlanRun.Update { + private ExecutionPlanRunInner innerObject; + + private final com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ExecutionPlanRunProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ExecutionPlanRunInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String cloudValidationName; + + private String validationExecutionPlanName; + + private String executionPlanRunName; + + public ExecutionPlanRunImpl withExistingValidationExecutionPlan(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName) { + this.resourceGroupName = resourceGroupName; + this.cloudValidationName = cloudValidationName; + this.validationExecutionPlanName = validationExecutionPlanName; + return this; + } + + public ExecutionPlanRun create() { + this.innerObject = serviceManager.serviceClient() + .getExecutionPlanRuns() + .createOrUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + this.innerModel(), Context.NONE); + return this; + } + + public ExecutionPlanRun create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getExecutionPlanRuns() + .createOrUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + this.innerModel(), context); + return this; + } + + ExecutionPlanRunImpl(String name, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerObject = new ExecutionPlanRunInner(); + this.serviceManager = serviceManager; + this.executionPlanRunName = name; + } + + public ExecutionPlanRunImpl update() { + return this; + } + + public ExecutionPlanRun apply() { + this.innerObject = serviceManager.serviceClient() + .getExecutionPlanRuns() + .createOrUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + this.innerModel(), Context.NONE); + return this; + } + + public ExecutionPlanRun apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getExecutionPlanRuns() + .createOrUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + this.innerModel(), context); + return this; + } + + ExecutionPlanRunImpl(ExecutionPlanRunInner innerObject, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.cloudValidationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "cloudValidations"); + this.validationExecutionPlanName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "validationExecutionPlans"); + this.executionPlanRunName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "executionPlanRuns"); + } + + public ExecutionPlanRun refresh() { + this.innerObject = serviceManager.serviceClient() + .getExecutionPlanRuns() + .getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + Context.NONE) + .getValue(); + return this; + } + + public ExecutionPlanRun refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getExecutionPlanRuns() + .getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + context) + .getValue(); + return this; + } + + public ExecutionPlanRunImpl withProperties(ExecutionPlanRunProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ExecutionPlanRunsClientImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ExecutionPlanRunsClientImpl.java new file mode 100644 index 000000000000..3ef5cdc633ef --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ExecutionPlanRunsClientImpl.java @@ -0,0 +1,863 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.platformvalidation.fluent.ExecutionPlanRunsClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.ExecutionPlanRunInner; +import com.azure.resourcemanager.platformvalidation.implementation.models.ExecutionPlanRunListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ExecutionPlanRunsClient. + */ +public final class ExecutionPlanRunsClientImpl implements ExecutionPlanRunsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ExecutionPlanRunsService service; + + /** + * The service client containing this operation class. + */ + private final PlatformValidationManagementClientImpl client; + + /** + * Initializes an instance of ExecutionPlanRunsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ExecutionPlanRunsClientImpl(PlatformValidationManagementClientImpl client) { + this.service + = RestProxy.create(ExecutionPlanRunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PlatformValidationManagementClientExecutionPlanRuns to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "PlatformValidationManagementClientExecutionPlanRuns") + public interface ExecutionPlanRunsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @PathParam("executionPlanRunName") String executionPlanRunName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @PathParam("executionPlanRunName") String executionPlanRunName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @PathParam("executionPlanRunName") String executionPlanRunName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecutionPlanRunInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @PathParam("executionPlanRunName") String executionPlanRunName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExecutionPlanRunInner resource, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @PathParam("executionPlanRunName") String executionPlanRunName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @PathParam("executionPlanRunName") String executionPlanRunName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByExecutionPlan(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByExecutionPlanSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByExecutionPlanNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByExecutionPlanNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a Validation test execution plan run details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Validation test execution plan run details along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String executionPlanRunName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Validation test execution plan run details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Validation test execution plan run details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName) { + return getWithResponseAsync(resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Validation test execution plan run details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @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 Validation test execution plan run details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, accept, context); + } + + /** + * Get a Validation test execution plan run details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Validation test execution plan run details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExecutionPlanRunInner get(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName) { + return getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, Context.NONE).getValue(); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of the execution plan run along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String executionPlanRunName, + ExecutionPlanRunInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of the execution plan run along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, ExecutionPlanRunInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, contentType, accept, resource, Context.NONE); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param resource Resource create parameters. + * @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 properties of the execution plan run along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, ExecutionPlanRunInner resource, + Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, contentType, accept, resource, context); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the properties of the execution plan run. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExecutionPlanRunInner> beginCreateOrUpdateAsync( + String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, ExecutionPlanRunInner resource) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ExecutionPlanRunInner.class, ExecutionPlanRunInner.class, + this.client.getContext()); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the properties of the execution plan run. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExecutionPlanRunInner> beginCreateOrUpdate( + String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, ExecutionPlanRunInner resource) { + Response response = createOrUpdateWithResponse(resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName, resource); + return this.client.getLroResult(response, + ExecutionPlanRunInner.class, ExecutionPlanRunInner.class, Context.NONE); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the properties of the execution plan run. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExecutionPlanRunInner> beginCreateOrUpdate( + String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, ExecutionPlanRunInner resource, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName, resource, context); + return this.client.getLroResult(response, + ExecutionPlanRunInner.class, ExecutionPlanRunInner.class, context); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of the execution plan run on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, ExecutionPlanRunInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, resource).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 properties of the execution plan run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExecutionPlanRunInner createOrUpdate(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, ExecutionPlanRunInner resource) { + return beginCreateOrUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, resource).getFinalResult(); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param resource Resource create parameters. + * @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 properties of the execution plan run. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExecutionPlanRunInner createOrUpdate(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, ExecutionPlanRunInner resource, + Context context) { + return beginCreateOrUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, resource, context).getFinalResult(); + } + + /** + * Delete a validation test execution plan run resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cloudValidationName, String validationExecutionPlanName, String executionPlanRunName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a validation test execution plan run resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, Context.NONE); + } + + /** + * Delete a validation test execution plan run resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, context); + } + + /** + * Delete a validation test execution plan run resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a validation test execution plan run resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName) { + Response response = deleteWithResponse(resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a validation test execution plan run resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, Context context) { + Response response = deleteWithResponse(resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a validation test execution plan run resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName) { + return beginDeleteAsync(resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a validation test execution plan run resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName) { + beginDelete(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName) + .getFinalResult(); + } + + /** + * Delete a validation test execution plan run resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, Context context) { + beginDelete(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, context) + .getFinalResult(); + } + + /** + * List Validation test execution plan runs for an execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param filter The OData filter expression to apply to the list operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ExecutionPlanRun list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByExecutionPlanSinglePageAsync(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String filter) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByExecutionPlan(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Validation test execution plan runs for an execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param filter The OData filter expression to apply to the list operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ExecutionPlanRun list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByExecutionPlanAsync(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String filter) { + return new PagedFlux<>(() -> listByExecutionPlanSinglePageAsync(resourceGroupName, cloudValidationName, + validationExecutionPlanName, filter), nextLink -> listByExecutionPlanNextSinglePageAsync(nextLink)); + } + + /** + * List Validation test execution plan runs for an execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ExecutionPlanRun list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByExecutionPlanAsync(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName) { + final String filter = null; + return new PagedFlux<>(() -> listByExecutionPlanSinglePageAsync(resourceGroupName, cloudValidationName, + validationExecutionPlanName, filter), nextLink -> listByExecutionPlanNextSinglePageAsync(nextLink)); + } + + /** + * List Validation test execution plan runs for an execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param filter The OData filter expression to apply to the list operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ExecutionPlanRun list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByExecutionPlanSinglePage(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String filter) { + final String accept = "application/json"; + Response res = service.listByExecutionPlanSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, + validationExecutionPlanName, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Validation test execution plan runs for an execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param filter The OData filter expression to apply to the list operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ExecutionPlanRun list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByExecutionPlanSinglePage(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String filter, Context context) { + final String accept = "application/json"; + Response res = service.listByExecutionPlanSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, + validationExecutionPlanName, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Validation test execution plan runs for an execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ExecutionPlanRun list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByExecutionPlan(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName) { + final String filter = null; + return new PagedIterable<>(() -> listByExecutionPlanSinglePage(resourceGroupName, cloudValidationName, + validationExecutionPlanName, filter), nextLink -> listByExecutionPlanNextSinglePage(nextLink)); + } + + /** + * List Validation test execution plan runs for an execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param filter The OData filter expression to apply to the list operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ExecutionPlanRun list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByExecutionPlan(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String filter, Context context) { + return new PagedIterable<>(() -> listByExecutionPlanSinglePage(resourceGroupName, cloudValidationName, + validationExecutionPlanName, filter, context), + nextLink -> listByExecutionPlanNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ExecutionPlanRun list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByExecutionPlanNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByExecutionPlanNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ExecutionPlanRun list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByExecutionPlanNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByExecutionPlanNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ExecutionPlanRun list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByExecutionPlanNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listByExecutionPlanNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ExecutionPlanRunsImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ExecutionPlanRunsImpl.java new file mode 100644 index 000000000000..0949bd3bd0ae --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ExecutionPlanRunsImpl.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.platformvalidation.fluent.ExecutionPlanRunsClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.ExecutionPlanRunInner; +import com.azure.resourcemanager.platformvalidation.models.ExecutionPlanRun; +import com.azure.resourcemanager.platformvalidation.models.ExecutionPlanRuns; + +public final class ExecutionPlanRunsImpl implements ExecutionPlanRuns { + private static final ClientLogger LOGGER = new ClientLogger(ExecutionPlanRunsImpl.class); + + private final ExecutionPlanRunsClient innerClient; + + private final com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager; + + public ExecutionPlanRunsImpl(ExecutionPlanRunsClient innerClient, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ExecutionPlanRunImpl(inner.getValue(), this.manager())); + } + + public ExecutionPlanRun get(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName) { + ExecutionPlanRunInner inner = this.serviceClient() + .get(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName); + if (inner != null) { + return new ExecutionPlanRunImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName) { + this.serviceClient() + .delete(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName); + } + + public void delete(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, Context context) { + this.serviceClient() + .delete(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, context); + } + + public PagedIterable listByExecutionPlan(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName) { + PagedIterable inner = this.serviceClient() + .listByExecutionPlan(resourceGroupName, cloudValidationName, validationExecutionPlanName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExecutionPlanRunImpl(inner1, this.manager())); + } + + public PagedIterable listByExecutionPlan(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String filter, Context context) { + PagedIterable inner = this.serviceClient() + .listByExecutionPlan(resourceGroupName, cloudValidationName, validationExecutionPlanName, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ExecutionPlanRunImpl(inner1, this.manager())); + } + + public ExecutionPlanRun getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 cloudValidationName = ResourceManagerUtils.getValueFromIdByName(id, "cloudValidations"); + if (cloudValidationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudValidations'.", id))); + } + String validationExecutionPlanName = ResourceManagerUtils.getValueFromIdByName(id, "validationExecutionPlans"); + if (validationExecutionPlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'validationExecutionPlans'.", id))); + } + String executionPlanRunName = ResourceManagerUtils.getValueFromIdByName(id, "executionPlanRuns"); + if (executionPlanRunName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'executionPlanRuns'.", id))); + } + return this + .getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 cloudValidationName = ResourceManagerUtils.getValueFromIdByName(id, "cloudValidations"); + if (cloudValidationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudValidations'.", id))); + } + String validationExecutionPlanName = ResourceManagerUtils.getValueFromIdByName(id, "validationExecutionPlans"); + if (validationExecutionPlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'validationExecutionPlans'.", id))); + } + String executionPlanRunName = ResourceManagerUtils.getValueFromIdByName(id, "executionPlanRuns"); + if (executionPlanRunName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'executionPlanRuns'.", id))); + } + return this.getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 cloudValidationName = ResourceManagerUtils.getValueFromIdByName(id, "cloudValidations"); + if (cloudValidationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudValidations'.", id))); + } + String validationExecutionPlanName = ResourceManagerUtils.getValueFromIdByName(id, "validationExecutionPlans"); + if (validationExecutionPlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'validationExecutionPlans'.", id))); + } + String executionPlanRunName = ResourceManagerUtils.getValueFromIdByName(id, "executionPlanRuns"); + if (executionPlanRunName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'executionPlanRuns'.", id))); + } + this.delete(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 cloudValidationName = ResourceManagerUtils.getValueFromIdByName(id, "cloudValidations"); + if (cloudValidationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudValidations'.", id))); + } + String validationExecutionPlanName = ResourceManagerUtils.getValueFromIdByName(id, "validationExecutionPlans"); + if (validationExecutionPlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'validationExecutionPlans'.", id))); + } + String executionPlanRunName = ResourceManagerUtils.getValueFromIdByName(id, "executionPlanRuns"); + if (executionPlanRunName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'executionPlanRuns'.", id))); + } + this.delete(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, context); + } + + private ExecutionPlanRunsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } + + public ExecutionPlanRunImpl define(String name) { + return new ExecutionPlanRunImpl(name, this.manager()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationImpl.java new file mode 100644 index 000000000000..90fe30d65dcd --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationImpl.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation; + +import com.azure.resourcemanager.platformvalidation.fluent.models.OperationInner; +import com.azure.resourcemanager.platformvalidation.models.ActionType; +import com.azure.resourcemanager.platformvalidation.models.Operation; +import com.azure.resourcemanager.platformvalidation.models.OperationDisplay; +import com.azure.resourcemanager.platformvalidation.models.Origin; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager; + + OperationImpl(OperationInner innerObject, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager 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.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationStatusClientImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationStatusClientImpl.java new file mode 100644 index 000000000000..15064c545fa5 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationStatusClientImpl.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.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.platformvalidation.fluent.OperationStatusClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.OperationStatusResultInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in OperationStatusClient. + */ +public final class OperationStatusClientImpl implements OperationStatusClient { + /** + * The proxy service used to perform REST calls. + */ + private final OperationStatusService service; + + /** + * The service client containing this operation class. + */ + private final PlatformValidationManagementClientImpl client; + + /** + * Initializes an instance of OperationStatusClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationStatusClientImpl(PlatformValidationManagementClientImpl client) { + this.service + = RestProxy.create(OperationStatusService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PlatformValidationManagementClientOperationStatus to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "PlatformValidationManagementClientOperationStatus") + public interface OperationStatusService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/locations/{location}/operationStatuses/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/locations/{location}/operationStatuses/{operationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("operationId") String operationId, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Returns the current status of an async operation. + * + * @param location The name of the Azure region. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String location, String operationId) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, operationId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Returns the current status of an async operation. + * + * @param location The name of the Azure region. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String location, String operationId) { + return getWithResponseAsync(location, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns the current status of an async operation. + * + * @param location The name of the Azure region. + * @param operationId The ID of an ongoing async operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, String operationId, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, operationId, accept, context); + } + + /** + * Returns the current status of an async operation. + * + * @param location The name of the Azure region. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner get(String location, String operationId) { + return getWithResponse(location, operationId, Context.NONE).getValue(); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationStatusImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationStatusImpl.java new file mode 100644 index 000000000000..34f7118e85a4 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationStatusImpl.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.platformvalidation.fluent.OperationStatusClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.platformvalidation.models.OperationStatus; +import com.azure.resourcemanager.platformvalidation.models.OperationStatusResult; + +public final class OperationStatusImpl implements OperationStatus { + private static final ClientLogger LOGGER = new ClientLogger(OperationStatusImpl.class); + + private final OperationStatusClient innerClient; + + private final com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager; + + public OperationStatusImpl(OperationStatusClient innerClient, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String location, String operationId, Context context) { + Response inner + = this.serviceClient().getWithResponse(location, operationId, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new OperationStatusResultImpl(inner.getValue(), this.manager())); + } + + public OperationStatusResult get(String location, String operationId) { + OperationStatusResultInner inner = this.serviceClient().get(location, operationId); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + private OperationStatusClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationStatusResultImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationStatusResultImpl.java new file mode 100644 index 000000000000..f112f6bde773 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationStatusResultImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.platformvalidation.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.platformvalidation.models.OperationStatusResult; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class OperationStatusResultImpl implements OperationStatusResult { + private OperationStatusResultInner innerObject; + + private final com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager; + + OperationStatusResultImpl(OperationStatusResultInner innerObject, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String status() { + return this.innerModel().status(); + } + + public Double percentComplete() { + return this.innerModel().percentComplete(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public List operations() { + List inner = this.innerModel().operations(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new OperationStatusResultImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public OperationStatusResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationsClientImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationsClientImpl.java new file mode 100644 index 000000000000..decbe632c46d --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationsClientImpl.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.platformvalidation.fluent.OperationsClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.OperationInner; +import com.azure.resourcemanager.platformvalidation.implementation.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 PlatformValidationManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(PlatformValidationManagementClientImpl client) { + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PlatformValidationManagementClientOperations to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "PlatformValidationManagementClientOperations") + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.PlatformValidation/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.PlatformValidation/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list 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> listSinglePageAsync() { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List the operations for the provider. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationsImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationsImpl.java new file mode 100644 index 000000000000..6d0e0939384d --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationsImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.platformvalidation.fluent.OperationsClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.OperationInner; +import com.azure.resourcemanager.platformvalidation.models.Operation; +import com.azure.resourcemanager.platformvalidation.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.platformvalidation.PlatformValidationManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/PlatformValidationManagementClientBuilder.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/PlatformValidationManagementClientBuilder.java new file mode 100644 index 000000000000..2cd945a92013 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/PlatformValidationManagementClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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 PlatformValidationManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { PlatformValidationManagementClientImpl.class }) +public final class PlatformValidationManagementClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the PlatformValidationManagementClientBuilder. + */ + public PlatformValidationManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the PlatformValidationManagementClientBuilder. + */ + public PlatformValidationManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the PlatformValidationManagementClientBuilder. + */ + public PlatformValidationManagementClientBuilder 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 PlatformValidationManagementClientBuilder. + */ + public PlatformValidationManagementClientBuilder 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 PlatformValidationManagementClientBuilder. + */ + public PlatformValidationManagementClientBuilder 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 PlatformValidationManagementClientBuilder. + */ + public PlatformValidationManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of PlatformValidationManagementClientImpl with the provided parameters. + * + * @return an instance of PlatformValidationManagementClientImpl. + */ + public PlatformValidationManagementClientImpl 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(); + PlatformValidationManagementClientImpl client = new PlatformValidationManagementClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); + return client; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/PlatformValidationManagementClientImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/PlatformValidationManagementClientImpl.java new file mode 100644 index 000000000000..7956fc1d7705 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/PlatformValidationManagementClientImpl.java @@ -0,0 +1,436 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +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.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.platformvalidation.fluent.CloudValidationsClient; +import com.azure.resourcemanager.platformvalidation.fluent.ExecutionPlanRunsClient; +import com.azure.resourcemanager.platformvalidation.fluent.OperationStatusClient; +import com.azure.resourcemanager.platformvalidation.fluent.OperationsClient; +import com.azure.resourcemanager.platformvalidation.fluent.PlatformValidationManagementClient; +import com.azure.resourcemanager.platformvalidation.fluent.ValidationExecutionPlansClient; +import com.azure.resourcemanager.platformvalidation.fluent.ValidationTestCategoriesClient; +import com.azure.resourcemanager.platformvalidation.fluent.ValidationTestRunsClient; +import com.azure.resourcemanager.platformvalidation.fluent.ValidationTestVersionsClient; +import com.azure.resourcemanager.platformvalidation.fluent.ValidationTestsClient; +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 PlatformValidationManagementClientImpl type. + */ +@ServiceClient(builder = PlatformValidationManagementClientBuilder.class) +public final class PlatformValidationManagementClientImpl implements PlatformValidationManagementClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Version parameter. + */ + private final String apiVersion; + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * The HTTP pipeline to send requests through. + */ + 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 OperationStatusClient object to access its operations. + */ + private final OperationStatusClient operationStatus; + + /** + * Gets the OperationStatusClient object to access its operations. + * + * @return the OperationStatusClient object. + */ + public OperationStatusClient getOperationStatus() { + return this.operationStatus; + } + + /** + * 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 CloudValidationsClient object to access its operations. + */ + private final CloudValidationsClient cloudValidations; + + /** + * Gets the CloudValidationsClient object to access its operations. + * + * @return the CloudValidationsClient object. + */ + public CloudValidationsClient getCloudValidations() { + return this.cloudValidations; + } + + /** + * The ValidationExecutionPlansClient object to access its operations. + */ + private final ValidationExecutionPlansClient validationExecutionPlans; + + /** + * Gets the ValidationExecutionPlansClient object to access its operations. + * + * @return the ValidationExecutionPlansClient object. + */ + public ValidationExecutionPlansClient getValidationExecutionPlans() { + return this.validationExecutionPlans; + } + + /** + * The ExecutionPlanRunsClient object to access its operations. + */ + private final ExecutionPlanRunsClient executionPlanRuns; + + /** + * Gets the ExecutionPlanRunsClient object to access its operations. + * + * @return the ExecutionPlanRunsClient object. + */ + public ExecutionPlanRunsClient getExecutionPlanRuns() { + return this.executionPlanRuns; + } + + /** + * The ValidationTestRunsClient object to access its operations. + */ + private final ValidationTestRunsClient validationTestRuns; + + /** + * Gets the ValidationTestRunsClient object to access its operations. + * + * @return the ValidationTestRunsClient object. + */ + public ValidationTestRunsClient getValidationTestRuns() { + return this.validationTestRuns; + } + + /** + * The ValidationTestsClient object to access its operations. + */ + private final ValidationTestsClient validationTests; + + /** + * Gets the ValidationTestsClient object to access its operations. + * + * @return the ValidationTestsClient object. + */ + public ValidationTestsClient getValidationTests() { + return this.validationTests; + } + + /** + * The ValidationTestVersionsClient object to access its operations. + */ + private final ValidationTestVersionsClient validationTestVersions; + + /** + * Gets the ValidationTestVersionsClient object to access its operations. + * + * @return the ValidationTestVersionsClient object. + */ + public ValidationTestVersionsClient getValidationTestVersions() { + return this.validationTestVersions; + } + + /** + * The ValidationTestCategoriesClient object to access its operations. + */ + private final ValidationTestCategoriesClient validationTestCategories; + + /** + * Gets the ValidationTestCategoriesClient object to access its operations. + * + * @return the ValidationTestCategoriesClient object. + */ + public ValidationTestCategoriesClient getValidationTestCategories() { + return this.validationTestCategories; + } + + /** + * Initializes an instance of PlatformValidationManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + */ + PlatformValidationManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-07-01-preview"; + this.operationStatus = new OperationStatusClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.cloudValidations = new CloudValidationsClientImpl(this); + this.validationExecutionPlans = new ValidationExecutionPlansClientImpl(this); + this.executionPlanRuns = new ExecutionPlanRunsClientImpl(this); + this.validationTestRuns = new ValidationTestRunsClientImpl(this); + this.validationTests = new ValidationTestsClientImpl(this); + this.validationTestVersions = new ValidationTestVersionsClientImpl(this); + this.validationTestCategories = new ValidationTestCategoriesClientImpl(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 long running operation result. + * + * @param activationResponse the response of activation operation. + * @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 SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @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 ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(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(PlatformValidationManagementClientImpl.class); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ResourceManagerUtils.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ResourceManagerUtils.java new file mode 100644 index 000000000000..e0c474099369 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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 ResourceManagerUtils { + private ResourceManagerUtils() { + } + + 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.isEmpty() && 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<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(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/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationExecutionPlanImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationExecutionPlanImpl.java new file mode 100644 index 000000000000..e840c7833d76 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationExecutionPlanImpl.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationExecutionPlanInner; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlan; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanProperties; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanUpdate; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanUpdateProperties; +import java.util.Collections; +import java.util.Map; + +public final class ValidationExecutionPlanImpl + implements ValidationExecutionPlan, ValidationExecutionPlan.Definition, ValidationExecutionPlan.Update { + private ValidationExecutionPlanInner innerObject; + + private final com.azure.resourcemanager.platformvalidation.PlatformValidationManager 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 ValidationExecutionPlanProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ValidationExecutionPlanInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String cloudValidationName; + + private String validationExecutionPlanName; + + private ValidationExecutionPlanUpdate updateProperties; + + public ValidationExecutionPlanImpl withExistingCloudValidation(String resourceGroupName, + String cloudValidationName) { + this.resourceGroupName = resourceGroupName; + this.cloudValidationName = cloudValidationName; + return this; + } + + public ValidationExecutionPlan create() { + this.innerObject = serviceManager.serviceClient() + .getValidationExecutionPlans() + .createOrUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, this.innerModel(), + Context.NONE); + return this; + } + + public ValidationExecutionPlan create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getValidationExecutionPlans() + .createOrUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, this.innerModel(), + context); + return this; + } + + ValidationExecutionPlanImpl(String name, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerObject = new ValidationExecutionPlanInner(); + this.serviceManager = serviceManager; + this.validationExecutionPlanName = name; + } + + public ValidationExecutionPlanImpl update() { + this.updateProperties = new ValidationExecutionPlanUpdate(); + return this; + } + + public ValidationExecutionPlan apply() { + this.innerObject = serviceManager.serviceClient() + .getValidationExecutionPlans() + .update(resourceGroupName, cloudValidationName, validationExecutionPlanName, updateProperties, + Context.NONE); + return this; + } + + public ValidationExecutionPlan apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getValidationExecutionPlans() + .update(resourceGroupName, cloudValidationName, validationExecutionPlanName, updateProperties, context); + return this; + } + + ValidationExecutionPlanImpl(ValidationExecutionPlanInner innerObject, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.cloudValidationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "cloudValidations"); + this.validationExecutionPlanName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "validationExecutionPlans"); + } + + public ValidationExecutionPlan refresh() { + this.innerObject = serviceManager.serviceClient() + .getValidationExecutionPlans() + .getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, Context.NONE) + .getValue(); + return this; + } + + public ValidationExecutionPlan refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getValidationExecutionPlans() + .getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, context) + .getValue(); + return this; + } + + public ValidationExecutionPlanImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ValidationExecutionPlanImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ValidationExecutionPlanImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateProperties.withTags(tags); + return this; + } + } + + public ValidationExecutionPlanImpl withProperties(ValidationExecutionPlanProperties properties) { + this.innerModel().withProperties(properties); + return this; + } + + public ValidationExecutionPlanImpl withProperties(ValidationExecutionPlanUpdateProperties properties) { + this.updateProperties.withProperties(properties); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel() == null || this.innerModel().id() == null; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationExecutionPlansClientImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationExecutionPlansClientImpl.java new file mode 100644 index 000000000000..358d418b1eeb --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationExecutionPlansClientImpl.java @@ -0,0 +1,1040 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.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.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.platformvalidation.fluent.ValidationExecutionPlansClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationExecutionPlanInner; +import com.azure.resourcemanager.platformvalidation.implementation.models.ValidationExecutionPlanListResult; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanUpdate; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ValidationExecutionPlansClient. + */ +public final class ValidationExecutionPlansClientImpl implements ValidationExecutionPlansClient { + /** + * The proxy service used to perform REST calls. + */ + private final ValidationExecutionPlansService service; + + /** + * The service client containing this operation class. + */ + private final PlatformValidationManagementClientImpl client; + + /** + * Initializes an instance of ValidationExecutionPlansClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ValidationExecutionPlansClientImpl(PlatformValidationManagementClientImpl client) { + this.service = RestProxy.create(ValidationExecutionPlansService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PlatformValidationManagementClientValidationExecutionPlans to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "PlatformValidationManagementClientValidationExecutionPlans") + public interface ValidationExecutionPlansService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ValidationExecutionPlanInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ValidationExecutionPlanInner resource, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ValidationExecutionPlanUpdate properties, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ValidationExecutionPlanUpdate properties, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 validation test execution plan along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 validation test execution plan on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName) { + return getWithResponseAsync(resourceGroupName, cloudValidationName, validationExecutionPlanName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @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 validation test execution plan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cloudValidationName, validationExecutionPlanName, accept, context); + } + + /** + * Get a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 validation test execution plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidationExecutionPlanInner get(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName) { + return getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, Context.NONE) + .getValue(); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation Test Execution Plan along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, ValidationExecutionPlanInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation Test Execution Plan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, ValidationExecutionPlanInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + contentType, accept, resource, Context.NONE); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param resource Resource create parameters. + * @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 validation Test Execution Plan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, ValidationExecutionPlanInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + contentType, accept, resource, context); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ValidationExecutionPlanInner> beginCreateOrUpdateAsync( + String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + ValidationExecutionPlanInner resource) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, cloudValidationName, + validationExecutionPlanName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ValidationExecutionPlanInner.class, ValidationExecutionPlanInner.class, + this.client.getContext()); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ValidationExecutionPlanInner> beginCreateOrUpdate( + String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + ValidationExecutionPlanInner resource) { + Response response + = createOrUpdateWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, resource); + return this.client.getLroResult(response, + ValidationExecutionPlanInner.class, ValidationExecutionPlanInner.class, Context.NONE); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ValidationExecutionPlanInner> beginCreateOrUpdate( + String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + ValidationExecutionPlanInner resource, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, cloudValidationName, + validationExecutionPlanName, resource, context); + return this.client.getLroResult(response, + ValidationExecutionPlanInner.class, ValidationExecutionPlanInner.class, context); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation Test Execution Plan on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, ValidationExecutionPlanInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, cloudValidationName, validationExecutionPlanName, resource) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidationExecutionPlanInner createOrUpdate(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, ValidationExecutionPlanInner resource) { + return beginCreateOrUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, resource) + .getFinalResult(); + } + + /** + * Create or update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param resource Resource create parameters. + * @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 validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidationExecutionPlanInner createOrUpdate(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, ValidationExecutionPlanInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, resource, + context).getFinalResult(); + } + + /** + * Update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param properties The resource properties to be 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 validation Test Execution Plan along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, ValidationExecutionPlanUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + contentType, accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param properties The resource properties to be 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 validation Test Execution Plan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, ValidationExecutionPlanUpdate properties) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + contentType, accept, properties, Context.NONE); + } + + /** + * Update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param properties The resource properties to be 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 validation Test Execution Plan along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, ValidationExecutionPlanUpdate properties, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + contentType, accept, properties, context); + } + + /** + * Update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ValidationExecutionPlanInner> beginUpdateAsync( + String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + ValidationExecutionPlanUpdate properties) { + Mono>> mono + = updateWithResponseAsync(resourceGroupName, cloudValidationName, validationExecutionPlanName, properties); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ValidationExecutionPlanInner.class, ValidationExecutionPlanInner.class, + this.client.getContext()); + } + + /** + * Update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ValidationExecutionPlanInner> beginUpdate( + String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + ValidationExecutionPlanUpdate properties) { + Response response + = updateWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, properties); + return this.client.getLroResult(response, + ValidationExecutionPlanInner.class, ValidationExecutionPlanInner.class, Context.NONE); + } + + /** + * Update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ValidationExecutionPlanInner> beginUpdate( + String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + ValidationExecutionPlanUpdate properties, Context context) { + Response response = updateWithResponse(resourceGroupName, cloudValidationName, + validationExecutionPlanName, properties, context); + return this.client.getLroResult(response, + ValidationExecutionPlanInner.class, ValidationExecutionPlanInner.class, context); + } + + /** + * Update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param properties The resource properties to be 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 validation Test Execution Plan on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, ValidationExecutionPlanUpdate properties) { + return beginUpdateAsync(resourceGroupName, cloudValidationName, validationExecutionPlanName, properties).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param properties The resource properties to be 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 validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidationExecutionPlanInner update(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, ValidationExecutionPlanUpdate properties) { + return beginUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, properties) + .getFinalResult(); + } + + /** + * Update a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param properties The resource properties to be 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 validation Test Execution Plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidationExecutionPlanInner update(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, ValidationExecutionPlanUpdate properties, Context context) { + return beginUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, properties, context) + .getFinalResult(); + } + + /** + * Delete a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cloudValidationName, String validationExecutionPlanName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + Context.NONE); + } + + /** + * Delete a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + context); + } + + /** + * Delete a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, cloudValidationName, validationExecutionPlanName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName) { + Response response + = deleteWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, Context context) { + Response response + = deleteWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cloudValidationName, + String validationExecutionPlanName) { + return beginDeleteAsync(resourceGroupName, cloudValidationName, validationExecutionPlanName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cloudValidationName, String validationExecutionPlanName) { + beginDelete(resourceGroupName, cloudValidationName, validationExecutionPlanName).getFinalResult(); + } + + /** + * Delete a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + Context context) { + beginDelete(resourceGroupName, cloudValidationName, validationExecutionPlanName, context).getFinalResult(); + } + + /** + * List validation test execution plans by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param filter The OData filter expression to apply to the list operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationExecutionPlan list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, String cloudValidationName, String filter) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List validation test execution plans by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param filter The OData filter expression to apply to the list operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationExecutionPlan list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + String cloudValidationName, String filter) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, cloudValidationName, filter), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List validation test execution plans by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationExecutionPlan list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + String cloudValidationName) { + final String filter = null; + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, cloudValidationName, filter), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List validation test execution plans by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param filter The OData filter expression to apply to the list operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationExecutionPlan list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + String cloudValidationName, String filter) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List validation test execution plans by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param filter The OData filter expression to apply to the list operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationExecutionPlan list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + String cloudValidationName, String filter, Context context) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List validation test execution plans by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationExecutionPlan list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + String cloudValidationName) { + final String filter = null; + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, cloudValidationName, filter), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); + } + + /** + * List validation test execution plans by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param filter The OData filter expression to apply to the list operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationExecutionPlan list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + String cloudValidationName, String filter, Context context) { + return new PagedIterable<>( + () -> listByResourceGroupSinglePage(resourceGroupName, cloudValidationName, filter, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationExecutionPlan list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationExecutionPlan list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationExecutionPlan list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationExecutionPlansImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationExecutionPlansImpl.java new file mode 100644 index 000000000000..150b0db1346c --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationExecutionPlansImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.platformvalidation.fluent.ValidationExecutionPlansClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationExecutionPlanInner; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlan; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlans; + +public final class ValidationExecutionPlansImpl implements ValidationExecutionPlans { + private static final ClientLogger LOGGER = new ClientLogger(ValidationExecutionPlansImpl.class); + + private final ValidationExecutionPlansClient innerClient; + + private final com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager; + + public ValidationExecutionPlansImpl(ValidationExecutionPlansClient innerClient, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ValidationExecutionPlanImpl(inner.getValue(), this.manager())); + } + + public ValidationExecutionPlan get(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName) { + ValidationExecutionPlanInner inner + = this.serviceClient().get(resourceGroupName, cloudValidationName, validationExecutionPlanName); + if (inner != null) { + return new ValidationExecutionPlanImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName) { + this.serviceClient().delete(resourceGroupName, cloudValidationName, validationExecutionPlanName); + } + + public void delete(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + Context context) { + this.serviceClient().delete(resourceGroupName, cloudValidationName, validationExecutionPlanName, context); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + String cloudValidationName) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, cloudValidationName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ValidationExecutionPlanImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, + String cloudValidationName, String filter, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, cloudValidationName, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ValidationExecutionPlanImpl(inner1, this.manager())); + } + + public ValidationExecutionPlan getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 cloudValidationName = ResourceManagerUtils.getValueFromIdByName(id, "cloudValidations"); + if (cloudValidationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudValidations'.", id))); + } + String validationExecutionPlanName = ResourceManagerUtils.getValueFromIdByName(id, "validationExecutionPlans"); + if (validationExecutionPlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'validationExecutionPlans'.", id))); + } + return this.getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 cloudValidationName = ResourceManagerUtils.getValueFromIdByName(id, "cloudValidations"); + if (cloudValidationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudValidations'.", id))); + } + String validationExecutionPlanName = ResourceManagerUtils.getValueFromIdByName(id, "validationExecutionPlans"); + if (validationExecutionPlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'validationExecutionPlans'.", id))); + } + return this.getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 cloudValidationName = ResourceManagerUtils.getValueFromIdByName(id, "cloudValidations"); + if (cloudValidationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudValidations'.", id))); + } + String validationExecutionPlanName = ResourceManagerUtils.getValueFromIdByName(id, "validationExecutionPlans"); + if (validationExecutionPlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'validationExecutionPlans'.", id))); + } + this.delete(resourceGroupName, cloudValidationName, validationExecutionPlanName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 cloudValidationName = ResourceManagerUtils.getValueFromIdByName(id, "cloudValidations"); + if (cloudValidationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudValidations'.", id))); + } + String validationExecutionPlanName = ResourceManagerUtils.getValueFromIdByName(id, "validationExecutionPlans"); + if (validationExecutionPlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'validationExecutionPlans'.", id))); + } + this.delete(resourceGroupName, cloudValidationName, validationExecutionPlanName, context); + } + + private ValidationExecutionPlansClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } + + public ValidationExecutionPlanImpl define(String name) { + return new ValidationExecutionPlanImpl(name, this.manager()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestCategoriesClientImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestCategoriesClientImpl.java new file mode 100644 index 000000000000..2430d4d13427 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestCategoriesClientImpl.java @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.platformvalidation.fluent.ValidationTestCategoriesClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestCategoryInner; +import com.azure.resourcemanager.platformvalidation.implementation.models.ValidationTestCategoryListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ValidationTestCategoriesClient. + */ +public final class ValidationTestCategoriesClientImpl implements ValidationTestCategoriesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ValidationTestCategoriesService service; + + /** + * The service client containing this operation class. + */ + private final PlatformValidationManagementClientImpl client; + + /** + * Initializes an instance of ValidationTestCategoriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ValidationTestCategoriesClientImpl(PlatformValidationManagementClientImpl client) { + this.service = RestProxy.create(ValidationTestCategoriesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PlatformValidationManagementClientValidationTestCategories to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "PlatformValidationManagementClientValidationTestCategories") + public interface ValidationTestCategoriesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTestCategories/{validationTestCategoryName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("validationTestCategoryName") String validationTestCategoryName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTestCategories/{validationTestCategoryName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("validationTestCategoryName") String validationTestCategoryName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTestCategories") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTestCategories") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a validation test category catalog entry. + * + * @param validationTestCategoryName The name of the ValidationTestCategory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 validation test category catalog entry along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String validationTestCategoryName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), validationTestCategoryName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a validation test category catalog entry. + * + * @param validationTestCategoryName The name of the ValidationTestCategory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 validation test category catalog entry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String validationTestCategoryName) { + return getWithResponseAsync(validationTestCategoryName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a validation test category catalog entry. + * + * @param validationTestCategoryName The name of the ValidationTestCategory. + * @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 validation test category catalog entry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String validationTestCategoryName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + validationTestCategoryName, accept, context); + } + + /** + * Get a validation test category catalog entry. + * + * @param validationTestCategoryName The name of the ValidationTestCategory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 validation test category catalog entry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidationTestCategoryInner get(String validationTestCategoryName) { + return getWithResponse(validationTestCategoryName, Context.NONE).getValue(); + } + + /** + * List validation test category catalog entries for a subscription. + * + * @param filter Filter expression used to constrain the returned items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestCategory list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List validation test category catalog entries for a subscription. + * + * @param filter Filter expression used to constrain the returned items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestCategory list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List validation test category catalog entries for 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 the response of a ValidationTestCategory list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List validation test category catalog entries for a subscription. + * + * @param filter Filter expression used to constrain the returned items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestCategory list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String filter) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List validation test category catalog entries for a subscription. + * + * @param filter Filter expression used to constrain the returned items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestCategory list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String filter, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List validation test category catalog entries for 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 the response of a ValidationTestCategory list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + return new PagedIterable<>(() -> listSinglePage(filter), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * List validation test category catalog entries for a subscription. + * + * @param filter Filter expression used to constrain the returned items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestCategory list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(() -> listSinglePage(filter, context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestCategory list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestCategory list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestCategory list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestCategoriesImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestCategoriesImpl.java new file mode 100644 index 000000000000..2b0166d6ac31 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestCategoriesImpl.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.platformvalidation.fluent.ValidationTestCategoriesClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestCategoryInner; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestCategories; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestCategory; + +public final class ValidationTestCategoriesImpl implements ValidationTestCategories { + private static final ClientLogger LOGGER = new ClientLogger(ValidationTestCategoriesImpl.class); + + private final ValidationTestCategoriesClient innerClient; + + private final com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager; + + public ValidationTestCategoriesImpl(ValidationTestCategoriesClient innerClient, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String validationTestCategoryName, Context context) { + Response inner + = this.serviceClient().getWithResponse(validationTestCategoryName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ValidationTestCategoryImpl(inner.getValue(), this.manager())); + } + + public ValidationTestCategory get(String validationTestCategoryName) { + ValidationTestCategoryInner inner = this.serviceClient().get(validationTestCategoryName); + if (inner != null) { + return new ValidationTestCategoryImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ValidationTestCategoryImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ValidationTestCategoryImpl(inner1, this.manager())); + } + + private ValidationTestCategoriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestCategoryImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestCategoryImpl.java new file mode 100644 index 000000000000..ecb4a1e32940 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestCategoryImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestCategoryInner; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestCategory; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestCategoryProperties; + +public final class ValidationTestCategoryImpl implements ValidationTestCategory { + private ValidationTestCategoryInner innerObject; + + private final com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager; + + ValidationTestCategoryImpl(ValidationTestCategoryInner innerObject, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager 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 ValidationTestCategoryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ValidationTestCategoryInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestImpl.java new file mode 100644 index 000000000000..bad79243294b --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestInner; +import com.azure.resourcemanager.platformvalidation.models.ValidationTest; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestProperties; + +public final class ValidationTestImpl implements ValidationTest { + private ValidationTestInner innerObject; + + private final com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager; + + ValidationTestImpl(ValidationTestInner innerObject, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager 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 ValidationTestProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ValidationTestInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestRunImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestRunImpl.java new file mode 100644 index 000000000000..12f8ba13052f --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestRunImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestRunInner; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestRun; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestRunProperties; + +public final class ValidationTestRunImpl + implements ValidationTestRun, ValidationTestRun.Definition, ValidationTestRun.Update { + private ValidationTestRunInner innerObject; + + private final com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ValidationTestRunProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public ValidationTestRunInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String cloudValidationName; + + private String validationExecutionPlanName; + + private String executionPlanRunName; + + private String validationTestRunName; + + public ValidationTestRunImpl withExistingExecutionPlanRun(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName) { + this.resourceGroupName = resourceGroupName; + this.cloudValidationName = cloudValidationName; + this.validationExecutionPlanName = validationExecutionPlanName; + this.executionPlanRunName = executionPlanRunName; + return this; + } + + public ValidationTestRun create() { + this.innerObject = serviceManager.serviceClient() + .getValidationTestRuns() + .createOrUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + validationTestRunName, this.innerModel(), Context.NONE); + return this; + } + + public ValidationTestRun create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getValidationTestRuns() + .createOrUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + validationTestRunName, this.innerModel(), context); + return this; + } + + ValidationTestRunImpl(String name, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerObject = new ValidationTestRunInner(); + this.serviceManager = serviceManager; + this.validationTestRunName = name; + } + + public ValidationTestRunImpl update() { + return this; + } + + public ValidationTestRun apply() { + this.innerObject = serviceManager.serviceClient() + .getValidationTestRuns() + .createOrUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + validationTestRunName, this.innerModel(), Context.NONE); + return this; + } + + public ValidationTestRun apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getValidationTestRuns() + .createOrUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + validationTestRunName, this.innerModel(), context); + return this; + } + + ValidationTestRunImpl(ValidationTestRunInner innerObject, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.cloudValidationName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "cloudValidations"); + this.validationExecutionPlanName + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "validationExecutionPlans"); + this.executionPlanRunName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "executionPlanRuns"); + this.validationTestRunName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "validationTestRuns"); + } + + public ValidationTestRun refresh() { + this.innerObject = serviceManager.serviceClient() + .getValidationTestRuns() + .getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + validationTestRunName, Context.NONE) + .getValue(); + return this; + } + + public ValidationTestRun refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getValidationTestRuns() + .getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + validationTestRunName, context) + .getValue(); + return this; + } + + public ValidationTestRunImpl withProperties(ValidationTestRunProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestRunsClientImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestRunsClientImpl.java new file mode 100644 index 000000000000..288651384516 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestRunsClientImpl.java @@ -0,0 +1,893 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.platformvalidation.fluent.ValidationTestRunsClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestRunInner; +import com.azure.resourcemanager.platformvalidation.implementation.models.ValidationTestRunListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ValidationTestRunsClient. + */ +public final class ValidationTestRunsClientImpl implements ValidationTestRunsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ValidationTestRunsService service; + + /** + * The service client containing this operation class. + */ + private final PlatformValidationManagementClientImpl client; + + /** + * Initializes an instance of ValidationTestRunsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ValidationTestRunsClientImpl(PlatformValidationManagementClientImpl client) { + this.service = RestProxy.create(ValidationTestRunsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PlatformValidationManagementClientValidationTestRuns to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "PlatformValidationManagementClientValidationTestRuns") + public interface ValidationTestRunsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}/validationTestRuns/{validationTestRunName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @PathParam("executionPlanRunName") String executionPlanRunName, + @PathParam("validationTestRunName") String validationTestRunName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}/validationTestRuns/{validationTestRunName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @PathParam("executionPlanRunName") String executionPlanRunName, + @PathParam("validationTestRunName") String validationTestRunName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}/validationTestRuns/{validationTestRunName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @PathParam("executionPlanRunName") String executionPlanRunName, + @PathParam("validationTestRunName") String validationTestRunName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ValidationTestRunInner resource, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}/validationTestRuns/{validationTestRunName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @PathParam("executionPlanRunName") String executionPlanRunName, + @PathParam("validationTestRunName") String validationTestRunName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ValidationTestRunInner resource, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}/validationTestRuns/{validationTestRunName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @PathParam("executionPlanRunName") String executionPlanRunName, + @PathParam("validationTestRunName") String validationTestRunName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}/validationTestRuns/{validationTestRunName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @PathParam("executionPlanRunName") String executionPlanRunName, + @PathParam("validationTestRunName") String validationTestRunName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}/validationTestRuns") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByExecutionPlanRun(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @PathParam("executionPlanRunName") String executionPlanRunName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PlatformValidation/cloudValidations/{cloudValidationName}/validationExecutionPlans/{validationExecutionPlanName}/executionPlanRuns/{executionPlanRunName}/validationTestRuns") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByExecutionPlanRunSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("cloudValidationName") String cloudValidationName, + @PathParam("validationExecutionPlanName") String validationExecutionPlanName, + @PathParam("executionPlanRunName") String executionPlanRunName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByExecutionPlanRunNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByExecutionPlanRunNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a validation test run details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 validation test run details along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String executionPlanRunName, + String validationTestRunName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, validationTestRunName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a validation test run details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 validation test run details on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName) { + return getWithResponseAsync(resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, validationTestRunName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a validation test run details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @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 validation test run details along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + validationTestRunName, accept, context); + } + + /** + * Get a validation test run details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 validation test run details. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidationTestRunInner get(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName) { + return getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, validationTestRunName, Context.NONE).getValue(); + } + + /** + * Create or update a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation Test Run represents execution instance(s) of a Validation Test instance under execution plan + * along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String executionPlanRunName, + String validationTestRunName, ValidationTestRunInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, validationTestRunName, contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation Test Run represents execution instance(s) of a Validation Test instance under execution plan + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName, + ValidationTestRunInner resource) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, validationTestRunName, contentType, accept, resource, Context.NONE); + } + + /** + * Create or update a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param resource Resource create parameters. + * @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 validation Test Run represents execution instance(s) of a Validation Test instance under execution plan + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName, + ValidationTestRunInner resource, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, validationTestRunName, contentType, accept, resource, context); + } + + /** + * Create or update a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of validation Test Run represents execution instance(s) of a + * Validation Test instance under execution plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ValidationTestRunInner> beginCreateOrUpdateAsync( + String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, String validationTestRunName, ValidationTestRunInner resource) { + Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName, validationTestRunName, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ValidationTestRunInner.class, ValidationTestRunInner.class, + this.client.getContext()); + } + + /** + * Create or update a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of validation Test Run represents execution instance(s) of a + * Validation Test instance under execution plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ValidationTestRunInner> beginCreateOrUpdate( + String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, String validationTestRunName, ValidationTestRunInner resource) { + Response response = createOrUpdateWithResponse(resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName, validationTestRunName, resource); + return this.client.getLroResult(response, + ValidationTestRunInner.class, ValidationTestRunInner.class, Context.NONE); + } + + /** + * Create or update a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of validation Test Run represents execution instance(s) of a + * Validation Test instance under execution plan. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ValidationTestRunInner> beginCreateOrUpdate( + String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, String validationTestRunName, ValidationTestRunInner resource, Context context) { + Response response = createOrUpdateWithResponse(resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName, validationTestRunName, resource, context); + return this.client.getLroResult(response, + ValidationTestRunInner.class, ValidationTestRunInner.class, context); + } + + /** + * Create or update a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation Test Run represents execution instance(s) of a Validation Test instance under execution plan + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName, + ValidationTestRunInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, validationTestRunName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return validation Test Run represents execution instance(s) of a Validation Test instance under execution plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidationTestRunInner createOrUpdate(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName, + ValidationTestRunInner resource) { + return beginCreateOrUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, validationTestRunName, resource).getFinalResult(); + } + + /** + * Create or update a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param resource Resource create parameters. + * @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 validation Test Run represents execution instance(s) of a Validation Test instance under execution plan. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidationTestRunInner createOrUpdate(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName, + ValidationTestRunInner resource, Context context) { + return beginCreateOrUpdate(resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, validationTestRunName, resource, context).getFinalResult(); + } + + /** + * Delete a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cloudValidationName, String validationExecutionPlanName, String executionPlanRunName, + String validationTestRunName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, validationTestRunName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, validationTestRunName, Context.NONE); + } + + /** + * Delete a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName, + Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, validationTestRunName, context); + } + + /** + * Delete a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName, validationTestRunName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName) { + Response response = deleteWithResponse(resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName, validationTestRunName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Delete a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName, + Context context) { + Response response = deleteWithResponse(resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName, validationTestRunName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Delete a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName) { + return beginDeleteAsync(resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, validationTestRunName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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 cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, String validationTestRunName) { + beginDelete(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + validationTestRunName).getFinalResult(); + } + + /** + * Delete a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, String validationTestRunName, Context context) { + beginDelete(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + validationTestRunName, context).getFinalResult(); + } + + /** + * List validation test runs for an execution plan run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestRun list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByExecutionPlanRunSinglePageAsync(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String executionPlanRunName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByExecutionPlanRun(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName, 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())); + } + + /** + * List validation test runs for an execution plan run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestRun list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByExecutionPlanRunAsync(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String executionPlanRunName) { + return new PagedFlux<>( + () -> listByExecutionPlanRunSinglePageAsync(resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName), + nextLink -> listByExecutionPlanRunNextSinglePageAsync(nextLink)); + } + + /** + * List validation test runs for an execution plan run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestRun list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByExecutionPlanRunSinglePage(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String executionPlanRunName) { + final String accept = "application/json"; + Response res = service.listByExecutionPlanRunSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List validation test runs for an execution plan run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestRun list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByExecutionPlanRunSinglePage(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String executionPlanRunName, Context context) { + final String accept = "application/json"; + Response res = service.listByExecutionPlanRunSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List validation test runs for an execution plan run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestRun list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByExecutionPlanRun(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String executionPlanRunName) { + return new PagedIterable<>(() -> listByExecutionPlanRunSinglePage(resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName), + nextLink -> listByExecutionPlanRunNextSinglePage(nextLink)); + } + + /** + * List validation test runs for an execution plan run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestRun list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByExecutionPlanRun(String resourceGroupName, + String cloudValidationName, String validationExecutionPlanName, String executionPlanRunName, Context context) { + return new PagedIterable<>(() -> listByExecutionPlanRunSinglePage(resourceGroupName, cloudValidationName, + validationExecutionPlanName, executionPlanRunName, context), + nextLink -> listByExecutionPlanRunNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestRun list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByExecutionPlanRunNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByExecutionPlanRunNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestRun list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByExecutionPlanRunNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listByExecutionPlanRunNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestRun list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByExecutionPlanRunNextSinglePage(String nextLink, + Context context) { + final String accept = "application/json"; + Response res + = service.listByExecutionPlanRunNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestRunsImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestRunsImpl.java new file mode 100644 index 000000000000..47e65dc3c0a2 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestRunsImpl.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.platformvalidation.fluent.ValidationTestRunsClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestRunInner; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestRun; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestRuns; + +public final class ValidationTestRunsImpl implements ValidationTestRuns { + private static final ClientLogger LOGGER = new ClientLogger(ValidationTestRunsImpl.class); + + private final ValidationTestRunsClient innerClient; + + private final com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager; + + public ValidationTestRunsImpl(ValidationTestRunsClient innerClient, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName, + Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + validationTestRunName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ValidationTestRunImpl(inner.getValue(), this.manager())); + } + + public ValidationTestRun get(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName) { + ValidationTestRunInner inner = this.serviceClient() + .get(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + validationTestRunName); + if (inner != null) { + return new ValidationTestRunImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, String validationTestRunName) { + this.serviceClient() + .delete(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + validationTestRunName); + } + + public void delete(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, String validationTestRunName, Context context) { + this.serviceClient() + .delete(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + validationTestRunName, context); + } + + public PagedIterable listByExecutionPlanRun(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName) { + PagedIterable inner = this.serviceClient() + .listByExecutionPlanRun(resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ValidationTestRunImpl(inner1, this.manager())); + } + + public PagedIterable listByExecutionPlanRun(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, Context context) { + PagedIterable inner = this.serviceClient() + .listByExecutionPlanRun(resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ValidationTestRunImpl(inner1, this.manager())); + } + + public ValidationTestRun getById(String id) { + String resourceGroupName = ResourceManagerUtils.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 cloudValidationName = ResourceManagerUtils.getValueFromIdByName(id, "cloudValidations"); + if (cloudValidationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudValidations'.", id))); + } + String validationExecutionPlanName = ResourceManagerUtils.getValueFromIdByName(id, "validationExecutionPlans"); + if (validationExecutionPlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'validationExecutionPlans'.", id))); + } + String executionPlanRunName = ResourceManagerUtils.getValueFromIdByName(id, "executionPlanRuns"); + if (executionPlanRunName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'executionPlanRuns'.", id))); + } + String validationTestRunName = ResourceManagerUtils.getValueFromIdByName(id, "validationTestRuns"); + if (validationTestRunName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'validationTestRuns'.", id))); + } + return this + .getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + validationTestRunName, Context.NONE) + .getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 cloudValidationName = ResourceManagerUtils.getValueFromIdByName(id, "cloudValidations"); + if (cloudValidationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudValidations'.", id))); + } + String validationExecutionPlanName = ResourceManagerUtils.getValueFromIdByName(id, "validationExecutionPlans"); + if (validationExecutionPlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'validationExecutionPlans'.", id))); + } + String executionPlanRunName = ResourceManagerUtils.getValueFromIdByName(id, "executionPlanRuns"); + if (executionPlanRunName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'executionPlanRuns'.", id))); + } + String validationTestRunName = ResourceManagerUtils.getValueFromIdByName(id, "validationTestRuns"); + if (validationTestRunName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'validationTestRuns'.", id))); + } + return this.getWithResponse(resourceGroupName, cloudValidationName, validationExecutionPlanName, + executionPlanRunName, validationTestRunName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.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 cloudValidationName = ResourceManagerUtils.getValueFromIdByName(id, "cloudValidations"); + if (cloudValidationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudValidations'.", id))); + } + String validationExecutionPlanName = ResourceManagerUtils.getValueFromIdByName(id, "validationExecutionPlans"); + if (validationExecutionPlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'validationExecutionPlans'.", id))); + } + String executionPlanRunName = ResourceManagerUtils.getValueFromIdByName(id, "executionPlanRuns"); + if (executionPlanRunName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'executionPlanRuns'.", id))); + } + String validationTestRunName = ResourceManagerUtils.getValueFromIdByName(id, "validationTestRuns"); + if (validationTestRunName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'validationTestRuns'.", id))); + } + this.delete(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + validationTestRunName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.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 cloudValidationName = ResourceManagerUtils.getValueFromIdByName(id, "cloudValidations"); + if (cloudValidationName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'cloudValidations'.", id))); + } + String validationExecutionPlanName = ResourceManagerUtils.getValueFromIdByName(id, "validationExecutionPlans"); + if (validationExecutionPlanName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'validationExecutionPlans'.", id))); + } + String executionPlanRunName = ResourceManagerUtils.getValueFromIdByName(id, "executionPlanRuns"); + if (executionPlanRunName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'executionPlanRuns'.", id))); + } + String validationTestRunName = ResourceManagerUtils.getValueFromIdByName(id, "validationTestRuns"); + if (validationTestRunName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'validationTestRuns'.", id))); + } + this.delete(resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName, + validationTestRunName, context); + } + + private ValidationTestRunsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } + + public ValidationTestRunImpl define(String name) { + return new ValidationTestRunImpl(name, this.manager()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestVersionImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestVersionImpl.java new file mode 100644 index 000000000000..d9d78c0f10d4 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestVersionImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestVersionInner; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestVersion; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestVersionProperties; + +public final class ValidationTestVersionImpl implements ValidationTestVersion { + private ValidationTestVersionInner innerObject; + + private final com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager; + + ValidationTestVersionImpl(ValidationTestVersionInner innerObject, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager 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 ValidationTestVersionProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ValidationTestVersionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestVersionsClientImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestVersionsClientImpl.java new file mode 100644 index 000000000000..cc5039370c2c --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestVersionsClientImpl.java @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.platformvalidation.fluent.ValidationTestVersionsClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestVersionInner; +import com.azure.resourcemanager.platformvalidation.implementation.models.ValidationTestVersionListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ValidationTestVersionsClient. + */ +public final class ValidationTestVersionsClientImpl implements ValidationTestVersionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ValidationTestVersionsService service; + + /** + * The service client containing this operation class. + */ + private final PlatformValidationManagementClientImpl client; + + /** + * Initializes an instance of ValidationTestVersionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ValidationTestVersionsClientImpl(PlatformValidationManagementClientImpl client) { + this.service = RestProxy.create(ValidationTestVersionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PlatformValidationManagementClientValidationTestVersions to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "PlatformValidationManagementClientValidationTestVersions") + public interface ValidationTestVersionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTests/{validationTestName}/versions/{version}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("validationTestName") String validationTestName, @PathParam("version") String version, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTests/{validationTestName}/versions/{version}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("validationTestName") String validationTestName, @PathParam("version") String version, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTests/{validationTestName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("validationTestName") String validationTestName, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTests/{validationTestName}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("validationTestName") String validationTestName, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a validation test version catalog entry. + * + * @param validationTestName The name of the ValidationTest. + * @param version The name of the ValidationTestVersion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 validation test version catalog entry along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String validationTestName, String version) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), validationTestName, version, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a validation test version catalog entry. + * + * @param validationTestName The name of the ValidationTest. + * @param version The name of the ValidationTestVersion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 validation test version catalog entry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String validationTestName, String version) { + return getWithResponseAsync(validationTestName, version).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a validation test version catalog entry. + * + * @param validationTestName The name of the ValidationTest. + * @param version The name of the ValidationTestVersion. + * @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 validation test version catalog entry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String validationTestName, String version, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + validationTestName, version, accept, context); + } + + /** + * Get a validation test version catalog entry. + * + * @param validationTestName The name of the ValidationTest. + * @param version The name of the ValidationTestVersion. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 validation test version catalog entry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidationTestVersionInner get(String validationTestName, String version) { + return getWithResponse(validationTestName, version, Context.NONE).getValue(); + } + + /** + * List validation test version catalog entries. + * + * @param validationTestName The name of the ValidationTest. + * @param filter Filter expression used to constrain the returned items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String validationTestName, + String filter) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), validationTestName, filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List validation test version catalog entries. + * + * @param validationTestName The name of the ValidationTest. + * @param filter Filter expression used to constrain the returned items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String validationTestName, String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(validationTestName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List validation test version catalog entries. + * + * @param validationTestName The name of the ValidationTest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestVersion list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String validationTestName) { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(validationTestName, filter), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List validation test version catalog entries. + * + * @param validationTestName The name of the ValidationTest. + * @param filter Filter expression used to constrain the returned items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestVersion list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String validationTestName, String filter) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + validationTestName, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List validation test version catalog entries. + * + * @param validationTestName The name of the ValidationTest. + * @param filter Filter expression used to constrain the returned items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestVersion list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String validationTestName, String filter, + Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), validationTestName, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List validation test version catalog entries. + * + * @param validationTestName The name of the ValidationTest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String validationTestName) { + final String filter = null; + return new PagedIterable<>(() -> listSinglePage(validationTestName, filter), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List validation test version catalog entries. + * + * @param validationTestName The name of the ValidationTest. + * @param filter Filter expression used to constrain the returned items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestVersion list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String validationTestName, String filter, Context context) { + return new PagedIterable<>(() -> listSinglePage(validationTestName, filter, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestVersion list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestVersion list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestVersion list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestVersionsImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestVersionsImpl.java new file mode 100644 index 000000000000..97ef80ee9fba --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestVersionsImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.platformvalidation.fluent.ValidationTestVersionsClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestVersionInner; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestVersion; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestVersions; + +public final class ValidationTestVersionsImpl implements ValidationTestVersions { + private static final ClientLogger LOGGER = new ClientLogger(ValidationTestVersionsImpl.class); + + private final ValidationTestVersionsClient innerClient; + + private final com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager; + + public ValidationTestVersionsImpl(ValidationTestVersionsClient innerClient, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String validationTestName, String version, Context context) { + Response inner + = this.serviceClient().getWithResponse(validationTestName, version, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ValidationTestVersionImpl(inner.getValue(), this.manager())); + } + + public ValidationTestVersion get(String validationTestName, String version) { + ValidationTestVersionInner inner = this.serviceClient().get(validationTestName, version); + if (inner != null) { + return new ValidationTestVersionImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list(String validationTestName) { + PagedIterable inner = this.serviceClient().list(validationTestName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ValidationTestVersionImpl(inner1, this.manager())); + } + + public PagedIterable list(String validationTestName, String filter, Context context) { + PagedIterable inner + = this.serviceClient().list(validationTestName, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ValidationTestVersionImpl(inner1, this.manager())); + } + + private ValidationTestVersionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestsClientImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestsClientImpl.java new file mode 100644 index 000000000000..07ed565f1089 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestsClientImpl.java @@ -0,0 +1,353 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.platformvalidation.fluent.ValidationTestsClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestInner; +import com.azure.resourcemanager.platformvalidation.implementation.models.ValidationTestListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ValidationTestsClient. + */ +public final class ValidationTestsClientImpl implements ValidationTestsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ValidationTestsService service; + + /** + * The service client containing this operation class. + */ + private final PlatformValidationManagementClientImpl client; + + /** + * Initializes an instance of ValidationTestsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ValidationTestsClientImpl(PlatformValidationManagementClientImpl client) { + this.service + = RestProxy.create(ValidationTestsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PlatformValidationManagementClientValidationTests to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "PlatformValidationManagementClientValidationTests") + public interface ValidationTestsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTests/{validationTestName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("validationTestName") String validationTestName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTests/{validationTestName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("validationTestName") String validationTestName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTests") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.PlatformValidation/validationTests") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a validation test catalog entry. + * + * @param validationTestName The name of the ValidationTest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 validation test catalog entry along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String validationTestName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), validationTestName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a validation test catalog entry. + * + * @param validationTestName The name of the ValidationTest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 validation test catalog entry on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String validationTestName) { + return getWithResponseAsync(validationTestName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a validation test catalog entry. + * + * @param validationTestName The name of the ValidationTest. + * @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 validation test catalog entry along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String validationTestName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + validationTestName, accept, context); + } + + /** + * Get a validation test catalog entry. + * + * @param validationTestName The name of the ValidationTest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 validation test catalog entry. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ValidationTestInner get(String validationTestName) { + return getWithResponse(validationTestName, Context.NONE).getValue(); + } + + /** + * List validation test catalog entries for a subscription. + * + * @param filter Filter expression used to constrain the returned items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTest list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String filter) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List validation test catalog entries for a subscription. + * + * @param filter Filter expression used to constrain the returned items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTest list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List validation test catalog entries for 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 the response of a ValidationTest list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(filter), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List validation test catalog entries for a subscription. + * + * @param filter Filter expression used to constrain the returned items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTest list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String filter) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List validation test catalog entries for a subscription. + * + * @param filter Filter expression used to constrain the returned items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTest list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String filter, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List validation test catalog entries for 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 the response of a ValidationTest list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final String filter = null; + return new PagedIterable<>(() -> listSinglePage(filter), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); + } + + /** + * List validation test catalog entries for a subscription. + * + * @param filter Filter expression used to constrain the returned items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTest list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String filter, Context context) { + return new PagedIterable<>(() -> listSinglePage(filter, context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTest list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTest list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTest list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestsImpl.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestsImpl.java new file mode 100644 index 000000000000..b293667d10ad --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestsImpl.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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.platformvalidation.fluent.ValidationTestsClient; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestInner; +import com.azure.resourcemanager.platformvalidation.models.ValidationTest; +import com.azure.resourcemanager.platformvalidation.models.ValidationTests; + +public final class ValidationTestsImpl implements ValidationTests { + private static final ClientLogger LOGGER = new ClientLogger(ValidationTestsImpl.class); + + private final ValidationTestsClient innerClient; + + private final com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager; + + public ValidationTestsImpl(ValidationTestsClient innerClient, + com.azure.resourcemanager.platformvalidation.PlatformValidationManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String validationTestName, Context context) { + Response inner = this.serviceClient().getWithResponse(validationTestName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ValidationTestImpl(inner.getValue(), this.manager())); + } + + public ValidationTest get(String validationTestName) { + ValidationTestInner inner = this.serviceClient().get(validationTestName); + if (inner != null) { + return new ValidationTestImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ValidationTestImpl(inner1, this.manager())); + } + + public PagedIterable list(String filter, Context context) { + PagedIterable inner = this.serviceClient().list(filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ValidationTestImpl(inner1, this.manager())); + } + + private ValidationTestsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/CloudValidationListResult.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/CloudValidationListResult.java new file mode 100644 index 000000000000..bd5f53de5709 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/CloudValidationListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.platformvalidation.fluent.models.CloudValidationInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a CloudValidation list operation. + */ +@Immutable +public final class CloudValidationListResult implements JsonSerializable { + /* + * The CloudValidation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of CloudValidationListResult class. + */ + private CloudValidationListResult() { + } + + /** + * Get the value property: The CloudValidation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudValidationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudValidationListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CloudValidationListResult. + */ + public static CloudValidationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudValidationListResult deserializedCloudValidationListResult = new CloudValidationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CloudValidationInner.fromJson(reader1)); + deserializedCloudValidationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCloudValidationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudValidationListResult; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ExecutionPlanRunListResult.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ExecutionPlanRunListResult.java new file mode 100644 index 000000000000..05cc549e0f59 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ExecutionPlanRunListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.platformvalidation.fluent.models.ExecutionPlanRunInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ExecutionPlanRun list operation. + */ +@Immutable +public final class ExecutionPlanRunListResult implements JsonSerializable { + /* + * The ExecutionPlanRun items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ExecutionPlanRunListResult class. + */ + private ExecutionPlanRunListResult() { + } + + /** + * Get the value property: The ExecutionPlanRun items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecutionPlanRunListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecutionPlanRunListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExecutionPlanRunListResult. + */ + public static ExecutionPlanRunListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecutionPlanRunListResult deserializedExecutionPlanRunListResult = new ExecutionPlanRunListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ExecutionPlanRunInner.fromJson(reader1)); + deserializedExecutionPlanRunListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedExecutionPlanRunListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExecutionPlanRunListResult; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/OperationListResult.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/OperationListResult.java new file mode 100644 index 000000000000..ab3ffa3dbd50 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/OperationListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.platformvalidation.fluent.models.OperationInner; +import java.io.IOException; +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 implements JsonSerializable { + /* + * The Operation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + private OperationListResult() { + } + + /** + * Get the value property: The Operation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationExecutionPlanListResult.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationExecutionPlanListResult.java new file mode 100644 index 000000000000..31f548558c1e --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationExecutionPlanListResult.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationExecutionPlanInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ValidationExecutionPlan list operation. + */ +@Immutable +public final class ValidationExecutionPlanListResult implements JsonSerializable { + /* + * The ValidationExecutionPlan items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ValidationExecutionPlanListResult class. + */ + private ValidationExecutionPlanListResult() { + } + + /** + * Get the value property: The ValidationExecutionPlan items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationExecutionPlanListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationExecutionPlanListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidationExecutionPlanListResult. + */ + public static ValidationExecutionPlanListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationExecutionPlanListResult deserializedValidationExecutionPlanListResult + = new ValidationExecutionPlanListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ValidationExecutionPlanInner.fromJson(reader1)); + deserializedValidationExecutionPlanListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedValidationExecutionPlanListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationExecutionPlanListResult; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationTestCategoryListResult.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationTestCategoryListResult.java new file mode 100644 index 000000000000..6ff98d9271f7 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationTestCategoryListResult.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestCategoryInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ValidationTestCategory list operation. + */ +@Immutable +public final class ValidationTestCategoryListResult implements JsonSerializable { + /* + * The ValidationTestCategory items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ValidationTestCategoryListResult class. + */ + private ValidationTestCategoryListResult() { + } + + /** + * Get the value property: The ValidationTestCategory items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationTestCategoryListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationTestCategoryListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidationTestCategoryListResult. + */ + public static ValidationTestCategoryListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationTestCategoryListResult deserializedValidationTestCategoryListResult + = new ValidationTestCategoryListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ValidationTestCategoryInner.fromJson(reader1)); + deserializedValidationTestCategoryListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedValidationTestCategoryListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationTestCategoryListResult; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationTestListResult.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationTestListResult.java new file mode 100644 index 000000000000..e6acfb7a85cf --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationTestListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ValidationTest list operation. + */ +@Immutable +public final class ValidationTestListResult implements JsonSerializable { + /* + * The ValidationTest items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ValidationTestListResult class. + */ + private ValidationTestListResult() { + } + + /** + * Get the value property: The ValidationTest items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationTestListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationTestListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidationTestListResult. + */ + public static ValidationTestListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationTestListResult deserializedValidationTestListResult = new ValidationTestListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ValidationTestInner.fromJson(reader1)); + deserializedValidationTestListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedValidationTestListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationTestListResult; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationTestRunListResult.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationTestRunListResult.java new file mode 100644 index 000000000000..7a8d10e92bb6 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationTestRunListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestRunInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ValidationTestRun list operation. + */ +@Immutable +public final class ValidationTestRunListResult implements JsonSerializable { + /* + * The ValidationTestRun items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ValidationTestRunListResult class. + */ + private ValidationTestRunListResult() { + } + + /** + * Get the value property: The ValidationTestRun items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationTestRunListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationTestRunListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidationTestRunListResult. + */ + public static ValidationTestRunListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationTestRunListResult deserializedValidationTestRunListResult = new ValidationTestRunListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ValidationTestRunInner.fromJson(reader1)); + deserializedValidationTestRunListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedValidationTestRunListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationTestRunListResult; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationTestVersionListResult.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationTestVersionListResult.java new file mode 100644 index 000000000000..078cf08d323a --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationTestVersionListResult.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestVersionInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ValidationTestVersion list operation. + */ +@Immutable +public final class ValidationTestVersionListResult implements JsonSerializable { + /* + * The ValidationTestVersion items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ValidationTestVersionListResult class. + */ + private ValidationTestVersionListResult() { + } + + /** + * Get the value property: The ValidationTestVersion items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationTestVersionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationTestVersionListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidationTestVersionListResult. + */ + public static ValidationTestVersionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationTestVersionListResult deserializedValidationTestVersionListResult + = new ValidationTestVersionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ValidationTestVersionInner.fromJson(reader1)); + deserializedValidationTestVersionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedValidationTestVersionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationTestVersionListResult; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/package-info.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/package-info.java new file mode 100644 index 000000000000..4ace8f5abead --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the implementations for PlatformValidation. + * Microsoft.PlatformValidation Resource Provider management API. + */ +package com.azure.resourcemanager.platformvalidation.implementation; diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ActionType.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ActionType.java new file mode 100644 index 000000000000..1ef39aa30e08 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ActionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Actions are for internal-only APIs. + */ + 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. + */ + 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/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CatalogAudience.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CatalogAudience.java new file mode 100644 index 000000000000..4f654d0ef391 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CatalogAudience.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Audience visibility of a published catalog item. + */ +public final class CatalogAudience extends ExpandableStringEnum { + /** + * Visible to all customers, including first-party and third-party callers. + */ + public static final CatalogAudience PUBLIC = fromString("Public"); + + /** + * Visible only to authorized Microsoft-internal callers. + */ + public static final CatalogAudience INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of CatalogAudience value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CatalogAudience() { + } + + /** + * Creates or finds a CatalogAudience from its string representation. + * + * @param name a name to look for. + * @return the corresponding CatalogAudience. + */ + public static CatalogAudience fromString(String name) { + return fromString(name, CatalogAudience.class); + } + + /** + * Gets known CatalogAudience values. + * + * @return known CatalogAudience values. + */ + public static Collection values() { + return values(CatalogAudience.class); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidation.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidation.java new file mode 100644 index 000000000000..eaac0ec8b2c9 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidation.java @@ -0,0 +1,265 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.platformvalidation.fluent.models.CloudValidationInner; +import java.util.Map; + +/** + * An immutable client-side representation of CloudValidation. + */ +public interface CloudValidation { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + CloudValidationProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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.platformvalidation.fluent.models.CloudValidationInner object. + * + * @return the inner object. + */ + CloudValidationInner innerModel(); + + /** + * The entirety of the CloudValidation definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The CloudValidation definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the CloudValidation definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the CloudValidation 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 CloudValidation definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the CloudValidation 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + CloudValidation create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + CloudValidation create(Context context); + } + + /** + * The stage of the CloudValidation 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 CloudValidation definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(CloudValidationProperties properties); + } + } + + /** + * Begins update for the CloudValidation resource. + * + * @return the stage of resource update. + */ + CloudValidation.Update update(); + + /** + * The template for CloudValidation update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + CloudValidation apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + CloudValidation apply(Context context); + } + + /** + * The CloudValidation update stages. + */ + interface UpdateStages { + /** + * The stage of the CloudValidation update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the CloudValidation update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(CloudValidationUpdateProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + CloudValidation refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + CloudValidation refresh(Context context); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidationOverallState.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidationOverallState.java new file mode 100644 index 000000000000..1ed2421887bf --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidationOverallState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The Overall states of the validation resource. + */ +public final class CloudValidationOverallState extends ExpandableStringEnum { + /** + * The resource is in enabled state. + */ + public static final CloudValidationOverallState ENABLED = fromString("Enabled"); + + /** + * The resource is in disabled state. + */ + public static final CloudValidationOverallState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of CloudValidationOverallState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CloudValidationOverallState() { + } + + /** + * Creates or finds a CloudValidationOverallState from its string representation. + * + * @param name a name to look for. + * @return the corresponding CloudValidationOverallState. + */ + public static CloudValidationOverallState fromString(String name) { + return fromString(name, CloudValidationOverallState.class); + } + + /** + * Gets known CloudValidationOverallState values. + * + * @return known CloudValidationOverallState values. + */ + public static Collection values() { + return values(CloudValidationOverallState.class); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidationProperties.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidationProperties.java new file mode 100644 index 000000000000..c86613c6ffa7 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidationProperties.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cloud Validation properties. + */ +@Fluent +public final class CloudValidationProperties implements JsonSerializable { + /* + * The description of the resource. + */ + private String description; + + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /* + * Error details. Populated when provisioningState is Failed or Canceled. + */ + private ManagementError error; + + /* + * The overall state of the resource. + */ + private CloudValidationOverallState overallState; + + /* + * Managed On Behalf Of Configuration. + */ + private ManagedOnBehalfOfConfiguration managedOnBehalfOfConfiguration; + + /** + * Creates an instance of CloudValidationProperties class. + */ + public CloudValidationProperties() { + } + + /** + * Get the description property: The description of the resource. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the resource. + * + * @param description the description value to set. + * @return the CloudValidationProperties object itself. + */ + public CloudValidationProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the error property: Error details. Populated when provisioningState is Failed or Canceled. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Get the overallState property: The overall state of the resource. + * + * @return the overallState value. + */ + public CloudValidationOverallState overallState() { + return this.overallState; + } + + /** + * Set the overallState property: The overall state of the resource. + * + * @param overallState the overallState value to set. + * @return the CloudValidationProperties object itself. + */ + public CloudValidationProperties withOverallState(CloudValidationOverallState overallState) { + this.overallState = overallState; + return this; + } + + /** + * Get the managedOnBehalfOfConfiguration property: Managed On Behalf Of Configuration. + * + * @return the managedOnBehalfOfConfiguration value. + */ + public ManagedOnBehalfOfConfiguration managedOnBehalfOfConfiguration() { + return this.managedOnBehalfOfConfiguration; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("overallState", this.overallState == null ? null : this.overallState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudValidationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudValidationProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CloudValidationProperties. + */ + public static CloudValidationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudValidationProperties deserializedCloudValidationProperties = new CloudValidationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedCloudValidationProperties.description = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedCloudValidationProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedCloudValidationProperties.error = ManagementError.fromJson(reader); + } else if ("overallState".equals(fieldName)) { + deserializedCloudValidationProperties.overallState + = CloudValidationOverallState.fromString(reader.getString()); + } else if ("managedOnBehalfOfConfiguration".equals(fieldName)) { + deserializedCloudValidationProperties.managedOnBehalfOfConfiguration + = ManagedOnBehalfOfConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudValidationProperties; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidationUpdate.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidationUpdate.java new file mode 100644 index 000000000000..823719ce361d --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidationUpdate.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for update operations of the CloudValidation. + */ +@Fluent +public final class CloudValidationUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /* + * The resource-specific properties for this resource. + */ + private CloudValidationUpdateProperties properties; + + /** + * Creates an instance of CloudValidationUpdate class. + */ + public CloudValidationUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the CloudValidationUpdate object itself. + */ + public CloudValidationUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public CloudValidationUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the CloudValidationUpdate object itself. + */ + public CloudValidationUpdate withProperties(CloudValidationUpdateProperties properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudValidationUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudValidationUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CloudValidationUpdate. + */ + public static CloudValidationUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudValidationUpdate deserializedCloudValidationUpdate = new CloudValidationUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCloudValidationUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedCloudValidationUpdate.properties = CloudValidationUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudValidationUpdate; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidationUpdateProperties.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidationUpdateProperties.java new file mode 100644 index 000000000000..7d4acec133c6 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidationUpdateProperties.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The updatable properties of the CloudValidation. + */ +@Fluent +public final class CloudValidationUpdateProperties implements JsonSerializable { + /* + * The description of the resource. + */ + private String description; + + /* + * The overall state of the resource. + */ + private CloudValidationOverallState overallState; + + /** + * Creates an instance of CloudValidationUpdateProperties class. + */ + public CloudValidationUpdateProperties() { + } + + /** + * Get the description property: The description of the resource. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the resource. + * + * @param description the description value to set. + * @return the CloudValidationUpdateProperties object itself. + */ + public CloudValidationUpdateProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the overallState property: The overall state of the resource. + * + * @return the overallState value. + */ + public CloudValidationOverallState overallState() { + return this.overallState; + } + + /** + * Set the overallState property: The overall state of the resource. + * + * @param overallState the overallState value to set. + * @return the CloudValidationUpdateProperties object itself. + */ + public CloudValidationUpdateProperties withOverallState(CloudValidationOverallState overallState) { + this.overallState = overallState; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("overallState", this.overallState == null ? null : this.overallState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CloudValidationUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CloudValidationUpdateProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CloudValidationUpdateProperties. + */ + public static CloudValidationUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CloudValidationUpdateProperties deserializedCloudValidationUpdateProperties + = new CloudValidationUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedCloudValidationUpdateProperties.description = reader.getString(); + } else if ("overallState".equals(fieldName)) { + deserializedCloudValidationUpdateProperties.overallState + = CloudValidationOverallState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCloudValidationUpdateProperties; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidations.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidations.java new file mode 100644 index 000000000000..39495788d922 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidations.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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 CloudValidations. + */ +public interface CloudValidations { + /** + * Get a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @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 cloud validation along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String cloudValidationName, + Context context); + + /** + * Get a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @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 cloud validation. + */ + CloudValidation getByResourceGroup(String resourceGroupName, String cloudValidationName); + + /** + * Delete a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @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 cloudValidationName); + + /** + * Delete a cloud validation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String cloudValidationName, Context context); + + /** + * List cloud validations by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List cloud validations by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param filter The OData filter expression to apply to the list operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String filter, Context context); + + /** + * List cloud validations by 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 the response of a CloudValidation list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List cloud validations by subscription. + * + * @param filter The OData filter expression to apply to the list operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a CloudValidation list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String filter, Context context); + + /** + * Get a cloud validation. + * + * @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 cloud validation along with {@link Response}. + */ + CloudValidation getById(String id); + + /** + * Get a cloud validation. + * + * @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 cloud validation along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a cloud validation. + * + * @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 cloud validation. + * + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new CloudValidation resource. + * + * @param name resource name. + * @return the first stage of the new CloudValidation definition. + */ + CloudValidation.DefinitionStages.Blank define(String name); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRun.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRun.java new file mode 100644 index 000000000000..9d2d2d6127b9 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRun.java @@ -0,0 +1,191 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.platformvalidation.fluent.models.ExecutionPlanRunInner; + +/** + * An immutable client-side representation of ExecutionPlanRun. + */ +public interface ExecutionPlanRun { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ExecutionPlanRunProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.platformvalidation.fluent.models.ExecutionPlanRunInner object. + * + * @return the inner object. + */ + ExecutionPlanRunInner innerModel(); + + /** + * The entirety of the ExecutionPlanRun definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ExecutionPlanRun definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ExecutionPlanRun definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ExecutionPlanRun definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, cloudValidationName, validationExecutionPlanName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @return the next definition stage. + */ + WithCreate withExistingValidationExecutionPlan(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName); + } + + /** + * The stage of the ExecutionPlanRun 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ExecutionPlanRun create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ExecutionPlanRun create(Context context); + } + + /** + * The stage of the ExecutionPlanRun definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ExecutionPlanRunProperties properties); + } + } + + /** + * Begins update for the ExecutionPlanRun resource. + * + * @return the stage of resource update. + */ + ExecutionPlanRun.Update update(); + + /** + * The template for ExecutionPlanRun update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ExecutionPlanRun apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ExecutionPlanRun apply(Context context); + } + + /** + * The ExecutionPlanRun update stages. + */ + interface UpdateStages { + /** + * The stage of the ExecutionPlanRun update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(ExecutionPlanRunProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ExecutionPlanRun refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ExecutionPlanRun refresh(Context context); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRunProperties.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRunProperties.java new file mode 100644 index 000000000000..d73e38c176da --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRunProperties.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * The properties of the execution plan run. + */ +@Fluent +public final class ExecutionPlanRunProperties implements JsonSerializable { + /* + * The description of the resource. + */ + private String description; + + /* + * The status of the execution plan run. + */ + private ExecutionPlanRunStatus status; + + /* + * Error details. Populated when status is Failed, TimedOut, or Unknown. + */ + private ManagementError error; + + /* + * The start time of the execution plan run. + */ + private OffsetDateTime startedAt; + + /* + * The completion time of the execution plan run. + */ + private OffsetDateTime completedAt; + + /* + * The time at which the execution result was reported. + */ + private OffsetDateTime reportedAt; + + /* + * Summary of tests executed for this run. + */ + private TestRunSummary testRunSummary; + + /* + * Snapshot of the execution plan configuration captured at trigger time. + */ + private String planConfigurationSnapshot; + + /* + * The ARM resource IDs of the validation test runs (ValidationTestRun resources) executed as part of this execution + * plan run. + */ + private List testRunIds; + + /* + * The provisioning state of the execution plan run. + */ + private ExecutionPlanRunProvisioningState provisioningState; + + /** + * Creates an instance of ExecutionPlanRunProperties class. + */ + public ExecutionPlanRunProperties() { + } + + /** + * Get the description property: The description of the resource. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the resource. + * + * @param description the description value to set. + * @return the ExecutionPlanRunProperties object itself. + */ + public ExecutionPlanRunProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the status property: The status of the execution plan run. + * + * @return the status value. + */ + public ExecutionPlanRunStatus status() { + return this.status; + } + + /** + * Get the error property: Error details. Populated when status is Failed, TimedOut, or Unknown. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Get the startedAt property: The start time of the execution plan run. + * + * @return the startedAt value. + */ + public OffsetDateTime startedAt() { + return this.startedAt; + } + + /** + * Get the completedAt property: The completion time of the execution plan run. + * + * @return the completedAt value. + */ + public OffsetDateTime completedAt() { + return this.completedAt; + } + + /** + * Get the reportedAt property: The time at which the execution result was reported. + * + * @return the reportedAt value. + */ + public OffsetDateTime reportedAt() { + return this.reportedAt; + } + + /** + * Get the testRunSummary property: Summary of tests executed for this run. + * + * @return the testRunSummary value. + */ + public TestRunSummary testRunSummary() { + return this.testRunSummary; + } + + /** + * Get the planConfigurationSnapshot property: Snapshot of the execution plan configuration captured at trigger + * time. + * + * @return the planConfigurationSnapshot value. + */ + public String planConfigurationSnapshot() { + return this.planConfigurationSnapshot; + } + + /** + * Get the testRunIds property: The ARM resource IDs of the validation test runs (ValidationTestRun resources) + * executed as part of this execution plan run. + * + * @return the testRunIds value. + */ + public List testRunIds() { + return this.testRunIds; + } + + /** + * Get the provisioningState property: The provisioning state of the execution plan run. + * + * @return the provisioningState value. + */ + public ExecutionPlanRunProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExecutionPlanRunProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExecutionPlanRunProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ExecutionPlanRunProperties. + */ + public static ExecutionPlanRunProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExecutionPlanRunProperties deserializedExecutionPlanRunProperties = new ExecutionPlanRunProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedExecutionPlanRunProperties.description = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedExecutionPlanRunProperties.status + = ExecutionPlanRunStatus.fromString(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedExecutionPlanRunProperties.error = ManagementError.fromJson(reader); + } else if ("startedAt".equals(fieldName)) { + deserializedExecutionPlanRunProperties.startedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("completedAt".equals(fieldName)) { + deserializedExecutionPlanRunProperties.completedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("reportedAt".equals(fieldName)) { + deserializedExecutionPlanRunProperties.reportedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("testRunSummary".equals(fieldName)) { + deserializedExecutionPlanRunProperties.testRunSummary = TestRunSummary.fromJson(reader); + } else if ("planConfigurationSnapshot".equals(fieldName)) { + deserializedExecutionPlanRunProperties.planConfigurationSnapshot = reader.getString(); + } else if ("testRunIds".equals(fieldName)) { + List testRunIds = reader.readArray(reader1 -> reader1.getString()); + deserializedExecutionPlanRunProperties.testRunIds = testRunIds; + } else if ("provisioningState".equals(fieldName)) { + deserializedExecutionPlanRunProperties.provisioningState + = ExecutionPlanRunProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedExecutionPlanRunProperties; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRunProvisioningState.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRunProvisioningState.java new file mode 100644 index 000000000000..4e6710ea23e5 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRunProvisioningState.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of the execution plan run. + */ +public final class ExecutionPlanRunProvisioningState extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final ExecutionPlanRunProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final ExecutionPlanRunProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final ExecutionPlanRunProvisioningState CANCELED = fromString("Canceled"); + + /** + * The execution plan run is in progress. + */ + public static final ExecutionPlanRunProvisioningState CREATING = fromString("Creating"); + + /** + * The execution plan run is running. + */ + public static final ExecutionPlanRunProvisioningState RUNNING = fromString("Running"); + + /** + * The execution plan run is waiting. + */ + public static final ExecutionPlanRunProvisioningState WAITING = fromString("Waiting"); + + /** + * The execution plan run is partially executed. + */ + public static final ExecutionPlanRunProvisioningState PROCESSING = fromString("Processing"); + + /** + * Creates a new instance of ExecutionPlanRunProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExecutionPlanRunProvisioningState() { + } + + /** + * Creates or finds a ExecutionPlanRunProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExecutionPlanRunProvisioningState. + */ + public static ExecutionPlanRunProvisioningState fromString(String name) { + return fromString(name, ExecutionPlanRunProvisioningState.class); + } + + /** + * Gets known ExecutionPlanRunProvisioningState values. + * + * @return known ExecutionPlanRunProvisioningState values. + */ + public static Collection values() { + return values(ExecutionPlanRunProvisioningState.class); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRunStatus.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRunStatus.java new file mode 100644 index 000000000000..d6000146f9cc --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRunStatus.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the execution plan run. + */ +public final class ExecutionPlanRunStatus extends ExpandableStringEnum { + /** + * The execution plan run is succeeded. + */ + public static final ExecutionPlanRunStatus SUCCEEDED = fromString("Succeeded"); + + /** + * The execution plan run has been queued. + */ + public static final ExecutionPlanRunStatus QUEUED = fromString("Queued"); + + /** + * The execution plan run is running. + */ + public static final ExecutionPlanRunStatus RUNNING = fromString("Running"); + + /** + * The execution plan run is completed. + */ + public static final ExecutionPlanRunStatus COMPLETED = fromString("Completed"); + + /** + * The execution plan run is failed. + */ + public static final ExecutionPlanRunStatus FAILED = fromString("Failed"); + + /** + * The execution plan run is timed out. + */ + public static final ExecutionPlanRunStatus TIMED_OUT = fromString("TimedOut"); + + /** + * The execution plan run is unknown. + */ + public static final ExecutionPlanRunStatus UNKNOWN = fromString("Unknown"); + + /** + * Creates a new instance of ExecutionPlanRunStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExecutionPlanRunStatus() { + } + + /** + * Creates or finds a ExecutionPlanRunStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExecutionPlanRunStatus. + */ + public static ExecutionPlanRunStatus fromString(String name) { + return fromString(name, ExecutionPlanRunStatus.class); + } + + /** + * Gets known ExecutionPlanRunStatus values. + * + * @return known ExecutionPlanRunStatus values. + */ + public static Collection values() { + return values(ExecutionPlanRunStatus.class); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRuns.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRuns.java new file mode 100644 index 000000000000..ac5b4d0d27f4 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRuns.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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 ExecutionPlanRuns. + */ +public interface ExecutionPlanRuns { + /** + * Get a Validation test execution plan run details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @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 Validation test execution plan run details along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, Context context); + + /** + * Get a Validation test execution plan run details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @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 Validation test execution plan run details. + */ + ExecutionPlanRun get(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName); + + /** + * Delete a validation test execution plan run resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @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 cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName); + + /** + * Delete a validation test execution plan run resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, Context context); + + /** + * List Validation test execution plan runs for an execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ExecutionPlanRun list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByExecutionPlan(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName); + + /** + * List Validation test execution plan runs for an execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param filter The OData filter expression to apply to the list operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ExecutionPlanRun list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByExecutionPlan(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String filter, Context context); + + /** + * Get a Validation test execution plan run details. + * + * @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 Validation test execution plan run details along with {@link Response}. + */ + ExecutionPlanRun getById(String id); + + /** + * Get a Validation test execution plan run details. + * + * @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 Validation test execution plan run details along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a validation test execution plan run 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 validation test execution plan run 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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ExecutionPlanRun resource. + * + * @param name resource name. + * @return the first stage of the new ExecutionPlanRun definition. + */ + ExecutionPlanRun.DefinitionStages.Blank define(String name); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ManagedOnBehalfOfConfiguration.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ManagedOnBehalfOfConfiguration.java new file mode 100644 index 000000000000..3e554bff7b0d --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ManagedOnBehalfOfConfiguration.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Managed-On-Behalf-Of configuration properties. This configuration exists for the resources where a resource provider + * manages those resources on behalf of the resource owner. + */ +@Immutable +public final class ManagedOnBehalfOfConfiguration implements JsonSerializable { + /* + * Managed-On-Behalf-Of broker resources + */ + private List moboBrokerResources; + + /** + * Creates an instance of ManagedOnBehalfOfConfiguration class. + */ + private ManagedOnBehalfOfConfiguration() { + } + + /** + * Get the moboBrokerResources property: Managed-On-Behalf-Of broker resources. + * + * @return the moboBrokerResources value. + */ + public List moboBrokerResources() { + return this.moboBrokerResources; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedOnBehalfOfConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedOnBehalfOfConfiguration if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedOnBehalfOfConfiguration. + */ + public static ManagedOnBehalfOfConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedOnBehalfOfConfiguration deserializedManagedOnBehalfOfConfiguration + = new ManagedOnBehalfOfConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("moboBrokerResources".equals(fieldName)) { + List moboBrokerResources + = reader.readArray(reader1 -> MoboBrokerResource.fromJson(reader1)); + deserializedManagedOnBehalfOfConfiguration.moboBrokerResources = moboBrokerResources; + } else { + reader.skipChildren(); + } + } + + return deserializedManagedOnBehalfOfConfiguration; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/MoboBrokerResource.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/MoboBrokerResource.java new file mode 100644 index 000000000000..dadb8867f869 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/MoboBrokerResource.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Managed-On-Behalf-Of broker resource. This resource is created by the Resource Provider to manage some resources on + * behalf of the user. + */ +@Immutable +public final class MoboBrokerResource implements JsonSerializable { + /* + * Resource identifier of a Managed-On-Behalf-Of broker resource + */ + private String id; + + /** + * Creates an instance of MoboBrokerResource class. + */ + private MoboBrokerResource() { + } + + /** + * Get the id property: Resource identifier of a Managed-On-Behalf-Of broker resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MoboBrokerResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MoboBrokerResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MoboBrokerResource. + */ + public static MoboBrokerResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MoboBrokerResource deserializedMoboBrokerResource = new MoboBrokerResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMoboBrokerResource.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMoboBrokerResource; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/Operation.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/Operation.java new file mode 100644 index 000000000000..050a7ce50e0f --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/Operation.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.resourcemanager.platformvalidation.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 Azure Resource Manager/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: Extensible 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.platformvalidation.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/OperationDisplay.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/OperationDisplay.java new file mode 100644 index 000000000000..a0c893f3cf4f --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Localized display information for an operation. + */ +@Immutable +public final class OperationDisplay implements JsonSerializable { + /* + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". + */ + private String provider; + + /* + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". + */ + private String resource; + + /* + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + */ + private String operation; + + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + + /** + * Creates an instance of OperationDisplay class. + */ + private 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/OperationStatus.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/OperationStatus.java new file mode 100644 index 000000000000..dd3e82aa9222 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/OperationStatus.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of OperationStatus. + */ +public interface OperationStatus { + /** + * Returns the current status of an async operation. + * + * @param location The name of the Azure region. + * @param operationId The ID of an ongoing async operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation along with {@link Response}. + */ + Response getWithResponse(String location, String operationId, Context context); + + /** + * Returns the current status of an async operation. + * + * @param location The name of the Azure region. + * @param operationId The ID of an ongoing async operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the current status of an async operation. + */ + OperationStatusResult get(String location, String operationId); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/OperationStatusResult.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/OperationStatusResult.java new file mode 100644 index 000000000000..4baf502f2080 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/OperationStatusResult.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.platformvalidation.fluent.models.OperationStatusResultInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * An immutable client-side representation of OperationStatusResult. + */ +public interface OperationStatusResult { + /** + * Gets the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: Name of the async operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the status property: Operation status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + Double percentComplete(); + + /** + * Gets the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + OffsetDateTime startTime(); + + /** + * Gets the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + OffsetDateTime endTime(); + + /** + * Gets the operations property: The operations list. + * + * @return the operations value. + */ + List operations(); + + /** + * Gets the error property: If present, details of the operation error. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the inner com.azure.resourcemanager.platformvalidation.fluent.models.OperationStatusResultInner object. + * + * @return the inner object. + */ + OperationStatusResultInner innerModel(); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/Operations.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/Operations.java new file mode 100644 index 000000000000..238c8ba35078 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/Operations.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** + * Resource collection API of Operations. + */ +public interface Operations { + /** + * List the operations for the provider. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List the operations for the provider. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/Origin.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/Origin.java new file mode 100644 index 000000000000..2fab0e2ab27e --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/Origin.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.util.ExpandableStringEnum; +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 { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + 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. + */ + 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/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ProvisioningState.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ProvisioningState.java new file mode 100644 index 000000000000..f1d310ddaf30 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ProvisioningState.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The resource provisioning state. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * The resource is being provisioned. + */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** + * The resource is updating. + */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** + * The resource is being disabled. + */ + public static final ProvisioningState DISABLING = fromString("Disabling"); + + /** + * The resource is being deleted. + */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** + * The resource create request has been accepted. + */ + public static final ProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Creates a new instance of ProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ProvisioningState() { + } + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * Gets known ProvisioningState values. + * + * @return known ProvisioningState values. + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ResourceProvisioningState.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ResourceProvisioningState.java new file mode 100644 index 000000000000..421698baebd3 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ResourceProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of a resource type. + */ +public final class ResourceProvisioningState extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final ResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final ResourceProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final ResourceProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ResourceProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceProvisioningState() { + } + + /** + * Creates or finds a ResourceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceProvisioningState. + */ + public static ResourceProvisioningState fromString(String name) { + return fromString(name, ResourceProvisioningState.class); + } + + /** + * Gets known ResourceProvisioningState values. + * + * @return known ResourceProvisioningState values. + */ + public static Collection values() { + return values(ResourceProvisioningState.class); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/TestRunOverallResult.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/TestRunOverallResult.java new file mode 100644 index 000000000000..4c841e09858e --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/TestRunOverallResult.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The overall result of a validation test run collection. + */ +public final class TestRunOverallResult extends ExpandableStringEnum { + /** + * All tests passed. + */ + public static final TestRunOverallResult PASSED = fromString("Passed"); + + /** + * One or more tests failed. + */ + public static final TestRunOverallResult FAILED = fromString("Failed"); + + /** + * Some tests passed and some failed. + */ + public static final TestRunOverallResult PARTIALLY_PASSED = fromString("PartiallyPassed"); + + /** + * Creates a new instance of TestRunOverallResult value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TestRunOverallResult() { + } + + /** + * Creates or finds a TestRunOverallResult from its string representation. + * + * @param name a name to look for. + * @return the corresponding TestRunOverallResult. + */ + public static TestRunOverallResult fromString(String name) { + return fromString(name, TestRunOverallResult.class); + } + + /** + * Gets known TestRunOverallResult values. + * + * @return known TestRunOverallResult values. + */ + public static Collection values() { + return values(TestRunOverallResult.class); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/TestRunSummary.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/TestRunSummary.java new file mode 100644 index 000000000000..e1a22d0c135b --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/TestRunSummary.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Execution summary details for a validation test run collection. + */ +@Immutable +public final class TestRunSummary implements JsonSerializable { + /* + * Total number of tests executed. + */ + private Integer totalTests; + + /* + * Number of passed tests. + */ + private Integer passedTests; + + /* + * Number of failed tests. + */ + private Integer failedTests; + + /* + * Number of skipped tests. + */ + private Integer skippedTests; + + /* + * Overall result for the execution plan run. + */ + private TestRunOverallResult overallResult; + + /* + * Human-readable summary message. + */ + private String message; + + /** + * Creates an instance of TestRunSummary class. + */ + private TestRunSummary() { + } + + /** + * Get the totalTests property: Total number of tests executed. + * + * @return the totalTests value. + */ + public Integer totalTests() { + return this.totalTests; + } + + /** + * Get the passedTests property: Number of passed tests. + * + * @return the passedTests value. + */ + public Integer passedTests() { + return this.passedTests; + } + + /** + * Get the failedTests property: Number of failed tests. + * + * @return the failedTests value. + */ + public Integer failedTests() { + return this.failedTests; + } + + /** + * Get the skippedTests property: Number of skipped tests. + * + * @return the skippedTests value. + */ + public Integer skippedTests() { + return this.skippedTests; + } + + /** + * Get the overallResult property: Overall result for the execution plan run. + * + * @return the overallResult value. + */ + public TestRunOverallResult overallResult() { + return this.overallResult; + } + + /** + * Get the message property: Human-readable summary message. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("totalTests", this.totalTests); + jsonWriter.writeNumberField("passedTests", this.passedTests); + jsonWriter.writeNumberField("failedTests", this.failedTests); + jsonWriter.writeNumberField("skippedTests", this.skippedTests); + jsonWriter.writeStringField("overallResult", this.overallResult == null ? null : this.overallResult.toString()); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestRunSummary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestRunSummary if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the TestRunSummary. + */ + public static TestRunSummary fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TestRunSummary deserializedTestRunSummary = new TestRunSummary(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalTests".equals(fieldName)) { + deserializedTestRunSummary.totalTests = reader.getNullable(JsonReader::getInt); + } else if ("passedTests".equals(fieldName)) { + deserializedTestRunSummary.passedTests = reader.getNullable(JsonReader::getInt); + } else if ("failedTests".equals(fieldName)) { + deserializedTestRunSummary.failedTests = reader.getNullable(JsonReader::getInt); + } else if ("skippedTests".equals(fieldName)) { + deserializedTestRunSummary.skippedTests = reader.getNullable(JsonReader::getInt); + } else if ("overallResult".equals(fieldName)) { + deserializedTestRunSummary.overallResult = TestRunOverallResult.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedTestRunSummary.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTestRunSummary; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlan.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlan.java new file mode 100644 index 000000000000..edda7effed63 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlan.java @@ -0,0 +1,266 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationExecutionPlanInner; +import java.util.Map; + +/** + * An immutable client-side representation of ValidationExecutionPlan. + */ +public interface ValidationExecutionPlan { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ValidationExecutionPlanProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * 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.platformvalidation.fluent.models.ValidationExecutionPlanInner object. + * + * @return the inner object. + */ + ValidationExecutionPlanInner innerModel(); + + /** + * The entirety of the ValidationExecutionPlan definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ValidationExecutionPlan definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ValidationExecutionPlan definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the ValidationExecutionPlan 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. + */ + WithParentResource withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithParentResource withRegion(String location); + } + + /** + * The stage of the ValidationExecutionPlan definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, cloudValidationName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @return the next definition stage. + */ + WithCreate withExistingCloudValidation(String resourceGroupName, String cloudValidationName); + } + + /** + * The stage of the ValidationExecutionPlan 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ValidationExecutionPlan create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ValidationExecutionPlan create(Context context); + } + + /** + * The stage of the ValidationExecutionPlan 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 ValidationExecutionPlan definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ValidationExecutionPlanProperties properties); + } + } + + /** + * Begins update for the ValidationExecutionPlan resource. + * + * @return the stage of resource update. + */ + ValidationExecutionPlan.Update update(); + + /** + * The template for ValidationExecutionPlan update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ValidationExecutionPlan apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ValidationExecutionPlan apply(Context context); + } + + /** + * The ValidationExecutionPlan update stages. + */ + interface UpdateStages { + /** + * The stage of the ValidationExecutionPlan update allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the ValidationExecutionPlan update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(ValidationExecutionPlanUpdateProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ValidationExecutionPlan refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ValidationExecutionPlan refresh(Context context); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanOverallState.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanOverallState.java new file mode 100644 index 000000000000..95be8327babd --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanOverallState.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The Overall states of the validation execution plan. + */ +public final class ValidationExecutionPlanOverallState + extends ExpandableStringEnum { + /** + * The resource is in enabled state. + */ + public static final ValidationExecutionPlanOverallState ENABLED = fromString("Enabled"); + + /** + * The resource is in disabled state. + */ + public static final ValidationExecutionPlanOverallState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ValidationExecutionPlanOverallState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ValidationExecutionPlanOverallState() { + } + + /** + * Creates or finds a ValidationExecutionPlanOverallState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ValidationExecutionPlanOverallState. + */ + public static ValidationExecutionPlanOverallState fromString(String name) { + return fromString(name, ValidationExecutionPlanOverallState.class); + } + + /** + * Gets known ValidationExecutionPlanOverallState values. + * + * @return known ValidationExecutionPlanOverallState values. + */ + public static Collection values() { + return values(ValidationExecutionPlanOverallState.class); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanProperties.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanProperties.java new file mode 100644 index 000000000000..11eba0b08ed0 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanProperties.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Validation Test Execution Plan properties. + */ +@Fluent +public final class ValidationExecutionPlanProperties implements JsonSerializable { + /* + * The description of the resource. + */ + private String description; + + /* + * URI where the configuration of the execution plan is defined. + * Either this property or `planConfigurationJson` is mandatory while creating; they are mutually exclusive. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + */ + private String planConfigurationUri; + + /* + * Entire execution plan configuration/manifest json. + * Either this property or `planConfigurationUri` is mandatory while creating; they are mutually exclusive. + * In get, always return the entire json configuration. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + */ + private String planConfigurationJson; + + /* + * The provisioning state of the resource. + */ + private ValidationExecutionPlanProvisioningState provisioningState; + + /* + * Error details. Populated when provisioningState is Failed or Canceled. + */ + private ManagementError error; + + /* + * The overall state of the resource. + */ + private ValidationExecutionPlanOverallState overallState; + + /** + * Creates an instance of ValidationExecutionPlanProperties class. + */ + public ValidationExecutionPlanProperties() { + } + + /** + * Get the description property: The description of the resource. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the resource. + * + * @param description the description value to set. + * @return the ValidationExecutionPlanProperties object itself. + */ + public ValidationExecutionPlanProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the planConfigurationUri property: URI where the configuration of the execution plan is defined. + * Either this property or `planConfigurationJson` is mandatory while creating; they are mutually exclusive. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + * + * @return the planConfigurationUri value. + */ + public String planConfigurationUri() { + return this.planConfigurationUri; + } + + /** + * Set the planConfigurationUri property: URI where the configuration of the execution plan is defined. + * Either this property or `planConfigurationJson` is mandatory while creating; they are mutually exclusive. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + * + * @param planConfigurationUri the planConfigurationUri value to set. + * @return the ValidationExecutionPlanProperties object itself. + */ + public ValidationExecutionPlanProperties withPlanConfigurationUri(String planConfigurationUri) { + this.planConfigurationUri = planConfigurationUri; + return this; + } + + /** + * Get the planConfigurationJson property: Entire execution plan configuration/manifest json. + * Either this property or `planConfigurationUri` is mandatory while creating; they are mutually exclusive. + * In get, always return the entire json configuration. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + * + * @return the planConfigurationJson value. + */ + public String planConfigurationJson() { + return this.planConfigurationJson; + } + + /** + * Set the planConfigurationJson property: Entire execution plan configuration/manifest json. + * Either this property or `planConfigurationUri` is mandatory while creating; they are mutually exclusive. + * In get, always return the entire json configuration. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + * + * @param planConfigurationJson the planConfigurationJson value to set. + * @return the ValidationExecutionPlanProperties object itself. + */ + public ValidationExecutionPlanProperties withPlanConfigurationJson(String planConfigurationJson) { + this.planConfigurationJson = planConfigurationJson; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ValidationExecutionPlanProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the error property: Error details. Populated when provisioningState is Failed or Canceled. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Get the overallState property: The overall state of the resource. + * + * @return the overallState value. + */ + public ValidationExecutionPlanOverallState overallState() { + return this.overallState; + } + + /** + * Set the overallState property: The overall state of the resource. + * + * @param overallState the overallState value to set. + * @return the ValidationExecutionPlanProperties object itself. + */ + public ValidationExecutionPlanProperties withOverallState(ValidationExecutionPlanOverallState overallState) { + this.overallState = overallState; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("planConfigurationUri", this.planConfigurationUri); + jsonWriter.writeStringField("planConfigurationJson", this.planConfigurationJson); + jsonWriter.writeStringField("overallState", this.overallState == null ? null : this.overallState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationExecutionPlanProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationExecutionPlanProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidationExecutionPlanProperties. + */ + public static ValidationExecutionPlanProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationExecutionPlanProperties deserializedValidationExecutionPlanProperties + = new ValidationExecutionPlanProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedValidationExecutionPlanProperties.description = reader.getString(); + } else if ("planConfigurationUri".equals(fieldName)) { + deserializedValidationExecutionPlanProperties.planConfigurationUri = reader.getString(); + } else if ("planConfigurationJson".equals(fieldName)) { + deserializedValidationExecutionPlanProperties.planConfigurationJson = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedValidationExecutionPlanProperties.provisioningState + = ValidationExecutionPlanProvisioningState.fromString(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedValidationExecutionPlanProperties.error = ManagementError.fromJson(reader); + } else if ("overallState".equals(fieldName)) { + deserializedValidationExecutionPlanProperties.overallState + = ValidationExecutionPlanOverallState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationExecutionPlanProperties; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanProvisioningState.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanProvisioningState.java new file mode 100644 index 000000000000..27e0b06203a6 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanProvisioningState.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The execution plan resource provisioning state. + */ +public final class ValidationExecutionPlanProvisioningState + extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final ValidationExecutionPlanProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final ValidationExecutionPlanProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final ValidationExecutionPlanProvisioningState CANCELED = fromString("Canceled"); + + /** + * The resource is being provisioned. + */ + public static final ValidationExecutionPlanProvisioningState CREATING = fromString("Creating"); + + /** + * The resource is updating. + */ + public static final ValidationExecutionPlanProvisioningState UPDATING = fromString("Updating"); + + /** + * Creates a new instance of ValidationExecutionPlanProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ValidationExecutionPlanProvisioningState() { + } + + /** + * Creates or finds a ValidationExecutionPlanProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ValidationExecutionPlanProvisioningState. + */ + public static ValidationExecutionPlanProvisioningState fromString(String name) { + return fromString(name, ValidationExecutionPlanProvisioningState.class); + } + + /** + * Gets known ValidationExecutionPlanProvisioningState values. + * + * @return known ValidationExecutionPlanProvisioningState values. + */ + public static Collection values() { + return values(ValidationExecutionPlanProvisioningState.class); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanUpdate.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanUpdate.java new file mode 100644 index 000000000000..1815883796e3 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanUpdate.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * The type used for update operations of the ValidationExecutionPlan. + */ +@Fluent +public final class ValidationExecutionPlanUpdate implements JsonSerializable { + /* + * Resource tags. + */ + private Map tags; + + /* + * The resource-specific properties for this resource. + */ + private ValidationExecutionPlanUpdateProperties properties; + + /** + * Creates an instance of ValidationExecutionPlanUpdate class. + */ + public ValidationExecutionPlanUpdate() { + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. + * @return the ValidationExecutionPlanUpdate object itself. + */ + public ValidationExecutionPlanUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public ValidationExecutionPlanUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the ValidationExecutionPlanUpdate object itself. + */ + public ValidationExecutionPlanUpdate withProperties(ValidationExecutionPlanUpdateProperties properties) { + this.properties = properties; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationExecutionPlanUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationExecutionPlanUpdate if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidationExecutionPlanUpdate. + */ + public static ValidationExecutionPlanUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationExecutionPlanUpdate deserializedValidationExecutionPlanUpdate + = new ValidationExecutionPlanUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedValidationExecutionPlanUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedValidationExecutionPlanUpdate.properties + = ValidationExecutionPlanUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationExecutionPlanUpdate; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanUpdateProperties.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanUpdateProperties.java new file mode 100644 index 000000000000..67d75990618d --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanUpdateProperties.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The updatable properties of the ValidationExecutionPlan. + */ +@Fluent +public final class ValidationExecutionPlanUpdateProperties + implements JsonSerializable { + /* + * The description of the resource. + */ + private String description; + + /* + * URI where the configuration of the execution plan is defined. + * Either this property or `planConfigurationJson` is mandatory while creating; they are mutually exclusive. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + */ + private String planConfigurationUri; + + /* + * Entire execution plan configuration/manifest json. + * Either this property or `planConfigurationUri` is mandatory while creating; they are mutually exclusive. + * In get, always return the entire json configuration. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + */ + private String planConfigurationJson; + + /* + * The overall state of the resource. + */ + private ValidationExecutionPlanOverallState overallState; + + /** + * Creates an instance of ValidationExecutionPlanUpdateProperties class. + */ + public ValidationExecutionPlanUpdateProperties() { + } + + /** + * Get the description property: The description of the resource. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the resource. + * + * @param description the description value to set. + * @return the ValidationExecutionPlanUpdateProperties object itself. + */ + public ValidationExecutionPlanUpdateProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the planConfigurationUri property: URI where the configuration of the execution plan is defined. + * Either this property or `planConfigurationJson` is mandatory while creating; they are mutually exclusive. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + * + * @return the planConfigurationUri value. + */ + public String planConfigurationUri() { + return this.planConfigurationUri; + } + + /** + * Set the planConfigurationUri property: URI where the configuration of the execution plan is defined. + * Either this property or `planConfigurationJson` is mandatory while creating; they are mutually exclusive. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + * + * @param planConfigurationUri the planConfigurationUri value to set. + * @return the ValidationExecutionPlanUpdateProperties object itself. + */ + public ValidationExecutionPlanUpdateProperties withPlanConfigurationUri(String planConfigurationUri) { + this.planConfigurationUri = planConfigurationUri; + return this; + } + + /** + * Get the planConfigurationJson property: Entire execution plan configuration/manifest json. + * Either this property or `planConfigurationUri` is mandatory while creating; they are mutually exclusive. + * In get, always return the entire json configuration. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + * + * @return the planConfigurationJson value. + */ + public String planConfigurationJson() { + return this.planConfigurationJson; + } + + /** + * Set the planConfigurationJson property: Entire execution plan configuration/manifest json. + * Either this property or `planConfigurationUri` is mandatory while creating; they are mutually exclusive. + * In get, always return the entire json configuration. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + * + * @param planConfigurationJson the planConfigurationJson value to set. + * @return the ValidationExecutionPlanUpdateProperties object itself. + */ + public ValidationExecutionPlanUpdateProperties withPlanConfigurationJson(String planConfigurationJson) { + this.planConfigurationJson = planConfigurationJson; + return this; + } + + /** + * Get the overallState property: The overall state of the resource. + * + * @return the overallState value. + */ + public ValidationExecutionPlanOverallState overallState() { + return this.overallState; + } + + /** + * Set the overallState property: The overall state of the resource. + * + * @param overallState the overallState value to set. + * @return the ValidationExecutionPlanUpdateProperties object itself. + */ + public ValidationExecutionPlanUpdateProperties withOverallState(ValidationExecutionPlanOverallState overallState) { + this.overallState = overallState; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("planConfigurationUri", this.planConfigurationUri); + jsonWriter.writeStringField("planConfigurationJson", this.planConfigurationJson); + jsonWriter.writeStringField("overallState", this.overallState == null ? null : this.overallState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationExecutionPlanUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationExecutionPlanUpdateProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidationExecutionPlanUpdateProperties. + */ + public static ValidationExecutionPlanUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationExecutionPlanUpdateProperties deserializedValidationExecutionPlanUpdateProperties + = new ValidationExecutionPlanUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedValidationExecutionPlanUpdateProperties.description = reader.getString(); + } else if ("planConfigurationUri".equals(fieldName)) { + deserializedValidationExecutionPlanUpdateProperties.planConfigurationUri = reader.getString(); + } else if ("planConfigurationJson".equals(fieldName)) { + deserializedValidationExecutionPlanUpdateProperties.planConfigurationJson = reader.getString(); + } else if ("overallState".equals(fieldName)) { + deserializedValidationExecutionPlanUpdateProperties.overallState + = ValidationExecutionPlanOverallState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationExecutionPlanUpdateProperties; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlans.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlans.java new file mode 100644 index 000000000000..535d89ade4a0 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlans.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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 ValidationExecutionPlans. + */ +public interface ValidationExecutionPlans { + /** + * Get a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @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 validation test execution plan along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, Context context); + + /** + * Get a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @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 validation test execution plan. + */ + ValidationExecutionPlan get(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName); + + /** + * Delete a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @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 cloudValidationName, String validationExecutionPlanName); + + /** + * Delete a validation test execution plan. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + Context context); + + /** + * List validation test execution plans by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationExecutionPlan list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String cloudValidationName); + + /** + * List validation test execution plans by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param filter The OData filter expression to apply to the list operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationExecutionPlan list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, String cloudValidationName, + String filter, Context context); + + /** + * Get a validation test execution plan. + * + * @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 validation test execution plan along with {@link Response}. + */ + ValidationExecutionPlan getById(String id); + + /** + * Get a validation test execution plan. + * + * @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 validation test execution plan along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a validation test execution plan. + * + * @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 validation test execution plan. + * + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ValidationExecutionPlan resource. + * + * @param name resource name. + * @return the first stage of the new ValidationExecutionPlan definition. + */ + ValidationExecutionPlan.DefinitionStages.Blank define(String name); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTest.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTest.java new file mode 100644 index 000000000000..23d1d30f0017 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTest.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestInner; + +/** + * An immutable client-side representation of ValidationTest. + */ +public interface ValidationTest { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ValidationTestProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestInner object. + * + * @return the inner object. + */ + ValidationTestInner innerModel(); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestCategories.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestCategories.java new file mode 100644 index 000000000000..1c33fd91f8e0 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestCategories.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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 ValidationTestCategories. + */ +public interface ValidationTestCategories { + /** + * Get a validation test category catalog entry. + * + * @param validationTestCategoryName The name of the ValidationTestCategory. + * @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 validation test category catalog entry along with {@link Response}. + */ + Response getWithResponse(String validationTestCategoryName, Context context); + + /** + * Get a validation test category catalog entry. + * + * @param validationTestCategoryName The name of the ValidationTestCategory. + * @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 validation test category catalog entry. + */ + ValidationTestCategory get(String validationTestCategoryName); + + /** + * List validation test category catalog entries for 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 the response of a ValidationTestCategory list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List validation test category catalog entries for a subscription. + * + * @param filter Filter expression used to constrain the returned items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestCategory list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String filter, Context context); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestCategory.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestCategory.java new file mode 100644 index 000000000000..123c291ef2b3 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestCategory.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestCategoryInner; + +/** + * An immutable client-side representation of ValidationTestCategory. + */ +public interface ValidationTestCategory { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ValidationTestCategoryProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestCategoryInner object. + * + * @return the inner object. + */ + ValidationTestCategoryInner innerModel(); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestCategoryProperties.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestCategoryProperties.java new file mode 100644 index 000000000000..91255b76d20a --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestCategoryProperties.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Validation test category properties. + */ +@Immutable +public final class ValidationTestCategoryProperties implements JsonSerializable { + /* + * Display name of the validation test category. + */ + private String displayName; + + /* + * Validation test category description. + */ + private String description; + + /* + * Audience visibility of this validation test category. + */ + private CatalogAudience audience; + + /* + * Provisioning state of the validation test category catalog resource. + */ + private ResourceProvisioningState provisioningState; + + /* + * Parent validation test category id. Categories form a two-level hierarchy only: + * a top-level category leaves this unset, and a sub-category sets this to its + * top-level parent's category id. Sub-categories cannot themselves have sub-categories, + * and a category must not reference itself as its own parent. + */ + private String parentCategoryId; + + /* + * Owners of the validation test category, expressed as email aliases or Microsoft Entra object IDs. + * Only catalog publishers set this value through an internal publishing process; end users of the validation + * service consume catalog entries read-only through Get/List and cannot modify it. + */ + private List owners; + + /** + * Creates an instance of ValidationTestCategoryProperties class. + */ + private ValidationTestCategoryProperties() { + } + + /** + * Get the displayName property: Display name of the validation test category. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the description property: Validation test category description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the audience property: Audience visibility of this validation test category. + * + * @return the audience value. + */ + public CatalogAudience audience() { + return this.audience; + } + + /** + * Get the provisioningState property: Provisioning state of the validation test category catalog resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the parentCategoryId property: Parent validation test category id. Categories form a two-level hierarchy + * only: + * a top-level category leaves this unset, and a sub-category sets this to its + * top-level parent's category id. Sub-categories cannot themselves have sub-categories, + * and a category must not reference itself as its own parent. + * + * @return the parentCategoryId value. + */ + public String parentCategoryId() { + return this.parentCategoryId; + } + + /** + * Get the owners property: Owners of the validation test category, expressed as email aliases or Microsoft Entra + * object IDs. + * Only catalog publishers set this value through an internal publishing process; end users of the validation + * service consume catalog entries read-only through Get/List and cannot modify it. + * + * @return the owners value. + */ + public List owners() { + return this.owners; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("audience", this.audience == null ? null : this.audience.toString()); + jsonWriter.writeStringField("parentCategoryId", this.parentCategoryId); + jsonWriter.writeArrayField("owners", this.owners, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationTestCategoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationTestCategoryProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidationTestCategoryProperties. + */ + public static ValidationTestCategoryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationTestCategoryProperties deserializedValidationTestCategoryProperties + = new ValidationTestCategoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedValidationTestCategoryProperties.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedValidationTestCategoryProperties.description = reader.getString(); + } else if ("audience".equals(fieldName)) { + deserializedValidationTestCategoryProperties.audience + = CatalogAudience.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedValidationTestCategoryProperties.provisioningState + = ResourceProvisioningState.fromString(reader.getString()); + } else if ("parentCategoryId".equals(fieldName)) { + deserializedValidationTestCategoryProperties.parentCategoryId = reader.getString(); + } else if ("owners".equals(fieldName)) { + List owners = reader.readArray(reader1 -> reader1.getString()); + deserializedValidationTestCategoryProperties.owners = owners; + } else { + reader.skipChildren(); + } + } + + return deserializedValidationTestCategoryProperties; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestFailureDetails.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestFailureDetails.java new file mode 100644 index 000000000000..9228d2b556af --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestFailureDetails.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Detailed information about test failure. + */ +@Immutable +public final class ValidationTestFailureDetails implements JsonSerializable { + /* + * Error code categorizing the type of failure. + */ + private String errorCode; + + /* + * Human-readable error message describing the failure. + */ + private String errorMessage; + + /* + * Detailed information about the failure. + */ + private String details; + + /* + * Additional diagnostic information. + */ + private String diagnosticInfo; + + /* + * Suggested remediation steps for the customer. + */ + private List recommendedActions; + + /** + * Creates an instance of ValidationTestFailureDetails class. + */ + private ValidationTestFailureDetails() { + } + + /** + * Get the errorCode property: Error code categorizing the type of failure. + * + * @return the errorCode value. + */ + public String errorCode() { + return this.errorCode; + } + + /** + * Get the errorMessage property: Human-readable error message describing the failure. + * + * @return the errorMessage value. + */ + public String errorMessage() { + return this.errorMessage; + } + + /** + * Get the details property: Detailed information about the failure. + * + * @return the details value. + */ + public String details() { + return this.details; + } + + /** + * Get the diagnosticInfo property: Additional diagnostic information. + * + * @return the diagnosticInfo value. + */ + public String diagnosticInfo() { + return this.diagnosticInfo; + } + + /** + * Get the recommendedActions property: Suggested remediation steps for the customer. + * + * @return the recommendedActions value. + */ + public List recommendedActions() { + return this.recommendedActions; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationTestFailureDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationTestFailureDetails if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidationTestFailureDetails. + */ + public static ValidationTestFailureDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationTestFailureDetails deserializedValidationTestFailureDetails = new ValidationTestFailureDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errorCode".equals(fieldName)) { + deserializedValidationTestFailureDetails.errorCode = reader.getString(); + } else if ("errorMessage".equals(fieldName)) { + deserializedValidationTestFailureDetails.errorMessage = reader.getString(); + } else if ("details".equals(fieldName)) { + deserializedValidationTestFailureDetails.details = reader.getString(); + } else if ("diagnosticInfo".equals(fieldName)) { + deserializedValidationTestFailureDetails.diagnosticInfo = reader.getString(); + } else if ("recommendedActions".equals(fieldName)) { + List recommendedActions = reader.readArray(reader1 -> reader1.getString()); + deserializedValidationTestFailureDetails.recommendedActions = recommendedActions; + } else { + reader.skipChildren(); + } + } + + return deserializedValidationTestFailureDetails; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestInput.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestInput.java new file mode 100644 index 000000000000..70a8782ab72d --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestInput.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A named declared input parameter for a validation test contract. + */ +@Immutable +public final class ValidationTestInput implements JsonSerializable { + /* + * The input parameter name. + */ + private String name; + + /* + * The declared contract for this input parameter. + */ + private ValidationTestInputDefinition definition; + + /** + * Creates an instance of ValidationTestInput class. + */ + private ValidationTestInput() { + } + + /** + * Get the name property: The input parameter name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the definition property: The declared contract for this input parameter. + * + * @return the definition value. + */ + public ValidationTestInputDefinition definition() { + return this.definition; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("definition", this.definition); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationTestInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationTestInput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ValidationTestInput. + */ + public static ValidationTestInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationTestInput deserializedValidationTestInput = new ValidationTestInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedValidationTestInput.name = reader.getString(); + } else if ("definition".equals(fieldName)) { + deserializedValidationTestInput.definition = ValidationTestInputDefinition.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationTestInput; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestInputDataType.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestInputDataType.java new file mode 100644 index 000000000000..dedf9845a240 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestInputDataType.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Supported data types for a declared test input. + */ +public final class ValidationTestInputDataType extends ExpandableStringEnum { + /** + * String input value. + */ + public static final ValidationTestInputDataType STRING = fromString("String"); + + /** + * Integer input value. + */ + public static final ValidationTestInputDataType INTEGER = fromString("Integer"); + + /** + * Numeric input value. + */ + public static final ValidationTestInputDataType NUMBER = fromString("Number"); + + /** + * Boolean input value. + */ + public static final ValidationTestInputDataType BOOLEAN = fromString("Boolean"); + + /** + * Object input value. + */ + public static final ValidationTestInputDataType OBJECT = fromString("Object"); + + /** + * Array input value. + */ + public static final ValidationTestInputDataType ARRAY = fromString("Array"); + + /** + * Creates a new instance of ValidationTestInputDataType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ValidationTestInputDataType() { + } + + /** + * Creates or finds a ValidationTestInputDataType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ValidationTestInputDataType. + */ + public static ValidationTestInputDataType fromString(String name) { + return fromString(name, ValidationTestInputDataType.class); + } + + /** + * Gets known ValidationTestInputDataType values. + * + * @return known ValidationTestInputDataType values. + */ + public static Collection values() { + return values(ValidationTestInputDataType.class); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestInputDefinition.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestInputDefinition.java new file mode 100644 index 000000000000..87b83553c03f --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestInputDefinition.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Declared contract for a validation test input parameter. + */ +@Immutable +public final class ValidationTestInputDefinition implements JsonSerializable { + /* + * Description of the declared input parameter. + */ + private String description; + + /* + * The data type expected for this input parameter. + */ + private ValidationTestInputDataType type; + + /* + * Whether this input parameter is required. + */ + private Boolean required; + + /* + * Optional default value to use when input is not provided. + */ + private String defaultValue; + + /* + * Allowed values for this input parameter. + */ + private List allowedValues; + + /** + * Creates an instance of ValidationTestInputDefinition class. + */ + private ValidationTestInputDefinition() { + } + + /** + * Get the description property: Description of the declared input parameter. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the type property: The data type expected for this input parameter. + * + * @return the type value. + */ + public ValidationTestInputDataType type() { + return this.type; + } + + /** + * Get the required property: Whether this input parameter is required. + * + * @return the required value. + */ + public Boolean required() { + return this.required; + } + + /** + * Get the defaultValue property: Optional default value to use when input is not provided. + * + * @return the defaultValue value. + */ + public String defaultValue() { + return this.defaultValue; + } + + /** + * Get the allowedValues property: Allowed values for this input parameter. + * + * @return the allowedValues value. + */ + public List allowedValues() { + return this.allowedValues; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeBooleanField("required", this.required); + jsonWriter.writeStringField("defaultValue", this.defaultValue); + jsonWriter.writeArrayField("allowedValues", this.allowedValues, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationTestInputDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationTestInputDefinition if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidationTestInputDefinition. + */ + public static ValidationTestInputDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationTestInputDefinition deserializedValidationTestInputDefinition + = new ValidationTestInputDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedValidationTestInputDefinition.description = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedValidationTestInputDefinition.type + = ValidationTestInputDataType.fromString(reader.getString()); + } else if ("required".equals(fieldName)) { + deserializedValidationTestInputDefinition.required = reader.getNullable(JsonReader::getBoolean); + } else if ("defaultValue".equals(fieldName)) { + deserializedValidationTestInputDefinition.defaultValue = reader.getString(); + } else if ("allowedValues".equals(fieldName)) { + List allowedValues = reader.readArray(reader1 -> reader1.getString()); + deserializedValidationTestInputDefinition.allowedValues = allowedValues; + } else { + reader.skipChildren(); + } + } + + return deserializedValidationTestInputDefinition; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestOverallState.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestOverallState.java new file mode 100644 index 000000000000..05b5383ebb31 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestOverallState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The overall state of a validation test or test version. + */ +public final class ValidationTestOverallState extends ExpandableStringEnum { + /** + * The validation test definition is in draft state. + */ + public static final ValidationTestOverallState DRAFT = fromString("Draft"); + + /** + * The validation test definition is active. + */ + public static final ValidationTestOverallState ACTIVE = fromString("Active"); + + /** + * The validation test definition is published. + */ + public static final ValidationTestOverallState PUBLISHED = fromString("Published"); + + /** + * The validation test definition is disabled. + */ + public static final ValidationTestOverallState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ValidationTestOverallState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ValidationTestOverallState() { + } + + /** + * Creates or finds a ValidationTestOverallState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ValidationTestOverallState. + */ + public static ValidationTestOverallState fromString(String name) { + return fromString(name, ValidationTestOverallState.class); + } + + /** + * Gets known ValidationTestOverallState values. + * + * @return known ValidationTestOverallState values. + */ + public static Collection values() { + return values(ValidationTestOverallState.class); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestPassDetails.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestPassDetails.java new file mode 100644 index 000000000000..76d36eab72e4 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestPassDetails.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Detailed information about test pass. + */ +@Immutable +public final class ValidationTestPassDetails implements JsonSerializable { + /* + * Result code categorizing the type of pass. + */ + private String resultCode; + + /* + * test name which passed. + */ + private String testName; + + /* + * Detailed information about the passed test. + */ + private String resultDetails; + + /** + * Creates an instance of ValidationTestPassDetails class. + */ + private ValidationTestPassDetails() { + } + + /** + * Get the resultCode property: Result code categorizing the type of pass. + * + * @return the resultCode value. + */ + public String resultCode() { + return this.resultCode; + } + + /** + * Get the testName property: test name which passed. + * + * @return the testName value. + */ + public String testName() { + return this.testName; + } + + /** + * Get the resultDetails property: Detailed information about the passed test. + * + * @return the resultDetails value. + */ + public String resultDetails() { + return this.resultDetails; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationTestPassDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationTestPassDetails if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidationTestPassDetails. + */ + public static ValidationTestPassDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationTestPassDetails deserializedValidationTestPassDetails = new ValidationTestPassDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resultCode".equals(fieldName)) { + deserializedValidationTestPassDetails.resultCode = reader.getString(); + } else if ("testName".equals(fieldName)) { + deserializedValidationTestPassDetails.testName = reader.getString(); + } else if ("resultDetails".equals(fieldName)) { + deserializedValidationTestPassDetails.resultDetails = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationTestPassDetails; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestProperties.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestProperties.java new file mode 100644 index 000000000000..ea26cf4df8d8 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestProperties.java @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * Validation test catalog properties. + */ +@Immutable +public final class ValidationTestProperties implements JsonSerializable { + /* + * Validation test description. + */ + private String description; + + /* + * Audience visibility of this validation test. + */ + private CatalogAudience audience; + + /* + * Provisioning state of the validation test catalog resource. + */ + private ResourceProvisioningState provisioningState; + + /* + * The names of the validation test categories (ValidationTestCategory resource names, not ARM resource IDs) + * associated with this test. + */ + private List categoryIds; + + /* + * Overall state of the validation test. + */ + private ValidationTestOverallState overallState; + + /* + * Owners of the validation test definition, expressed as aliases. + * Only catalog publishers(limited to microsoft internal only) set this value through an internal publishing + * process; end users of the validation + * service consume catalog entries read-only through Get/List and cannot modify it. + */ + private List owners; + + /* + * Declared input contract for this validation test. + */ + private List inputs; + + /* + * URI of the location where the test artifact is stored. + */ + private String testStoreUri; + + /* + * The resource ID of the current immutable version snapshot. + */ + private String currentVersion; + + /* + * The resource ID of the latest published version snapshot. + */ + private String latestPublishedVersion; + + /* + * Timestamp of the last version publication. + */ + private OffsetDateTime lastPublishedAt; + + /** + * Creates an instance of ValidationTestProperties class. + */ + private ValidationTestProperties() { + } + + /** + * Get the description property: Validation test description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the audience property: Audience visibility of this validation test. + * + * @return the audience value. + */ + public CatalogAudience audience() { + return this.audience; + } + + /** + * Get the provisioningState property: Provisioning state of the validation test catalog resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the categoryIds property: The names of the validation test categories (ValidationTestCategory resource names, + * not ARM resource IDs) associated with this test. + * + * @return the categoryIds value. + */ + public List categoryIds() { + return this.categoryIds; + } + + /** + * Get the overallState property: Overall state of the validation test. + * + * @return the overallState value. + */ + public ValidationTestOverallState overallState() { + return this.overallState; + } + + /** + * Get the owners property: Owners of the validation test definition, expressed as aliases. + * Only catalog publishers(limited to microsoft internal only) set this value through an internal publishing + * process; end users of the validation + * service consume catalog entries read-only through Get/List and cannot modify it. + * + * @return the owners value. + */ + public List owners() { + return this.owners; + } + + /** + * Get the inputs property: Declared input contract for this validation test. + * + * @return the inputs value. + */ + public List inputs() { + return this.inputs; + } + + /** + * Get the testStoreUri property: URI of the location where the test artifact is stored. + * + * @return the testStoreUri value. + */ + public String testStoreUri() { + return this.testStoreUri; + } + + /** + * Get the currentVersion property: The resource ID of the current immutable version snapshot. + * + * @return the currentVersion value. + */ + public String currentVersion() { + return this.currentVersion; + } + + /** + * Get the latestPublishedVersion property: The resource ID of the latest published version snapshot. + * + * @return the latestPublishedVersion value. + */ + public String latestPublishedVersion() { + return this.latestPublishedVersion; + } + + /** + * Get the lastPublishedAt property: Timestamp of the last version publication. + * + * @return the lastPublishedAt value. + */ + public OffsetDateTime lastPublishedAt() { + return this.lastPublishedAt; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("audience", this.audience == null ? null : this.audience.toString()); + jsonWriter.writeArrayField("categoryIds", this.categoryIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("overallState", this.overallState == null ? null : this.overallState.toString()); + jsonWriter.writeArrayField("owners", this.owners, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("inputs", this.inputs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("testStoreUri", this.testStoreUri); + jsonWriter.writeStringField("currentVersion", this.currentVersion); + jsonWriter.writeStringField("latestPublishedVersion", this.latestPublishedVersion); + jsonWriter.writeStringField("lastPublishedAt", + this.lastPublishedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastPublishedAt)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationTestProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationTestProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidationTestProperties. + */ + public static ValidationTestProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationTestProperties deserializedValidationTestProperties = new ValidationTestProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedValidationTestProperties.description = reader.getString(); + } else if ("audience".equals(fieldName)) { + deserializedValidationTestProperties.audience = CatalogAudience.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedValidationTestProperties.provisioningState + = ResourceProvisioningState.fromString(reader.getString()); + } else if ("categoryIds".equals(fieldName)) { + List categoryIds = reader.readArray(reader1 -> reader1.getString()); + deserializedValidationTestProperties.categoryIds = categoryIds; + } else if ("overallState".equals(fieldName)) { + deserializedValidationTestProperties.overallState + = ValidationTestOverallState.fromString(reader.getString()); + } else if ("owners".equals(fieldName)) { + List owners = reader.readArray(reader1 -> reader1.getString()); + deserializedValidationTestProperties.owners = owners; + } else if ("inputs".equals(fieldName)) { + List inputs + = reader.readArray(reader1 -> ValidationTestInput.fromJson(reader1)); + deserializedValidationTestProperties.inputs = inputs; + } else if ("testStoreUri".equals(fieldName)) { + deserializedValidationTestProperties.testStoreUri = reader.getString(); + } else if ("currentVersion".equals(fieldName)) { + deserializedValidationTestProperties.currentVersion = reader.getString(); + } else if ("latestPublishedVersion".equals(fieldName)) { + deserializedValidationTestProperties.latestPublishedVersion = reader.getString(); + } else if ("lastPublishedAt".equals(fieldName)) { + deserializedValidationTestProperties.lastPublishedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationTestProperties; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRun.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRun.java new file mode 100644 index 000000000000..b1d4bc7f6905 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRun.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestRunInner; + +/** + * An immutable client-side representation of ValidationTestRun. + */ +public interface ValidationTestRun { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ValidationTestRunProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestRunInner object. + * + * @return the inner object. + */ + ValidationTestRunInner innerModel(); + + /** + * The entirety of the ValidationTestRun definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The ValidationTestRun definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the ValidationTestRun definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the ValidationTestRun definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, cloudValidationName, validationExecutionPlanName, executionPlanRunName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @return the next definition stage. + */ + WithCreate withExistingExecutionPlanRun(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName); + } + + /** + * The stage of the ValidationTestRun 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ValidationTestRun create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ValidationTestRun create(Context context); + } + + /** + * The stage of the ValidationTestRun definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(ValidationTestRunProperties properties); + } + } + + /** + * Begins update for the ValidationTestRun resource. + * + * @return the stage of resource update. + */ + ValidationTestRun.Update update(); + + /** + * The template for ValidationTestRun update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ValidationTestRun apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ValidationTestRun apply(Context context); + } + + /** + * The ValidationTestRun update stages. + */ + interface UpdateStages { + /** + * The stage of the ValidationTestRun update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(ValidationTestRunProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ValidationTestRun refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ValidationTestRun refresh(Context context); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRunProperties.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRunProperties.java new file mode 100644 index 000000000000..0fd6ab0cff6f --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRunProperties.java @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.List; + +/** + * Validation Test Run properties. + */ +@Fluent +public final class ValidationTestRunProperties implements JsonSerializable { + /* + * The overall status of the test run. + */ + private ValidationTestRunStatus status; + + /* + * Error details. Populated when status is Error. + */ + private ManagementError error; + + /* + * The state of the test run. + */ + private ValidationTestRunProvisioningState provisioningState; + + /* + * The start time of the test run. + */ + private OffsetDateTime startedAt; + + /* + * The completion time of the test run. + */ + private OffsetDateTime completedAt; + + /* + * The time at which the test run result was reported. + */ + private OffsetDateTime reportedAt; + + /* + * The name of the validation test (ValidationTest resource name, not an ARM resource ID) in the validation test + * catalog. + */ + private String testId; + + /* + * The names of the validation test categories (ValidationTestCategory resource names, not ARM resource IDs) + * associated with this test run. + */ + private List testCategoryIds; + + /* + * Validation test run inputs json, conforming to the input contract declared by `ValidationTestInput` on the + * corresponding validation test. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + */ + private String inputsJson; + + /* + * Detailed pass information when the test passes. + */ + private List passDetails; + + /* + * Detailed failure information when the test fails. + */ + private List failureDetails; + + /** + * Creates an instance of ValidationTestRunProperties class. + */ + public ValidationTestRunProperties() { + } + + /** + * Get the status property: The overall status of the test run. + * + * @return the status value. + */ + public ValidationTestRunStatus status() { + return this.status; + } + + /** + * Get the error property: Error details. Populated when status is Error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Get the provisioningState property: The state of the test run. + * + * @return the provisioningState value. + */ + public ValidationTestRunProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the startedAt property: The start time of the test run. + * + * @return the startedAt value. + */ + public OffsetDateTime startedAt() { + return this.startedAt; + } + + /** + * Get the completedAt property: The completion time of the test run. + * + * @return the completedAt value. + */ + public OffsetDateTime completedAt() { + return this.completedAt; + } + + /** + * Get the reportedAt property: The time at which the test run result was reported. + * + * @return the reportedAt value. + */ + public OffsetDateTime reportedAt() { + return this.reportedAt; + } + + /** + * Get the testId property: The name of the validation test (ValidationTest resource name, not an ARM resource ID) + * in the validation test catalog. + * + * @return the testId value. + */ + public String testId() { + return this.testId; + } + + /** + * Set the testId property: The name of the validation test (ValidationTest resource name, not an ARM resource ID) + * in the validation test catalog. + * + * @param testId the testId value to set. + * @return the ValidationTestRunProperties object itself. + */ + public ValidationTestRunProperties withTestId(String testId) { + this.testId = testId; + return this; + } + + /** + * Get the testCategoryIds property: The names of the validation test categories (ValidationTestCategory resource + * names, not ARM resource IDs) associated with this test run. + * + * @return the testCategoryIds value. + */ + public List testCategoryIds() { + return this.testCategoryIds; + } + + /** + * Set the testCategoryIds property: The names of the validation test categories (ValidationTestCategory resource + * names, not ARM resource IDs) associated with this test run. + * + * @param testCategoryIds the testCategoryIds value to set. + * @return the ValidationTestRunProperties object itself. + */ + public ValidationTestRunProperties withTestCategoryIds(List testCategoryIds) { + this.testCategoryIds = testCategoryIds; + return this; + } + + /** + * Get the inputsJson property: Validation test run inputs json, conforming to the input contract declared by + * `ValidationTestInput` on the corresponding validation test. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + * + * @return the inputsJson value. + */ + public String inputsJson() { + return this.inputsJson; + } + + /** + * Set the inputsJson property: Validation test run inputs json, conforming to the input contract declared by + * `ValidationTestInput` on the corresponding validation test. + * This value is returned as-is in get responses, so it must not contain credentials or other secrets. + * + * @param inputsJson the inputsJson value to set. + * @return the ValidationTestRunProperties object itself. + */ + public ValidationTestRunProperties withInputsJson(String inputsJson) { + this.inputsJson = inputsJson; + return this; + } + + /** + * Get the passDetails property: Detailed pass information when the test passes. + * + * @return the passDetails value. + */ + public List passDetails() { + return this.passDetails; + } + + /** + * Get the failureDetails property: Detailed failure information when the test fails. + * + * @return the failureDetails value. + */ + public List failureDetails() { + return this.failureDetails; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("testId", this.testId); + jsonWriter.writeArrayField("testCategoryIds", this.testCategoryIds, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("inputsJson", this.inputsJson); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationTestRunProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationTestRunProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidationTestRunProperties. + */ + public static ValidationTestRunProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationTestRunProperties deserializedValidationTestRunProperties = new ValidationTestRunProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedValidationTestRunProperties.status + = ValidationTestRunStatus.fromString(reader.getString()); + } else if ("error".equals(fieldName)) { + deserializedValidationTestRunProperties.error = ManagementError.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedValidationTestRunProperties.provisioningState + = ValidationTestRunProvisioningState.fromString(reader.getString()); + } else if ("startedAt".equals(fieldName)) { + deserializedValidationTestRunProperties.startedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("completedAt".equals(fieldName)) { + deserializedValidationTestRunProperties.completedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("reportedAt".equals(fieldName)) { + deserializedValidationTestRunProperties.reportedAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("testId".equals(fieldName)) { + deserializedValidationTestRunProperties.testId = reader.getString(); + } else if ("testCategoryIds".equals(fieldName)) { + List testCategoryIds = reader.readArray(reader1 -> reader1.getString()); + deserializedValidationTestRunProperties.testCategoryIds = testCategoryIds; + } else if ("inputsJson".equals(fieldName)) { + deserializedValidationTestRunProperties.inputsJson = reader.getString(); + } else if ("passDetails".equals(fieldName)) { + List passDetails + = reader.readArray(reader1 -> ValidationTestPassDetails.fromJson(reader1)); + deserializedValidationTestRunProperties.passDetails = passDetails; + } else if ("failureDetails".equals(fieldName)) { + List failureDetails + = reader.readArray(reader1 -> ValidationTestFailureDetails.fromJson(reader1)); + deserializedValidationTestRunProperties.failureDetails = failureDetails; + } else { + reader.skipChildren(); + } + } + + return deserializedValidationTestRunProperties; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRunProvisioningState.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRunProvisioningState.java new file mode 100644 index 000000000000..4679546ded40 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRunProvisioningState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of the validation test run. + */ +public final class ValidationTestRunProvisioningState extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final ValidationTestRunProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final ValidationTestRunProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final ValidationTestRunProvisioningState CANCELED = fromString("Canceled"); + + /** + * The validation test run is in progress. + */ + public static final ValidationTestRunProvisioningState RUNNING = fromString("Running"); + + /** + * Creates a new instance of ValidationTestRunProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ValidationTestRunProvisioningState() { + } + + /** + * Creates or finds a ValidationTestRunProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ValidationTestRunProvisioningState. + */ + public static ValidationTestRunProvisioningState fromString(String name) { + return fromString(name, ValidationTestRunProvisioningState.class); + } + + /** + * Gets known ValidationTestRunProvisioningState values. + * + * @return known ValidationTestRunProvisioningState values. + */ + public static Collection values() { + return values(ValidationTestRunProvisioningState.class); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRunStatus.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRunStatus.java new file mode 100644 index 000000000000..7a31f2e0e759 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRunStatus.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The overall status of the test run. + */ +public final class ValidationTestRunStatus extends ExpandableStringEnum { + /** + * The test run is not running. + */ + public static final ValidationTestRunStatus NOT_RUNNING = fromString("NotRunning"); + + /** + * The test run is scheduled. + */ + public static final ValidationTestRunStatus SCHEDULED = fromString("Scheduled"); + + /** + * The test run is ready. + */ + public static final ValidationTestRunStatus READY = fromString("Ready"); + + /** + * The test run is running. + */ + public static final ValidationTestRunStatus RUNNING = fromString("Running"); + + /** + * The test run is completed. + */ + public static final ValidationTestRunStatus COMPLETED = fromString("Completed"); + + /** + * The test run is stopped. + */ + public static final ValidationTestRunStatus STOPPED = fromString("Stopped"); + + /** + * The test run is errored out. + */ + public static final ValidationTestRunStatus ERROR = fromString("Error"); + + /** + * Creates a new instance of ValidationTestRunStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ValidationTestRunStatus() { + } + + /** + * Creates or finds a ValidationTestRunStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ValidationTestRunStatus. + */ + public static ValidationTestRunStatus fromString(String name) { + return fromString(name, ValidationTestRunStatus.class); + } + + /** + * Gets known ValidationTestRunStatus values. + * + * @return known ValidationTestRunStatus values. + */ + public static Collection values() { + return values(ValidationTestRunStatus.class); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRuns.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRuns.java new file mode 100644 index 000000000000..1e2bd34c84fa --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRuns.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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 ValidationTestRuns. + */ +public interface ValidationTestRuns { + /** + * Get a validation test run details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @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 validation test run details along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, String validationTestRunName, Context context); + + /** + * Get a validation test run details. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @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 validation test run details. + */ + ValidationTestRun get(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, String validationTestRunName); + + /** + * Delete a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @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 cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, String validationTestRunName); + + /** + * Delete a validation test run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param validationTestRunName The name of the ValidationTestRun. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String cloudValidationName, String validationExecutionPlanName, + String executionPlanRunName, String validationTestRunName, Context context); + + /** + * List validation test runs for an execution plan run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestRun list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByExecutionPlanRun(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName); + + /** + * List validation test runs for an execution plan run. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param cloudValidationName The name of the CloudValidation. + * @param validationExecutionPlanName The name of the ValidationExecutionPlan. + * @param executionPlanRunName The name of the ExecutionPlanRun. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestRun list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByExecutionPlanRun(String resourceGroupName, String cloudValidationName, + String validationExecutionPlanName, String executionPlanRunName, Context context); + + /** + * Get a validation test run details. + * + * @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 validation test run details along with {@link Response}. + */ + ValidationTestRun getById(String id); + + /** + * Get a validation test run details. + * + * @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 validation test run details along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a validation test run. + * + * @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 validation test run. + * + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new ValidationTestRun resource. + * + * @param name resource name. + * @return the first stage of the new ValidationTestRun definition. + */ + ValidationTestRun.DefinitionStages.Blank define(String name); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestVersion.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestVersion.java new file mode 100644 index 000000000000..f83dc8500749 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestVersion.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestVersionInner; + +/** + * An immutable client-side representation of ValidationTestVersion. + */ +public interface ValidationTestVersion { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + ValidationTestVersionProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestVersionInner object. + * + * @return the inner object. + */ + ValidationTestVersionInner innerModel(); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestVersionProperties.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestVersionProperties.java new file mode 100644 index 000000000000..0d1652b90fb5 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestVersionProperties.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Validation test version catalog properties. + */ +@Immutable +public final class ValidationTestVersionProperties implements JsonSerializable { + /* + * Validation test description. + */ + private String description; + + /* + * Audience visibility of this validation test version. + */ + private CatalogAudience audience; + + /* + * Provisioning state of the validation test version catalog resource. + */ + private ResourceProvisioningState provisioningState; + + /* + * The names of the validation test categories (ValidationTestCategory resource names, not ARM resource IDs) + * associated with this test version. + */ + private List categoryIds; + + /* + * Overall state of the validation test. + */ + private ValidationTestOverallState overallState; + + /* + * Owners of the validation test version definition, expressed as email aliases or Microsoft Entra object IDs. + * Only catalog publishers set this value through an internal publishing process; end users of the validation + * service consume catalog entries read-only through Get/List and cannot modify it. + */ + private List owners; + + /* + * Declared input contract for this validation test version. + */ + private List inputs; + + /* + * SHA-256 hash of the version content used for integrity and deduplication. + */ + private String contentHash; + + /* + * URI of the location where the test artifact is stored. + */ + private String testStoreUri; + + /** + * Creates an instance of ValidationTestVersionProperties class. + */ + private ValidationTestVersionProperties() { + } + + /** + * Get the description property: Validation test description. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the audience property: Audience visibility of this validation test version. + * + * @return the audience value. + */ + public CatalogAudience audience() { + return this.audience; + } + + /** + * Get the provisioningState property: Provisioning state of the validation test version catalog resource. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the categoryIds property: The names of the validation test categories (ValidationTestCategory resource names, + * not ARM resource IDs) associated with this test version. + * + * @return the categoryIds value. + */ + public List categoryIds() { + return this.categoryIds; + } + + /** + * Get the overallState property: Overall state of the validation test. + * + * @return the overallState value. + */ + public ValidationTestOverallState overallState() { + return this.overallState; + } + + /** + * Get the owners property: Owners of the validation test version definition, expressed as email aliases or + * Microsoft Entra object IDs. + * Only catalog publishers set this value through an internal publishing process; end users of the validation + * service consume catalog entries read-only through Get/List and cannot modify it. + * + * @return the owners value. + */ + public List owners() { + return this.owners; + } + + /** + * Get the inputs property: Declared input contract for this validation test version. + * + * @return the inputs value. + */ + public List inputs() { + return this.inputs; + } + + /** + * Get the contentHash property: SHA-256 hash of the version content used for integrity and deduplication. + * + * @return the contentHash value. + */ + public String contentHash() { + return this.contentHash; + } + + /** + * Get the testStoreUri property: URI of the location where the test artifact is stored. + * + * @return the testStoreUri value. + */ + public String testStoreUri() { + return this.testStoreUri; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("audience", this.audience == null ? null : this.audience.toString()); + jsonWriter.writeArrayField("categoryIds", this.categoryIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("overallState", this.overallState == null ? null : this.overallState.toString()); + jsonWriter.writeArrayField("owners", this.owners, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("inputs", this.inputs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("contentHash", this.contentHash); + jsonWriter.writeStringField("testStoreUri", this.testStoreUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ValidationTestVersionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ValidationTestVersionProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ValidationTestVersionProperties. + */ + public static ValidationTestVersionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ValidationTestVersionProperties deserializedValidationTestVersionProperties + = new ValidationTestVersionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("description".equals(fieldName)) { + deserializedValidationTestVersionProperties.description = reader.getString(); + } else if ("audience".equals(fieldName)) { + deserializedValidationTestVersionProperties.audience + = CatalogAudience.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedValidationTestVersionProperties.provisioningState + = ResourceProvisioningState.fromString(reader.getString()); + } else if ("categoryIds".equals(fieldName)) { + List categoryIds = reader.readArray(reader1 -> reader1.getString()); + deserializedValidationTestVersionProperties.categoryIds = categoryIds; + } else if ("overallState".equals(fieldName)) { + deserializedValidationTestVersionProperties.overallState + = ValidationTestOverallState.fromString(reader.getString()); + } else if ("owners".equals(fieldName)) { + List owners = reader.readArray(reader1 -> reader1.getString()); + deserializedValidationTestVersionProperties.owners = owners; + } else if ("inputs".equals(fieldName)) { + List inputs + = reader.readArray(reader1 -> ValidationTestInput.fromJson(reader1)); + deserializedValidationTestVersionProperties.inputs = inputs; + } else if ("contentHash".equals(fieldName)) { + deserializedValidationTestVersionProperties.contentHash = reader.getString(); + } else if ("testStoreUri".equals(fieldName)) { + deserializedValidationTestVersionProperties.testStoreUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedValidationTestVersionProperties; + }); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestVersions.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestVersions.java new file mode 100644 index 000000000000..aa92f52c8ee2 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestVersions.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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 ValidationTestVersions. + */ +public interface ValidationTestVersions { + /** + * Get a validation test version catalog entry. + * + * @param validationTestName The name of the ValidationTest. + * @param version The name of the ValidationTestVersion. + * @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 validation test version catalog entry along with {@link Response}. + */ + Response getWithResponse(String validationTestName, String version, Context context); + + /** + * Get a validation test version catalog entry. + * + * @param validationTestName The name of the ValidationTest. + * @param version The name of the ValidationTestVersion. + * @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 validation test version catalog entry. + */ + ValidationTestVersion get(String validationTestName, String version); + + /** + * List validation test version catalog entries. + * + * @param validationTestName The name of the ValidationTest. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestVersion list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String validationTestName); + + /** + * List validation test version catalog entries. + * + * @param validationTestName The name of the ValidationTest. + * @param filter Filter expression used to constrain the returned items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTestVersion list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String validationTestName, String filter, Context context); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTests.java new file mode 100644 index 000000000000..19ee8f361467 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTests.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.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 ValidationTests. + */ +public interface ValidationTests { + /** + * Get a validation test catalog entry. + * + * @param validationTestName The name of the ValidationTest. + * @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 validation test catalog entry along with {@link Response}. + */ + Response getWithResponse(String validationTestName, Context context); + + /** + * Get a validation test catalog entry. + * + * @param validationTestName The name of the ValidationTest. + * @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 validation test catalog entry. + */ + ValidationTest get(String validationTestName); + + /** + * List validation test catalog entries for 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 the response of a ValidationTest list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List validation test catalog entries for a subscription. + * + * @param filter Filter expression used to constrain the returned items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a ValidationTest list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String filter, Context context); +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/package-info.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/package-info.java new file mode 100644 index 000000000000..8034a8047432 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for PlatformValidation. + * Microsoft.PlatformValidation Resource Provider management API. + */ +package com.azure.resourcemanager.platformvalidation.models; diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/package-info.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/package-info.java new file mode 100644 index 000000000000..0cd45d18973f --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/com/azure/resourcemanager/platformvalidation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the classes for PlatformValidation. + * Microsoft.PlatformValidation Resource Provider management API. + */ +package com.azure.resourcemanager.platformvalidation; diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/module-info.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/module-info.java new file mode 100644 index 000000000000..4a7335242cd7 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/java/module-info.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.resourcemanager.platformvalidation { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.platformvalidation; + exports com.azure.resourcemanager.platformvalidation.fluent; + exports com.azure.resourcemanager.platformvalidation.fluent.models; + exports com.azure.resourcemanager.platformvalidation.models; + + opens com.azure.resourcemanager.platformvalidation.fluent.models to com.azure.core; + opens com.azure.resourcemanager.platformvalidation.models to com.azure.core; + opens com.azure.resourcemanager.platformvalidation.implementation.models to com.azure.core; +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/resources/META-INF/azure-resourcemanager-platformvalidation_metadata.json b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/resources/META-INF/azure-resourcemanager-platformvalidation_metadata.json new file mode 100644 index 000000000000..5b96480cbf99 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/resources/META-INF/azure-resourcemanager-platformvalidation_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.PlatformValidation":"2026-07-01-preview"},"crossLanguagePackageId":"Microsoft.PlatformValidation","crossLanguageVersion":"74a2ff1f2099","crossLanguageDefinitions":{"com.azure.resourcemanager.platformvalidation.fluent.CloudValidationsClient":"Microsoft.PlatformValidation.CloudValidations","com.azure.resourcemanager.platformvalidation.fluent.CloudValidationsClient.beginCreateOrUpdate":"Microsoft.PlatformValidation.CloudValidations.createOrUpdate","com.azure.resourcemanager.platformvalidation.fluent.CloudValidationsClient.beginDelete":"Microsoft.PlatformValidation.CloudValidations.delete","com.azure.resourcemanager.platformvalidation.fluent.CloudValidationsClient.beginUpdate":"Microsoft.PlatformValidation.CloudValidations.update","com.azure.resourcemanager.platformvalidation.fluent.CloudValidationsClient.createOrUpdate":"Microsoft.PlatformValidation.CloudValidations.createOrUpdate","com.azure.resourcemanager.platformvalidation.fluent.CloudValidationsClient.delete":"Microsoft.PlatformValidation.CloudValidations.delete","com.azure.resourcemanager.platformvalidation.fluent.CloudValidationsClient.getByResourceGroup":"Microsoft.PlatformValidation.CloudValidations.get","com.azure.resourcemanager.platformvalidation.fluent.CloudValidationsClient.getByResourceGroupWithResponse":"Microsoft.PlatformValidation.CloudValidations.get","com.azure.resourcemanager.platformvalidation.fluent.CloudValidationsClient.list":"Microsoft.PlatformValidation.CloudValidations.listBySubscription","com.azure.resourcemanager.platformvalidation.fluent.CloudValidationsClient.listByResourceGroup":"Microsoft.PlatformValidation.CloudValidations.listByResourceGroup","com.azure.resourcemanager.platformvalidation.fluent.CloudValidationsClient.update":"Microsoft.PlatformValidation.CloudValidations.update","com.azure.resourcemanager.platformvalidation.fluent.ExecutionPlanRunsClient":"Microsoft.PlatformValidation.ExecutionPlanRuns","com.azure.resourcemanager.platformvalidation.fluent.ExecutionPlanRunsClient.beginCreateOrUpdate":"Microsoft.PlatformValidation.ExecutionPlanRuns.createOrUpdate","com.azure.resourcemanager.platformvalidation.fluent.ExecutionPlanRunsClient.beginDelete":"Microsoft.PlatformValidation.ExecutionPlanRuns.delete","com.azure.resourcemanager.platformvalidation.fluent.ExecutionPlanRunsClient.createOrUpdate":"Microsoft.PlatformValidation.ExecutionPlanRuns.createOrUpdate","com.azure.resourcemanager.platformvalidation.fluent.ExecutionPlanRunsClient.delete":"Microsoft.PlatformValidation.ExecutionPlanRuns.delete","com.azure.resourcemanager.platformvalidation.fluent.ExecutionPlanRunsClient.get":"Microsoft.PlatformValidation.ExecutionPlanRuns.get","com.azure.resourcemanager.platformvalidation.fluent.ExecutionPlanRunsClient.getWithResponse":"Microsoft.PlatformValidation.ExecutionPlanRuns.get","com.azure.resourcemanager.platformvalidation.fluent.ExecutionPlanRunsClient.listByExecutionPlan":"Microsoft.PlatformValidation.ExecutionPlanRuns.listByExecutionPlan","com.azure.resourcemanager.platformvalidation.fluent.OperationStatusClient":"Microsoft.PlatformValidation.OperationStatus","com.azure.resourcemanager.platformvalidation.fluent.OperationStatusClient.get":"Microsoft.PlatformValidation.OperationStatus.get","com.azure.resourcemanager.platformvalidation.fluent.OperationStatusClient.getWithResponse":"Microsoft.PlatformValidation.OperationStatus.get","com.azure.resourcemanager.platformvalidation.fluent.OperationsClient":"Microsoft.PlatformValidation.Operations","com.azure.resourcemanager.platformvalidation.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.platformvalidation.fluent.PlatformValidationManagementClient":"Microsoft.PlatformValidation","com.azure.resourcemanager.platformvalidation.fluent.ValidationExecutionPlansClient":"Microsoft.PlatformValidation.ValidationExecutionPlans","com.azure.resourcemanager.platformvalidation.fluent.ValidationExecutionPlansClient.beginCreateOrUpdate":"Microsoft.PlatformValidation.ValidationExecutionPlans.createOrUpdate","com.azure.resourcemanager.platformvalidation.fluent.ValidationExecutionPlansClient.beginDelete":"Microsoft.PlatformValidation.ValidationExecutionPlans.delete","com.azure.resourcemanager.platformvalidation.fluent.ValidationExecutionPlansClient.beginUpdate":"Microsoft.PlatformValidation.ValidationExecutionPlans.update","com.azure.resourcemanager.platformvalidation.fluent.ValidationExecutionPlansClient.createOrUpdate":"Microsoft.PlatformValidation.ValidationExecutionPlans.createOrUpdate","com.azure.resourcemanager.platformvalidation.fluent.ValidationExecutionPlansClient.delete":"Microsoft.PlatformValidation.ValidationExecutionPlans.delete","com.azure.resourcemanager.platformvalidation.fluent.ValidationExecutionPlansClient.get":"Microsoft.PlatformValidation.ValidationExecutionPlans.get","com.azure.resourcemanager.platformvalidation.fluent.ValidationExecutionPlansClient.getWithResponse":"Microsoft.PlatformValidation.ValidationExecutionPlans.get","com.azure.resourcemanager.platformvalidation.fluent.ValidationExecutionPlansClient.listByResourceGroup":"Microsoft.PlatformValidation.ValidationExecutionPlans.listByResourceGroup","com.azure.resourcemanager.platformvalidation.fluent.ValidationExecutionPlansClient.update":"Microsoft.PlatformValidation.ValidationExecutionPlans.update","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestCategoriesClient":"Microsoft.PlatformValidation.ValidationTestCategories","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestCategoriesClient.get":"Microsoft.PlatformValidation.ValidationTestCategories.get","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestCategoriesClient.getWithResponse":"Microsoft.PlatformValidation.ValidationTestCategories.get","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestCategoriesClient.list":"Microsoft.PlatformValidation.ValidationTestCategories.listBySubscription","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestRunsClient":"Microsoft.PlatformValidation.ValidationTestRuns","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestRunsClient.beginCreateOrUpdate":"Microsoft.PlatformValidation.ValidationTestRuns.createOrUpdate","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestRunsClient.beginDelete":"Microsoft.PlatformValidation.ValidationTestRuns.delete","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestRunsClient.createOrUpdate":"Microsoft.PlatformValidation.ValidationTestRuns.createOrUpdate","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestRunsClient.delete":"Microsoft.PlatformValidation.ValidationTestRuns.delete","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestRunsClient.get":"Microsoft.PlatformValidation.ValidationTestRuns.get","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestRunsClient.getWithResponse":"Microsoft.PlatformValidation.ValidationTestRuns.get","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestRunsClient.listByExecutionPlanRun":"Microsoft.PlatformValidation.ValidationTestRuns.listByExecutionPlanRun","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestVersionsClient":"Microsoft.PlatformValidation.ValidationTestVersions","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestVersionsClient.get":"Microsoft.PlatformValidation.ValidationTestVersions.get","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestVersionsClient.getWithResponse":"Microsoft.PlatformValidation.ValidationTestVersions.get","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestVersionsClient.list":"Microsoft.PlatformValidation.ValidationTestVersions.list","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestsClient":"Microsoft.PlatformValidation.ValidationTests","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestsClient.get":"Microsoft.PlatformValidation.ValidationTests.get","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestsClient.getWithResponse":"Microsoft.PlatformValidation.ValidationTests.get","com.azure.resourcemanager.platformvalidation.fluent.ValidationTestsClient.list":"Microsoft.PlatformValidation.ValidationTests.listBySubscription","com.azure.resourcemanager.platformvalidation.fluent.models.CloudValidationInner":"Microsoft.PlatformValidation.CloudValidation","com.azure.resourcemanager.platformvalidation.fluent.models.ExecutionPlanRunInner":"Microsoft.PlatformValidation.ExecutionPlanRun","com.azure.resourcemanager.platformvalidation.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.platformvalidation.fluent.models.OperationStatusResultInner":"Azure.ResourceManager.CommonTypes.OperationStatusResult","com.azure.resourcemanager.platformvalidation.fluent.models.ValidationExecutionPlanInner":"Microsoft.PlatformValidation.ValidationExecutionPlan","com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestCategoryInner":"Microsoft.PlatformValidation.ValidationTestCategory","com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestInner":"Microsoft.PlatformValidation.ValidationTest","com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestRunInner":"Microsoft.PlatformValidation.ValidationTestRun","com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestVersionInner":"Microsoft.PlatformValidation.ValidationTestVersion","com.azure.resourcemanager.platformvalidation.implementation.PlatformValidationManagementClientBuilder":"Microsoft.PlatformValidation","com.azure.resourcemanager.platformvalidation.implementation.models.CloudValidationListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.platformvalidation.implementation.models.ExecutionPlanRunListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.platformvalidation.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.platformvalidation.implementation.models.ValidationExecutionPlanListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.platformvalidation.implementation.models.ValidationTestCategoryListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.platformvalidation.implementation.models.ValidationTestListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.platformvalidation.implementation.models.ValidationTestRunListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.platformvalidation.implementation.models.ValidationTestVersionListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.platformvalidation.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.platformvalidation.models.CatalogAudience":"Microsoft.PlatformValidation.CatalogAudience","com.azure.resourcemanager.platformvalidation.models.CloudValidationOverallState":"Microsoft.PlatformValidation.CloudValidationOverallState","com.azure.resourcemanager.platformvalidation.models.CloudValidationProperties":"Microsoft.PlatformValidation.CloudValidationProperties","com.azure.resourcemanager.platformvalidation.models.CloudValidationUpdate":"Azure.ResourceManager.Foundations.ResourceUpdateModel","com.azure.resourcemanager.platformvalidation.models.CloudValidationUpdateProperties":"Azure.ResourceManager.Foundations.ResourceUpdateModelProperties","com.azure.resourcemanager.platformvalidation.models.ExecutionPlanRunProperties":"Microsoft.PlatformValidation.ExecutionPlanRunProperties","com.azure.resourcemanager.platformvalidation.models.ExecutionPlanRunProvisioningState":"Microsoft.PlatformValidation.ExecutionPlanRunProvisioningState","com.azure.resourcemanager.platformvalidation.models.ExecutionPlanRunStatus":"Microsoft.PlatformValidation.ExecutionPlanRunStatus","com.azure.resourcemanager.platformvalidation.models.ManagedOnBehalfOfConfiguration":"Azure.ResourceManager.CommonTypes.ManagedOnBehalfOfConfiguration","com.azure.resourcemanager.platformvalidation.models.MoboBrokerResource":"Azure.ResourceManager.CommonTypes.MoboBrokerResource","com.azure.resourcemanager.platformvalidation.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.platformvalidation.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.platformvalidation.models.ProvisioningState":"Microsoft.PlatformValidation.ProvisioningState","com.azure.resourcemanager.platformvalidation.models.ResourceProvisioningState":"Azure.ResourceManager.ResourceProvisioningState","com.azure.resourcemanager.platformvalidation.models.TestRunOverallResult":"Microsoft.PlatformValidation.TestRunOverallResult","com.azure.resourcemanager.platformvalidation.models.TestRunSummary":"Microsoft.PlatformValidation.TestRunSummary","com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanOverallState":"Microsoft.PlatformValidation.ValidationExecutionPlanOverallState","com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanProperties":"Microsoft.PlatformValidation.ValidationExecutionPlanProperties","com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanProvisioningState":"Microsoft.PlatformValidation.ValidationExecutionPlanProvisioningState","com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanUpdate":"Azure.ResourceManager.Foundations.ResourceUpdateModel","com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanUpdateProperties":"Azure.ResourceManager.Foundations.ResourceUpdateModelProperties","com.azure.resourcemanager.platformvalidation.models.ValidationTestCategoryProperties":"Microsoft.PlatformValidation.ValidationTestCategoryProperties","com.azure.resourcemanager.platformvalidation.models.ValidationTestFailureDetails":"Microsoft.PlatformValidation.ValidationTestFailureDetails","com.azure.resourcemanager.platformvalidation.models.ValidationTestInput":"Microsoft.PlatformValidation.ValidationTestInput","com.azure.resourcemanager.platformvalidation.models.ValidationTestInputDataType":"Microsoft.PlatformValidation.ValidationTestInputDataType","com.azure.resourcemanager.platformvalidation.models.ValidationTestInputDefinition":"Microsoft.PlatformValidation.ValidationTestInputDefinition","com.azure.resourcemanager.platformvalidation.models.ValidationTestOverallState":"Microsoft.PlatformValidation.ValidationTestOverallState","com.azure.resourcemanager.platformvalidation.models.ValidationTestPassDetails":"Microsoft.PlatformValidation.ValidationTestPassDetails","com.azure.resourcemanager.platformvalidation.models.ValidationTestProperties":"Microsoft.PlatformValidation.ValidationTestProperties","com.azure.resourcemanager.platformvalidation.models.ValidationTestRunProperties":"Microsoft.PlatformValidation.ValidationTestRunProperties","com.azure.resourcemanager.platformvalidation.models.ValidationTestRunProvisioningState":"Microsoft.PlatformValidation.ValidationTestRunProvisioningState","com.azure.resourcemanager.platformvalidation.models.ValidationTestRunStatus":"Microsoft.PlatformValidation.ValidationTestRunStatus","com.azure.resourcemanager.platformvalidation.models.ValidationTestVersionProperties":"Microsoft.PlatformValidation.ValidationTestVersionProperties"},"generatedFiles":["src/main/java/com/azure/resourcemanager/platformvalidation/PlatformValidationManager.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/CloudValidationsClient.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ExecutionPlanRunsClient.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/OperationStatusClient.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/PlatformValidationManagementClient.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationExecutionPlansClient.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationTestCategoriesClient.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationTestRunsClient.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationTestVersionsClient.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/ValidationTestsClient.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/CloudValidationInner.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ExecutionPlanRunInner.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/OperationStatusResultInner.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationExecutionPlanInner.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationTestCategoryInner.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationTestInner.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationTestRunInner.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/ValidationTestVersionInner.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/platformvalidation/fluent/package-info.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/CloudValidationImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/CloudValidationsClientImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/CloudValidationsImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ExecutionPlanRunImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ExecutionPlanRunsClientImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ExecutionPlanRunsImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationStatusClientImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationStatusImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationStatusResultImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/PlatformValidationManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/PlatformValidationManagementClientImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationExecutionPlanImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationExecutionPlansClientImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationExecutionPlansImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestCategoriesClientImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestCategoriesImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestCategoryImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestRunImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestRunsClientImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestRunsImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestVersionImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestVersionsClientImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestVersionsImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestsClientImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/ValidationTestsImpl.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/CloudValidationListResult.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ExecutionPlanRunListResult.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationExecutionPlanListResult.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationTestCategoryListResult.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationTestListResult.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationTestRunListResult.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/models/ValidationTestVersionListResult.java","src/main/java/com/azure/resourcemanager/platformvalidation/implementation/package-info.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ActionType.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/CatalogAudience.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidation.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidationOverallState.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidationProperties.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidationUpdate.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidationUpdateProperties.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/CloudValidations.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRun.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRunProperties.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRunProvisioningState.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRunStatus.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ExecutionPlanRuns.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ManagedOnBehalfOfConfiguration.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/MoboBrokerResource.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/Operation.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/OperationStatus.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/OperationStatusResult.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/Operations.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/Origin.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ResourceProvisioningState.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/TestRunOverallResult.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/TestRunSummary.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlan.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanOverallState.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanProperties.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanProvisioningState.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanUpdate.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlanUpdateProperties.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationExecutionPlans.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTest.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestCategories.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestCategory.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestCategoryProperties.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestFailureDetails.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestInput.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestInputDataType.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestInputDefinition.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestOverallState.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestPassDetails.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestProperties.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRun.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRunProperties.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRunProvisioningState.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRunStatus.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestRuns.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestVersion.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestVersionProperties.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTestVersions.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/ValidationTests.java","src/main/java/com/azure/resourcemanager/platformvalidation/models/package-info.java","src/main/java/com/azure/resourcemanager/platformvalidation/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-platformvalidation/proxy-config.json b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-platformvalidation/proxy-config.json new file mode 100644 index 000000000000..2f7900c248c2 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-platformvalidation/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.platformvalidation.implementation.CloudValidationsClientImpl$CloudValidationsService"],["com.azure.resourcemanager.platformvalidation.implementation.ExecutionPlanRunsClientImpl$ExecutionPlanRunsService"],["com.azure.resourcemanager.platformvalidation.implementation.OperationStatusClientImpl$OperationStatusService"],["com.azure.resourcemanager.platformvalidation.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.platformvalidation.implementation.ValidationExecutionPlansClientImpl$ValidationExecutionPlansService"],["com.azure.resourcemanager.platformvalidation.implementation.ValidationTestCategoriesClientImpl$ValidationTestCategoriesService"],["com.azure.resourcemanager.platformvalidation.implementation.ValidationTestRunsClientImpl$ValidationTestRunsService"],["com.azure.resourcemanager.platformvalidation.implementation.ValidationTestVersionsClientImpl$ValidationTestVersionsService"],["com.azure.resourcemanager.platformvalidation.implementation.ValidationTestsClientImpl$ValidationTestsService"]] \ No newline at end of file diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-platformvalidation/reflect-config.json b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-platformvalidation/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-platformvalidation/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/resources/azure-resourcemanager-platformvalidation.properties b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/resources/azure-resourcemanager-platformvalidation.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/main/resources/azure-resourcemanager-platformvalidation.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsCreateOrUpdateSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..63a070100b78 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsCreateOrUpdateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.resourcemanager.platformvalidation.models.CloudValidationOverallState; +import com.azure.resourcemanager.platformvalidation.models.CloudValidationProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudValidations CreateOrUpdate. + */ +public final class CloudValidationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/CloudValidations_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: CloudValidations_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void cloudValidationsCreateOrUpdateMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.cloudValidations() + .define("cvtest01") + .withRegion("byryro") + .withExistingResourceGroup("rgvalidate") + .withTags(mapOf("key2277", "fakeTokenPlaceholder")) + .withProperties(new CloudValidationProperties().withDescription("ezutdlxrzaemjqpqpandwfixfkfk") + .withOverallState(CloudValidationOverallState.ENABLED)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsDeleteSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsDeleteSamples.java new file mode 100644 index 000000000000..719b0b05fe42 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsDeleteSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for CloudValidations Delete. + */ +public final class CloudValidationsDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/CloudValidations_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: CloudValidations_Delete_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void cloudValidationsDeleteMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.cloudValidations().delete("rgvalidate", "cvtest01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsGetByResourceGroupSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..cfba7a8d0bbf --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for CloudValidations GetByResourceGroup. + */ +public final class CloudValidationsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2026-07-01-preview/CloudValidations_Get_MaximumSet_Gen.json + */ + /** + * Sample code: CloudValidations_Get_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void + cloudValidationsGetMaximumSet(com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.cloudValidations() + .getByResourceGroupWithResponse("rgvalidate", "cvtest01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsListByResourceGroupSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsListByResourceGroupSamples.java new file mode 100644 index 000000000000..853139fe9861 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsListByResourceGroupSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for CloudValidations ListByResourceGroup. + */ +public final class CloudValidationsListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-07-01-preview/CloudValidations_ListByResourceGroup_MinimumSet_Gen.json + */ + /** + * Sample code: CloudValidations_ListByResourceGroup_MinimumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void cloudValidationsListByResourceGroupMinimumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.cloudValidations().listByResourceGroup("rgplatformvalidation", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/CloudValidations_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: CloudValidations_ListByResourceGroup_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void cloudValidationsListByResourceGroupMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.cloudValidations().listByResourceGroup("rgvalidate", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsListSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsListSamples.java new file mode 100644 index 000000000000..7a02c3978586 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsListSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for CloudValidations List. + */ +public final class CloudValidationsListSamples { + /* + * x-ms-original-file: 2026-07-01-preview/CloudValidations_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: CloudValidations_ListBySubscription_MinimumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void cloudValidationsListBySubscriptionMinimumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.cloudValidations().list(null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/CloudValidations_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: CloudValidations_ListBySubscription_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void cloudValidationsListBySubscriptionMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.cloudValidations().list(null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsUpdateSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsUpdateSamples.java new file mode 100644 index 000000000000..383e3cc91b92 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationsUpdateSamples.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.resourcemanager.platformvalidation.models.CloudValidation; +import com.azure.resourcemanager.platformvalidation.models.CloudValidationOverallState; +import com.azure.resourcemanager.platformvalidation.models.CloudValidationUpdateProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for CloudValidations Update. + */ +public final class CloudValidationsUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/CloudValidations_Update_MaximumSet_Gen.json + */ + /** + * Sample code: CloudValidations_Update_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void cloudValidationsUpdateMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + CloudValidation resource = manager.cloudValidations() + .getByResourceGroupWithResponse("rgvalidate", "cvtest01", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key3330", "fakeTokenPlaceholder")) + .withProperties(new CloudValidationUpdateProperties().withDescription("ezutdlxrzaemjqpqpandwfixfkfk") + .withOverallState(CloudValidationOverallState.ENABLED)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ExecutionPlanRunsCreateOrUpdateSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ExecutionPlanRunsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..8756f1541631 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ExecutionPlanRunsCreateOrUpdateSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.resourcemanager.platformvalidation.models.ExecutionPlanRunProperties; + +/** + * Samples for ExecutionPlanRuns CreateOrUpdate. + */ +public final class ExecutionPlanRunsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ExecutionPlanRuns_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: ExecutionPlanRuns_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void executionPlanRunsCreateOrUpdateMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.executionPlanRuns() + .define("veprun01") + .withExistingValidationExecutionPlan("rgvalidate", "cvtest01", "veptest01") + .withProperties(new ExecutionPlanRunProperties().withDescription("zwakqazgtploz")) + .create(); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ExecutionPlanRunsDeleteSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ExecutionPlanRunsDeleteSamples.java new file mode 100644 index 000000000000..8e8027305f63 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ExecutionPlanRunsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for ExecutionPlanRuns Delete. + */ +public final class ExecutionPlanRunsDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ExecutionPlanRuns_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: ExecutionPlanRuns_Delete_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void executionPlanRunsDeleteMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.executionPlanRuns() + .delete("rgvalidate", "cvtest01", "veptest01", "veprun01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ExecutionPlanRunsGetSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ExecutionPlanRunsGetSamples.java new file mode 100644 index 000000000000..18f2b35e7019 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ExecutionPlanRunsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for ExecutionPlanRuns Get. + */ +public final class ExecutionPlanRunsGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ExecutionPlanRuns_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ExecutionPlanRuns_Get_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void + executionPlanRunsGetMaximumSet(com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.executionPlanRuns() + .getWithResponse("rgvalidate", "cvtest01", "veptest01", "veprun01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ExecutionPlanRunsListByExecutionPlanSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ExecutionPlanRunsListByExecutionPlanSamples.java new file mode 100644 index 000000000000..faa361d5f4ad --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ExecutionPlanRunsListByExecutionPlanSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for ExecutionPlanRuns ListByExecutionPlan. + */ +public final class ExecutionPlanRunsListByExecutionPlanSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ExecutionPlanRuns_ListByExecutionPlan_MaximumSet_Gen.json + */ + /** + * Sample code: ExecutionPlanRuns_ListByExecutionPlan_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void executionPlanRunsListByExecutionPlanMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.executionPlanRuns() + .listByExecutionPlan("rgvalidate", "cvtest01", "veptest01", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/OperationStatusGetSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/OperationStatusGetSamples.java new file mode 100644 index 000000000000..ff3cd31d98b3 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/OperationStatusGetSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for OperationStatus Get. + */ +public final class OperationStatusGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/OperationStatus_Get_MinimumSet_Gen.json + */ + /** + * Sample code: OperationStatus_Get_MaximumSet - generated by [MinimumSet] rule. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void operationStatusGetMaximumSetGeneratedByMinimumSetRule( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.operationStatus() + .getWithResponse("obkgllzbzclv", "mewjfcrlycxuylboqxenpnsxxgcncx", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/OperationStatus_Get_MaximumSet_Gen.json + */ + /** + * Sample code: OperationStatus_Get_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void + operationStatusGetMaximumSet(com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.operationStatus() + .getWithResponse("obkgllzbzclv", "mewjfcrlycxuylboqxenpnsxxgcncx", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/OperationsListSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/OperationsListSamples.java new file mode 100644 index 000000000000..1ed59318f96d --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/OperationsListSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2026-07-01-preview/Operations_List_MinimumSet_Gen.json + */ + /** + * Sample code: Operations_List_MinimumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void + operationsListMinimumSet(com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/Operations_List_MaximumSet_Gen.json + */ + /** + * Sample code: Operations_List_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void + operationsListMaximumSet(com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlansCreateOrUpdateSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlansCreateOrUpdateSamples.java new file mode 100644 index 000000000000..7414428f7cc2 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlansCreateOrUpdateSamples.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanOverallState; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ValidationExecutionPlans CreateOrUpdate. + */ +public final class ValidationExecutionPlansCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationExecutionPlans_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationExecutionPlans_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationExecutionPlansCreateOrUpdateMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationExecutionPlans() + .define("veptest01") + .withRegion("cqqovjagjsndikbdlpltbtxisptjh") + .withExistingCloudValidation("rgvalidate", "cvtest01") + .withTags(mapOf("key3482", "fakeTokenPlaceholder")) + .withProperties(new ValidationExecutionPlanProperties().withDescription("ortzzlmaoxmwtcjkjkvuxx") + .withPlanConfigurationUri("xsouolufo") + .withPlanConfigurationJson("vmqqmcdpvhgu") + .withOverallState(ValidationExecutionPlanOverallState.ENABLED)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlansDeleteSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlansDeleteSamples.java new file mode 100644 index 000000000000..13a615969c58 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlansDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for ValidationExecutionPlans Delete. + */ +public final class ValidationExecutionPlansDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationExecutionPlans_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationExecutionPlans_Delete_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationExecutionPlansDeleteMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationExecutionPlans() + .delete("rgvalidate", "cvtest01", "veptest01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlansGetSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlansGetSamples.java new file mode 100644 index 000000000000..8442ebff54e4 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlansGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for ValidationExecutionPlans Get. + */ +public final class ValidationExecutionPlansGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationExecutionPlans_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationExecutionPlans_Get_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationExecutionPlansGetMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationExecutionPlans() + .getWithResponse("rgvalidate", "cvtest01", "veptest01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlansListByResourceGroupSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlansListByResourceGroupSamples.java new file mode 100644 index 000000000000..f899c3472988 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlansListByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for ValidationExecutionPlans ListByResourceGroup. + */ +public final class ValidationExecutionPlansListByResourceGroupSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationExecutionPlans_ListByResourceGroup_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationExecutionPlans_ListByResourceGroup_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationExecutionPlansListByResourceGroupMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationExecutionPlans() + .listByResourceGroup("rgvalidate", "cvtest01", null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlansUpdateSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlansUpdateSamples.java new file mode 100644 index 000000000000..6f047129ed5e --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlansUpdateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlan; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanOverallState; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanUpdateProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for ValidationExecutionPlans Update. + */ +public final class ValidationExecutionPlansUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationExecutionPlans_Update_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationExecutionPlans_Update_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationExecutionPlansUpdateMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + ValidationExecutionPlan resource = manager.validationExecutionPlans() + .getWithResponse("rgvalidate", "cvtest01", "veptest01", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf("key145", "fakeTokenPlaceholder")) + .withProperties(new ValidationExecutionPlanUpdateProperties().withDescription("ortzzlmaoxmwtcjkjkvuxx") + .withPlanConfigurationUri("xsouolufo") + .withPlanConfigurationJson("vmqqmcdpvhgu") + .withOverallState(ValidationExecutionPlanOverallState.ENABLED)) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoriesGetSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoriesGetSamples.java new file mode 100644 index 000000000000..a272bfc6fbcc --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoriesGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for ValidationTestCategories Get. + */ +public final class ValidationTestCategoriesGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestCategories_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTestCategories_Get_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestCategoriesGetMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestCategories().getWithResponse("olnmhyteecutmvckbt", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoriesListSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoriesListSamples.java new file mode 100644 index 000000000000..6f9168abdfb6 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoriesListSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for ValidationTestCategories List. + */ +public final class ValidationTestCategoriesListSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestCategories_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: ValidationTestCategories_ListBySubscription_MinimumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestCategoriesListBySubscriptionMinimumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestCategories().list(null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestCategories_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTestCategories_ListBySubscription_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestCategoriesListBySubscriptionMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestCategories().list("yolfvidccdfa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestRunsCreateOrUpdateSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestRunsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..ed2c5b7628b9 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestRunsCreateOrUpdateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.resourcemanager.platformvalidation.models.ValidationTestRunProperties; +import java.util.Arrays; + +/** + * Samples for ValidationTestRuns CreateOrUpdate. + */ +public final class ValidationTestRunsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestRuns_CreateOrUpdate_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTestRuns_CreateOrUpdate_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestRunsCreateOrUpdateMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestRuns() + .define("vtrun01") + .withExistingExecutionPlanRun("rgvalidate", "cvtest01", "veptest01", "veprun01") + .withProperties(new ValidationTestRunProperties().withTestId("validation-test-001") + .withTestCategoryIds(Arrays.asList("cat-network", "cat-security")) + .withInputsJson("{\"region\":\"eastus\",\"sku\":\"standard\"}")) + .create(); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestRunsDeleteSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestRunsDeleteSamples.java new file mode 100644 index 000000000000..2abffe6e5784 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestRunsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for ValidationTestRuns Delete. + */ +public final class ValidationTestRunsDeleteSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestRuns_Delete_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTestRuns_Delete_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestRunsDeleteMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestRuns() + .delete("rgvalidate", "cvtest01", "veptest01", "veprun01", "vtrun01", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestRunsGetSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestRunsGetSamples.java new file mode 100644 index 000000000000..0d04d34beb9c --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestRunsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for ValidationTestRuns Get. + */ +public final class ValidationTestRunsGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestRuns_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTestRuns_Get_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestRunsGetMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestRuns() + .getWithResponse("rgvalidate", "cvtest01", "veptest01", "veprun01", "vtrun01", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestRunsListByExecutionPlanRunSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestRunsListByExecutionPlanRunSamples.java new file mode 100644 index 000000000000..dc76abf785b6 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestRunsListByExecutionPlanRunSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for ValidationTestRuns ListByExecutionPlanRun. + */ +public final class ValidationTestRunsListByExecutionPlanRunSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestRuns_ListByExecutionPlanRun_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTestRuns_ListByExecutionPlanRun_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestRunsListByExecutionPlanRunMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestRuns() + .listByExecutionPlanRun("rgvalidate", "cvtest01", "veptest01", "veprun01", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionsGetSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionsGetSamples.java new file mode 100644 index 000000000000..6827f3c2b78e --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for ValidationTestVersions Get. + */ +public final class ValidationTestVersionsGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestVersions_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTestVersions_Get_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestVersionsGetMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestVersions().getWithResponse("test1", "1.0.0", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionsListSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionsListSamples.java new file mode 100644 index 000000000000..68ada123f156 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for ValidationTestVersions List. + */ +public final class ValidationTestVersionsListSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTestVersions_List_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTestVersions_List_MaximumSet - generated by [MaximumSet] rule. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestVersionsListMaximumSetGeneratedByMaximumSetRule( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTestVersions().list("test1", "yolfvidccdfa", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestsGetSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestsGetSamples.java new file mode 100644 index 000000000000..34c1f9f91a54 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for ValidationTests Get. + */ +public final class ValidationTestsGetSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTests_Get_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTests_Get_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void + validationTestsGetMaximumSet(com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTests().getWithResponse("pgaqtvwrkwboi", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestsListSamples.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestsListSamples.java new file mode 100644 index 000000000000..a2e5debdfbe5 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/samples/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestsListSamples.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +/** + * Samples for ValidationTests List. + */ +public final class ValidationTestsListSamples { + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTests_ListBySubscription_MaximumSet_Gen.json + */ + /** + * Sample code: ValidationTests_ListBySubscription_MaximumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestsListBySubscriptionMaximumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTests().list("yolfvidccdfa", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01-preview/ValidationTests_ListBySubscription_MinimumSet_Gen.json + */ + /** + * Sample code: ValidationTests_ListBySubscription_MinimumSet. + * + * @param manager Entry point to PlatformValidationManager. + */ + public static void validationTestsListBySubscriptionMinimumSet( + com.azure.resourcemanager.platformvalidation.PlatformValidationManager manager) { + manager.validationTests().list(null, com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationUpdatePropertiesTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationUpdatePropertiesTests.java new file mode 100644 index 000000000000..7a438ada5189 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationUpdatePropertiesTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.models.CloudValidationOverallState; +import com.azure.resourcemanager.platformvalidation.models.CloudValidationUpdateProperties; +import org.junit.jupiter.api.Assertions; + +public final class CloudValidationUpdatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CloudValidationUpdateProperties model + = BinaryData.fromString("{\"description\":\"rgqjbpfzfsinzg\",\"overallState\":\"Disabled\"}") + .toObject(CloudValidationUpdateProperties.class); + Assertions.assertEquals("rgqjbpfzfsinzg", model.description()); + Assertions.assertEquals(CloudValidationOverallState.DISABLED, model.overallState()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CloudValidationUpdateProperties model = new CloudValidationUpdateProperties().withDescription("rgqjbpfzfsinzg") + .withOverallState(CloudValidationOverallState.DISABLED); + model = BinaryData.fromObject(model).toObject(CloudValidationUpdateProperties.class); + Assertions.assertEquals("rgqjbpfzfsinzg", model.description()); + Assertions.assertEquals(CloudValidationOverallState.DISABLED, model.overallState()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationUpdateTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationUpdateTests.java new file mode 100644 index 000000000000..5d21e3340b0d --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/CloudValidationUpdateTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.models.CloudValidationOverallState; +import com.azure.resourcemanager.platformvalidation.models.CloudValidationUpdate; +import com.azure.resourcemanager.platformvalidation.models.CloudValidationUpdateProperties; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class CloudValidationUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + CloudValidationUpdate model = BinaryData.fromString( + "{\"tags\":{\"ozkrwfndiodjpslw\":\"dvpjhulsuuvmk\",\"psoacctazakljl\":\"jdpvwryo\",\"paojakhmsbzjh\":\"hbcryffdfdosyge\"},\"properties\":{\"description\":\"evdphlxaol\",\"overallState\":\"Disabled\"}}") + .toObject(CloudValidationUpdate.class); + Assertions.assertEquals("dvpjhulsuuvmk", model.tags().get("ozkrwfndiodjpslw")); + Assertions.assertEquals("evdphlxaol", model.properties().description()); + Assertions.assertEquals(CloudValidationOverallState.DISABLED, model.properties().overallState()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + CloudValidationUpdate model = new CloudValidationUpdate() + .withTags(mapOf("ozkrwfndiodjpslw", "dvpjhulsuuvmk", "psoacctazakljl", "jdpvwryo", "paojakhmsbzjh", + "hbcryffdfdosyge")) + .withProperties(new CloudValidationUpdateProperties().withDescription("evdphlxaol") + .withOverallState(CloudValidationOverallState.DISABLED)); + model = BinaryData.fromObject(model).toObject(CloudValidationUpdate.class); + Assertions.assertEquals("dvpjhulsuuvmk", model.tags().get("ozkrwfndiodjpslw")); + Assertions.assertEquals("evdphlxaol", model.properties().description()); + Assertions.assertEquals(CloudValidationOverallState.DISABLED, model.properties().overallState()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ManagedOnBehalfOfConfigurationTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ManagedOnBehalfOfConfigurationTests.java new file mode 100644 index 000000000000..4afa20d5d4c7 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ManagedOnBehalfOfConfigurationTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.models.ManagedOnBehalfOfConfiguration; + +public final class ManagedOnBehalfOfConfigurationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ManagedOnBehalfOfConfiguration model + = BinaryData.fromString("{\"moboBrokerResources\":[{\"id\":\"qnjaqwix\"},{\"id\":\"prozvcputegjvwmf\"}]}") + .toObject(ManagedOnBehalfOfConfiguration.class); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/MoboBrokerResourceTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/MoboBrokerResourceTests.java new file mode 100644 index 000000000000..67b561977a6a --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/MoboBrokerResourceTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.models.MoboBrokerResource; +import org.junit.jupiter.api.Assertions; + +public final class MoboBrokerResourceTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MoboBrokerResource model = BinaryData.fromString("{\"id\":\"t\"}").toObject(MoboBrokerResource.class); + Assertions.assertEquals("t", model.id()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/OperationDisplayTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/OperationDisplayTests.java new file mode 100644 index 000000000000..bfdb560b869a --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/OperationDisplayTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.models.OperationDisplay; + +public final class OperationDisplayTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"k\",\"resource\":\"audccsnhs\",\"operation\":\"nyejhkryhtnap\",\"description\":\"wlokjyem\"}") + .toObject(OperationDisplay.class); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/OperationInnerTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/OperationInnerTests.java new file mode 100644 index 000000000000..5d35988f2055 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/OperationInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.fluent.models.OperationInner; + +public final class OperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInner model = BinaryData.fromString( + "{\"name\":\"th\",\"isDataAction\":false,\"display\":{\"provider\":\"ifpikxwczby\",\"resource\":\"npqxuh\",\"operation\":\"y\",\"description\":\"iwbybrkxvdumjg\"},\"origin\":\"user\",\"actionType\":\"Internal\"}") + .toObject(OperationInner.class); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/OperationListResultTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/OperationListResultTests.java new file mode 100644 index 000000000000..79341022db82 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/OperationListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"ifkwmrvktsizntoc\",\"isDataAction\":false,\"display\":{\"provider\":\"ajpsquc\",\"resource\":\"o\",\"operation\":\"dkfo\",\"description\":\"nygj\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"qs\",\"isDataAction\":true,\"display\":{\"provider\":\"ewnwreitjzyfl\",\"resource\":\"arhmofcqhsmy\",\"operation\":\"kdtmlxhekuk\",\"description\":\"txukcdmp\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"anzwuxzdxta\",\"isDataAction\":true,\"display\":{\"provider\":\"whfpmrqobmtu\",\"resource\":\"nryrtihf\",\"operation\":\"ijbpzvgnwzsymgl\",\"description\":\"fcyzkohdbihanufh\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"a\"}") + .toObject(OperationListResult.class); + Assertions.assertEquals("a", model.nextLink()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/OperationsListMockTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/OperationsListMockTests.java new file mode 100644 index 000000000000..6f84d1fee789 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/OperationsListMockTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.platformvalidation.PlatformValidationManager; +import com.azure.resourcemanager.platformvalidation.models.Operation; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class OperationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"name\":\"txhp\",\"isDataAction\":false,\"display\":{\"provider\":\"fzab\",\"resource\":\"cuh\",\"operation\":\"tcty\",\"description\":\"klbb\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + PlatformValidationManager manager = PlatformValidationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/TestRunSummaryTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/TestRunSummaryTests.java new file mode 100644 index 000000000000..339c3378723d --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/TestRunSummaryTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.models.TestRunOverallResult; +import com.azure.resourcemanager.platformvalidation.models.TestRunSummary; +import org.junit.jupiter.api.Assertions; + +public final class TestRunSummaryTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TestRunSummary model = BinaryData.fromString( + "{\"totalTests\":732372528,\"passedTests\":1906017395,\"failedTests\":1237091800,\"skippedTests\":897751873,\"overallResult\":\"PartiallyPassed\",\"message\":\"ftyhxhurokf\"}") + .toObject(TestRunSummary.class); + Assertions.assertEquals(732372528, model.totalTests()); + Assertions.assertEquals(1906017395, model.passedTests()); + Assertions.assertEquals(1237091800, model.failedTests()); + Assertions.assertEquals(897751873, model.skippedTests()); + Assertions.assertEquals(TestRunOverallResult.PARTIALLY_PASSED, model.overallResult()); + Assertions.assertEquals("ftyhxhurokf", model.message()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlanUpdatePropertiesTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlanUpdatePropertiesTests.java new file mode 100644 index 000000000000..8c4b9f0cf9f0 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlanUpdatePropertiesTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanOverallState; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanUpdateProperties; +import org.junit.jupiter.api.Assertions; + +public final class ValidationExecutionPlanUpdatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidationExecutionPlanUpdateProperties model = BinaryData.fromString( + "{\"description\":\"gsntnbybkzgcwr\",\"planConfigurationUri\":\"lxxwrljdouskc\",\"planConfigurationJson\":\"kocrcjdkwtnhx\",\"overallState\":\"Disabled\"}") + .toObject(ValidationExecutionPlanUpdateProperties.class); + Assertions.assertEquals("gsntnbybkzgcwr", model.description()); + Assertions.assertEquals("lxxwrljdouskc", model.planConfigurationUri()); + Assertions.assertEquals("kocrcjdkwtnhx", model.planConfigurationJson()); + Assertions.assertEquals(ValidationExecutionPlanOverallState.DISABLED, model.overallState()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ValidationExecutionPlanUpdateProperties model + = new ValidationExecutionPlanUpdateProperties().withDescription("gsntnbybkzgcwr") + .withPlanConfigurationUri("lxxwrljdouskc") + .withPlanConfigurationJson("kocrcjdkwtnhx") + .withOverallState(ValidationExecutionPlanOverallState.DISABLED); + model = BinaryData.fromObject(model).toObject(ValidationExecutionPlanUpdateProperties.class); + Assertions.assertEquals("gsntnbybkzgcwr", model.description()); + Assertions.assertEquals("lxxwrljdouskc", model.planConfigurationUri()); + Assertions.assertEquals("kocrcjdkwtnhx", model.planConfigurationJson()); + Assertions.assertEquals(ValidationExecutionPlanOverallState.DISABLED, model.overallState()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlanUpdateTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlanUpdateTests.java new file mode 100644 index 000000000000..b3ef080025b6 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationExecutionPlanUpdateTests.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanOverallState; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanUpdate; +import com.azure.resourcemanager.platformvalidation.models.ValidationExecutionPlanUpdateProperties; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class ValidationExecutionPlanUpdateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidationExecutionPlanUpdate model = BinaryData.fromString( + "{\"tags\":{\"gxg\":\"zrnf\",\"fublj\":\"spemvtzfk\"},\"properties\":{\"description\":\"qeof\",\"planConfigurationUri\":\"e\",\"planConfigurationJson\":\"hqjbasvmsmj\",\"overallState\":\"Disabled\"}}") + .toObject(ValidationExecutionPlanUpdate.class); + Assertions.assertEquals("zrnf", model.tags().get("gxg")); + Assertions.assertEquals("qeof", model.properties().description()); + Assertions.assertEquals("e", model.properties().planConfigurationUri()); + Assertions.assertEquals("hqjbasvmsmj", model.properties().planConfigurationJson()); + Assertions.assertEquals(ValidationExecutionPlanOverallState.DISABLED, model.properties().overallState()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ValidationExecutionPlanUpdate model + = new ValidationExecutionPlanUpdate().withTags(mapOf("gxg", "zrnf", "fublj", "spemvtzfk")) + .withProperties(new ValidationExecutionPlanUpdateProperties().withDescription("qeof") + .withPlanConfigurationUri("e") + .withPlanConfigurationJson("hqjbasvmsmj") + .withOverallState(ValidationExecutionPlanOverallState.DISABLED)); + model = BinaryData.fromObject(model).toObject(ValidationExecutionPlanUpdate.class); + Assertions.assertEquals("zrnf", model.tags().get("gxg")); + Assertions.assertEquals("qeof", model.properties().description()); + Assertions.assertEquals("e", model.properties().planConfigurationUri()); + Assertions.assertEquals("hqjbasvmsmj", model.properties().planConfigurationJson()); + Assertions.assertEquals(ValidationExecutionPlanOverallState.DISABLED, model.properties().overallState()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoriesGetWithResponseMockTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoriesGetWithResponseMockTests.java new file mode 100644 index 000000000000..a9964ded8879 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoriesGetWithResponseMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.platformvalidation.PlatformValidationManager; +import com.azure.resourcemanager.platformvalidation.models.CatalogAudience; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestCategory; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ValidationTestCategoriesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"displayName\":\"uwhhmhykojoxafn\",\"description\":\"lpichk\",\"audience\":\"Internal\",\"provisioningState\":\"Succeeded\",\"parentCategoryId\":\"yhbpkkpw\",\"owners\":[\"q\",\"ovvqfovljxywsu\",\"syrsndsytgadgvra\"]},\"id\":\"en\",\"name\":\"qnzarrwl\",\"type\":\"uu\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + PlatformValidationManager manager = PlatformValidationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ValidationTestCategory response = manager.validationTestCategories() + .getWithResponse("bdbutauvf", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("uwhhmhykojoxafn", response.properties().displayName()); + Assertions.assertEquals("lpichk", response.properties().description()); + Assertions.assertEquals(CatalogAudience.INTERNAL, response.properties().audience()); + Assertions.assertEquals("yhbpkkpw", response.properties().parentCategoryId()); + Assertions.assertEquals("q", response.properties().owners().get(0)); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoriesListMockTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoriesListMockTests.java new file mode 100644 index 000000000000..a5a29cc02266 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoriesListMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.platformvalidation.PlatformValidationManager; +import com.azure.resourcemanager.platformvalidation.models.CatalogAudience; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestCategory; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ValidationTestCategoriesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"displayName\":\"iipfpubj\",\"description\":\"wwiftohqkvpuv\",\"audience\":\"Internal\",\"provisioningState\":\"Succeeded\",\"parentCategoryId\":\"aknynfsynljphuop\",\"owners\":[\"lqiyntorzihl\",\"osjswsr\",\"slyzrpzbchckqq\"]},\"id\":\"ioxiysuiizyn\",\"name\":\"edyatrwyhqmibzyh\",\"type\":\"itsmypyyn\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + PlatformValidationManager manager = PlatformValidationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.validationTestCategories().list("jfqka", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("iipfpubj", response.iterator().next().properties().displayName()); + Assertions.assertEquals("wwiftohqkvpuv", response.iterator().next().properties().description()); + Assertions.assertEquals(CatalogAudience.INTERNAL, response.iterator().next().properties().audience()); + Assertions.assertEquals("aknynfsynljphuop", response.iterator().next().properties().parentCategoryId()); + Assertions.assertEquals("lqiyntorzihl", response.iterator().next().properties().owners().get(0)); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoryInnerTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoryInnerTests.java new file mode 100644 index 000000000000..b1e7fb229749 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoryInnerTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestCategoryInner; +import com.azure.resourcemanager.platformvalidation.models.CatalogAudience; +import org.junit.jupiter.api.Assertions; + +public final class ValidationTestCategoryInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidationTestCategoryInner model = BinaryData.fromString( + "{\"properties\":{\"displayName\":\"dwtiukbldngkp\",\"description\":\"ipazyxoegukgjnpi\",\"audience\":\"Public\",\"provisioningState\":\"Succeeded\",\"parentCategoryId\":\"vqzntypmrbpizcdr\",\"owners\":[\"dpydn\",\"yhxdeoejzicwi\",\"sjttgzfbish\",\"bkh\"]},\"id\":\"deyeamdphagalpbu\",\"name\":\"wgipwhono\",\"type\":\"kgshwa\"}") + .toObject(ValidationTestCategoryInner.class); + Assertions.assertEquals("dwtiukbldngkp", model.properties().displayName()); + Assertions.assertEquals("ipazyxoegukgjnpi", model.properties().description()); + Assertions.assertEquals(CatalogAudience.PUBLIC, model.properties().audience()); + Assertions.assertEquals("vqzntypmrbpizcdr", model.properties().parentCategoryId()); + Assertions.assertEquals("dpydn", model.properties().owners().get(0)); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoryListResultTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoryListResultTests.java new file mode 100644 index 000000000000..9f7dd07e13a5 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoryListResultTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.implementation.models.ValidationTestCategoryListResult; +import com.azure.resourcemanager.platformvalidation.models.CatalogAudience; +import org.junit.jupiter.api.Assertions; + +public final class ValidationTestCategoryListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidationTestCategoryListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"displayName\":\"ocukoklyax\",\"description\":\"onuq\",\"audience\":\"Public\",\"provisioningState\":\"Succeeded\",\"parentCategoryId\":\"ypewrmjmwvvjekt\",\"owners\":[\"enhwlrs\",\"frzpwvlqdqgb\"]},\"id\":\"ylihkaetckt\",\"name\":\"fcivfsnkym\",\"type\":\"ctq\"},{\"properties\":{\"displayName\":\"bebrjcxerfuwuttt\",\"description\":\"vjrbirphxepcyvah\",\"audience\":\"Internal\",\"provisioningState\":\"Failed\",\"parentCategoryId\":\"qxj\",\"owners\":[\"j\",\"gidokgjljyoxgvcl\"]},\"id\":\"gsncghkjeszz\",\"name\":\"bijhtxfvgxbf\",\"type\":\"mxnehmp\"}],\"nextLink\":\"cxgod\"}") + .toObject(ValidationTestCategoryListResult.class); + Assertions.assertEquals("ocukoklyax", model.value().get(0).properties().displayName()); + Assertions.assertEquals("onuq", model.value().get(0).properties().description()); + Assertions.assertEquals(CatalogAudience.PUBLIC, model.value().get(0).properties().audience()); + Assertions.assertEquals("ypewrmjmwvvjekt", model.value().get(0).properties().parentCategoryId()); + Assertions.assertEquals("enhwlrs", model.value().get(0).properties().owners().get(0)); + Assertions.assertEquals("cxgod", model.nextLink()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoryPropertiesTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoryPropertiesTests.java new file mode 100644 index 000000000000..e17b4749fc5e --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestCategoryPropertiesTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.models.CatalogAudience; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestCategoryProperties; +import org.junit.jupiter.api.Assertions; + +public final class ValidationTestCategoryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidationTestCategoryProperties model = BinaryData.fromString( + "{\"displayName\":\"ixzbinjeputtmryw\",\"description\":\"zoqftiyqzrnkcqvy\",\"audience\":\"Internal\",\"provisioningState\":\"Canceled\",\"parentCategoryId\":\"sicohoqqnwvlry\",\"owners\":[\"hheunmmqhgyx\"]}") + .toObject(ValidationTestCategoryProperties.class); + Assertions.assertEquals("ixzbinjeputtmryw", model.displayName()); + Assertions.assertEquals("zoqftiyqzrnkcqvy", model.description()); + Assertions.assertEquals(CatalogAudience.INTERNAL, model.audience()); + Assertions.assertEquals("sicohoqqnwvlry", model.parentCategoryId()); + Assertions.assertEquals("hheunmmqhgyx", model.owners().get(0)); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestInnerTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestInnerTests.java new file mode 100644 index 000000000000..b4c07f19e8ad --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestInnerTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestInner; +import com.azure.resourcemanager.platformvalidation.models.CatalogAudience; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestInputDataType; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestOverallState; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ValidationTestInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidationTestInner model = BinaryData.fromString( + "{\"properties\":{\"description\":\"tbciqfouflmm\",\"audience\":\"Public\",\"provisioningState\":\"Canceled\",\"categoryIds\":[\"mglougpbkw\",\"mutduqktaps\"],\"overallState\":\"Draft\",\"owners\":[\"ertumkdo\",\"vqwhbmdgbbjfd\"],\"inputs\":[{\"name\":\"bmbexppbhtqqro\",\"definition\":{\"description\":\"p\",\"type\":\"Array\",\"required\":false,\"defaultValue\":\"bquxigjy\",\"allowedValues\":[\"jaoyfhrtx\",\"lnerkujysvleju\",\"fqawrlyxw\"]}},{\"name\":\"kcprbnw\",\"definition\":{\"description\":\"gjvtbv\",\"type\":\"Number\",\"required\":false,\"defaultValue\":\"nruj\",\"allowedValues\":[\"hmuouqfprwzwbn\",\"uitnwuiz\",\"a\",\"x\"]}},{\"name\":\"fizuckyf\",\"definition\":{\"description\":\"rfidfvzwdz\",\"type\":\"Integer\",\"required\":true,\"defaultValue\":\"isdkfthwxmnteiw\",\"allowedValues\":[\"vkmijcmmxdcuf\",\"fsrpymzidnse\",\"cxtbzsg\",\"yc\"]}}],\"testStoreUri\":\"newmdwzjeiachbo\",\"currentVersion\":\"flnrosfqpteehzz\",\"latestPublishedVersion\":\"pyqr\",\"lastPublishedAt\":\"2021-02-03T19:04:42Z\"},\"id\":\"npvswjdkirso\",\"name\":\"dqxhcrmnohjtckwh\",\"type\":\"soifiyipjxsqw\"}") + .toObject(ValidationTestInner.class); + Assertions.assertEquals("tbciqfouflmm", model.properties().description()); + Assertions.assertEquals(CatalogAudience.PUBLIC, model.properties().audience()); + Assertions.assertEquals("mglougpbkw", model.properties().categoryIds().get(0)); + Assertions.assertEquals(ValidationTestOverallState.DRAFT, model.properties().overallState()); + Assertions.assertEquals("ertumkdo", model.properties().owners().get(0)); + Assertions.assertEquals("bmbexppbhtqqro", model.properties().inputs().get(0).name()); + Assertions.assertEquals("p", model.properties().inputs().get(0).definition().description()); + Assertions.assertEquals(ValidationTestInputDataType.ARRAY, + model.properties().inputs().get(0).definition().type()); + Assertions.assertFalse(model.properties().inputs().get(0).definition().required()); + Assertions.assertEquals("bquxigjy", model.properties().inputs().get(0).definition().defaultValue()); + Assertions.assertEquals("jaoyfhrtx", model.properties().inputs().get(0).definition().allowedValues().get(0)); + Assertions.assertEquals("newmdwzjeiachbo", model.properties().testStoreUri()); + Assertions.assertEquals("flnrosfqpteehzz", model.properties().currentVersion()); + Assertions.assertEquals("pyqr", model.properties().latestPublishedVersion()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-03T19:04:42Z"), model.properties().lastPublishedAt()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestInputDefinitionTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestInputDefinitionTests.java new file mode 100644 index 000000000000..af57291d5fb2 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestInputDefinitionTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestInputDataType; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestInputDefinition; +import org.junit.jupiter.api.Assertions; + +public final class ValidationTestInputDefinitionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidationTestInputDefinition model = BinaryData.fromString( + "{\"description\":\"jwzrl\",\"type\":\"Boolean\",\"required\":true,\"defaultValue\":\"hijco\",\"allowedValues\":[\"tbzaqsqsycbkbfk\",\"ukdkexxppofmxa\"]}") + .toObject(ValidationTestInputDefinition.class); + Assertions.assertEquals("jwzrl", model.description()); + Assertions.assertEquals(ValidationTestInputDataType.BOOLEAN, model.type()); + Assertions.assertTrue(model.required()); + Assertions.assertEquals("hijco", model.defaultValue()); + Assertions.assertEquals("tbzaqsqsycbkbfk", model.allowedValues().get(0)); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestInputTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestInputTests.java new file mode 100644 index 000000000000..3a8ceaa24c1e --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestInputTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestInput; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestInputDataType; +import org.junit.jupiter.api.Assertions; + +public final class ValidationTestInputTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidationTestInput model = BinaryData.fromString( + "{\"name\":\"tjaodxobnb\",\"definition\":{\"description\":\"k\",\"type\":\"Boolean\",\"required\":true,\"defaultValue\":\"jionpimexgstxgc\",\"allowedValues\":[\"gmaajrm\"]}}") + .toObject(ValidationTestInput.class); + Assertions.assertEquals("tjaodxobnb", model.name()); + Assertions.assertEquals("k", model.definition().description()); + Assertions.assertEquals(ValidationTestInputDataType.BOOLEAN, model.definition().type()); + Assertions.assertTrue(model.definition().required()); + Assertions.assertEquals("jionpimexgstxgc", model.definition().defaultValue()); + Assertions.assertEquals("gmaajrm", model.definition().allowedValues().get(0)); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestListResultTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestListResultTests.java new file mode 100644 index 000000000000..7f8eb8add544 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestListResultTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.implementation.models.ValidationTestListResult; +import com.azure.resourcemanager.platformvalidation.models.CatalogAudience; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestOverallState; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ValidationTestListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidationTestListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"description\":\"pg\",\"audience\":\"Public\",\"provisioningState\":\"Canceled\",\"categoryIds\":[\"xhvpmoue\"],\"overallState\":\"Disabled\",\"owners\":[\"i\",\"qeojnxqbzvddntw\",\"deicbtwnpzao\"],\"inputs\":[{\"name\":\"hrhcffcyddglmjth\",\"definition\":{}},{\"name\":\"qkwpyeicxmqc\",\"definition\":{}},{\"name\":\"wqvhkhixuigdt\",\"definition\":{}},{\"name\":\"pbobjo\",\"definition\":{}}],\"testStoreUri\":\"m\",\"currentVersion\":\"u\",\"latestPublishedVersion\":\"a\",\"lastPublishedAt\":\"2021-09-14T08:48:03Z\"},\"id\":\"ayvvtpgvdf\",\"name\":\"iotkftutqxl\",\"type\":\"gxlefgugnxkrxd\"}],\"nextLink\":\"i\"}") + .toObject(ValidationTestListResult.class); + Assertions.assertEquals("pg", model.value().get(0).properties().description()); + Assertions.assertEquals(CatalogAudience.PUBLIC, model.value().get(0).properties().audience()); + Assertions.assertEquals("xhvpmoue", model.value().get(0).properties().categoryIds().get(0)); + Assertions.assertEquals(ValidationTestOverallState.DISABLED, model.value().get(0).properties().overallState()); + Assertions.assertEquals("i", model.value().get(0).properties().owners().get(0)); + Assertions.assertEquals("hrhcffcyddglmjth", model.value().get(0).properties().inputs().get(0).name()); + Assertions.assertEquals("m", model.value().get(0).properties().testStoreUri()); + Assertions.assertEquals("u", model.value().get(0).properties().currentVersion()); + Assertions.assertEquals("a", model.value().get(0).properties().latestPublishedVersion()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-14T08:48:03Z"), + model.value().get(0).properties().lastPublishedAt()); + Assertions.assertEquals("i", model.nextLink()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestPropertiesTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestPropertiesTests.java new file mode 100644 index 000000000000..7e4fdbb91930 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestPropertiesTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.models.CatalogAudience; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestInputDataType; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestOverallState; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestProperties; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class ValidationTestPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidationTestProperties model = BinaryData.fromString( + "{\"description\":\"rjb\",\"audience\":\"Internal\",\"provisioningState\":\"Canceled\",\"categoryIds\":[\"vsnb\"],\"overallState\":\"Active\",\"owners\":[\"nmoc\"],\"inputs\":[{\"name\":\"shurzafbljjgpbto\",\"definition\":{\"description\":\"jmkljavbqidtqajz\",\"type\":\"String\",\"required\":true,\"defaultValue\":\"dj\",\"allowedValues\":[\"khbzhfepgzg\",\"e\"]}}],\"testStoreUri\":\"locx\",\"currentVersion\":\"paierh\",\"latestPublishedVersion\":\"csglum\",\"lastPublishedAt\":\"2021-11-23T17:21:38Z\"}") + .toObject(ValidationTestProperties.class); + Assertions.assertEquals("rjb", model.description()); + Assertions.assertEquals(CatalogAudience.INTERNAL, model.audience()); + Assertions.assertEquals("vsnb", model.categoryIds().get(0)); + Assertions.assertEquals(ValidationTestOverallState.ACTIVE, model.overallState()); + Assertions.assertEquals("nmoc", model.owners().get(0)); + Assertions.assertEquals("shurzafbljjgpbto", model.inputs().get(0).name()); + Assertions.assertEquals("jmkljavbqidtqajz", model.inputs().get(0).definition().description()); + Assertions.assertEquals(ValidationTestInputDataType.STRING, model.inputs().get(0).definition().type()); + Assertions.assertTrue(model.inputs().get(0).definition().required()); + Assertions.assertEquals("dj", model.inputs().get(0).definition().defaultValue()); + Assertions.assertEquals("khbzhfepgzg", model.inputs().get(0).definition().allowedValues().get(0)); + Assertions.assertEquals("locx", model.testStoreUri()); + Assertions.assertEquals("paierh", model.currentVersion()); + Assertions.assertEquals("csglum", model.latestPublishedVersion()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-23T17:21:38Z"), model.lastPublishedAt()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionInnerTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionInnerTests.java new file mode 100644 index 000000000000..6e399b8e9cdb --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionInnerTests.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.fluent.models.ValidationTestVersionInner; +import com.azure.resourcemanager.platformvalidation.models.CatalogAudience; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestInputDataType; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestOverallState; +import org.junit.jupiter.api.Assertions; + +public final class ValidationTestVersionInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidationTestVersionInner model = BinaryData.fromString( + "{\"properties\":{\"description\":\"hzrvqd\",\"audience\":\"Public\",\"provisioningState\":\"Failed\",\"categoryIds\":[\"igeho\"],\"overallState\":\"Active\",\"owners\":[\"skanyk\"],\"inputs\":[{\"name\":\"cuiywgqyw\",\"definition\":{\"description\":\"drvyn\",\"type\":\"Integer\",\"required\":true,\"defaultValue\":\"rcgyn\",\"allowedValues\":[\"pec\",\"vmmcoofs\",\"lzevgbmqjqab\",\"y\"]}},{\"name\":\"mivkwlzuvcc\",\"definition\":{\"description\":\"nfnbacfionlebxe\",\"type\":\"Object\",\"required\":true,\"defaultValue\":\"dpnqbq\",\"allowedValues\":[\"rjfeallnwsubisnj\",\"mpmngnzscxaqwoo\",\"hcbonqvpkvlr\",\"njeaseipheofloke\"]}},{\"name\":\"y\",\"definition\":{\"description\":\"nj\",\"type\":\"Boolean\",\"required\":true,\"defaultValue\":\"rhpdjpjumas\",\"allowedValues\":[\"jpqyegu\"]}},{\"name\":\"lhbxxhejjzzvdud\",\"definition\":{\"description\":\"dslfhotwmcy\",\"type\":\"Boolean\",\"required\":false,\"defaultValue\":\"npgacftade\",\"allowedValues\":[\"ltyfsop\",\"usue\",\"nzwdejba\",\"orxzdmohctbqvud\"]}}],\"contentHash\":\"dndnvow\",\"testStoreUri\":\"jjugwdkcglhslaz\"},\"id\":\"yggdtjixh\",\"name\":\"kuofqweykhme\",\"type\":\"evfyexfwhybcib\"}") + .toObject(ValidationTestVersionInner.class); + Assertions.assertEquals("hzrvqd", model.properties().description()); + Assertions.assertEquals(CatalogAudience.PUBLIC, model.properties().audience()); + Assertions.assertEquals("igeho", model.properties().categoryIds().get(0)); + Assertions.assertEquals(ValidationTestOverallState.ACTIVE, model.properties().overallState()); + Assertions.assertEquals("skanyk", model.properties().owners().get(0)); + Assertions.assertEquals("cuiywgqyw", model.properties().inputs().get(0).name()); + Assertions.assertEquals("drvyn", model.properties().inputs().get(0).definition().description()); + Assertions.assertEquals(ValidationTestInputDataType.INTEGER, + model.properties().inputs().get(0).definition().type()); + Assertions.assertTrue(model.properties().inputs().get(0).definition().required()); + Assertions.assertEquals("rcgyn", model.properties().inputs().get(0).definition().defaultValue()); + Assertions.assertEquals("pec", model.properties().inputs().get(0).definition().allowedValues().get(0)); + Assertions.assertEquals("dndnvow", model.properties().contentHash()); + Assertions.assertEquals("jjugwdkcglhslaz", model.properties().testStoreUri()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionListResultTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionListResultTests.java new file mode 100644 index 000000000000..87fc882e4e99 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionListResultTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.implementation.models.ValidationTestVersionListResult; +import com.azure.resourcemanager.platformvalidation.models.CatalogAudience; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestOverallState; +import org.junit.jupiter.api.Assertions; + +public final class ValidationTestVersionListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidationTestVersionListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"description\":\"mddystkiiux\",\"audience\":\"Internal\",\"provisioningState\":\"Failed\",\"categoryIds\":[\"rrqnbpoczvyifqrv\"],\"overallState\":\"Published\",\"owners\":[\"llr\"],\"inputs\":[{\"name\":\"d\",\"definition\":{}},{\"name\":\"watkpnpulexxb\",\"definition\":{}},{\"name\":\"zwtruwiqzbqjvsov\",\"definition\":{}}],\"contentHash\":\"okacspk\",\"testStoreUri\":\"hzdobpxjmflbvvnc\"},\"id\":\"kcciwwzjuqkhr\",\"name\":\"ajiwkuo\",\"type\":\"oskg\"},{\"properties\":{\"description\":\"uuimjmvxieduug\",\"audience\":\"Public\",\"provisioningState\":\"Succeeded\",\"categoryIds\":[\"byao\"],\"overallState\":\"Draft\",\"owners\":[\"sonpclhocohs\",\"kevle\",\"gz\"],\"inputs\":[{\"name\":\"hfmvfaxkffe\",\"definition\":{}}],\"contentHash\":\"th\",\"testStoreUri\":\"m\"},\"id\":\"yvshxmz\",\"name\":\"bbzoggig\",\"type\":\"xwburvjxxjns\"}],\"nextLink\":\"dptkoenkouk\"}") + .toObject(ValidationTestVersionListResult.class); + Assertions.assertEquals("mddystkiiux", model.value().get(0).properties().description()); + Assertions.assertEquals(CatalogAudience.INTERNAL, model.value().get(0).properties().audience()); + Assertions.assertEquals("rrqnbpoczvyifqrv", model.value().get(0).properties().categoryIds().get(0)); + Assertions.assertEquals(ValidationTestOverallState.PUBLISHED, model.value().get(0).properties().overallState()); + Assertions.assertEquals("llr", model.value().get(0).properties().owners().get(0)); + Assertions.assertEquals("d", model.value().get(0).properties().inputs().get(0).name()); + Assertions.assertEquals("okacspk", model.value().get(0).properties().contentHash()); + Assertions.assertEquals("hzdobpxjmflbvvnc", model.value().get(0).properties().testStoreUri()); + Assertions.assertEquals("dptkoenkouk", model.nextLink()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionPropertiesTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionPropertiesTests.java new file mode 100644 index 000000000000..05a368524fc1 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionPropertiesTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.platformvalidation.models.CatalogAudience; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestInputDataType; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestOverallState; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestVersionProperties; +import org.junit.jupiter.api.Assertions; + +public final class ValidationTestVersionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ValidationTestVersionProperties model = BinaryData.fromString( + "{\"description\":\"vdcsitynn\",\"audience\":\"Internal\",\"provisioningState\":\"Canceled\",\"categoryIds\":[\"eh\",\"iqscjeypv\",\"ezrkgqhcjrefo\",\"gm\"],\"overallState\":\"Draft\",\"owners\":[\"yyvxyqjpkcattpn\",\"jcrcczsqpjhvmda\",\"v\",\"ysou\"],\"inputs\":[{\"name\":\"canoaeupf\",\"definition\":{\"description\":\"hltrpmopjmcmatuo\",\"type\":\"Integer\",\"required\":true,\"defaultValue\":\"uaodsfcpk\",\"allowedValues\":[\"dpuozmyz\",\"dagfuaxbezyiuok\",\"twhrdxwzywqsm\",\"surex\"]}}],\"contentHash\":\"o\",\"testStoreUri\":\"ocfs\"}") + .toObject(ValidationTestVersionProperties.class); + Assertions.assertEquals("vdcsitynn", model.description()); + Assertions.assertEquals(CatalogAudience.INTERNAL, model.audience()); + Assertions.assertEquals("eh", model.categoryIds().get(0)); + Assertions.assertEquals(ValidationTestOverallState.DRAFT, model.overallState()); + Assertions.assertEquals("yyvxyqjpkcattpn", model.owners().get(0)); + Assertions.assertEquals("canoaeupf", model.inputs().get(0).name()); + Assertions.assertEquals("hltrpmopjmcmatuo", model.inputs().get(0).definition().description()); + Assertions.assertEquals(ValidationTestInputDataType.INTEGER, model.inputs().get(0).definition().type()); + Assertions.assertTrue(model.inputs().get(0).definition().required()); + Assertions.assertEquals("uaodsfcpk", model.inputs().get(0).definition().defaultValue()); + Assertions.assertEquals("dpuozmyz", model.inputs().get(0).definition().allowedValues().get(0)); + Assertions.assertEquals("o", model.contentHash()); + Assertions.assertEquals("ocfs", model.testStoreUri()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionsGetWithResponseMockTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionsGetWithResponseMockTests.java new file mode 100644 index 000000000000..1405d5991dbd --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionsGetWithResponseMockTests.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.platformvalidation.PlatformValidationManager; +import com.azure.resourcemanager.platformvalidation.models.CatalogAudience; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestInputDataType; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestOverallState; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestVersion; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ValidationTestVersionsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"description\":\"pjflcxogao\",\"audience\":\"Internal\",\"provisioningState\":\"Failed\",\"categoryIds\":[\"ikvmkqzeqqk\",\"l\",\"fzxmhhvhgureodkw\",\"bdagxt\"],\"overallState\":\"Active\",\"owners\":[\"bxwakbog\",\"xndlkzgxhu\"],\"inputs\":[{\"name\":\"lbpodxunk\",\"definition\":{\"description\":\"bxmubyynt\",\"type\":\"Array\",\"required\":false,\"defaultValue\":\"koievseo\",\"allowedValues\":[\"rlltmuwlauwzizx\"]}},{\"name\":\"mpgcjefuzmuvpbt\",\"definition\":{\"description\":\"um\",\"type\":\"Boolean\",\"required\":false,\"defaultValue\":\"bmnzbtbhjpgl\",\"allowedValues\":[\"ohdneuel\",\"phsdyhto\",\"fikdowwqu\",\"v\"]}},{\"name\":\"zx\",\"definition\":{\"description\":\"vithh\",\"type\":\"Integer\",\"required\":false,\"defaultValue\":\"ggbhcohfwds\",\"allowedValues\":[\"aljutiiswac\"]}}],\"contentHash\":\"gdkz\",\"testStoreUri\":\"wkfvhqcrailvp\"},\"id\":\"pfuflrw\",\"name\":\"mh\",\"type\":\"lxyjr\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + PlatformValidationManager manager = PlatformValidationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ValidationTestVersion response = manager.validationTestVersions() + .getWithResponse("zhedplvwiw", "bmwmbesldnkw", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("pjflcxogao", response.properties().description()); + Assertions.assertEquals(CatalogAudience.INTERNAL, response.properties().audience()); + Assertions.assertEquals("ikvmkqzeqqk", response.properties().categoryIds().get(0)); + Assertions.assertEquals(ValidationTestOverallState.ACTIVE, response.properties().overallState()); + Assertions.assertEquals("bxwakbog", response.properties().owners().get(0)); + Assertions.assertEquals("lbpodxunk", response.properties().inputs().get(0).name()); + Assertions.assertEquals("bxmubyynt", response.properties().inputs().get(0).definition().description()); + Assertions.assertEquals(ValidationTestInputDataType.ARRAY, + response.properties().inputs().get(0).definition().type()); + Assertions.assertFalse(response.properties().inputs().get(0).definition().required()); + Assertions.assertEquals("koievseo", response.properties().inputs().get(0).definition().defaultValue()); + Assertions.assertEquals("rlltmuwlauwzizx", + response.properties().inputs().get(0).definition().allowedValues().get(0)); + Assertions.assertEquals("gdkz", response.properties().contentHash()); + Assertions.assertEquals("wkfvhqcrailvp", response.properties().testStoreUri()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionsListMockTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionsListMockTests.java new file mode 100644 index 000000000000..69a1f4c1a0ec --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestVersionsListMockTests.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.platformvalidation.PlatformValidationManager; +import com.azure.resourcemanager.platformvalidation.models.CatalogAudience; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestInputDataType; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestOverallState; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestVersion; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ValidationTestVersionsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"description\":\"edgfbcvkcvq\",\"audience\":\"Internal\",\"provisioningState\":\"Failed\",\"categoryIds\":[\"vdrhvoo\",\"sotbob\",\"dopcjwvnh\"],\"overallState\":\"Draft\",\"owners\":[\"gx\",\"xrslpm\",\"twuoegrpkhjwni\"],\"inputs\":[{\"name\":\"luicpdggkzzlvmbm\",\"definition\":{\"description\":\"xmodf\",\"type\":\"Object\",\"required\":false,\"defaultValue\":\"sbpfvmwyhr\",\"allowedValues\":[\"yftaakcpw\",\"yzvqt\"]}},{\"name\":\"nubexk\",\"definition\":{\"description\":\"ksmond\",\"type\":\"Number\",\"required\":false,\"defaultValue\":\"ypomgkopkwho\",\"allowedValues\":[\"ajqgxy\",\"mocmbqfqvmk\",\"xozap\"]}},{\"name\":\"helxprglya\",\"definition\":{\"description\":\"dckcbc\",\"type\":\"String\",\"required\":true,\"defaultValue\":\"gciqibrh\",\"allowedValues\":[\"sdqrhzoymibmrq\",\"ibahwflus\",\"dtmhrkwofyyvoqa\",\"piexpbtgiw\"]}}],\"contentHash\":\"oenwashr\",\"testStoreUri\":\"tkcnqxwb\"},\"id\":\"kulpiujwaasi\",\"name\":\"qiiobyuqer\",\"type\":\"qlpqwcciuq\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + PlatformValidationManager manager = PlatformValidationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.validationTestVersions().list("sag", "fcnihgwq", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("edgfbcvkcvq", response.iterator().next().properties().description()); + Assertions.assertEquals(CatalogAudience.INTERNAL, response.iterator().next().properties().audience()); + Assertions.assertEquals("vdrhvoo", response.iterator().next().properties().categoryIds().get(0)); + Assertions.assertEquals(ValidationTestOverallState.DRAFT, + response.iterator().next().properties().overallState()); + Assertions.assertEquals("gx", response.iterator().next().properties().owners().get(0)); + Assertions.assertEquals("luicpdggkzzlvmbm", response.iterator().next().properties().inputs().get(0).name()); + Assertions.assertEquals("xmodf", + response.iterator().next().properties().inputs().get(0).definition().description()); + Assertions.assertEquals(ValidationTestInputDataType.OBJECT, + response.iterator().next().properties().inputs().get(0).definition().type()); + Assertions.assertFalse(response.iterator().next().properties().inputs().get(0).definition().required()); + Assertions.assertEquals("sbpfvmwyhr", + response.iterator().next().properties().inputs().get(0).definition().defaultValue()); + Assertions.assertEquals("yftaakcpw", + response.iterator().next().properties().inputs().get(0).definition().allowedValues().get(0)); + Assertions.assertEquals("oenwashr", response.iterator().next().properties().contentHash()); + Assertions.assertEquals("tkcnqxwb", response.iterator().next().properties().testStoreUri()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestsGetWithResponseMockTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestsGetWithResponseMockTests.java new file mode 100644 index 000000000000..aeef952e124f --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestsGetWithResponseMockTests.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.platformvalidation.PlatformValidationManager; +import com.azure.resourcemanager.platformvalidation.models.CatalogAudience; +import com.azure.resourcemanager.platformvalidation.models.ValidationTest; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestInputDataType; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestOverallState; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ValidationTestsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"description\":\"cqibycnojv\",\"audience\":\"Internal\",\"provisioningState\":\"Succeeded\",\"categoryIds\":[\"gzva\",\"apj\",\"zhpvgqzcjrvxd\",\"zlmwlxkvugfhz\"],\"overallState\":\"Disabled\",\"owners\":[\"vzunluthnnprnxi\",\"eilpjzuaejxdu\",\"tskzbbtdzumveek\"],\"inputs\":[{\"name\":\"ozuhkfp\",\"definition\":{\"description\":\"jyofdxluusdtto\",\"type\":\"Number\",\"required\":false,\"defaultValue\":\"kqvkelnsmvbxwyjs\",\"allowedValues\":[\"hcaalnjix\",\"sxyawjoyaqcs\"]}},{\"name\":\"yjpkiidzyexz\",\"definition\":{\"description\":\"lixhnrztfol\",\"type\":\"Integer\",\"required\":true,\"defaultValue\":\"alaulppggdtpnapn\",\"allowedValues\":[\"opuhpig\",\"pgylg\",\"git\"]}}],\"testStoreUri\":\"edjvcslynqw\",\"currentVersion\":\"cwzzhxgktr\",\"latestPublishedVersion\":\"ucnapkteoellwp\",\"lastPublishedAt\":\"2021-07-15T21:53:29Z\"},\"id\":\"gpfqbuace\",\"name\":\"pzfqrhhuaoppp\",\"type\":\"qeqxo\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + PlatformValidationManager manager = PlatformValidationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ValidationTest response = manager.validationTests() + .getWithResponse("vxqtayriwwroyqbe", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("cqibycnojv", response.properties().description()); + Assertions.assertEquals(CatalogAudience.INTERNAL, response.properties().audience()); + Assertions.assertEquals("gzva", response.properties().categoryIds().get(0)); + Assertions.assertEquals(ValidationTestOverallState.DISABLED, response.properties().overallState()); + Assertions.assertEquals("vzunluthnnprnxi", response.properties().owners().get(0)); + Assertions.assertEquals("ozuhkfp", response.properties().inputs().get(0).name()); + Assertions.assertEquals("jyofdxluusdtto", response.properties().inputs().get(0).definition().description()); + Assertions.assertEquals(ValidationTestInputDataType.NUMBER, + response.properties().inputs().get(0).definition().type()); + Assertions.assertFalse(response.properties().inputs().get(0).definition().required()); + Assertions.assertEquals("kqvkelnsmvbxwyjs", response.properties().inputs().get(0).definition().defaultValue()); + Assertions.assertEquals("hcaalnjix", response.properties().inputs().get(0).definition().allowedValues().get(0)); + Assertions.assertEquals("edjvcslynqw", response.properties().testStoreUri()); + Assertions.assertEquals("cwzzhxgktr", response.properties().currentVersion()); + Assertions.assertEquals("ucnapkteoellwp", response.properties().latestPublishedVersion()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-15T21:53:29Z"), response.properties().lastPublishedAt()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestsListMockTests.java b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestsListMockTests.java new file mode 100644 index 000000000000..efacecb4c44d --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/src/test/java/com/azure/resourcemanager/platformvalidation/generated/ValidationTestsListMockTests.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.platformvalidation.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.platformvalidation.PlatformValidationManager; +import com.azure.resourcemanager.platformvalidation.models.CatalogAudience; +import com.azure.resourcemanager.platformvalidation.models.ValidationTest; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestInputDataType; +import com.azure.resourcemanager.platformvalidation.models.ValidationTestOverallState; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ValidationTestsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"description\":\"zxctobgb\",\"audience\":\"Public\",\"provisioningState\":\"Canceled\",\"categoryIds\":[\"ostmgrcf\",\"unrmfqjhhkxb\",\"vjymjhxxjyngud\",\"vkr\"],\"overallState\":\"Published\",\"owners\":[\"qzvszjf\",\"uvjfdxxive\",\"vtcqaqtdo\"],\"inputs\":[{\"name\":\"bxvwv\",\"definition\":{\"description\":\"slqb\",\"type\":\"String\",\"required\":false,\"defaultValue\":\"lyt\",\"allowedValues\":[\"mpew\",\"wfbkrvrns\",\"shqjohxcrsbf\"]}},{\"name\":\"vasrruvwb\",\"definition\":{\"description\":\"qfsubcgjbirx\",\"type\":\"Array\",\"required\":true,\"defaultValue\":\"fbjfdtwssotftpvj\",\"allowedValues\":[\"xilzznf\",\"q\",\"vwpm\",\"taruoujmkcj\"]}},{\"name\":\"wqytjrybnwjewgdr\",\"definition\":{\"description\":\"rvnaenqpeh\",\"type\":\"Array\",\"required\":false,\"defaultValue\":\"mifthnzdnd\",\"allowedValues\":[\"nayqi\",\"ynduha\",\"hqlkthumaqo\"]}},{\"name\":\"bgycduiertgccym\",\"definition\":{\"description\":\"olpsslqlf\",\"type\":\"String\",\"required\":true,\"defaultValue\":\"glzpswiydm\",\"allowedValues\":[\"hzdxssadbzm\"]}}],\"testStoreUri\":\"dfznudaodv\",\"currentVersion\":\"bncblylpstdbhhx\",\"latestPublishedVersion\":\"zdzucerscdntnevf\",\"lastPublishedAt\":\"2021-05-10T05:26:40Z\"},\"id\":\"ygtdsslswt\",\"name\":\"weriofzpyqsem\",\"type\":\"abnetshh\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + PlatformValidationManager manager = PlatformValidationManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.validationTests().list("z", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("zxctobgb", response.iterator().next().properties().description()); + Assertions.assertEquals(CatalogAudience.PUBLIC, response.iterator().next().properties().audience()); + Assertions.assertEquals("ostmgrcf", response.iterator().next().properties().categoryIds().get(0)); + Assertions.assertEquals(ValidationTestOverallState.PUBLISHED, + response.iterator().next().properties().overallState()); + Assertions.assertEquals("qzvszjf", response.iterator().next().properties().owners().get(0)); + Assertions.assertEquals("bxvwv", response.iterator().next().properties().inputs().get(0).name()); + Assertions.assertEquals("slqb", + response.iterator().next().properties().inputs().get(0).definition().description()); + Assertions.assertEquals(ValidationTestInputDataType.STRING, + response.iterator().next().properties().inputs().get(0).definition().type()); + Assertions.assertFalse(response.iterator().next().properties().inputs().get(0).definition().required()); + Assertions.assertEquals("lyt", + response.iterator().next().properties().inputs().get(0).definition().defaultValue()); + Assertions.assertEquals("mpew", + response.iterator().next().properties().inputs().get(0).definition().allowedValues().get(0)); + Assertions.assertEquals("dfznudaodv", response.iterator().next().properties().testStoreUri()); + Assertions.assertEquals("bncblylpstdbhhx", response.iterator().next().properties().currentVersion()); + Assertions.assertEquals("zdzucerscdntnevf", response.iterator().next().properties().latestPublishedVersion()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-10T05:26:40Z"), + response.iterator().next().properties().lastPublishedAt()); + } +} diff --git a/sdk/platformvalidation/azure-resourcemanager-platformvalidation/tsp-location.yaml b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/tsp-location.yaml new file mode 100644 index 000000000000..e24e70a34715 --- /dev/null +++ b/sdk/platformvalidation/azure-resourcemanager-platformvalidation/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/platformvalidation/resource-manager/Microsoft.PlatformValidation/PlatformValidation +commit: 127674911f4714c636d2c6495b7959d094d05dff +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/platformvalidation/ci.yml b/sdk/platformvalidation/ci.yml new file mode 100644 index 000000000000..eda34586d4c1 --- /dev/null +++ b/sdk/platformvalidation/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/platformvalidation/ci.yml + - sdk/platformvalidation/azure-resourcemanager-platformvalidation/ + exclude: + - sdk/platformvalidation/pom.xml + - sdk/platformvalidation/azure-resourcemanager-platformvalidation/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/platformvalidation/ci.yml + - sdk/platformvalidation/azure-resourcemanager-platformvalidation/ + exclude: + - sdk/platformvalidation/pom.xml + - sdk/platformvalidation/azure-resourcemanager-platformvalidation/pom.xml + +parameters: + - name: release_azureresourcemanagerplatformvalidation + displayName: azure-resourcemanager-platformvalidation + type: boolean + default: false + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: platformvalidation + Artifacts: + - name: azure-resourcemanager-platformvalidation + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerplatformvalidation + releaseInBatch: ${{ parameters.release_azureresourcemanagerplatformvalidation }} diff --git a/sdk/platformvalidation/pom.xml b/sdk/platformvalidation/pom.xml new file mode 100644 index 000000000000..efd084b9eb91 --- /dev/null +++ b/sdk/platformvalidation/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + com.azure + azure-platformvalidation-service + pom + 1.0.0 + + + azure-resourcemanager-platformvalidation + +