diff --git a/sdk/nginx/azure-resourcemanager-nginx/CHANGELOG.md b/sdk/nginx/azure-resourcemanager-nginx/CHANGELOG.md index 369c502903b3c..51944ddadbf92 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/CHANGELOG.md +++ b/sdk/nginx/azure-resourcemanager-nginx/CHANGELOG.md @@ -1,14 +1,187 @@ # Release History -## 1.1.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2024-08-27) + +- Azure Resource Manager Nginx client library for Java. This package contains Microsoft Azure SDK for Nginx Management SDK. Package tag package-2024-06-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 -### Breaking Changes +* `models.AnalysisCreateConfig` was added + +* `models.ScaleProfileCapacity` was added + +* `models.WebApplicationFirewallSettings` was added + +* `models.AnalysisDiagnostic` was added + +* `models.NginxDeploymentPropertiesNginxAppProtect` was added + +* `models.NginxCertificateErrorResponseBody` was added + +* `models.WebApplicationFirewallComponentVersions` was added + +* `models.WebApplicationFirewallStatus` was added + +* `models.ActivationState` was added + +* `models.WebApplicationFirewallPackage` was added + +* `models.AutoUpgradeProfile` was added + +* `models.NginxDeploymentUpdatePropertiesNginxAppProtect` was added + +* `models.AnalysisCreate` was added + +* `models.ScaleProfile` was added + +* `models.AnalysisResultData` was added + +* `models.AnalysisResult` was added + +#### `models.IdentityProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OperationListResult` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.NginxConfigurationFile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.UserIdentityProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NginxNetworkInterfaceConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.NginxDeploymentListResponse` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.NginxDeploymentScalingProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `profiles()` was added +* `withProfiles(java.util.List)` was added + +#### `models.NginxConfigurationListResponse` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NginxDeploymentUpdateParameters` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NginxFrontendIpConfiguration` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.Configurations` was modified + +* `analysisWithResponse(java.lang.String,java.lang.String,java.lang.String,models.AnalysisCreate,com.azure.core.util.Context)` was added +* `analysis(java.lang.String,java.lang.String,java.lang.String)` was added + +#### `models.OperationDisplay` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NginxDeploymentUserProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NginxPublicIpAddress` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NginxConfigurationPackage` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.NginxDeploymentUpdateProperties` was modified + +* `nginxAppProtect()` was added +* `autoUpgradeProfile()` was added +* `withNginxAppProtect(models.NginxDeploymentUpdatePropertiesNginxAppProtect)` was added +* `withAutoUpgradeProfile(models.AutoUpgradeProfile)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.NginxLogging` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NginxDeploymentProperties` was modified + +* `autoUpgradeProfile()` was added +* `nginxAppProtect()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `withAutoUpgradeProfile(models.AutoUpgradeProfile)` was added +* `withNginxAppProtect(models.NginxDeploymentPropertiesNginxAppProtect)` was added + +#### `models.ResourceSku` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NginxCertificateProperties` was modified + +* `certificateError()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `keyVaultSecretCreated()` was added +* `sha1Thumbprint()` was added +* `withCertificateError(models.NginxCertificateErrorResponseBody)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `keyVaultSecretVersion()` was added + +#### `models.NginxNetworkProfile` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NginxStorageAccount` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NginxCertificateListResponse` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NginxConfiguration` was modified + +* `analysis()` was added +* `analysisWithResponse(models.AnalysisCreate,com.azure.core.util.Context)` was added + +#### `models.NginxConfigurationProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added -### Bugs Fixed +#### `models.NginxPrivateIpAddress` was modified -### Other Changes +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added ## 1.1.0-beta.1 (2024-05-20) diff --git a/sdk/nginx/azure-resourcemanager-nginx/README.md b/sdk/nginx/azure-resourcemanager-nginx/README.md index b602cd6db2067..d59cd8ca23f7a 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/README.md +++ b/sdk/nginx/azure-resourcemanager-nginx/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Nginx client library for Java. -This package contains Microsoft Azure SDK for Nginx Management SDK. Package tag package-2024-01-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Nginx Management SDK. Package tag package-2024-06-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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-nginx - 1.1.0-beta.1 + 1.1.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. -- `AZURE_CLIENT_ID` for Azure client ID. -- `AZURE_TENANT_ID` for Azure tenant ID. -- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. - -With above configuration, `azure` client can be authenticated using the following code: +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -97,6 +93,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [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 diff --git a/sdk/nginx/azure-resourcemanager-nginx/SAMPLE.md b/sdk/nginx/azure-resourcemanager-nginx/SAMPLE.md index 780e9b2d34aae..021475ebacf95 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/SAMPLE.md +++ b/sdk/nginx/azure-resourcemanager-nginx/SAMPLE.md @@ -31,14 +31,13 @@ ### Certificates_CreateOrUpdate ```java -import com.azure.resourcemanager.nginx.models.NginxCertificateProperties; - /** * Samples for Certificates CreateOrUpdate. */ public final class CertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Certificates_CreateOrUpdate.json + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/ + * Certificates_CreateOrUpdate.json */ /** * Sample code: Certificates_CreateOrUpdate. @@ -49,9 +48,6 @@ public final class CertificatesCreateOrUpdateSamples { manager.certificates() .define("default") .withExistingNginxDeployment("myResourceGroup", "myDeployment") - .withProperties(new NginxCertificateProperties().withKeyVirtualPath("fakeTokenPlaceholder") - .withCertificateVirtualPath("/src/cert/somePath.cert") - .withKeyVaultSecretId("fakeTokenPlaceholder")) .create(); } } @@ -65,7 +61,8 @@ public final class CertificatesCreateOrUpdateSamples { */ public final class CertificatesDeleteSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Certificates_Delete.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Certificates_Delete.json */ /** * Sample code: Certificates_Delete. @@ -86,7 +83,8 @@ public final class CertificatesDeleteSamples { */ public final class CertificatesGetSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Certificates_Get.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Certificates_Get.json */ /** * Sample code: Certificates_Get. @@ -108,7 +106,8 @@ public final class CertificatesGetSamples { */ public final class CertificatesListSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Certificates_List.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Certificates_List.json */ /** * Sample code: Certificates_List. @@ -124,18 +123,15 @@ public final class CertificatesListSamples { ### Configurations_Analysis ```java -import com.azure.resourcemanager.nginx.models.AnalysisCreate; -import com.azure.resourcemanager.nginx.models.AnalysisCreateConfig; -import com.azure.resourcemanager.nginx.models.NginxConfigurationFile; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import java.util.Arrays; /** * Samples for Configurations Analysis. */ public final class ConfigurationsAnalysisSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Configurations_Analysis.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Configurations_Analysis. + * json */ /** * Sample code: Configurations_Analysis. @@ -144,12 +140,7 @@ public final class ConfigurationsAnalysisSamples { */ public static void configurationsAnalysis(com.azure.resourcemanager.nginx.NginxManager manager) { manager.configurations() - .analysisWithResponse("myResourceGroup", "myDeployment", "default", - new AnalysisCreate().withConfig(new AnalysisCreateConfig().withRootFile("/etc/nginx/nginx.conf") - .withFiles(Arrays.asList( - new NginxConfigurationFile().withContent("ABCDEF==").withVirtualPath("/etc/nginx/nginx.conf"))) - .withPackageProperty(new NginxConfigurationPackage())), - com.azure.core.util.Context.NONE); + .analysisWithResponse("myResourceGroup", "myDeployment", "default", null, com.azure.core.util.Context.NONE); } } ``` @@ -157,17 +148,13 @@ public final class ConfigurationsAnalysisSamples { ### Configurations_CreateOrUpdate ```java -import com.azure.resourcemanager.nginx.models.NginxConfigurationFile; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import com.azure.resourcemanager.nginx.models.NginxConfigurationProperties; -import java.util.Arrays; - /** * Samples for Configurations CreateOrUpdate. */ public final class ConfigurationsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Configurations_CreateOrUpdate.json + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/ + * Configurations_CreateOrUpdate.json */ /** * Sample code: Configurations_CreateOrUpdate. @@ -178,11 +165,6 @@ public final class ConfigurationsCreateOrUpdateSamples { manager.configurations() .define("default") .withExistingNginxDeployment("myResourceGroup", "myDeployment") - .withProperties(new NginxConfigurationProperties() - .withFiles(Arrays.asList( - new NginxConfigurationFile().withContent("ABCDEF==").withVirtualPath("/etc/nginx/nginx.conf"))) - .withPackageProperty(new NginxConfigurationPackage()) - .withRootFile("/etc/nginx/nginx.conf")) .create(); } } @@ -196,7 +178,9 @@ public final class ConfigurationsCreateOrUpdateSamples { */ public final class ConfigurationsDeleteSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Configurations_Delete.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Configurations_Delete. + * json */ /** * Sample code: Configurations_Delete. @@ -217,7 +201,8 @@ public final class ConfigurationsDeleteSamples { */ public final class ConfigurationsGetSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Configurations_Get.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Configurations_Get.json */ /** * Sample code: Configurations_Get. @@ -239,7 +224,8 @@ public final class ConfigurationsGetSamples { */ public final class ConfigurationsListSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Configurations_List.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Configurations_List.json */ /** * Sample code: Configurations_List. @@ -255,26 +241,13 @@ public final class ConfigurationsListSamples { ### Deployments_CreateOrUpdate ```java -import com.azure.resourcemanager.nginx.models.AutoUpgradeProfile; -import com.azure.resourcemanager.nginx.models.NginxDeploymentProperties; -import com.azure.resourcemanager.nginx.models.NginxDeploymentScalingProperties; -import com.azure.resourcemanager.nginx.models.NginxDeploymentUserProfile; -import com.azure.resourcemanager.nginx.models.NginxFrontendIpConfiguration; -import com.azure.resourcemanager.nginx.models.NginxNetworkInterfaceConfiguration; -import com.azure.resourcemanager.nginx.models.NginxNetworkProfile; -import com.azure.resourcemanager.nginx.models.NginxPrivateIpAddress; -import com.azure.resourcemanager.nginx.models.NginxPrivateIpAllocationMethod; -import com.azure.resourcemanager.nginx.models.NginxPublicIpAddress; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - /** * Samples for Deployments CreateOrUpdate. */ public final class DeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Deployments_Create.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Deployments_Create.json */ /** * Sample code: Deployments_Create. @@ -284,38 +257,10 @@ public final class DeploymentsCreateOrUpdateSamples { public static void deploymentsCreate(com.azure.resourcemanager.nginx.NginxManager manager) { manager.deployments() .define("myDeployment") - .withRegion("West US") + .withRegion((String) null) .withExistingResourceGroup("myResourceGroup") - .withTags(mapOf("Environment", "Dev")) - .withProperties(new NginxDeploymentProperties().withManagedResourceGroup("myManagedResourceGroup") - .withNetworkProfile(new NginxNetworkProfile() - .withFrontEndIpConfiguration(new NginxFrontendIpConfiguration() - .withPublicIpAddresses(Arrays.asList(new NginxPublicIpAddress().withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/myPublicIPAddress"))) - .withPrivateIpAddresses(Arrays.asList(new NginxPrivateIpAddress() - .withPrivateIpAddress("1.1.1.1") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.STATIC) - .withSubnetId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")))) - .withNetworkInterfaceConfiguration(new NginxNetworkInterfaceConfiguration().withSubnetId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"))) - .withScalingProperties(new NginxDeploymentScalingProperties().withCapacity(10)) - .withAutoUpgradeProfile(new AutoUpgradeProfile().withUpgradeChannel("stable")) - .withUserProfile(new NginxDeploymentUserProfile().withPreferredEmail("example@example.email"))) .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; - } } ``` @@ -327,7 +272,8 @@ public final class DeploymentsCreateOrUpdateSamples { */ public final class DeploymentsDeleteSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Deployments_Delete.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Deployments_Delete.json */ /** * Sample code: Deployments_Delete. @@ -348,7 +294,8 @@ public final class DeploymentsDeleteSamples { */ public final class DeploymentsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Deployments_Get.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Deployments_Get.json */ /** * Sample code: Deployments_Get. @@ -361,7 +308,8 @@ public final class DeploymentsGetByResourceGroupSamples { } /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Deployments_Get_AutoScale.json + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/ + * Deployments_Get_AutoScale.json */ /** * Sample code: Deployments_Get_AutoScale. @@ -383,7 +331,8 @@ public final class DeploymentsGetByResourceGroupSamples { */ public final class DeploymentsListSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Deployments_List.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Deployments_List.json */ /** * Sample code: Deployments_List. @@ -404,7 +353,8 @@ public final class DeploymentsListSamples { */ public final class DeploymentsListByResourceGroupSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Deployments_ListByResourceGroup.json + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/ + * Deployments_ListByResourceGroup.json */ /** * Sample code: Deployments_ListByResourceGroup. @@ -421,15 +371,14 @@ public final class DeploymentsListByResourceGroupSamples { ```java import com.azure.resourcemanager.nginx.models.NginxDeployment; -import java.util.HashMap; -import java.util.Map; /** * Samples for Deployments Update. */ public final class DeploymentsUpdateSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Deployments_Update.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Deployments_Update.json */ /** * Sample code: Deployments_Update. @@ -440,19 +389,7 @@ public final class DeploymentsUpdateSamples { NginxDeployment resource = manager.deployments() .getByResourceGroupWithResponse("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withTags(mapOf("Environment", "Dev")).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; + resource.update().apply(); } } ``` @@ -465,7 +402,8 @@ public final class DeploymentsUpdateSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Operations_List.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Operations_List.json */ /** * Sample code: Operations_List. diff --git a/sdk/nginx/azure-resourcemanager-nginx/pom.xml b/sdk/nginx/azure-resourcemanager-nginx/pom.xml index a76f48c720450..25fa1b9ad180e 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/pom.xml +++ b/sdk/nginx/azure-resourcemanager-nginx/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for Nginx Management - This package contains Microsoft Azure SDK for Nginx Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-01-01-preview. + This package contains Microsoft Azure SDK for Nginx Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-06-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -48,6 +48,11 @@ true + + com.azure + azure-json + 1.2.0 + com.azure azure-core diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/NginxManager.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/NginxManager.java index a5b3029c0277e..11f9e7a9749fc 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/NginxManager.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/NginxManager.java @@ -216,7 +216,7 @@ public NginxManager authenticate(TokenCredential credential, AzureProfile profil .append("-") .append("com.azure.resourcemanager.nginx") .append("/") - .append("1.1.0-beta.1"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/OperationsClient.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/OperationsClient.java index 63a12124e50d3..c9bd16b9f55e2 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/OperationsClient.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/OperationsClient.java @@ -15,7 +15,7 @@ */ public interface OperationsClient { /** - * List all operations provided by Nginx.NginxPlus for the 2024-01-01-preview api version. + * List all operations provided by Nginx.NginxPlus for the 2024-06-01-preview api version. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -26,7 +26,7 @@ public interface OperationsClient { PagedIterable list(); /** - * List all operations provided by Nginx.NginxPlus for the 2024-01-01-preview api version. + * List all operations provided by Nginx.NginxPlus for the 2024-06-01-preview api version. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/AnalysisResultInner.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/AnalysisResultInner.java index 49fdc8c0e4c55..0e15a54b3d7c9 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/AnalysisResultInner.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/AnalysisResultInner.java @@ -6,24 +6,26 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.nginx.models.AnalysisResultData; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The response body for an analysis request. Contains the status of the analysis and any errors. */ @Fluent -public final class AnalysisResultInner { +public final class AnalysisResultInner implements JsonSerializable { /* * The status of the analysis. */ - @JsonProperty(value = "status", required = true) private String status; /* * The data property. */ - @JsonProperty(value = "data") private AnalysisResultData data; /** @@ -88,4 +90,44 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(AnalysisResultInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeJsonField("data", this.data); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalysisResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalysisResultInner 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 AnalysisResultInner. + */ + public static AnalysisResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalysisResultInner deserializedAnalysisResultInner = new AnalysisResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedAnalysisResultInner.status = reader.getString(); + } else if ("data".equals(fieldName)) { + deserializedAnalysisResultInner.data = AnalysisResultData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAnalysisResultInner; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxCertificateInner.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxCertificateInner.java index d05ed34fedad8..ad3f72c0c980b 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxCertificateInner.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxCertificateInner.java @@ -7,8 +7,11 @@ 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.nginx.models.NginxCertificateProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The NginxCertificate model. @@ -18,21 +21,33 @@ public final class NginxCertificateInner extends ProxyResource { /* * The properties property. */ - @JsonProperty(value = "properties") private NginxCertificateProperties properties; /* * The location property. */ - @JsonProperty(value = "location") private String location; /* * Metadata pertaining to creation and last modification of the resource. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of NginxCertificateInner class. */ @@ -88,6 +103,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. * @@ -98,4 +143,52 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxCertificateInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxCertificateInner 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 NginxCertificateInner. + */ + public static NginxCertificateInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxCertificateInner deserializedNginxCertificateInner = new NginxCertificateInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNginxCertificateInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNginxCertificateInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNginxCertificateInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNginxCertificateInner.properties = NginxCertificateProperties.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedNginxCertificateInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedNginxCertificateInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxCertificateInner; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxConfigurationInner.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxConfigurationInner.java index e9b16634caad0..a678bd3554fae 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxConfigurationInner.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxConfigurationInner.java @@ -7,8 +7,11 @@ 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.nginx.models.NginxConfigurationProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * The NginxConfiguration model. @@ -18,21 +21,33 @@ public final class NginxConfigurationInner extends ProxyResource { /* * The properties property. */ - @JsonProperty(value = "properties") private NginxConfigurationProperties properties; /* * The location property. */ - @JsonProperty(value = "location") private String location; /* * Metadata pertaining to creation and last modification of the resource. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of NginxConfigurationInner class. */ @@ -88,6 +103,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * Validates the instance. * @@ -98,4 +143,52 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxConfigurationInner 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 NginxConfigurationInner. + */ + public static NginxConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxConfigurationInner deserializedNginxConfigurationInner = new NginxConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNginxConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNginxConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNginxConfigurationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNginxConfigurationInner.properties = NginxConfigurationProperties.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedNginxConfigurationInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedNginxConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxConfigurationInner; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentInner.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentInner.java index 2031edc46582e..745c802a645c3 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentInner.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentInner.java @@ -7,10 +7,13 @@ 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.nginx.models.IdentityProperties; import com.azure.resourcemanager.nginx.models.NginxDeploymentProperties; import com.azure.resourcemanager.nginx.models.ResourceSku; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; /** @@ -21,27 +24,38 @@ public final class NginxDeploymentInner extends Resource { /* * The identity property. */ - @JsonProperty(value = "identity") private IdentityProperties identity; /* * The properties property. */ - @JsonProperty(value = "properties") private NginxDeploymentProperties properties; /* * The sku property. */ - @JsonProperty(value = "sku") private ResourceSku sku; /* * Metadata pertaining to creation and last modification of the resource. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /* + * The name of the resource. + */ + private String name; + + /* + * The type of the resource. + */ + private String type; + /** * Creates an instance of NginxDeploymentInner class. */ @@ -117,6 +131,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + /** * {@inheritDoc} */ @@ -151,4 +195,62 @@ public void validate() { sku().validate(); } } + + /** + * {@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("identity", this.identity); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("sku", this.sku); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxDeploymentInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentInner 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 NginxDeploymentInner. + */ + public static NginxDeploymentInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentInner deserializedNginxDeploymentInner = new NginxDeploymentInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNginxDeploymentInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNginxDeploymentInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNginxDeploymentInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNginxDeploymentInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNginxDeploymentInner.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedNginxDeploymentInner.identity = IdentityProperties.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedNginxDeploymentInner.properties = NginxDeploymentProperties.fromJson(reader); + } else if ("sku".equals(fieldName)) { + deserializedNginxDeploymentInner.sku = ResourceSku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNginxDeploymentInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentInner; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentScalingPropertiesAutoScaleSettings.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentScalingPropertiesAutoScaleSettings.java index fe799b05ec174..18272c09b5c6f 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentScalingPropertiesAutoScaleSettings.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentScalingPropertiesAutoScaleSettings.java @@ -6,8 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.nginx.models.ScaleProfile; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** @@ -15,11 +19,11 @@ * empty. */ @Fluent -public final class NginxDeploymentScalingPropertiesAutoScaleSettings { +public final class NginxDeploymentScalingPropertiesAutoScaleSettings + implements JsonSerializable { /* * The profiles property. */ - @JsonProperty(value = "profiles", required = true) private List profiles; /** @@ -65,4 +69,43 @@ public void validate() { private static final ClientLogger LOGGER = new ClientLogger(NginxDeploymentScalingPropertiesAutoScaleSettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("profiles", this.profiles, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxDeploymentScalingPropertiesAutoScaleSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentScalingPropertiesAutoScaleSettings 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 NginxDeploymentScalingPropertiesAutoScaleSettings. + */ + public static NginxDeploymentScalingPropertiesAutoScaleSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentScalingPropertiesAutoScaleSettings deserializedNginxDeploymentScalingPropertiesAutoScaleSettings + = new NginxDeploymentScalingPropertiesAutoScaleSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("profiles".equals(fieldName)) { + List profiles = reader.readArray(reader1 -> ScaleProfile.fromJson(reader1)); + deserializedNginxDeploymentScalingPropertiesAutoScaleSettings.profiles = profiles; + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentScalingPropertiesAutoScaleSettings; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/OperationResultInner.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/OperationResultInner.java index 850d26d4c9bc5..624a3ec16a28b 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/OperationResultInner.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/OperationResultInner.java @@ -5,30 +5,31 @@ package com.azure.resourcemanager.nginx.fluent.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 com.azure.resourcemanager.nginx.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * A Nginx.NginxPlus REST API operation. */ @Fluent -public final class OperationResultInner { +public final class OperationResultInner implements JsonSerializable { /* * Operation name: {provider}/{resource}/{operation} */ - @JsonProperty(value = "name") private String name; /* * The object that represents the operation. */ - @JsonProperty(value = "display") private OperationDisplay display; /* * Indicates whether the operation is a data action */ - @JsonProperty(value = "isDataAction") private Boolean isDataAction; /** @@ -107,4 +108,46 @@ public void validate() { display().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("display", this.display); + jsonWriter.writeBooleanField("isDataAction", this.isDataAction); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationResultInner 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 OperationResultInner. + */ + public static OperationResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationResultInner deserializedOperationResultInner = new OperationResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationResultInner.name = reader.getString(); + } else if ("display".equals(fieldName)) { + deserializedOperationResultInner.display = OperationDisplay.fromJson(reader); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationResultInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationResultInner; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/CertificatesClientImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/CertificatesClientImpl.java index 439266765f644..14126560be267 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/CertificatesClientImpl.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/CertificatesClientImpl.java @@ -911,9 +911,7 @@ public PagedIterable list(String resourceGroupName, Strin /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -938,9 +936,7 @@ private Mono> listNextSinglePageAsync(Strin /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/ConfigurationsClientImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/ConfigurationsClientImpl.java index 5fb23c0eb4e97..b77984118a414 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/ConfigurationsClientImpl.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/ConfigurationsClientImpl.java @@ -1110,9 +1110,7 @@ public AnalysisResultInner analysis(String resourceGroupName, String deploymentN /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -1137,9 +1135,7 @@ private Mono> listNextSinglePageAsync(Str /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/DeploymentsClientImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/DeploymentsClientImpl.java index 2574062b46f98..e000914c8d27e 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/DeploymentsClientImpl.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/DeploymentsClientImpl.java @@ -1227,9 +1227,7 @@ public PagedIterable listByResourceGroup(String resourceGr /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -1254,9 +1252,7 @@ private Mono> listNextSinglePageAsync(String /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -1282,9 +1278,7 @@ private Mono> listNextSinglePageAsync(String /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -1311,9 +1305,7 @@ private Mono> listByResourceGroupNextSingleP /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxManagementClientImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxManagementClientImpl.java index c3d57779131e4..c8daf574b6963 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxManagementClientImpl.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxManagementClientImpl.java @@ -199,7 +199,7 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-01-01-preview"; + this.apiVersion = "2024-06-01-preview"; this.certificates = new CertificatesClientImpl(this); this.configurations = new ConfigurationsClientImpl(this); this.deployments = new DeploymentsClientImpl(this); diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationsClientImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationsClientImpl.java index 840c9ebd875b6..eb5ef98317bd1 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationsClientImpl.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationsClientImpl.java @@ -78,7 +78,7 @@ Mono> listNext(@PathParam(value = "nextLink", enco } /** - * List all operations provided by Nginx.NginxPlus for the 2024-01-01-preview api version. + * List all operations provided by Nginx.NginxPlus for the 2024-06-01-preview api version. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -101,7 +101,7 @@ private Mono> listSinglePageAsync() { } /** - * List all operations provided by Nginx.NginxPlus for the 2024-01-01-preview api version. + * List all operations provided by Nginx.NginxPlus for the 2024-06-01-preview api version. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,7 +124,7 @@ private Mono> listSinglePageAsync(Context co } /** - * List all operations provided by Nginx.NginxPlus for the 2024-01-01-preview api version. + * List all operations provided by Nginx.NginxPlus for the 2024-06-01-preview api version. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -136,7 +136,7 @@ private PagedFlux listAsync() { } /** - * List all operations provided by Nginx.NginxPlus for the 2024-01-01-preview api version. + * List all operations provided by Nginx.NginxPlus for the 2024-06-01-preview api version. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -151,7 +151,7 @@ private PagedFlux listAsync(Context context) { } /** - * List all operations provided by Nginx.NginxPlus for the 2024-01-01-preview api version. + * List all operations provided by Nginx.NginxPlus for the 2024-06-01-preview api version. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -164,7 +164,7 @@ public PagedIterable list() { } /** - * List all operations provided by Nginx.NginxPlus for the 2024-01-01-preview api version. + * List all operations provided by Nginx.NginxPlus for the 2024-06-01-preview api version. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -181,9 +181,7 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. @@ -209,9 +207,7 @@ private Mono> listNextSinglePageAsync(String /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @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. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ActivationState.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ActivationState.java new file mode 100644 index 0000000000000..042cbf437d2e5 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ActivationState.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The activation state of the WAF. Use 'Enabled' to enable the WAF and 'Disabled' to disable it. + */ +public final class ActivationState extends ExpandableStringEnum { + /** + * Static value Enabled for ActivationState. + */ + public static final ActivationState ENABLED = fromString("Enabled"); + + /** + * Static value Disabled for ActivationState. + */ + public static final ActivationState DISABLED = fromString("Disabled"); + + /** + * Creates a new instance of ActivationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActivationState() { + } + + /** + * Creates or finds a ActivationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActivationState. + */ + public static ActivationState fromString(String name) { + return fromString(name, ActivationState.class); + } + + /** + * Gets known ActivationState values. + * + * @return known ActivationState values. + */ + public static Collection values() { + return values(ActivationState.class); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisCreate.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisCreate.java index 4bae1a99e4f12..11fef865899a6 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisCreate.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisCreate.java @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +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 request body for creating an analysis for an NGINX configuration. */ @Fluent -public final class AnalysisCreate { +public final class AnalysisCreate implements JsonSerializable { /* * The config property. */ - @JsonProperty(value = "config", required = true) private AnalysisCreateConfig config; /** @@ -60,4 +63,41 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(AnalysisCreate.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("config", this.config); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalysisCreate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalysisCreate 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 AnalysisCreate. + */ + public static AnalysisCreate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalysisCreate deserializedAnalysisCreate = new AnalysisCreate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("config".equals(fieldName)) { + deserializedAnalysisCreate.config = AnalysisCreateConfig.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAnalysisCreate; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisCreateConfig.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisCreateConfig.java index 104390d46c805..66886dc556420 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisCreateConfig.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisCreateConfig.java @@ -5,36 +5,36 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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; /** * The AnalysisCreateConfig model. */ @Fluent -public final class AnalysisCreateConfig { +public final class AnalysisCreateConfig implements JsonSerializable { /* * The root file of the NGINX config file(s). It must match one of the files' filepath. */ - @JsonProperty(value = "rootFile") private String rootFile; /* * The files property. */ - @JsonProperty(value = "files") private List files; /* * The protectedFiles property. */ - @JsonProperty(value = "protectedFiles") private List protectedFiles; /* * The package property. */ - @JsonProperty(value = "package") private NginxConfigurationPackage packageProperty; /** @@ -139,4 +139,54 @@ public void validate() { packageProperty().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("rootFile", this.rootFile); + jsonWriter.writeArrayField("files", this.files, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("protectedFiles", this.protectedFiles, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("package", this.packageProperty); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalysisCreateConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalysisCreateConfig 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 AnalysisCreateConfig. + */ + public static AnalysisCreateConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalysisCreateConfig deserializedAnalysisCreateConfig = new AnalysisCreateConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rootFile".equals(fieldName)) { + deserializedAnalysisCreateConfig.rootFile = reader.getString(); + } else if ("files".equals(fieldName)) { + List files + = reader.readArray(reader1 -> NginxConfigurationFile.fromJson(reader1)); + deserializedAnalysisCreateConfig.files = files; + } else if ("protectedFiles".equals(fieldName)) { + List protectedFiles + = reader.readArray(reader1 -> NginxConfigurationFile.fromJson(reader1)); + deserializedAnalysisCreateConfig.protectedFiles = protectedFiles; + } else if ("package".equals(fieldName)) { + deserializedAnalysisCreateConfig.packageProperty = NginxConfigurationPackage.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAnalysisCreateConfig; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisDiagnostic.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisDiagnostic.java index 3c93181c45240..c3a571d6196c3 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisDiagnostic.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisDiagnostic.java @@ -6,53 +6,50 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * An error object found during the analysis of an NGINX configuration. */ @Fluent -public final class AnalysisDiagnostic { +public final class AnalysisDiagnostic implements JsonSerializable { /* * Unique identifier for the error */ - @JsonProperty(value = "id") private String id; /* * The directive property. */ - @JsonProperty(value = "directive", required = true) private String directive; /* * The description property. */ - @JsonProperty(value = "description", required = true) private String description; /* * the filepath of the most relevant config file */ - @JsonProperty(value = "file", required = true) private String file; /* * The line property. */ - @JsonProperty(value = "line", required = true) private float line; /* * The message property. */ - @JsonProperty(value = "message", required = true) private String message; /* * The rule property. */ - @JsonProperty(value = "rule", required = true) private String rule; /** @@ -230,4 +227,59 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(AnalysisDiagnostic.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("directive", this.directive); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("file", this.file); + jsonWriter.writeFloatField("line", this.line); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeStringField("rule", this.rule); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalysisDiagnostic from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalysisDiagnostic 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 AnalysisDiagnostic. + */ + public static AnalysisDiagnostic fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalysisDiagnostic deserializedAnalysisDiagnostic = new AnalysisDiagnostic(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("directive".equals(fieldName)) { + deserializedAnalysisDiagnostic.directive = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedAnalysisDiagnostic.description = reader.getString(); + } else if ("file".equals(fieldName)) { + deserializedAnalysisDiagnostic.file = reader.getString(); + } else if ("line".equals(fieldName)) { + deserializedAnalysisDiagnostic.line = reader.getFloat(); + } else if ("message".equals(fieldName)) { + deserializedAnalysisDiagnostic.message = reader.getString(); + } else if ("rule".equals(fieldName)) { + deserializedAnalysisDiagnostic.rule = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedAnalysisDiagnostic.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAnalysisDiagnostic; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisResultData.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisResultData.java index 97b5e7ea75253..7ddfa92b5fd0f 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisResultData.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisResultData.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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; /** * The AnalysisResultData model. */ @Fluent -public final class AnalysisResultData { +public final class AnalysisResultData implements JsonSerializable { /* * The errors property. */ - @JsonProperty(value = "errors") private List errors; /** @@ -55,4 +58,41 @@ public void validate() { errors().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AnalysisResultData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AnalysisResultData 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 AnalysisResultData. + */ + public static AnalysisResultData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AnalysisResultData deserializedAnalysisResultData = new AnalysisResultData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("errors".equals(fieldName)) { + List errors = reader.readArray(reader1 -> AnalysisDiagnostic.fromJson(reader1)); + deserializedAnalysisResultData.errors = errors; + } else { + reader.skipChildren(); + } + } + + return deserializedAnalysisResultData; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AutoUpgradeProfile.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AutoUpgradeProfile.java index 51f1d28d99312..9be87a2d66f45 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AutoUpgradeProfile.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AutoUpgradeProfile.java @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Autoupgrade settings of a deployment. */ @Fluent -public final class AutoUpgradeProfile { +public final class AutoUpgradeProfile implements JsonSerializable { /* * Channel used for autoupgrade. */ - @JsonProperty(value = "upgradeChannel", required = true) private String upgradeChannel; /** @@ -59,4 +62,41 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(AutoUpgradeProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("upgradeChannel", this.upgradeChannel); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AutoUpgradeProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AutoUpgradeProfile 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 AutoUpgradeProfile. + */ + public static AutoUpgradeProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AutoUpgradeProfile deserializedAutoUpgradeProfile = new AutoUpgradeProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("upgradeChannel".equals(fieldName)) { + deserializedAutoUpgradeProfile.upgradeChannel = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAutoUpgradeProfile; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/IdentityProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/IdentityProperties.java index cff0ae4423e97..d5c34d2ab24a7 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/IdentityProperties.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/IdentityProperties.java @@ -5,38 +5,36 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +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 IdentityProperties model. */ @Fluent -public final class IdentityProperties { +public final class IdentityProperties implements JsonSerializable { /* * The principalId property. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private String principalId; /* * The tenantId property. */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) private String tenantId; /* * The type property. */ - @JsonProperty(value = "type") private IdentityType type; /* * Dictionary of */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map userAssignedIdentities; /** @@ -117,4 +115,50 @@ public void validate() { }); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IdentityProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IdentityProperties 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 IdentityProperties. + */ + public static IdentityProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IdentityProperties deserializedIdentityProperties = new IdentityProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedIdentityProperties.principalId = reader.getString(); + } else if ("tenantId".equals(fieldName)) { + deserializedIdentityProperties.tenantId = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedIdentityProperties.type = IdentityType.fromString(reader.getString()); + } else if ("userAssignedIdentities".equals(fieldName)) { + Map userAssignedIdentities + = reader.readMap(reader1 -> UserIdentityProperties.fromJson(reader1)); + deserializedIdentityProperties.userAssignedIdentities = userAssignedIdentities; + } else { + reader.skipChildren(); + } + } + + return deserializedIdentityProperties; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/IdentityType.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/IdentityType.java index a236b15b9b8eb..169737ba494b3 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/IdentityType.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/IdentityType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -47,7 +46,6 @@ public IdentityType() { * @param name a name to look for. * @return the corresponding IdentityType. */ - @JsonCreator public static IdentityType fromString(String name) { return fromString(name, IdentityType.class); } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateErrorResponseBody.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateErrorResponseBody.java index 1bdfdc28151b7..7b682e5a9ce13 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateErrorResponseBody.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateErrorResponseBody.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 NginxCertificateErrorResponseBody model. */ @Fluent -public final class NginxCertificateErrorResponseBody { +public final class NginxCertificateErrorResponseBody implements JsonSerializable { /* * The code property. */ - @JsonProperty(value = "code") private String code; /* * The message property. */ - @JsonProperty(value = "message") private String message; /** @@ -77,4 +79,44 @@ public NginxCertificateErrorResponseBody withMessage(String message) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxCertificateErrorResponseBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxCertificateErrorResponseBody 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 NginxCertificateErrorResponseBody. + */ + public static NginxCertificateErrorResponseBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxCertificateErrorResponseBody deserializedNginxCertificateErrorResponseBody + = new NginxCertificateErrorResponseBody(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedNginxCertificateErrorResponseBody.code = reader.getString(); + } else if ("message".equals(fieldName)) { + deserializedNginxCertificateErrorResponseBody.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxCertificateErrorResponseBody; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateListResponse.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateListResponse.java index 6d4f3a82f45ae..6bdc7aa6a911a 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateListResponse.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateListResponse.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.nginx.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 com.azure.resourcemanager.nginx.fluent.models.NginxCertificateInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The NginxCertificateListResponse model. */ @Fluent -public final class NginxCertificateListResponse { +public final class NginxCertificateListResponse implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The nextLink property. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@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 NginxCertificateListResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxCertificateListResponse 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 NginxCertificateListResponse. + */ + public static NginxCertificateListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxCertificateListResponse deserializedNginxCertificateListResponse = new NginxCertificateListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NginxCertificateInner.fromJson(reader1)); + deserializedNginxCertificateListResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNginxCertificateListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxCertificateListResponse; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateProperties.java index 4ea219bea0fd6..b70bf2fb879fc 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateProperties.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificateProperties.java @@ -5,60 +5,57 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.time.OffsetDateTime; /** * The NginxCertificateProperties model. */ @Fluent -public final class NginxCertificateProperties { +public final class NginxCertificateProperties implements JsonSerializable { /* * The provisioningState property. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * The keyVirtualPath property. */ - @JsonProperty(value = "keyVirtualPath") private String keyVirtualPath; /* * The certificateVirtualPath property. */ - @JsonProperty(value = "certificateVirtualPath") private String certificateVirtualPath; /* * The keyVaultSecretId property. */ - @JsonProperty(value = "keyVaultSecretId") private String keyVaultSecretId; /* * The sha1Thumbprint property. */ - @JsonProperty(value = "sha1Thumbprint", access = JsonProperty.Access.WRITE_ONLY) private String sha1Thumbprint; /* * The keyVaultSecretVersion property. */ - @JsonProperty(value = "keyVaultSecretVersion", access = JsonProperty.Access.WRITE_ONLY) private String keyVaultSecretVersion; /* * The keyVaultSecretCreated property. */ - @JsonProperty(value = "keyVaultSecretCreated", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime keyVaultSecretCreated; /* * The certificateError property. */ - @JsonProperty(value = "certificateError") private NginxCertificateErrorResponseBody certificateError; /** @@ -193,4 +190,60 @@ public void validate() { certificateError().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyVirtualPath", this.keyVirtualPath); + jsonWriter.writeStringField("certificateVirtualPath", this.certificateVirtualPath); + jsonWriter.writeStringField("keyVaultSecretId", this.keyVaultSecretId); + jsonWriter.writeJsonField("certificateError", this.certificateError); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxCertificateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxCertificateProperties 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 NginxCertificateProperties. + */ + public static NginxCertificateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxCertificateProperties deserializedNginxCertificateProperties = new NginxCertificateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedNginxCertificateProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("keyVirtualPath".equals(fieldName)) { + deserializedNginxCertificateProperties.keyVirtualPath = reader.getString(); + } else if ("certificateVirtualPath".equals(fieldName)) { + deserializedNginxCertificateProperties.certificateVirtualPath = reader.getString(); + } else if ("keyVaultSecretId".equals(fieldName)) { + deserializedNginxCertificateProperties.keyVaultSecretId = reader.getString(); + } else if ("sha1Thumbprint".equals(fieldName)) { + deserializedNginxCertificateProperties.sha1Thumbprint = reader.getString(); + } else if ("keyVaultSecretVersion".equals(fieldName)) { + deserializedNginxCertificateProperties.keyVaultSecretVersion = reader.getString(); + } else if ("keyVaultSecretCreated".equals(fieldName)) { + deserializedNginxCertificateProperties.keyVaultSecretCreated = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("certificateError".equals(fieldName)) { + deserializedNginxCertificateProperties.certificateError + = NginxCertificateErrorResponseBody.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxCertificateProperties; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationFile.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationFile.java index 9195b1706b606..bc8cfcaab18e4 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationFile.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationFile.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 NginxConfigurationFile model. */ @Fluent -public final class NginxConfigurationFile { +public final class NginxConfigurationFile implements JsonSerializable { /* * The content property. */ - @JsonProperty(value = "content") private String content; /* * The virtualPath property. */ - @JsonProperty(value = "virtualPath") private String virtualPath; /** @@ -77,4 +79,43 @@ public NginxConfigurationFile withVirtualPath(String virtualPath) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeStringField("virtualPath", this.virtualPath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxConfigurationFile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxConfigurationFile 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 NginxConfigurationFile. + */ + public static NginxConfigurationFile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxConfigurationFile deserializedNginxConfigurationFile = new NginxConfigurationFile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("content".equals(fieldName)) { + deserializedNginxConfigurationFile.content = reader.getString(); + } else if ("virtualPath".equals(fieldName)) { + deserializedNginxConfigurationFile.virtualPath = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxConfigurationFile; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationListResponse.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationListResponse.java index 6b368a36e840b..5e325d00d9816 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationListResponse.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationListResponse.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.nginx.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 com.azure.resourcemanager.nginx.fluent.models.NginxConfigurationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Response of a list operation. */ @Fluent -public final class NginxConfigurationListResponse { +public final class NginxConfigurationListResponse implements JsonSerializable { /* * Results of a list operation. */ - @JsonProperty(value = "value") private List value; /* * Link to the next set of results, if any. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,46 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@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 NginxConfigurationListResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxConfigurationListResponse 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 NginxConfigurationListResponse. + */ + public static NginxConfigurationListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxConfigurationListResponse deserializedNginxConfigurationListResponse + = new NginxConfigurationListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NginxConfigurationInner.fromJson(reader1)); + deserializedNginxConfigurationListResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNginxConfigurationListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxConfigurationListResponse; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationPackage.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationPackage.java index ae97b53f5bd86..c4c6987582085 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationPackage.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationPackage.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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; /** * The NginxConfigurationPackage model. */ @Fluent -public final class NginxConfigurationPackage { +public final class NginxConfigurationPackage implements JsonSerializable { /* * The data property. */ - @JsonProperty(value = "data") private String data; /* * The protectedFiles property. */ - @JsonProperty(value = "protectedFiles") private List protectedFiles; /** @@ -78,4 +80,45 @@ public NginxConfigurationPackage withProtectedFiles(List protectedFiles) */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("data", this.data); + jsonWriter.writeArrayField("protectedFiles", this.protectedFiles, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxConfigurationPackage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxConfigurationPackage 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 NginxConfigurationPackage. + */ + public static NginxConfigurationPackage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxConfigurationPackage deserializedNginxConfigurationPackage = new NginxConfigurationPackage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("data".equals(fieldName)) { + deserializedNginxConfigurationPackage.data = reader.getString(); + } else if ("protectedFiles".equals(fieldName)) { + List protectedFiles = reader.readArray(reader1 -> reader1.getString()); + deserializedNginxConfigurationPackage.protectedFiles = protectedFiles; + } else { + reader.skipChildren(); + } + } + + return deserializedNginxConfigurationPackage; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationProperties.java index e2b9d03a8f9bf..392e091d60043 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationProperties.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationProperties.java @@ -5,42 +5,41 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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; /** * The NginxConfigurationProperties model. */ @Fluent -public final class NginxConfigurationProperties { +public final class NginxConfigurationProperties implements JsonSerializable { /* * The provisioningState property. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * The files property. */ - @JsonProperty(value = "files") private List files; /* * The protectedFiles property. */ - @JsonProperty(value = "protectedFiles") private List protectedFiles; /* * The package property. */ - @JsonProperty(value = "package") private NginxConfigurationPackage packageProperty; /* * The rootFile property. */ - @JsonProperty(value = "rootFile") private String rootFile; /** @@ -154,4 +153,58 @@ public void validate() { packageProperty().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("files", this.files, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("protectedFiles", this.protectedFiles, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("package", this.packageProperty); + jsonWriter.writeStringField("rootFile", this.rootFile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxConfigurationProperties 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 NginxConfigurationProperties. + */ + public static NginxConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxConfigurationProperties deserializedNginxConfigurationProperties = new NginxConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedNginxConfigurationProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("files".equals(fieldName)) { + List files + = reader.readArray(reader1 -> NginxConfigurationFile.fromJson(reader1)); + deserializedNginxConfigurationProperties.files = files; + } else if ("protectedFiles".equals(fieldName)) { + List protectedFiles + = reader.readArray(reader1 -> NginxConfigurationFile.fromJson(reader1)); + deserializedNginxConfigurationProperties.protectedFiles = protectedFiles; + } else if ("package".equals(fieldName)) { + deserializedNginxConfigurationProperties.packageProperty + = NginxConfigurationPackage.fromJson(reader); + } else if ("rootFile".equals(fieldName)) { + deserializedNginxConfigurationProperties.rootFile = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxConfigurationProperties; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentListResponse.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentListResponse.java index 687c1e2161878..414e6e86c3818 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentListResponse.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentListResponse.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.nginx.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 com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The NginxDeploymentListResponse model. */ @Fluent -public final class NginxDeploymentListResponse { +public final class NginxDeploymentListResponse implements JsonSerializable { /* * The value property. */ - @JsonProperty(value = "value") private List value; /* * The nextLink property. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@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 NginxDeploymentListResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentListResponse 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 NginxDeploymentListResponse. + */ + public static NginxDeploymentListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentListResponse deserializedNginxDeploymentListResponse = new NginxDeploymentListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NginxDeploymentInner.fromJson(reader1)); + deserializedNginxDeploymentListResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNginxDeploymentListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentListResponse; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentProperties.java index 181650903e1dc..404ba9167ca24 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentProperties.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentProperties.java @@ -5,73 +5,72 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 NginxDeploymentProperties model. */ @Fluent -public final class NginxDeploymentProperties { +public final class NginxDeploymentProperties implements JsonSerializable { /* * The provisioningState property. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /* * The nginxVersion property. */ - @JsonProperty(value = "nginxVersion", access = JsonProperty.Access.WRITE_ONLY) private String nginxVersion; /* * The managed resource group to deploy VNet injection related network resources. */ - @JsonProperty(value = "managedResourceGroup") private String managedResourceGroup; /* * The networkProfile property. */ - @JsonProperty(value = "networkProfile") private NginxNetworkProfile networkProfile; /* * The IP address of the deployment. */ - @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) private String ipAddress; /* * The enableDiagnosticsSupport property. */ - @JsonProperty(value = "enableDiagnosticsSupport") private Boolean enableDiagnosticsSupport; /* * The logging property. */ - @JsonProperty(value = "logging") private NginxLogging logging; /* * Information on how the deployment will be scaled. */ - @JsonProperty(value = "scalingProperties") private NginxDeploymentScalingProperties scalingProperties; /* * Autoupgrade settings of a deployment. */ - @JsonProperty(value = "autoUpgradeProfile") private AutoUpgradeProfile autoUpgradeProfile; /* * The userProfile property. */ - @JsonProperty(value = "userProfile") private NginxDeploymentUserProfile userProfile; + /* + * Settings for NGINX App Protect (NAP) + */ + private NginxDeploymentPropertiesNginxAppProtect nginxAppProtect; + /** * Creates an instance of NginxDeploymentProperties class. */ @@ -247,6 +246,26 @@ public NginxDeploymentProperties withUserProfile(NginxDeploymentUserProfile user return this; } + /** + * Get the nginxAppProtect property: Settings for NGINX App Protect (NAP). + * + * @return the nginxAppProtect value. + */ + public NginxDeploymentPropertiesNginxAppProtect nginxAppProtect() { + return this.nginxAppProtect; + } + + /** + * Set the nginxAppProtect property: Settings for NGINX App Protect (NAP). + * + * @param nginxAppProtect the nginxAppProtect value to set. + * @return the NginxDeploymentProperties object itself. + */ + public NginxDeploymentProperties withNginxAppProtect(NginxDeploymentPropertiesNginxAppProtect nginxAppProtect) { + this.nginxAppProtect = nginxAppProtect; + return this; + } + /** * Validates the instance. * @@ -268,5 +287,75 @@ public void validate() { if (userProfile() != null) { userProfile().validate(); } + if (nginxAppProtect() != null) { + nginxAppProtect().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("managedResourceGroup", this.managedResourceGroup); + jsonWriter.writeJsonField("networkProfile", this.networkProfile); + jsonWriter.writeBooleanField("enableDiagnosticsSupport", this.enableDiagnosticsSupport); + jsonWriter.writeJsonField("logging", this.logging); + jsonWriter.writeJsonField("scalingProperties", this.scalingProperties); + jsonWriter.writeJsonField("autoUpgradeProfile", this.autoUpgradeProfile); + jsonWriter.writeJsonField("userProfile", this.userProfile); + jsonWriter.writeJsonField("nginxAppProtect", this.nginxAppProtect); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxDeploymentProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentProperties 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 NginxDeploymentProperties. + */ + public static NginxDeploymentProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentProperties deserializedNginxDeploymentProperties = new NginxDeploymentProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedNginxDeploymentProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("nginxVersion".equals(fieldName)) { + deserializedNginxDeploymentProperties.nginxVersion = reader.getString(); + } else if ("managedResourceGroup".equals(fieldName)) { + deserializedNginxDeploymentProperties.managedResourceGroup = reader.getString(); + } else if ("networkProfile".equals(fieldName)) { + deserializedNginxDeploymentProperties.networkProfile = NginxNetworkProfile.fromJson(reader); + } else if ("ipAddress".equals(fieldName)) { + deserializedNginxDeploymentProperties.ipAddress = reader.getString(); + } else if ("enableDiagnosticsSupport".equals(fieldName)) { + deserializedNginxDeploymentProperties.enableDiagnosticsSupport + = reader.getNullable(JsonReader::getBoolean); + } else if ("logging".equals(fieldName)) { + deserializedNginxDeploymentProperties.logging = NginxLogging.fromJson(reader); + } else if ("scalingProperties".equals(fieldName)) { + deserializedNginxDeploymentProperties.scalingProperties + = NginxDeploymentScalingProperties.fromJson(reader); + } else if ("autoUpgradeProfile".equals(fieldName)) { + deserializedNginxDeploymentProperties.autoUpgradeProfile = AutoUpgradeProfile.fromJson(reader); + } else if ("userProfile".equals(fieldName)) { + deserializedNginxDeploymentProperties.userProfile = NginxDeploymentUserProfile.fromJson(reader); + } else if ("nginxAppProtect".equals(fieldName)) { + deserializedNginxDeploymentProperties.nginxAppProtect + = NginxDeploymentPropertiesNginxAppProtect.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentProperties; + }); } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentPropertiesNginxAppProtect.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentPropertiesNginxAppProtect.java new file mode 100644 index 0000000000000..c91903f50bf8a --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentPropertiesNginxAppProtect.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Settings for NGINX App Protect (NAP). + */ +@Fluent +public final class NginxDeploymentPropertiesNginxAppProtect + implements JsonSerializable { + /* + * Settings for the NGINX App Protect Web Application Firewall (WAF) + */ + private WebApplicationFirewallSettings webApplicationFirewallSettings; + + /* + * The status of the NGINX App Protect Web Application Firewall + */ + private WebApplicationFirewallStatus webApplicationFirewallStatus; + + /** + * Creates an instance of NginxDeploymentPropertiesNginxAppProtect class. + */ + public NginxDeploymentPropertiesNginxAppProtect() { + } + + /** + * Get the webApplicationFirewallSettings property: Settings for the NGINX App Protect Web Application Firewall + * (WAF). + * + * @return the webApplicationFirewallSettings value. + */ + public WebApplicationFirewallSettings webApplicationFirewallSettings() { + return this.webApplicationFirewallSettings; + } + + /** + * Set the webApplicationFirewallSettings property: Settings for the NGINX App Protect Web Application Firewall + * (WAF). + * + * @param webApplicationFirewallSettings the webApplicationFirewallSettings value to set. + * @return the NginxDeploymentPropertiesNginxAppProtect object itself. + */ + public NginxDeploymentPropertiesNginxAppProtect + withWebApplicationFirewallSettings(WebApplicationFirewallSettings webApplicationFirewallSettings) { + this.webApplicationFirewallSettings = webApplicationFirewallSettings; + return this; + } + + /** + * Get the webApplicationFirewallStatus property: The status of the NGINX App Protect Web Application Firewall. + * + * @return the webApplicationFirewallStatus value. + */ + public WebApplicationFirewallStatus webApplicationFirewallStatus() { + return this.webApplicationFirewallStatus; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (webApplicationFirewallSettings() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property webApplicationFirewallSettings in model NginxDeploymentPropertiesNginxAppProtect")); + } else { + webApplicationFirewallSettings().validate(); + } + if (webApplicationFirewallStatus() != null) { + webApplicationFirewallStatus().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NginxDeploymentPropertiesNginxAppProtect.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("webApplicationFirewallSettings", this.webApplicationFirewallSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxDeploymentPropertiesNginxAppProtect from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentPropertiesNginxAppProtect 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 NginxDeploymentPropertiesNginxAppProtect. + */ + public static NginxDeploymentPropertiesNginxAppProtect fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentPropertiesNginxAppProtect deserializedNginxDeploymentPropertiesNginxAppProtect + = new NginxDeploymentPropertiesNginxAppProtect(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("webApplicationFirewallSettings".equals(fieldName)) { + deserializedNginxDeploymentPropertiesNginxAppProtect.webApplicationFirewallSettings + = WebApplicationFirewallSettings.fromJson(reader); + } else if ("webApplicationFirewallStatus".equals(fieldName)) { + deserializedNginxDeploymentPropertiesNginxAppProtect.webApplicationFirewallStatus + = WebApplicationFirewallStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentPropertiesNginxAppProtect; + }); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentScalingProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentScalingProperties.java index 86a3b6afd9781..62ce08643beca 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentScalingProperties.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentScalingProperties.java @@ -5,25 +5,28 @@ package com.azure.resourcemanager.nginx.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 com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentScalingPropertiesAutoScaleSettings; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Information on how the deployment will be scaled. */ @Fluent -public final class NginxDeploymentScalingProperties { +public final class NginxDeploymentScalingProperties implements JsonSerializable { /* * The capacity property. */ - @JsonProperty(value = "capacity") private Integer capacity; /* - * The settings for enabling automatic scaling of the deployment. If this field is specified, 'scale.capacity' must be empty. + * The settings for enabling automatic scaling of the deployment. If this field is specified, 'scale.capacity' must + * be empty. */ - @JsonProperty(value = "autoScaleSettings") private NginxDeploymentScalingPropertiesAutoScaleSettings innerAutoScaleSettings; /** @@ -95,4 +98,45 @@ public void validate() { innerAutoScaleSettings().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("capacity", this.capacity); + jsonWriter.writeJsonField("autoScaleSettings", this.innerAutoScaleSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxDeploymentScalingProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentScalingProperties 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 NginxDeploymentScalingProperties. + */ + public static NginxDeploymentScalingProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentScalingProperties deserializedNginxDeploymentScalingProperties + = new NginxDeploymentScalingProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("capacity".equals(fieldName)) { + deserializedNginxDeploymentScalingProperties.capacity = reader.getNullable(JsonReader::getInt); + } else if ("autoScaleSettings".equals(fieldName)) { + deserializedNginxDeploymentScalingProperties.innerAutoScaleSettings + = NginxDeploymentScalingPropertiesAutoScaleSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentScalingProperties; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdateParameters.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdateParameters.java index 7f4ded4b0533d..a09e239a93e13 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdateParameters.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdateParameters.java @@ -5,44 +5,41 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +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 NginxDeploymentUpdateParameters model. */ @Fluent -public final class NginxDeploymentUpdateParameters { +public final class NginxDeploymentUpdateParameters implements JsonSerializable { /* * The identity property. */ - @JsonProperty(value = "identity") private IdentityProperties identity; /* * Dictionary of */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* * The sku property. */ - @JsonProperty(value = "sku") private ResourceSku sku; /* * The location property. */ - @JsonProperty(value = "location") private String location; /* * The properties property. */ - @JsonProperty(value = "properties") private NginxDeploymentUpdateProperties properties; /** @@ -167,4 +164,55 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxDeploymentUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentUpdateParameters 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 NginxDeploymentUpdateParameters. + */ + public static NginxDeploymentUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentUpdateParameters deserializedNginxDeploymentUpdateParameters + = new NginxDeploymentUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identity".equals(fieldName)) { + deserializedNginxDeploymentUpdateParameters.identity = IdentityProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNginxDeploymentUpdateParameters.tags = tags; + } else if ("sku".equals(fieldName)) { + deserializedNginxDeploymentUpdateParameters.sku = ResourceSku.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedNginxDeploymentUpdateParameters.location = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNginxDeploymentUpdateParameters.properties + = NginxDeploymentUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentUpdateParameters; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdateProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdateProperties.java index 1df790889663a..02910c1403bde 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdateProperties.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdateProperties.java @@ -5,43 +5,47 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 NginxDeploymentUpdateProperties model. */ @Fluent -public final class NginxDeploymentUpdateProperties { +public final class NginxDeploymentUpdateProperties implements JsonSerializable { /* * The enableDiagnosticsSupport property. */ - @JsonProperty(value = "enableDiagnosticsSupport") private Boolean enableDiagnosticsSupport; /* * The logging property. */ - @JsonProperty(value = "logging") private NginxLogging logging; /* * Information on how the deployment will be scaled. */ - @JsonProperty(value = "scalingProperties") private NginxDeploymentScalingProperties scalingProperties; /* * The userProfile property. */ - @JsonProperty(value = "userProfile") private NginxDeploymentUserProfile userProfile; /* * Autoupgrade settings of a deployment. */ - @JsonProperty(value = "autoUpgradeProfile") private AutoUpgradeProfile autoUpgradeProfile; + /* + * Update settings for NGINX App Protect (NAP) + */ + private NginxDeploymentUpdatePropertiesNginxAppProtect nginxAppProtect; + /** * Creates an instance of NginxDeploymentUpdateProperties class. */ @@ -148,6 +152,27 @@ public NginxDeploymentUpdateProperties withAutoUpgradeProfile(AutoUpgradeProfile return this; } + /** + * Get the nginxAppProtect property: Update settings for NGINX App Protect (NAP). + * + * @return the nginxAppProtect value. + */ + public NginxDeploymentUpdatePropertiesNginxAppProtect nginxAppProtect() { + return this.nginxAppProtect; + } + + /** + * Set the nginxAppProtect property: Update settings for NGINX App Protect (NAP). + * + * @param nginxAppProtect the nginxAppProtect value to set. + * @return the NginxDeploymentUpdateProperties object itself. + */ + public NginxDeploymentUpdateProperties + withNginxAppProtect(NginxDeploymentUpdatePropertiesNginxAppProtect nginxAppProtect) { + this.nginxAppProtect = nginxAppProtect; + return this; + } + /** * Validates the instance. * @@ -166,5 +191,65 @@ public void validate() { if (autoUpgradeProfile() != null) { autoUpgradeProfile().validate(); } + if (nginxAppProtect() != null) { + nginxAppProtect().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enableDiagnosticsSupport", this.enableDiagnosticsSupport); + jsonWriter.writeJsonField("logging", this.logging); + jsonWriter.writeJsonField("scalingProperties", this.scalingProperties); + jsonWriter.writeJsonField("userProfile", this.userProfile); + jsonWriter.writeJsonField("autoUpgradeProfile", this.autoUpgradeProfile); + jsonWriter.writeJsonField("nginxAppProtect", this.nginxAppProtect); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxDeploymentUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentUpdateProperties 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 NginxDeploymentUpdateProperties. + */ + public static NginxDeploymentUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentUpdateProperties deserializedNginxDeploymentUpdateProperties + = new NginxDeploymentUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableDiagnosticsSupport".equals(fieldName)) { + deserializedNginxDeploymentUpdateProperties.enableDiagnosticsSupport + = reader.getNullable(JsonReader::getBoolean); + } else if ("logging".equals(fieldName)) { + deserializedNginxDeploymentUpdateProperties.logging = NginxLogging.fromJson(reader); + } else if ("scalingProperties".equals(fieldName)) { + deserializedNginxDeploymentUpdateProperties.scalingProperties + = NginxDeploymentScalingProperties.fromJson(reader); + } else if ("userProfile".equals(fieldName)) { + deserializedNginxDeploymentUpdateProperties.userProfile + = NginxDeploymentUserProfile.fromJson(reader); + } else if ("autoUpgradeProfile".equals(fieldName)) { + deserializedNginxDeploymentUpdateProperties.autoUpgradeProfile + = AutoUpgradeProfile.fromJson(reader); + } else if ("nginxAppProtect".equals(fieldName)) { + deserializedNginxDeploymentUpdateProperties.nginxAppProtect + = NginxDeploymentUpdatePropertiesNginxAppProtect.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentUpdateProperties; + }); } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdatePropertiesNginxAppProtect.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdatePropertiesNginxAppProtect.java new file mode 100644 index 0000000000000..1768e1e1bfb44 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdatePropertiesNginxAppProtect.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.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; + +/** + * Update settings for NGINX App Protect (NAP). + */ +@Fluent +public final class NginxDeploymentUpdatePropertiesNginxAppProtect + implements JsonSerializable { + /* + * Settings for the NGINX App Protect Web Application Firewall (WAF) + */ + private WebApplicationFirewallSettings webApplicationFirewallSettings; + + /** + * Creates an instance of NginxDeploymentUpdatePropertiesNginxAppProtect class. + */ + public NginxDeploymentUpdatePropertiesNginxAppProtect() { + } + + /** + * Get the webApplicationFirewallSettings property: Settings for the NGINX App Protect Web Application Firewall + * (WAF). + * + * @return the webApplicationFirewallSettings value. + */ + public WebApplicationFirewallSettings webApplicationFirewallSettings() { + return this.webApplicationFirewallSettings; + } + + /** + * Set the webApplicationFirewallSettings property: Settings for the NGINX App Protect Web Application Firewall + * (WAF). + * + * @param webApplicationFirewallSettings the webApplicationFirewallSettings value to set. + * @return the NginxDeploymentUpdatePropertiesNginxAppProtect object itself. + */ + public NginxDeploymentUpdatePropertiesNginxAppProtect + withWebApplicationFirewallSettings(WebApplicationFirewallSettings webApplicationFirewallSettings) { + this.webApplicationFirewallSettings = webApplicationFirewallSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (webApplicationFirewallSettings() != null) { + webApplicationFirewallSettings().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("webApplicationFirewallSettings", this.webApplicationFirewallSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxDeploymentUpdatePropertiesNginxAppProtect from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentUpdatePropertiesNginxAppProtect 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 NginxDeploymentUpdatePropertiesNginxAppProtect. + */ + public static NginxDeploymentUpdatePropertiesNginxAppProtect fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentUpdatePropertiesNginxAppProtect deserializedNginxDeploymentUpdatePropertiesNginxAppProtect + = new NginxDeploymentUpdatePropertiesNginxAppProtect(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("webApplicationFirewallSettings".equals(fieldName)) { + deserializedNginxDeploymentUpdatePropertiesNginxAppProtect.webApplicationFirewallSettings + = WebApplicationFirewallSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentUpdatePropertiesNginxAppProtect; + }); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUserProfile.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUserProfile.java index 0673a76ea431e..38d12e6eb9fc8 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUserProfile.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUserProfile.java @@ -5,17 +5,21 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 NginxDeploymentUserProfile model. */ @Fluent -public final class NginxDeploymentUserProfile { +public final class NginxDeploymentUserProfile implements JsonSerializable { /* - * The preferred support contact email address of the user used for sending alerts and notification. Can be an empty string or a valid email address. + * The preferred support contact email address of the user used for sending alerts and notification. Can be an empty + * string or a valid email address. */ - @JsonProperty(value = "preferredEmail") private String preferredEmail; /** @@ -53,4 +57,40 @@ public NginxDeploymentUserProfile withPreferredEmail(String preferredEmail) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("preferredEmail", this.preferredEmail); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxDeploymentUserProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentUserProfile 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 NginxDeploymentUserProfile. + */ + public static NginxDeploymentUserProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentUserProfile deserializedNginxDeploymentUserProfile = new NginxDeploymentUserProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("preferredEmail".equals(fieldName)) { + deserializedNginxDeploymentUserProfile.preferredEmail = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentUserProfile; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxFrontendIpConfiguration.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxFrontendIpConfiguration.java index 44d9b7f79e25f..e156910eb28cf 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxFrontendIpConfiguration.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxFrontendIpConfiguration.java @@ -5,24 +5,26 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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; /** * The NginxFrontendIpConfiguration model. */ @Fluent -public final class NginxFrontendIpConfiguration { +public final class NginxFrontendIpConfiguration implements JsonSerializable { /* * The publicIPAddresses property. */ - @JsonProperty(value = "publicIPAddresses") private List publicIpAddresses; /* * The privateIPAddresses property. */ - @JsonProperty(value = "privateIPAddresses") private List privateIpAddresses; /** @@ -84,4 +86,49 @@ public void validate() { privateIpAddresses().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("publicIPAddresses", this.publicIpAddresses, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("privateIPAddresses", this.privateIpAddresses, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxFrontendIpConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxFrontendIpConfiguration 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 NginxFrontendIpConfiguration. + */ + public static NginxFrontendIpConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxFrontendIpConfiguration deserializedNginxFrontendIpConfiguration = new NginxFrontendIpConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("publicIPAddresses".equals(fieldName)) { + List publicIpAddresses + = reader.readArray(reader1 -> NginxPublicIpAddress.fromJson(reader1)); + deserializedNginxFrontendIpConfiguration.publicIpAddresses = publicIpAddresses; + } else if ("privateIPAddresses".equals(fieldName)) { + List privateIpAddresses + = reader.readArray(reader1 -> NginxPrivateIpAddress.fromJson(reader1)); + deserializedNginxFrontendIpConfiguration.privateIpAddresses = privateIpAddresses; + } else { + reader.skipChildren(); + } + } + + return deserializedNginxFrontendIpConfiguration; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxLogging.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxLogging.java index 1769ff01f7ea5..7739d08b00267 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxLogging.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxLogging.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 NginxLogging model. */ @Fluent -public final class NginxLogging { +public final class NginxLogging implements JsonSerializable { /* * The storageAccount property. */ - @JsonProperty(value = "storageAccount") private NginxStorageAccount storageAccount; /** @@ -54,4 +57,40 @@ public void validate() { storageAccount().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("storageAccount", this.storageAccount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxLogging from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxLogging 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 NginxLogging. + */ + public static NginxLogging fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxLogging deserializedNginxLogging = new NginxLogging(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("storageAccount".equals(fieldName)) { + deserializedNginxLogging.storageAccount = NginxStorageAccount.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxLogging; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxNetworkInterfaceConfiguration.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxNetworkInterfaceConfiguration.java index e3149e77617e0..1163a4f1783b7 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxNetworkInterfaceConfiguration.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxNetworkInterfaceConfiguration.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 NginxNetworkInterfaceConfiguration model. */ @Fluent -public final class NginxNetworkInterfaceConfiguration { +public final class NginxNetworkInterfaceConfiguration implements JsonSerializable { /* * The subnetId property. */ - @JsonProperty(value = "subnetId") private String subnetId; /** @@ -51,4 +54,41 @@ public NginxNetworkInterfaceConfiguration withSubnetId(String subnetId) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subnetId", this.subnetId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxNetworkInterfaceConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxNetworkInterfaceConfiguration 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 NginxNetworkInterfaceConfiguration. + */ + public static NginxNetworkInterfaceConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxNetworkInterfaceConfiguration deserializedNginxNetworkInterfaceConfiguration + = new NginxNetworkInterfaceConfiguration(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subnetId".equals(fieldName)) { + deserializedNginxNetworkInterfaceConfiguration.subnetId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxNetworkInterfaceConfiguration; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxNetworkProfile.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxNetworkProfile.java index bac62d501aaba..3ab5e43a29d93 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxNetworkProfile.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxNetworkProfile.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 NginxNetworkProfile model. */ @Fluent -public final class NginxNetworkProfile { +public final class NginxNetworkProfile implements JsonSerializable { /* * The frontEndIPConfiguration property. */ - @JsonProperty(value = "frontEndIPConfiguration") private NginxFrontendIpConfiguration frontEndIpConfiguration; /* * The networkInterfaceConfiguration property. */ - @JsonProperty(value = "networkInterfaceConfiguration") private NginxNetworkInterfaceConfiguration networkInterfaceConfiguration; /** @@ -84,4 +86,45 @@ public void validate() { networkInterfaceConfiguration().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("frontEndIPConfiguration", this.frontEndIpConfiguration); + jsonWriter.writeJsonField("networkInterfaceConfiguration", this.networkInterfaceConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxNetworkProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxNetworkProfile 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 NginxNetworkProfile. + */ + public static NginxNetworkProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxNetworkProfile deserializedNginxNetworkProfile = new NginxNetworkProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("frontEndIPConfiguration".equals(fieldName)) { + deserializedNginxNetworkProfile.frontEndIpConfiguration + = NginxFrontendIpConfiguration.fromJson(reader); + } else if ("networkInterfaceConfiguration".equals(fieldName)) { + deserializedNginxNetworkProfile.networkInterfaceConfiguration + = NginxNetworkInterfaceConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxNetworkProfile; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPrivateIpAddress.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPrivateIpAddress.java index f033b96d70ac2..5aad1df53a6f6 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPrivateIpAddress.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPrivateIpAddress.java @@ -5,29 +5,30 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 NginxPrivateIpAddress model. */ @Fluent -public final class NginxPrivateIpAddress { +public final class NginxPrivateIpAddress implements JsonSerializable { /* * The privateIPAddress property. */ - @JsonProperty(value = "privateIPAddress") private String privateIpAddress; /* * The privateIPAllocationMethod property. */ - @JsonProperty(value = "privateIPAllocationMethod") private NginxPrivateIpAllocationMethod privateIpAllocationMethod; /* * The subnetId property. */ - @JsonProperty(value = "subnetId") private String subnetId; /** @@ -104,4 +105,48 @@ public NginxPrivateIpAddress withSubnetId(String subnetId) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("privateIPAddress", this.privateIpAddress); + jsonWriter.writeStringField("privateIPAllocationMethod", + this.privateIpAllocationMethod == null ? null : this.privateIpAllocationMethod.toString()); + jsonWriter.writeStringField("subnetId", this.subnetId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxPrivateIpAddress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxPrivateIpAddress 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 NginxPrivateIpAddress. + */ + public static NginxPrivateIpAddress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxPrivateIpAddress deserializedNginxPrivateIpAddress = new NginxPrivateIpAddress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("privateIPAddress".equals(fieldName)) { + deserializedNginxPrivateIpAddress.privateIpAddress = reader.getString(); + } else if ("privateIPAllocationMethod".equals(fieldName)) { + deserializedNginxPrivateIpAddress.privateIpAllocationMethod + = NginxPrivateIpAllocationMethod.fromString(reader.getString()); + } else if ("subnetId".equals(fieldName)) { + deserializedNginxPrivateIpAddress.subnetId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxPrivateIpAddress; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPrivateIpAllocationMethod.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPrivateIpAllocationMethod.java index 6c0829f53a356..06c78befb8ea9 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPrivateIpAllocationMethod.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPrivateIpAllocationMethod.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -37,7 +36,6 @@ public NginxPrivateIpAllocationMethod() { * @param name a name to look for. * @return the corresponding NginxPrivateIpAllocationMethod. */ - @JsonCreator public static NginxPrivateIpAllocationMethod fromString(String name) { return fromString(name, NginxPrivateIpAllocationMethod.class); } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPublicIpAddress.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPublicIpAddress.java index f4a729f0cc85d..40172dd30eaef 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPublicIpAddress.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxPublicIpAddress.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 NginxPublicIpAddress model. */ @Fluent -public final class NginxPublicIpAddress { +public final class NginxPublicIpAddress implements JsonSerializable { /* * The id property. */ - @JsonProperty(value = "id") private String id; /** @@ -51,4 +54,40 @@ public NginxPublicIpAddress withId(String id) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxPublicIpAddress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxPublicIpAddress 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 NginxPublicIpAddress. + */ + public static NginxPublicIpAddress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxPublicIpAddress deserializedNginxPublicIpAddress = new NginxPublicIpAddress(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNginxPublicIpAddress.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxPublicIpAddress; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxStorageAccount.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxStorageAccount.java index 55b547ed69504..a0141417dce26 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxStorageAccount.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxStorageAccount.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 NginxStorageAccount model. */ @Fluent -public final class NginxStorageAccount { +public final class NginxStorageAccount implements JsonSerializable { /* * The accountName property. */ - @JsonProperty(value = "accountName") private String accountName; /* * The containerName property. */ - @JsonProperty(value = "containerName") private String containerName; /** @@ -77,4 +79,43 @@ public NginxStorageAccount withContainerName(String containerName) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accountName", this.accountName); + jsonWriter.writeStringField("containerName", this.containerName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxStorageAccount from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxStorageAccount 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 NginxStorageAccount. + */ + public static NginxStorageAccount fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxStorageAccount deserializedNginxStorageAccount = new NginxStorageAccount(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accountName".equals(fieldName)) { + deserializedNginxStorageAccount.accountName = reader.getString(); + } else if ("containerName".equals(fieldName)) { + deserializedNginxStorageAccount.containerName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxStorageAccount; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationDisplay.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationDisplay.java index e22b0923c4afe..67b46fae38ad4 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationDisplay.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationDisplay.java @@ -5,35 +5,35 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 object that represents the operation. */ @Fluent -public final class OperationDisplay { +public final class OperationDisplay implements JsonSerializable { /* * Service provider: Nginx.NginxPlus */ - @JsonProperty(value = "provider") private String provider; /* * Type on which the operation is performed, e.g., 'deployments'. */ - @JsonProperty(value = "resource") private String resource; /* * Operation type, e.g., read, write, delete, etc. */ - @JsonProperty(value = "operation") private String operation; /* * Description of the operation, e.g., 'Write deployments'. */ - @JsonProperty(value = "description") private String description; /** @@ -129,4 +129,49 @@ public OperationDisplay withDescription(String description) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeStringField("resource", this.resource); + jsonWriter.writeStringField("operation", this.operation); + jsonWriter.writeStringField("description", this.description); + 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/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationListResult.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationListResult.java index 674f2adc273fe..bd478aed5d0b7 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationListResult.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationListResult.java @@ -5,25 +5,27 @@ package com.azure.resourcemanager.nginx.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 com.azure.resourcemanager.nginx.fluent.models.OperationResultInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * Result of GET request to list Nginx.NginxPlus operations. */ @Fluent -public final class OperationListResult { +public final class OperationListResult implements JsonSerializable { /* * List of operations supported by the Nginx.NginxPlus provider. */ - @JsonProperty(value = "value") private List value; /* * URL to get the next set of operation list results if there are any. */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -82,4 +84,45 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@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 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 -> OperationResultInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Operations.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Operations.java index e4961fb6b2e40..8c981d6df3a58 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Operations.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Operations.java @@ -12,7 +12,7 @@ */ public interface Operations { /** - * List all operations provided by Nginx.NginxPlus for the 2024-01-01-preview api version. + * List all operations provided by Nginx.NginxPlus for the 2024-06-01-preview api version. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -22,7 +22,7 @@ public interface Operations { PagedIterable list(); /** - * List all operations provided by Nginx.NginxPlus for the 2024-01-01-preview api version. + * List all operations provided by Nginx.NginxPlus for the 2024-06-01-preview api version. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ProvisioningState.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ProvisioningState.java index 8d0165df4bdd6..b4ca02477a9ac 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ProvisioningState.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -72,7 +71,6 @@ public ProvisioningState() { * @param name a name to look for. * @return the corresponding ProvisioningState. */ - @JsonCreator public static ProvisioningState fromString(String name) { return fromString(name, ProvisioningState.class); } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ResourceSku.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ResourceSku.java index ddf05638d7a76..d41e0997138fd 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ResourceSku.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ResourceSku.java @@ -6,17 +6,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +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 ResourceSku model. */ @Fluent -public final class ResourceSku { +public final class ResourceSku implements JsonSerializable { /* * Name of the SKU. */ - @JsonProperty(value = "name", required = true) private String name; /** @@ -58,4 +61,41 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ResourceSku.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceSku from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceSku 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 ResourceSku. + */ + public static ResourceSku fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceSku deserializedResourceSku = new ResourceSku(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedResourceSku.name = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceSku; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ScaleProfile.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ScaleProfile.java index bceb36946e70c..99ebf154151d4 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ScaleProfile.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ScaleProfile.java @@ -6,23 +6,25 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; +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 autoscale profile. */ @Fluent -public final class ScaleProfile { +public final class ScaleProfile implements JsonSerializable { /* * The name property. */ - @JsonProperty(value = "name", required = true) private String name; /* * The capacity parameters of the profile. */ - @JsonProperty(value = "capacity", required = true) private ScaleProfileCapacity capacity; /** @@ -90,4 +92,44 @@ public void validate() { } private static final ClientLogger LOGGER = new ClientLogger(ScaleProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("capacity", this.capacity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScaleProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScaleProfile 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 ScaleProfile. + */ + public static ScaleProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScaleProfile deserializedScaleProfile = new ScaleProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedScaleProfile.name = reader.getString(); + } else if ("capacity".equals(fieldName)) { + deserializedScaleProfile.capacity = ScaleProfileCapacity.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedScaleProfile; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ScaleProfileCapacity.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ScaleProfileCapacity.java index 6ec0e43cbeb1e..d4571e5b24053 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ScaleProfileCapacity.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ScaleProfileCapacity.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +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 capacity parameters of the profile. */ @Fluent -public final class ScaleProfileCapacity { +public final class ScaleProfileCapacity implements JsonSerializable { /* * The minimum number of NCUs the deployment can be autoscaled to. */ - @JsonProperty(value = "min", required = true) private int min; /* * The maximum number of NCUs the deployment can be autoscaled to. */ - @JsonProperty(value = "max", required = true) private int max; /** @@ -77,4 +79,44 @@ public ScaleProfileCapacity withMax(int max) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("min", this.min); + jsonWriter.writeIntField("max", this.max); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScaleProfileCapacity from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScaleProfileCapacity 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 ScaleProfileCapacity. + */ + public static ScaleProfileCapacity fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ScaleProfileCapacity deserializedScaleProfileCapacity = new ScaleProfileCapacity(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("min".equals(fieldName)) { + deserializedScaleProfileCapacity.min = reader.getInt(); + } else if ("max".equals(fieldName)) { + deserializedScaleProfileCapacity.max = reader.getInt(); + } else { + reader.skipChildren(); + } + } + + return deserializedScaleProfileCapacity; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/UserIdentityProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/UserIdentityProperties.java index 8e4f1ebbb0e49..c75461d15625e 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/UserIdentityProperties.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/UserIdentityProperties.java @@ -5,23 +5,25 @@ package com.azure.resourcemanager.nginx.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +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 UserIdentityProperties model. */ @Immutable -public final class UserIdentityProperties { +public final class UserIdentityProperties implements JsonSerializable { /* * The principalId property. */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private String principalId; /* * The clientId property. */ - @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) private String clientId; /** @@ -55,4 +57,41 @@ public String clientId() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UserIdentityProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UserIdentityProperties 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 UserIdentityProperties. + */ + public static UserIdentityProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UserIdentityProperties deserializedUserIdentityProperties = new UserIdentityProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("principalId".equals(fieldName)) { + deserializedUserIdentityProperties.principalId = reader.getString(); + } else if ("clientId".equals(fieldName)) { + deserializedUserIdentityProperties.clientId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedUserIdentityProperties; + }); + } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/WebApplicationFirewallComponentVersions.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/WebApplicationFirewallComponentVersions.java new file mode 100644 index 0000000000000..1d791f63f2dff --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/WebApplicationFirewallComponentVersions.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Versions of the NGINX App Protect Web Application Firewall (WAF) components. + */ +@Fluent +public final class WebApplicationFirewallComponentVersions + implements JsonSerializable { + /* + * The version of the NGINX App Protect Web Application Firewall (WAF) engine. + */ + private String wafEngineVersion; + + /* + * The version of the NGINX App Protect Web Application Firewall (WAF) module for NGINX. + */ + private String wafNginxVersion; + + /** + * Creates an instance of WebApplicationFirewallComponentVersions class. + */ + public WebApplicationFirewallComponentVersions() { + } + + /** + * Get the wafEngineVersion property: The version of the NGINX App Protect Web Application Firewall (WAF) engine. + * + * @return the wafEngineVersion value. + */ + public String wafEngineVersion() { + return this.wafEngineVersion; + } + + /** + * Set the wafEngineVersion property: The version of the NGINX App Protect Web Application Firewall (WAF) engine. + * + * @param wafEngineVersion the wafEngineVersion value to set. + * @return the WebApplicationFirewallComponentVersions object itself. + */ + public WebApplicationFirewallComponentVersions withWafEngineVersion(String wafEngineVersion) { + this.wafEngineVersion = wafEngineVersion; + return this; + } + + /** + * Get the wafNginxVersion property: The version of the NGINX App Protect Web Application Firewall (WAF) module for + * NGINX. + * + * @return the wafNginxVersion value. + */ + public String wafNginxVersion() { + return this.wafNginxVersion; + } + + /** + * Set the wafNginxVersion property: The version of the NGINX App Protect Web Application Firewall (WAF) module for + * NGINX. + * + * @param wafNginxVersion the wafNginxVersion value to set. + * @return the WebApplicationFirewallComponentVersions object itself. + */ + public WebApplicationFirewallComponentVersions withWafNginxVersion(String wafNginxVersion) { + this.wafNginxVersion = wafNginxVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (wafEngineVersion() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property wafEngineVersion in model WebApplicationFirewallComponentVersions")); + } + if (wafNginxVersion() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property wafNginxVersion in model WebApplicationFirewallComponentVersions")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebApplicationFirewallComponentVersions.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("wafEngineVersion", this.wafEngineVersion); + jsonWriter.writeStringField("wafNginxVersion", this.wafNginxVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebApplicationFirewallComponentVersions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebApplicationFirewallComponentVersions 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 WebApplicationFirewallComponentVersions. + */ + public static WebApplicationFirewallComponentVersions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebApplicationFirewallComponentVersions deserializedWebApplicationFirewallComponentVersions + = new WebApplicationFirewallComponentVersions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("wafEngineVersion".equals(fieldName)) { + deserializedWebApplicationFirewallComponentVersions.wafEngineVersion = reader.getString(); + } else if ("wafNginxVersion".equals(fieldName)) { + deserializedWebApplicationFirewallComponentVersions.wafNginxVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedWebApplicationFirewallComponentVersions; + }); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/WebApplicationFirewallPackage.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/WebApplicationFirewallPackage.java new file mode 100644 index 0000000000000..43b07d2a67c57 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/WebApplicationFirewallPackage.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * NGINX App Protect Web Application Firewall (WAF) Package. Contains the version and revision date of the package. + */ +@Fluent +public final class WebApplicationFirewallPackage implements JsonSerializable { + /* + * The version of the NGINX App Protect Web Application Firewall (WAF) package. + */ + private String version; + + /* + * The date and time of the package revision. + */ + private OffsetDateTime revisionDatetime; + + /** + * Creates an instance of WebApplicationFirewallPackage class. + */ + public WebApplicationFirewallPackage() { + } + + /** + * Get the version property: The version of the NGINX App Protect Web Application Firewall (WAF) package. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Set the version property: The version of the NGINX App Protect Web Application Firewall (WAF) package. + * + * @param version the version value to set. + * @return the WebApplicationFirewallPackage object itself. + */ + public WebApplicationFirewallPackage withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the revisionDatetime property: The date and time of the package revision. + * + * @return the revisionDatetime value. + */ + public OffsetDateTime revisionDatetime() { + return this.revisionDatetime; + } + + /** + * Set the revisionDatetime property: The date and time of the package revision. + * + * @param revisionDatetime the revisionDatetime value to set. + * @return the WebApplicationFirewallPackage object itself. + */ + public WebApplicationFirewallPackage withRevisionDatetime(OffsetDateTime revisionDatetime) { + this.revisionDatetime = revisionDatetime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (version() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property version in model WebApplicationFirewallPackage")); + } + if (revisionDatetime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property revisionDatetime in model WebApplicationFirewallPackage")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(WebApplicationFirewallPackage.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("revisionDatetime", + this.revisionDatetime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.revisionDatetime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebApplicationFirewallPackage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebApplicationFirewallPackage 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 WebApplicationFirewallPackage. + */ + public static WebApplicationFirewallPackage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebApplicationFirewallPackage deserializedWebApplicationFirewallPackage + = new WebApplicationFirewallPackage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("version".equals(fieldName)) { + deserializedWebApplicationFirewallPackage.version = reader.getString(); + } else if ("revisionDatetime".equals(fieldName)) { + deserializedWebApplicationFirewallPackage.revisionDatetime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedWebApplicationFirewallPackage; + }); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/WebApplicationFirewallSettings.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/WebApplicationFirewallSettings.java new file mode 100644 index 0000000000000..86ed71f3d5c18 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/WebApplicationFirewallSettings.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.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; + +/** + * Settings for the NGINX App Protect Web Application Firewall (WAF). + */ +@Fluent +public final class WebApplicationFirewallSettings implements JsonSerializable { + /* + * The activation state of the WAF. Use 'Enabled' to enable the WAF and 'Disabled' to disable it. + */ + private ActivationState activationState; + + /** + * Creates an instance of WebApplicationFirewallSettings class. + */ + public WebApplicationFirewallSettings() { + } + + /** + * Get the activationState property: The activation state of the WAF. Use 'Enabled' to enable the WAF and 'Disabled' + * to disable it. + * + * @return the activationState value. + */ + public ActivationState activationState() { + return this.activationState; + } + + /** + * Set the activationState property: The activation state of the WAF. Use 'Enabled' to enable the WAF and 'Disabled' + * to disable it. + * + * @param activationState the activationState value to set. + * @return the WebApplicationFirewallSettings object itself. + */ + public WebApplicationFirewallSettings withActivationState(ActivationState activationState) { + this.activationState = activationState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("activationState", + this.activationState == null ? null : this.activationState.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebApplicationFirewallSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebApplicationFirewallSettings 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 WebApplicationFirewallSettings. + */ + public static WebApplicationFirewallSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebApplicationFirewallSettings deserializedWebApplicationFirewallSettings + = new WebApplicationFirewallSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("activationState".equals(fieldName)) { + deserializedWebApplicationFirewallSettings.activationState + = ActivationState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedWebApplicationFirewallSettings; + }); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/WebApplicationFirewallStatus.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/WebApplicationFirewallStatus.java new file mode 100644 index 0000000000000..44c0238e6a229 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/WebApplicationFirewallStatus.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.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; + +/** + * The status of the NGINX App Protect Web Application Firewall. + */ +@Immutable +public final class WebApplicationFirewallStatus implements JsonSerializable { + /* + * Package containing attack signatures for the NGINX App Protect Web Application Firewall (WAF). + */ + private WebApplicationFirewallPackage attackSignaturesPackage; + + /* + * Package containing bot signatures for the NGINX App Protect Web Application Firewall (WAF). + */ + private WebApplicationFirewallPackage botSignaturesPackage; + + /* + * Package containing threat campaigns for the NGINX App Protect Web Application Firewall (WAF). + */ + private WebApplicationFirewallPackage threatCampaignsPackage; + + /* + * Versions of the NGINX App Protect Web Application Firewall (WAF) components. + */ + private WebApplicationFirewallComponentVersions componentVersions; + + /** + * Creates an instance of WebApplicationFirewallStatus class. + */ + public WebApplicationFirewallStatus() { + } + + /** + * Get the attackSignaturesPackage property: Package containing attack signatures for the NGINX App Protect Web + * Application Firewall (WAF). + * + * @return the attackSignaturesPackage value. + */ + public WebApplicationFirewallPackage attackSignaturesPackage() { + return this.attackSignaturesPackage; + } + + /** + * Get the botSignaturesPackage property: Package containing bot signatures for the NGINX App Protect Web + * Application Firewall (WAF). + * + * @return the botSignaturesPackage value. + */ + public WebApplicationFirewallPackage botSignaturesPackage() { + return this.botSignaturesPackage; + } + + /** + * Get the threatCampaignsPackage property: Package containing threat campaigns for the NGINX App Protect Web + * Application Firewall (WAF). + * + * @return the threatCampaignsPackage value. + */ + public WebApplicationFirewallPackage threatCampaignsPackage() { + return this.threatCampaignsPackage; + } + + /** + * Get the componentVersions property: Versions of the NGINX App Protect Web Application Firewall (WAF) components. + * + * @return the componentVersions value. + */ + public WebApplicationFirewallComponentVersions componentVersions() { + return this.componentVersions; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (attackSignaturesPackage() != null) { + attackSignaturesPackage().validate(); + } + if (botSignaturesPackage() != null) { + botSignaturesPackage().validate(); + } + if (threatCampaignsPackage() != null) { + threatCampaignsPackage().validate(); + } + if (componentVersions() != null) { + componentVersions().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebApplicationFirewallStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebApplicationFirewallStatus 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 WebApplicationFirewallStatus. + */ + public static WebApplicationFirewallStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebApplicationFirewallStatus deserializedWebApplicationFirewallStatus = new WebApplicationFirewallStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("attackSignaturesPackage".equals(fieldName)) { + deserializedWebApplicationFirewallStatus.attackSignaturesPackage + = WebApplicationFirewallPackage.fromJson(reader); + } else if ("botSignaturesPackage".equals(fieldName)) { + deserializedWebApplicationFirewallStatus.botSignaturesPackage + = WebApplicationFirewallPackage.fromJson(reader); + } else if ("threatCampaignsPackage".equals(fieldName)) { + deserializedWebApplicationFirewallStatus.threatCampaignsPackage + = WebApplicationFirewallPackage.fromJson(reader); + } else if ("componentVersions".equals(fieldName)) { + deserializedWebApplicationFirewallStatus.componentVersions + = WebApplicationFirewallComponentVersions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedWebApplicationFirewallStatus; + }); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/module-info.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/module-info.java index e2552fbeb92ee..0c9efecf6717d 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/module-info.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/module-info.java @@ -8,6 +8,6 @@ exports com.azure.resourcemanager.nginx.fluent; exports com.azure.resourcemanager.nginx.fluent.models; exports com.azure.resourcemanager.nginx.models; - opens com.azure.resourcemanager.nginx.fluent.models to com.azure.core, com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.nginx.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.nginx.fluent.models to com.azure.core; + opens com.azure.resourcemanager.nginx.models to com.azure.core; } \ No newline at end of file diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-nginx/proxy-config.json b/sdk/nginx/azure-resourcemanager-nginx/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-nginx/proxy-config.json index 99c4aa9b83cd8..fa397baef5fea 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-nginx/proxy-config.json +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-nginx/proxy-config.json @@ -1 +1 @@ -[ [ "com.azure.resourcemanager.nginx.implementation.CertificatesClientImpl$CertificatesService" ], [ "com.azure.resourcemanager.nginx.implementation.ConfigurationsClientImpl$ConfigurationsService" ], [ "com.azure.resourcemanager.nginx.implementation.DeploymentsClientImpl$DeploymentsService" ], [ "com.azure.resourcemanager.nginx.implementation.OperationsClientImpl$OperationsService" ] ] \ No newline at end of file +[["com.azure.resourcemanager.nginx.implementation.CertificatesClientImpl$CertificatesService"],["com.azure.resourcemanager.nginx.implementation.ConfigurationsClientImpl$ConfigurationsService"],["com.azure.resourcemanager.nginx.implementation.DeploymentsClientImpl$DeploymentsService"],["com.azure.resourcemanager.nginx.implementation.OperationsClientImpl$OperationsService"]] \ No newline at end of file diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-nginx/reflect-config.json b/sdk/nginx/azure-resourcemanager-nginx/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-nginx/reflect-config.json index 8d918b3e188e6..0637a088a01e8 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-nginx/reflect-config.json +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-nginx/reflect-config.json @@ -1,206 +1 @@ -[ { - "name" : "com.azure.resourcemanager.nginx.fluent.models.NginxCertificateInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxCertificateProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxCertificateErrorResponseBody", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxCertificateListResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxConfigurationListResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.fluent.models.NginxConfigurationInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxConfigurationProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxConfigurationFile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxConfigurationPackage", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.AnalysisCreate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.AnalysisCreateConfig", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.fluent.models.AnalysisResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.AnalysisResultData", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.AnalysisDiagnostic", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.IdentityProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.UserIdentityProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxDeploymentProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxNetworkProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxFrontendIpConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxPublicIpAddress", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxPrivateIpAddress", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxNetworkInterfaceConfiguration", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxLogging", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxStorageAccount", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxDeploymentScalingProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentScalingPropertiesAutoScaleSettings", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.ScaleProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.ScaleProfileCapacity", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.AutoUpgradeProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxDeploymentUserProfile", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.ResourceSku", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxDeploymentUpdateParameters", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxDeploymentUpdateProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxDeploymentListResponse", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.OperationListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.fluent.models.OperationResultInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.OperationDisplay", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.ProvisioningState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.IdentityType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.nginx.models.NginxPrivateIpAllocationMethod", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -} ] \ No newline at end of file +[] \ No newline at end of file diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesCreateOrUpdateSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesCreateOrUpdateSamples.java index b35bccd9d0847..1065ddfbd6b1c 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesCreateOrUpdateSamples.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesCreateOrUpdateSamples.java @@ -4,14 +4,13 @@ package com.azure.resourcemanager.nginx.generated; -import com.azure.resourcemanager.nginx.models.NginxCertificateProperties; - /** * Samples for Certificates CreateOrUpdate. */ public final class CertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Certificates_CreateOrUpdate.json + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/ + * Certificates_CreateOrUpdate.json */ /** * Sample code: Certificates_CreateOrUpdate. @@ -22,9 +21,6 @@ public static void certificatesCreateOrUpdate(com.azure.resourcemanager.nginx.Ng manager.certificates() .define("default") .withExistingNginxDeployment("myResourceGroup", "myDeployment") - .withProperties(new NginxCertificateProperties().withKeyVirtualPath("fakeTokenPlaceholder") - .withCertificateVirtualPath("/src/cert/somePath.cert") - .withKeyVaultSecretId("fakeTokenPlaceholder")) .create(); } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesDeleteSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesDeleteSamples.java index 46dbc8d517025..91ee2a4b4bb44 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesDeleteSamples.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesDeleteSamples.java @@ -9,7 +9,8 @@ */ public final class CertificatesDeleteSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Certificates_Delete.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Certificates_Delete.json */ /** * Sample code: Certificates_Delete. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesGetSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesGetSamples.java index acc5df0c721f2..d361a1dd205d8 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesGetSamples.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesGetSamples.java @@ -9,7 +9,8 @@ */ public final class CertificatesGetSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Certificates_Get.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Certificates_Get.json */ /** * Sample code: Certificates_Get. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesListSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesListSamples.java index 7893eecb20e35..75ba25e7951cc 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesListSamples.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/CertificatesListSamples.java @@ -9,7 +9,8 @@ */ public final class CertificatesListSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Certificates_List.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Certificates_List.json */ /** * Sample code: Certificates_List. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsAnalysisSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsAnalysisSamples.java index 0d6380795af19..77e1b16766f00 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsAnalysisSamples.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsAnalysisSamples.java @@ -4,18 +4,14 @@ package com.azure.resourcemanager.nginx.generated; -import com.azure.resourcemanager.nginx.models.AnalysisCreate; -import com.azure.resourcemanager.nginx.models.AnalysisCreateConfig; -import com.azure.resourcemanager.nginx.models.NginxConfigurationFile; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import java.util.Arrays; - /** * Samples for Configurations Analysis. */ public final class ConfigurationsAnalysisSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Configurations_Analysis.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Configurations_Analysis. + * json */ /** * Sample code: Configurations_Analysis. @@ -24,11 +20,6 @@ public final class ConfigurationsAnalysisSamples { */ public static void configurationsAnalysis(com.azure.resourcemanager.nginx.NginxManager manager) { manager.configurations() - .analysisWithResponse("myResourceGroup", "myDeployment", "default", - new AnalysisCreate().withConfig(new AnalysisCreateConfig().withRootFile("/etc/nginx/nginx.conf") - .withFiles(Arrays.asList( - new NginxConfigurationFile().withContent("ABCDEF==").withVirtualPath("/etc/nginx/nginx.conf"))) - .withPackageProperty(new NginxConfigurationPackage())), - com.azure.core.util.Context.NONE); + .analysisWithResponse("myResourceGroup", "myDeployment", "default", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsCreateOrUpdateSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsCreateOrUpdateSamples.java index a2caef0ef021b..1d50d73d3ebac 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsCreateOrUpdateSamples.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsCreateOrUpdateSamples.java @@ -4,17 +4,13 @@ package com.azure.resourcemanager.nginx.generated; -import com.azure.resourcemanager.nginx.models.NginxConfigurationFile; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import com.azure.resourcemanager.nginx.models.NginxConfigurationProperties; -import java.util.Arrays; - /** * Samples for Configurations CreateOrUpdate. */ public final class ConfigurationsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Configurations_CreateOrUpdate.json + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/ + * Configurations_CreateOrUpdate.json */ /** * Sample code: Configurations_CreateOrUpdate. @@ -25,11 +21,6 @@ public static void configurationsCreateOrUpdate(com.azure.resourcemanager.nginx. manager.configurations() .define("default") .withExistingNginxDeployment("myResourceGroup", "myDeployment") - .withProperties(new NginxConfigurationProperties() - .withFiles(Arrays.asList( - new NginxConfigurationFile().withContent("ABCDEF==").withVirtualPath("/etc/nginx/nginx.conf"))) - .withPackageProperty(new NginxConfigurationPackage()) - .withRootFile("/etc/nginx/nginx.conf")) .create(); } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsDeleteSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsDeleteSamples.java index 9b8d943ff3b68..90146f92eff44 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsDeleteSamples.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsDeleteSamples.java @@ -9,7 +9,9 @@ */ public final class ConfigurationsDeleteSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Configurations_Delete.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Configurations_Delete. + * json */ /** * Sample code: Configurations_Delete. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsGetSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsGetSamples.java index 0f83fb50c1590..defed57d79674 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsGetSamples.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsGetSamples.java @@ -9,7 +9,8 @@ */ public final class ConfigurationsGetSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Configurations_Get.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Configurations_Get.json */ /** * Sample code: Configurations_Get. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsListSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsListSamples.java index b1ed7c92d426b..792e4497dd893 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsListSamples.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/ConfigurationsListSamples.java @@ -9,7 +9,8 @@ */ public final class ConfigurationsListSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Configurations_List.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Configurations_List.json */ /** * Sample code: Configurations_List. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsCreateOrUpdateSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsCreateOrUpdateSamples.java index 4efe37ed8edd1..8e91697d99765 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsCreateOrUpdateSamples.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsCreateOrUpdateSamples.java @@ -4,26 +4,13 @@ package com.azure.resourcemanager.nginx.generated; -import com.azure.resourcemanager.nginx.models.AutoUpgradeProfile; -import com.azure.resourcemanager.nginx.models.NginxDeploymentProperties; -import com.azure.resourcemanager.nginx.models.NginxDeploymentScalingProperties; -import com.azure.resourcemanager.nginx.models.NginxDeploymentUserProfile; -import com.azure.resourcemanager.nginx.models.NginxFrontendIpConfiguration; -import com.azure.resourcemanager.nginx.models.NginxNetworkInterfaceConfiguration; -import com.azure.resourcemanager.nginx.models.NginxNetworkProfile; -import com.azure.resourcemanager.nginx.models.NginxPrivateIpAddress; -import com.azure.resourcemanager.nginx.models.NginxPrivateIpAllocationMethod; -import com.azure.resourcemanager.nginx.models.NginxPublicIpAddress; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - /** * Samples for Deployments CreateOrUpdate. */ public final class DeploymentsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Deployments_Create.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Deployments_Create.json */ /** * Sample code: Deployments_Create. @@ -33,36 +20,8 @@ public final class DeploymentsCreateOrUpdateSamples { public static void deploymentsCreate(com.azure.resourcemanager.nginx.NginxManager manager) { manager.deployments() .define("myDeployment") - .withRegion("West US") + .withRegion((String) null) .withExistingResourceGroup("myResourceGroup") - .withTags(mapOf("Environment", "Dev")) - .withProperties(new NginxDeploymentProperties().withManagedResourceGroup("myManagedResourceGroup") - .withNetworkProfile(new NginxNetworkProfile() - .withFrontEndIpConfiguration(new NginxFrontendIpConfiguration() - .withPublicIpAddresses(Arrays.asList(new NginxPublicIpAddress().withId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/publicIPAddresses/myPublicIPAddress"))) - .withPrivateIpAddresses(Arrays.asList(new NginxPrivateIpAddress() - .withPrivateIpAddress("1.1.1.1") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.STATIC) - .withSubnetId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet")))) - .withNetworkInterfaceConfiguration(new NginxNetworkInterfaceConfiguration().withSubnetId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet"))) - .withScalingProperties(new NginxDeploymentScalingProperties().withCapacity(10)) - .withAutoUpgradeProfile(new AutoUpgradeProfile().withUpgradeChannel("stable")) - .withUserProfile(new NginxDeploymentUserProfile().withPreferredEmail("example@example.email"))) .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/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsDeleteSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsDeleteSamples.java index dbe30bbf946e0..1e5687b1c80fa 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsDeleteSamples.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsDeleteSamples.java @@ -9,7 +9,8 @@ */ public final class DeploymentsDeleteSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Deployments_Delete.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Deployments_Delete.json */ /** * Sample code: Deployments_Delete. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsGetByResourceGroupSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsGetByResourceGroupSamples.java index 541a4fc89213d..73b9d1aadd04b 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsGetByResourceGroupSamples.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsGetByResourceGroupSamples.java @@ -9,7 +9,8 @@ */ public final class DeploymentsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Deployments_Get.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Deployments_Get.json */ /** * Sample code: Deployments_Get. @@ -22,7 +23,8 @@ public static void deploymentsGet(com.azure.resourcemanager.nginx.NginxManager m } /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Deployments_Get_AutoScale.json + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/ + * Deployments_Get_AutoScale.json */ /** * Sample code: Deployments_Get_AutoScale. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsListByResourceGroupSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsListByResourceGroupSamples.java index a266c5e7957ad..125df77700001 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsListByResourceGroupSamples.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsListByResourceGroupSamples.java @@ -9,7 +9,8 @@ */ public final class DeploymentsListByResourceGroupSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Deployments_ListByResourceGroup.json + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/ + * Deployments_ListByResourceGroup.json */ /** * Sample code: Deployments_ListByResourceGroup. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsListSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsListSamples.java index 575f49d11dd0f..db1d692f29cc9 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsListSamples.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsListSamples.java @@ -9,7 +9,8 @@ */ public final class DeploymentsListSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Deployments_List.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Deployments_List.json */ /** * Sample code: Deployments_List. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsUpdateSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsUpdateSamples.java index b3ac0467d856c..56815acd859bb 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsUpdateSamples.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/DeploymentsUpdateSamples.java @@ -5,15 +5,14 @@ package com.azure.resourcemanager.nginx.generated; import com.azure.resourcemanager.nginx.models.NginxDeployment; -import java.util.HashMap; -import java.util.Map; /** * Samples for Deployments Update. */ public final class DeploymentsUpdateSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Deployments_Update.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Deployments_Update.json */ /** * Sample code: Deployments_Update. @@ -24,18 +23,6 @@ public static void deploymentsUpdate(com.azure.resourcemanager.nginx.NginxManage NginxDeployment resource = manager.deployments() .getByResourceGroupWithResponse("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withTags(mapOf("Environment", "Dev")).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; + resource.update().apply(); } } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/OperationsListSamples.java b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/OperationsListSamples.java index 5be0affa7a5d3..a679f5f840010 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/OperationsListSamples.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/samples/java/com/azure/resourcemanager/nginx/generated/OperationsListSamples.java @@ -9,7 +9,8 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-01-01-preview/examples/Operations_List.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-06-01-preview/examples/Operations_List.json */ /** * Sample code: Operations_List. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AnalysisCreateConfigTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AnalysisCreateConfigTests.java deleted file mode 100644 index c5cecf7522d30..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AnalysisCreateConfigTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.AnalysisCreateConfig; -import com.azure.resourcemanager.nginx.models.NginxConfigurationFile; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AnalysisCreateConfigTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AnalysisCreateConfig model = BinaryData.fromString( - "{\"rootFile\":\"qrglssainqpjwn\",\"files\":[{\"content\":\"fmppe\",\"virtualPath\":\"vmgxsab\"},{\"content\":\"qduujitcjczdz\",\"virtualPath\":\"ndhkrw\"}],\"protectedFiles\":[{\"content\":\"p\",\"virtualPath\":\"bdkvwrwjf\"}],\"package\":{\"data\":\"nhutjeltmrldhugj\",\"protectedFiles\":[\"atqxho\",\"dgeablgphu\",\"icndvkaozwyifty\",\"xhurok\"]}}") - .toObject(AnalysisCreateConfig.class); - Assertions.assertEquals("qrglssainqpjwn", model.rootFile()); - Assertions.assertEquals("fmppe", model.files().get(0).content()); - Assertions.assertEquals("vmgxsab", model.files().get(0).virtualPath()); - Assertions.assertEquals("p", model.protectedFiles().get(0).content()); - Assertions.assertEquals("bdkvwrwjf", model.protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("nhutjeltmrldhugj", model.packageProperty().data()); - Assertions.assertEquals("atqxho", model.packageProperty().protectedFiles().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AnalysisCreateConfig model = new AnalysisCreateConfig().withRootFile("qrglssainqpjwn") - .withFiles(Arrays.asList(new NginxConfigurationFile().withContent("fmppe").withVirtualPath("vmgxsab"), - new NginxConfigurationFile().withContent("qduujitcjczdz").withVirtualPath("ndhkrw"))) - .withProtectedFiles( - Arrays.asList(new NginxConfigurationFile().withContent("p").withVirtualPath("bdkvwrwjf"))) - .withPackageProperty(new NginxConfigurationPackage().withData("nhutjeltmrldhugj") - .withProtectedFiles(Arrays.asList("atqxho", "dgeablgphu", "icndvkaozwyifty", "xhurok"))); - model = BinaryData.fromObject(model).toObject(AnalysisCreateConfig.class); - Assertions.assertEquals("qrglssainqpjwn", model.rootFile()); - Assertions.assertEquals("fmppe", model.files().get(0).content()); - Assertions.assertEquals("vmgxsab", model.files().get(0).virtualPath()); - Assertions.assertEquals("p", model.protectedFiles().get(0).content()); - Assertions.assertEquals("bdkvwrwjf", model.protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("nhutjeltmrldhugj", model.packageProperty().data()); - Assertions.assertEquals("atqxho", model.packageProperty().protectedFiles().get(0)); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AnalysisCreateTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AnalysisCreateTests.java deleted file mode 100644 index 2c2329dec664c..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AnalysisCreateTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.AnalysisCreate; -import com.azure.resourcemanager.nginx.models.AnalysisCreateConfig; -import com.azure.resourcemanager.nginx.models.NginxConfigurationFile; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AnalysisCreateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AnalysisCreate model = BinaryData.fromString( - "{\"config\":{\"rootFile\":\"zoxxjtf\",\"files\":[{\"content\":\"wfzitonpeqfpjk\",\"virtualPath\":\"xofpdvhpfxxypi\"},{\"content\":\"nmayhuybb\",\"virtualPath\":\"odepoogin\"},{\"content\":\"amiheognarxz\",\"virtualPath\":\"heotusiv\"},{\"content\":\"v\",\"virtualPath\":\"iqihn\"}],\"protectedFiles\":[{\"content\":\"bwjzr\",\"virtualPath\":\"ygxgispemvtz\"},{\"content\":\"ufubl\",\"virtualPath\":\"fxqeof\"}],\"package\":{\"data\":\"qjhqjbas\",\"protectedFiles\":[\"mjqulngsn\",\"nbybkzgcwrwcl\",\"xwrljdouskcqvkoc\",\"cjdkwtnhxbnjbi\"]}}}") - .toObject(AnalysisCreate.class); - Assertions.assertEquals("zoxxjtf", model.config().rootFile()); - Assertions.assertEquals("wfzitonpeqfpjk", model.config().files().get(0).content()); - Assertions.assertEquals("xofpdvhpfxxypi", model.config().files().get(0).virtualPath()); - Assertions.assertEquals("bwjzr", model.config().protectedFiles().get(0).content()); - Assertions.assertEquals("ygxgispemvtz", model.config().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("qjhqjbas", model.config().packageProperty().data()); - Assertions.assertEquals("mjqulngsn", model.config().packageProperty().protectedFiles().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AnalysisCreate model = new AnalysisCreate().withConfig(new AnalysisCreateConfig().withRootFile("zoxxjtf") - .withFiles(Arrays.asList( - new NginxConfigurationFile().withContent("wfzitonpeqfpjk").withVirtualPath("xofpdvhpfxxypi"), - new NginxConfigurationFile().withContent("nmayhuybb").withVirtualPath("odepoogin"), - new NginxConfigurationFile().withContent("amiheognarxz").withVirtualPath("heotusiv"), - new NginxConfigurationFile().withContent("v").withVirtualPath("iqihn"))) - .withProtectedFiles( - Arrays.asList(new NginxConfigurationFile().withContent("bwjzr").withVirtualPath("ygxgispemvtz"), - new NginxConfigurationFile().withContent("ufubl").withVirtualPath("fxqeof"))) - .withPackageProperty(new NginxConfigurationPackage().withData("qjhqjbas") - .withProtectedFiles( - Arrays.asList("mjqulngsn", "nbybkzgcwrwcl", "xwrljdouskcqvkoc", "cjdkwtnhxbnjbi")))); - model = BinaryData.fromObject(model).toObject(AnalysisCreate.class); - Assertions.assertEquals("zoxxjtf", model.config().rootFile()); - Assertions.assertEquals("wfzitonpeqfpjk", model.config().files().get(0).content()); - Assertions.assertEquals("xofpdvhpfxxypi", model.config().files().get(0).virtualPath()); - Assertions.assertEquals("bwjzr", model.config().protectedFiles().get(0).content()); - Assertions.assertEquals("ygxgispemvtz", model.config().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("qjhqjbas", model.config().packageProperty().data()); - Assertions.assertEquals("mjqulngsn", model.config().packageProperty().protectedFiles().get(0)); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AnalysisDiagnosticTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AnalysisDiagnosticTests.java deleted file mode 100644 index e19ff6caffe10..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AnalysisDiagnosticTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.AnalysisDiagnostic; -import org.junit.jupiter.api.Assertions; - -public final class AnalysisDiagnosticTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AnalysisDiagnostic model = BinaryData.fromString( - "{\"id\":\"wrlyxwjkcprb\",\"directive\":\"wbxgjvt\",\"description\":\"vpys\",\"file\":\"zdn\",\"line\":7.3524117,\"message\":\"jq\",\"rule\":\"uhmuouqfprwzwbn\"}") - .toObject(AnalysisDiagnostic.class); - Assertions.assertEquals("wrlyxwjkcprb", model.id()); - Assertions.assertEquals("wbxgjvt", model.directive()); - Assertions.assertEquals("vpys", model.description()); - Assertions.assertEquals("zdn", model.file()); - Assertions.assertEquals(7.3524117f, model.line()); - Assertions.assertEquals("jq", model.message()); - Assertions.assertEquals("uhmuouqfprwzwbn", model.rule()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AnalysisDiagnostic model = new AnalysisDiagnostic().withId("wrlyxwjkcprb") - .withDirective("wbxgjvt") - .withDescription("vpys") - .withFile("zdn") - .withLine(7.3524117f) - .withMessage("jq") - .withRule("uhmuouqfprwzwbn"); - model = BinaryData.fromObject(model).toObject(AnalysisDiagnostic.class); - Assertions.assertEquals("wrlyxwjkcprb", model.id()); - Assertions.assertEquals("wbxgjvt", model.directive()); - Assertions.assertEquals("vpys", model.description()); - Assertions.assertEquals("zdn", model.file()); - Assertions.assertEquals(7.3524117f, model.line()); - Assertions.assertEquals("jq", model.message()); - Assertions.assertEquals("uhmuouqfprwzwbn", model.rule()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AnalysisResultDataTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AnalysisResultDataTests.java deleted file mode 100644 index a5f81cdf1547e..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AnalysisResultDataTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.AnalysisDiagnostic; -import com.azure.resourcemanager.nginx.models.AnalysisResultData; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AnalysisResultDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AnalysisResultData model = BinaryData.fromString( - "{\"errors\":[{\"id\":\"kwtmutduqktapspw\",\"directive\":\"cuertu\",\"description\":\"kdosvqw\",\"file\":\"bmdg\",\"line\":14.188546,\"message\":\"jfddgmbmbe\",\"rule\":\"ppbhtqqrolfp\"},{\"id\":\"s\",\"directive\":\"lgbquxig\",\"description\":\"yjgzjaoyfhrtxiln\",\"file\":\"rkujy\",\"line\":55.834507,\"message\":\"l\",\"rule\":\"juvf\"}]}") - .toObject(AnalysisResultData.class); - Assertions.assertEquals("kwtmutduqktapspw", model.errors().get(0).id()); - Assertions.assertEquals("cuertu", model.errors().get(0).directive()); - Assertions.assertEquals("kdosvqw", model.errors().get(0).description()); - Assertions.assertEquals("bmdg", model.errors().get(0).file()); - Assertions.assertEquals(14.188546f, model.errors().get(0).line()); - Assertions.assertEquals("jfddgmbmbe", model.errors().get(0).message()); - Assertions.assertEquals("ppbhtqqrolfp", model.errors().get(0).rule()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AnalysisResultData model = new AnalysisResultData().withErrors(Arrays.asList( - new AnalysisDiagnostic().withId("kwtmutduqktapspw") - .withDirective("cuertu") - .withDescription("kdosvqw") - .withFile("bmdg") - .withLine(14.188546f) - .withMessage("jfddgmbmbe") - .withRule("ppbhtqqrolfp"), - new AnalysisDiagnostic().withId("s") - .withDirective("lgbquxig") - .withDescription("yjgzjaoyfhrtxiln") - .withFile("rkujy") - .withLine(55.834507f) - .withMessage("l") - .withRule("juvf"))); - model = BinaryData.fromObject(model).toObject(AnalysisResultData.class); - Assertions.assertEquals("kwtmutduqktapspw", model.errors().get(0).id()); - Assertions.assertEquals("cuertu", model.errors().get(0).directive()); - Assertions.assertEquals("kdosvqw", model.errors().get(0).description()); - Assertions.assertEquals("bmdg", model.errors().get(0).file()); - Assertions.assertEquals(14.188546f, model.errors().get(0).line()); - Assertions.assertEquals("jfddgmbmbe", model.errors().get(0).message()); - Assertions.assertEquals("ppbhtqqrolfp", model.errors().get(0).rule()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AnalysisResultInnerTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AnalysisResultInnerTests.java deleted file mode 100644 index d1bed829475e5..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AnalysisResultInnerTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.fluent.models.AnalysisResultInner; -import com.azure.resourcemanager.nginx.models.AnalysisDiagnostic; -import com.azure.resourcemanager.nginx.models.AnalysisResultData; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AnalysisResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AnalysisResultInner model = BinaryData.fromString( - "{\"status\":\"tyxolniwpwc\",\"data\":{\"errors\":[{\"id\":\"giawx\",\"directive\":\"lryplwckbasyy\",\"description\":\"nddhsgcbacph\",\"file\":\"jkot\",\"line\":64.57916,\"message\":\"qgoulznd\",\"rule\":\"i\"},{\"id\":\"yqkgfg\",\"directive\":\"bmadgak\",\"description\":\"qsrxybzqqed\",\"file\":\"ytb\",\"line\":72.395676,\"message\":\"qfou\",\"rule\":\"lmmnkzsmodmglo\"}]}}") - .toObject(AnalysisResultInner.class); - Assertions.assertEquals("tyxolniwpwc", model.status()); - Assertions.assertEquals("giawx", model.data().errors().get(0).id()); - Assertions.assertEquals("lryplwckbasyy", model.data().errors().get(0).directive()); - Assertions.assertEquals("nddhsgcbacph", model.data().errors().get(0).description()); - Assertions.assertEquals("jkot", model.data().errors().get(0).file()); - Assertions.assertEquals(64.57916f, model.data().errors().get(0).line()); - Assertions.assertEquals("qgoulznd", model.data().errors().get(0).message()); - Assertions.assertEquals("i", model.data().errors().get(0).rule()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AnalysisResultInner model = new AnalysisResultInner().withStatus("tyxolniwpwc") - .withData(new AnalysisResultData().withErrors(Arrays.asList( - new AnalysisDiagnostic().withId("giawx") - .withDirective("lryplwckbasyy") - .withDescription("nddhsgcbacph") - .withFile("jkot") - .withLine(64.57916f) - .withMessage("qgoulznd") - .withRule("i"), - new AnalysisDiagnostic().withId("yqkgfg") - .withDirective("bmadgak") - .withDescription("qsrxybzqqed") - .withFile("ytb") - .withLine(72.395676f) - .withMessage("qfou") - .withRule("lmmnkzsmodmglo")))); - model = BinaryData.fromObject(model).toObject(AnalysisResultInner.class); - Assertions.assertEquals("tyxolniwpwc", model.status()); - Assertions.assertEquals("giawx", model.data().errors().get(0).id()); - Assertions.assertEquals("lryplwckbasyy", model.data().errors().get(0).directive()); - Assertions.assertEquals("nddhsgcbacph", model.data().errors().get(0).description()); - Assertions.assertEquals("jkot", model.data().errors().get(0).file()); - Assertions.assertEquals(64.57916f, model.data().errors().get(0).line()); - Assertions.assertEquals("qgoulznd", model.data().errors().get(0).message()); - Assertions.assertEquals("i", model.data().errors().get(0).rule()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AutoUpgradeProfileTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AutoUpgradeProfileTests.java deleted file mode 100644 index d83631c77fcc8..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/AutoUpgradeProfileTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.AutoUpgradeProfile; -import org.junit.jupiter.api.Assertions; - -public final class AutoUpgradeProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoUpgradeProfile model - = BinaryData.fromString("{\"upgradeChannel\":\"kktwhrdxw\"}").toObject(AutoUpgradeProfile.class); - Assertions.assertEquals("kktwhrdxw", model.upgradeChannel()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoUpgradeProfile model = new AutoUpgradeProfile().withUpgradeChannel("kktwhrdxw"); - model = BinaryData.fromObject(model).toObject(AutoUpgradeProfile.class); - Assertions.assertEquals("kktwhrdxw", model.upgradeChannel()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/CertificatesDeleteMockTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/CertificatesDeleteMockTests.java deleted file mode 100644 index b05b33acf6a88..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/CertificatesDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CertificatesDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - NginxManager manager = NginxManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.certificates().delete("euojgjrwju", "iotwmcdytdxwit", "nrjawgqwg", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsAnalysisWithResponseMockTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsAnalysisWithResponseMockTests.java deleted file mode 100644 index 4e7f0d5b9221a..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsAnalysisWithResponseMockTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.AnalysisCreate; -import com.azure.resourcemanager.nginx.models.AnalysisCreateConfig; -import com.azure.resourcemanager.nginx.models.AnalysisResult; -import com.azure.resourcemanager.nginx.models.NginxConfigurationFile; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationsAnalysisWithResponseMockTests { - @Test - public void testAnalysisWithResponse() throws Exception { - String responseStr - = "{\"status\":\"eh\",\"data\":{\"errors\":[{\"id\":\"gmifthnzd\",\"directive\":\"dslgnayqigynduh\",\"description\":\"vhqlkthumaqo\",\"file\":\"bgycduiertgccym\",\"line\":30.20277,\"message\":\"olpsslqlf\",\"rule\":\"mdnbbglzpswiy\"},{\"id\":\"cwyhzdxssa\",\"directive\":\"bzmnvdfznud\",\"description\":\"od\",\"file\":\"xzb\",\"line\":92.67567,\"message\":\"blylpstdbh\",\"rule\":\"xsrz\"}]}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - NginxManager manager = NginxManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AnalysisResult response = manager.configurations() - .analysisWithResponse("tkblmpewww", "bkrvrnsvshqj", "hxcr", - new AnalysisCreate().withConfig(new AnalysisCreateConfig().withRootFile("fovasr") - .withFiles(Arrays - .asList(new NginxConfigurationFile().withContent("bhsqfsubcgjbirxb").withVirtualPath("bsrfbj"))) - .withProtectedFiles(Arrays - .asList(new NginxConfigurationFile().withContent("ssotftpv").withVirtualPath("bexilzznfqqnv"))) - .withPackageProperty(new NginxConfigurationPackage().withData("qtaruoujmkcjhwq") - .withProtectedFiles(Arrays.asList("r", "bnw", "ewgdrjervn", "enq")))), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("eh", response.status()); - Assertions.assertEquals("gmifthnzd", response.data().errors().get(0).id()); - Assertions.assertEquals("dslgnayqigynduh", response.data().errors().get(0).directive()); - Assertions.assertEquals("vhqlkthumaqo", response.data().errors().get(0).description()); - Assertions.assertEquals("bgycduiertgccym", response.data().errors().get(0).file()); - Assertions.assertEquals(30.20277f, response.data().errors().get(0).line()); - Assertions.assertEquals("olpsslqlf", response.data().errors().get(0).message()); - Assertions.assertEquals("mdnbbglzpswiy", response.data().errors().get(0).rule()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsCreateOrUpdateMockTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsCreateOrUpdateMockTests.java deleted file mode 100644 index 351e94db853a0..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.NginxConfiguration; -import com.azure.resourcemanager.nginx.models.NginxConfigurationFile; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import com.azure.resourcemanager.nginx.models.NginxConfigurationProperties; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"files\":[{\"content\":\"hjpglkf\",\"virtualPath\":\"hdneuelfph\"},{\"content\":\"yhtozfikdowwqu\",\"virtualPath\":\"xzxcl\"},{\"content\":\"thhqzonosggbh\",\"virtualPath\":\"hfwdsjnkaljutiis\"},{\"content\":\"cffgdkzzewk\",\"virtualPath\":\"hqcrailvpnpp\"}],\"protectedFiles\":[{\"content\":\"rwdmhdlxyjrxsa\",\"virtualPath\":\"fcnihgwq\"},{\"content\":\"nedgfbc\",\"virtualPath\":\"cvqvpkeqdcv\"}],\"package\":{\"data\":\"vo\",\"protectedFiles\":[\"otbobzdopcj\",\"vnhdldwmgxcxr\"]},\"rootFile\":\"pmutwuo\"},\"location\":\"rpkhjwn\",\"id\":\"qsluicp\",\"name\":\"ggkzzlvmbmpa\",\"type\":\"modfvuefywsbpfvm\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - NginxManager manager = NginxManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NginxConfiguration response = manager.configurations() - .define("tmweriofzpyq") - .withExistingNginxDeployment("zucerscdntnev", "iwjmygtdssls") - .withRegion("pgcjefuzmuvp") - .withProperties(new NginxConfigurationProperties() - .withFiles(Arrays.asList(new NginxConfigurationFile().withContent("ets").withVirtualPath("szhedplvw"), - new NginxConfigurationFile().withContent("ubmwmbesld").withVirtualPath("wwtppj"))) - .withProtectedFiles( - Arrays.asList(new NginxConfigurationFile().withContent("ogaok").withVirtualPath("z"), - new NginxConfigurationFile().withContent("sikvmkqzeqqkdlt").withVirtualPath("xmhhvhgureo"), - new NginxConfigurationFile().withContent("wobdagxtibqdx").withVirtualPath("wakbogqxndl"))) - .withPackageProperty(new NginxConfigurationPackage().withData("xhuri") - .withProtectedFiles(Arrays.asList("podxunkb", "bxmubyynt", "lrb", "tkoievseotgq"))) - .withRootFile("ltmuwlauwzizx")) - .create(); - - Assertions.assertEquals("hjpglkf", response.properties().files().get(0).content()); - Assertions.assertEquals("hdneuelfph", response.properties().files().get(0).virtualPath()); - Assertions.assertEquals("rwdmhdlxyjrxsa", response.properties().protectedFiles().get(0).content()); - Assertions.assertEquals("fcnihgwq", response.properties().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("vo", response.properties().packageProperty().data()); - Assertions.assertEquals("otbobzdopcj", response.properties().packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("pmutwuo", response.properties().rootFile()); - Assertions.assertEquals("rpkhjwn", response.location()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsDeleteMockTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsDeleteMockTests.java deleted file mode 100644 index 2e7d3aecd5bfb..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ConfigurationsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - NginxManager manager = NginxManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.configurations().delete("qaqtdoqmcbxvwvxy", "lqbhsf", "obl", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsGetWithResponseMockTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsGetWithResponseMockTests.java deleted file mode 100644 index 62cea59da5cda..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsGetWithResponseMockTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.NginxConfiguration; -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 ConfigurationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"provisioningState\":\"Deleting\",\"files\":[{\"content\":\"xisxyawjoyaqcsl\",\"virtualPath\":\"pkii\"},{\"content\":\"yexz\",\"virtualPath\":\"lixhnrztfol\"},{\"content\":\"nxknalaulp\",\"virtualPath\":\"gdtpnapnyiro\"},{\"content\":\"hpigv\",\"virtualPath\":\"ylgqgitxmedjvcsl\"}],\"protectedFiles\":[{\"content\":\"wncwzzhxgktrmg\",\"virtualPath\":\"napkteoellw\"},{\"content\":\"fdygpfqbuaceopz\",\"virtualPath\":\"rhhuaopppcqeqx\"}],\"package\":{\"data\":\"dahzxctobg\",\"protectedFiles\":[\"moizpos\",\"mgrcfbu\",\"rmfqjhhkxbpvj\"]},\"rootFile\":\"jhxxjyn\"},\"location\":\"divkrt\",\"id\":\"bxqz\",\"name\":\"szjfauvjfdxxivet\",\"type\":\"t\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - NginxManager manager = NginxManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NginxConfiguration response = manager.configurations() - .getWithResponse("oekqvk", "lns", "vbxwyjsflhh", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xisxyawjoyaqcsl", response.properties().files().get(0).content()); - Assertions.assertEquals("pkii", response.properties().files().get(0).virtualPath()); - Assertions.assertEquals("wncwzzhxgktrmg", response.properties().protectedFiles().get(0).content()); - Assertions.assertEquals("napkteoellw", response.properties().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("dahzxctobg", response.properties().packageProperty().data()); - Assertions.assertEquals("moizpos", response.properties().packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("jhxxjyn", response.properties().rootFile()); - Assertions.assertEquals("divkrt", response.location()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsListMockTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsListMockTests.java deleted file mode 100644 index 2a0ee50c1e262..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsListMockTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.NginxConfiguration; -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 ConfigurationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Accepted\",\"files\":[{\"content\":\"wyzmhtxon\",\"virtualPath\":\"ts\"}],\"protectedFiles\":[{\"content\":\"bp\",\"virtualPath\":\"qpsrknftguvri\"},{\"content\":\"prwmdyvxqt\",\"virtualPath\":\"riwwroy\"},{\"content\":\"exrmcqibycnojvk\",\"virtualPath\":\"e\"},{\"content\":\"sgzvahapjyzhpv\",\"virtualPath\":\"zcjrvxdjzlmwlx\"}],\"package\":{\"data\":\"gfhzovawjvzunlut\",\"protectedFiles\":[\"prnxipeil\"]},\"rootFile\":\"zuaejxd\"},\"location\":\"tskzbbtdzumveek\",\"id\":\"wozuhkf\",\"name\":\"bsjyofdx\",\"type\":\"uusdttouwa\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - NginxManager manager = NginxManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.configurations().list("jkbegibtnmxiebww", "loayqcgw", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wyzmhtxon", response.iterator().next().properties().files().get(0).content()); - Assertions.assertEquals("ts", response.iterator().next().properties().files().get(0).virtualPath()); - Assertions.assertEquals("bp", response.iterator().next().properties().protectedFiles().get(0).content()); - Assertions.assertEquals("qpsrknftguvri", - response.iterator().next().properties().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("gfhzovawjvzunlut", response.iterator().next().properties().packageProperty().data()); - Assertions.assertEquals("prnxipeil", - response.iterator().next().properties().packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("zuaejxd", response.iterator().next().properties().rootFile()); - Assertions.assertEquals("tskzbbtdzumveek", response.iterator().next().location()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsCreateOrUpdateMockTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsCreateOrUpdateMockTests.java deleted file mode 100644 index 5c694af1c5a8d..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.AutoUpgradeProfile; -import com.azure.resourcemanager.nginx.models.IdentityProperties; -import com.azure.resourcemanager.nginx.models.IdentityType; -import com.azure.resourcemanager.nginx.models.NginxDeployment; -import com.azure.resourcemanager.nginx.models.NginxDeploymentProperties; -import com.azure.resourcemanager.nginx.models.NginxDeploymentScalingProperties; -import com.azure.resourcemanager.nginx.models.NginxDeploymentUserProfile; -import com.azure.resourcemanager.nginx.models.NginxFrontendIpConfiguration; -import com.azure.resourcemanager.nginx.models.NginxLogging; -import com.azure.resourcemanager.nginx.models.NginxNetworkInterfaceConfiguration; -import com.azure.resourcemanager.nginx.models.NginxNetworkProfile; -import com.azure.resourcemanager.nginx.models.NginxPrivateIpAddress; -import com.azure.resourcemanager.nginx.models.NginxPublicIpAddress; -import com.azure.resourcemanager.nginx.models.NginxStorageAccount; -import com.azure.resourcemanager.nginx.models.ResourceSku; -import com.azure.resourcemanager.nginx.models.ScaleProfile; -import com.azure.resourcemanager.nginx.models.ScaleProfileCapacity; -import com.azure.resourcemanager.nginx.models.UserIdentityProperties; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DeploymentsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"identity\":{\"principalId\":\"xwabmqoe\",\"tenantId\":\"ifrvtpu\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ujitcjedftww\":{\"principalId\":\"gkfbtndoaong\",\"clientId\":\"cn\"},\"zfoqouicybxar\":{\"principalId\":\"zkoj\",\"clientId\":\"c\"}}},\"properties\":{\"provisioningState\":\"Succeeded\",\"nginxVersion\":\"foxciq\",\"managedResourceGroup\":\"idoamciodhkha\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{}],\"privateIPAddresses\":[{}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"lwntoego\"}},\"ipAddress\":\"wbw\",\"enableDiagnosticsSupport\":true,\"logging\":{\"storageAccount\":{\"accountName\":\"mrv\",\"containerName\":\"ztvbtqgsfr\"}},\"scalingProperties\":{\"capacity\":2100359325,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"owtlmnguxawqald\",\"capacity\":{\"min\":2048944312,\"max\":1988673385}},{\"name\":\"uximerqfobw\",\"capacity\":{\"min\":2077702872,\"max\":880028215}},{\"name\":\"kby\",\"capacity\":{\"min\":1828204425,\"max\":189482477}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"pfhpagmhrskdsnfd\"},\"userProfile\":{\"preferredEmail\":\"akgtdlmkkzevdlh\"}},\"sku\":{\"name\":\"pusdstt\"},\"location\":\"ogvbbejdcngq\",\"tags\":{\"wr\":\"akufgmjz\",\"u\":\"grtwae\"},\"id\":\"zkopb\",\"name\":\"inrfdwoyu\",\"type\":\"hziuiefozbhdms\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - NginxManager manager = NginxManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NginxDeployment response - = manager.deployments() - .define("l") - .withRegion("kgjubgdknnqvsazn") - .withExistingResourceGroup("yfxrx") - .withTags(mapOf("mkycgra", "orudsgsa")) - .withIdentity( - new IdentityProperties().withType(IdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("msbvdkcrodtjinf", new UserIdentityProperties(), "pagao", - new UserIdentityProperties(), "sz", new UserIdentityProperties(), "vinvkj", - new UserIdentityProperties()))) - .withProperties(new NginxDeploymentProperties().withManagedResourceGroup("aztz") - .withNetworkProfile(new NginxNetworkProfile() - .withFrontEndIpConfiguration(new NginxFrontendIpConfiguration() - .withPublicIpAddresses(Arrays.asList(new NginxPublicIpAddress(), new NginxPublicIpAddress(), - new NginxPublicIpAddress(), new NginxPublicIpAddress())) - .withPrivateIpAddresses(Arrays.asList(new NginxPrivateIpAddress(), - new NginxPrivateIpAddress(), new NginxPrivateIpAddress(), new NginxPrivateIpAddress()))) - .withNetworkInterfaceConfiguration(new NginxNetworkInterfaceConfiguration().withSubnetId("fz"))) - .withEnableDiagnosticsSupport(false) - .withLogging(new NginxLogging().withStorageAccount( - new NginxStorageAccount().withAccountName("zfeqztppri").withContainerName("xorjaltolmncwsob"))) - .withScalingProperties(new NginxDeploymentScalingProperties().withCapacity(1713401176) - .withProfiles(Arrays.asList( - new ScaleProfile().withName("nwdcfhu") - .withCapacity(new ScaleProfileCapacity().withMin(1589501712).withMax(1491398356)), - new ScaleProfile().withName("pfuvglsbjjca") - .withCapacity(new ScaleProfileCapacity().withMin(615108235).withMax(1995846414))))) - .withAutoUpgradeProfile(new AutoUpgradeProfile().withUpgradeChannel("vtvudutncormr")) - .withUserProfile(new NginxDeploymentUserProfile().withPreferredEmail("tvcof"))) - .withSku(new ResourceSku().withName("f")) - .create(); - - Assertions.assertEquals("ogvbbejdcngq", response.location()); - Assertions.assertEquals("akufgmjz", response.tags().get("wr")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("idoamciodhkha", response.properties().managedResourceGroup()); - Assertions.assertEquals("lwntoego", - response.properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(true, response.properties().enableDiagnosticsSupport()); - Assertions.assertEquals("mrv", response.properties().logging().storageAccount().accountName()); - Assertions.assertEquals("ztvbtqgsfr", response.properties().logging().storageAccount().containerName()); - Assertions.assertEquals(2100359325, response.properties().scalingProperties().capacity()); - Assertions.assertEquals("owtlmnguxawqald", response.properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(2048944312, - response.properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(1988673385, - response.properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("pfhpagmhrskdsnfd", response.properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("akgtdlmkkzevdlh", response.properties().userProfile().preferredEmail()); - Assertions.assertEquals("pusdstt", response.sku().name()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsDeleteMockTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsDeleteMockTests.java deleted file mode 100644 index a5ea7a6467f27..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsDeleteMockTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class DeploymentsDeleteMockTests { - @Test - public void testDelete() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - NginxManager manager = NginxManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.deployments().delete("e", "iipfpubj", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsGetByResourceGroupWithResponseMockTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index b6305dadbbf3a..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.IdentityType; -import com.azure.resourcemanager.nginx.models.NginxDeployment; -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 DeploymentsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"identity\":{\"principalId\":\"bexkpzksmondj\",\"tenantId\":\"uxvypomgkopkwh\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"vhelxprglyatdd\":{\"principalId\":\"qgxy\",\"clientId\":\"ocmbqfqvmkcxoza\"},\"sdqrhzoymibmrq\":{\"principalId\":\"cbcuejrjxgciqi\",\"clientId\":\"hos\"}}},\"properties\":{\"provisioningState\":\"Failed\",\"nginxVersion\":\"wfluszdt\",\"managedResourceGroup\":\"rkwofyyvoqa\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{},{},{}],\"privateIPAddresses\":[{},{},{},{}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"iwbwoenwashrtdtk\"}},\"ipAddress\":\"qxwbpokulpiu\",\"enableDiagnosticsSupport\":false,\"logging\":{\"storageAccount\":{\"accountName\":\"pqiiobyuqe\",\"containerName\":\"qlpqwcciuq\"}},\"scalingProperties\":{\"capacity\":1924773766,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"auvfbtkuwhhmhyk\",\"capacity\":{\"min\":697722485,\"max\":1183832331}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"afnn\"},\"userProfile\":{\"preferredEmail\":\"ichkoymkcdyhb\"}},\"sku\":{\"name\":\"kpw\"},\"location\":\"eqnovvqfovl\",\"tags\":{\"ndsytgadg\":\"wsuwsyr\",\"ea\":\"r\"},\"id\":\"neqn\",\"name\":\"arrwlquu\",\"type\":\"jfqka\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - NginxManager manager = NginxManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NginxDeployment response = manager.deployments() - .getByResourceGroupWithResponse("yhrfouyftaakcpw", "yzvqt", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("eqnovvqfovl", response.location()); - Assertions.assertEquals("wsuwsyr", response.tags().get("ndsytgadg")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals("rkwofyyvoqa", response.properties().managedResourceGroup()); - Assertions.assertEquals("iwbwoenwashrtdtk", - response.properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(false, response.properties().enableDiagnosticsSupport()); - Assertions.assertEquals("pqiiobyuqe", response.properties().logging().storageAccount().accountName()); - Assertions.assertEquals("qlpqwcciuq", response.properties().logging().storageAccount().containerName()); - Assertions.assertEquals(1924773766, response.properties().scalingProperties().capacity()); - Assertions.assertEquals("auvfbtkuwhhmhyk", response.properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(697722485, - response.properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(1183832331, - response.properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("afnn", response.properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("ichkoymkcdyhb", response.properties().userProfile().preferredEmail()); - Assertions.assertEquals("kpw", response.sku().name()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsListByResourceGroupMockTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsListByResourceGroupMockTests.java deleted file mode 100644 index 177a231f93ddd..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsListByResourceGroupMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.IdentityType; -import com.azure.resourcemanager.nginx.models.NginxDeployment; -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 DeploymentsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"identity\":{\"principalId\":\"tkl\",\"tenantId\":\"xbjhwuaanozjosph\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"kfcktqum\":{\"principalId\":\"rvxaglrvimjwosy\",\"clientId\":\"itc\"},\"eqidbqfatpx\":{\"principalId\":\"kkezzikhlyfjhdgq\",\"clientId\":\"ebdunyg\"}}},\"properties\":{\"provisioningState\":\"Succeeded\",\"nginxVersion\":\"yjmoadsu\",\"managedResourceGroup\":\"r\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{},{}],\"privateIPAddresses\":[{},{},{}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"bjhhyx\"}},\"ipAddress\":\"wlycoduhpkxkg\",\"enableDiagnosticsSupport\":false,\"logging\":{\"storageAccount\":{\"accountName\":\"n\",\"containerName\":\"xqugjhkycubedd\"}},\"scalingProperties\":{\"capacity\":947899145,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"qmzqalkrmnjijpx\",\"capacity\":{\"min\":1400063393,\"max\":222517676}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"udfnbyxba\"},\"userProfile\":{\"preferredEmail\":\"jyvayffimrzrtuz\"}},\"sku\":{\"name\":\"gsexne\"},\"location\":\"dnw\",\"tags\":{\"ud\":\"ewzsyyceuzsoib\",\"brqubp\":\"frxtrthzvaytdwk\"},\"id\":\"xhexiilivpdti\",\"name\":\"r\",\"type\":\"tdqoaxoruzfgsq\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - NginxManager manager = NginxManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.deployments().listByResourceGroup("elpcirelsfeaenwa", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("dnw", response.iterator().next().location()); - Assertions.assertEquals("ewzsyyceuzsoib", response.iterator().next().tags().get("ud")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("r", response.iterator().next().properties().managedResourceGroup()); - Assertions.assertEquals("bjhhyx", - response.iterator().next().properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(false, response.iterator().next().properties().enableDiagnosticsSupport()); - Assertions.assertEquals("n", response.iterator().next().properties().logging().storageAccount().accountName()); - Assertions.assertEquals("xqugjhkycubedd", - response.iterator().next().properties().logging().storageAccount().containerName()); - Assertions.assertEquals(947899145, response.iterator().next().properties().scalingProperties().capacity()); - Assertions.assertEquals("qmzqalkrmnjijpx", - response.iterator().next().properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(1400063393, - response.iterator().next().properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(222517676, - response.iterator().next().properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("udfnbyxba", - response.iterator().next().properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("jyvayffimrzrtuz", - response.iterator().next().properties().userProfile().preferredEmail()); - Assertions.assertEquals("gsexne", response.iterator().next().sku().name()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsListMockTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsListMockTests.java deleted file mode 100644 index 41f347b02f04e..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsListMockTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.IdentityType; -import com.azure.resourcemanager.nginx.models.NginxDeployment; -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 DeploymentsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"identity\":{\"principalId\":\"wifto\",\"tenantId\":\"kvpuvksgplsaknyn\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"eosjswsr\":{\"principalId\":\"ph\",\"clientId\":\"pxodlqiyntorzih\"},\"zynkedya\":{\"principalId\":\"lyzrpzbchckqqzqi\",\"clientId\":\"iysui\"},\"pcdpumnz\":{\"principalId\":\"wyhqmibzyhwits\",\"clientId\":\"pyy\"}}},\"properties\":{\"provisioningState\":\"Deleting\",\"nginxVersion\":\"mabiknsorgjhxb\",\"managedResourceGroup\":\"tlwwrlk\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{},{},{},{}],\"privateIPAddresses\":[{}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"tllxdyhgsyocogj\"}},\"ipAddress\":\"dtbnnha\",\"enableDiagnosticsSupport\":true,\"logging\":{\"storageAccount\":{\"accountName\":\"vcikhnvpamqgx\",\"containerName\":\"u\"}},\"scalingProperties\":{\"capacity\":1817330156,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"ggxkallatmelwuip\",\"capacity\":{\"min\":555730544,\"max\":1103817240}},{\"name\":\"jzkzi\",\"capacity\":{\"min\":766917495,\"max\":1783583685}},{\"name\":\"vc\",\"capacity\":{\"min\":2028866606,\"max\":192957128}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"hyrnxxmu\"},\"userProfile\":{\"preferredEmail\":\"ndrdvstkwq\"}},\"sku\":{\"name\":\"chea\"},\"location\":\"fmtdaaygdvwvgp\",\"tags\":{\"xrtfudxep\":\"g\",\"himdbl\":\"gyqagvrvmnpkuk\",\"hfjx\":\"gwimfn\"},\"id\":\"mszkkfo\",\"name\":\"rey\",\"type\":\"kzikfjawneaivxwc\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - NginxManager manager = NginxManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.deployments().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fmtdaaygdvwvgp", response.iterator().next().location()); - Assertions.assertEquals("g", response.iterator().next().tags().get("xrtfudxep")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("tlwwrlk", response.iterator().next().properties().managedResourceGroup()); - Assertions.assertEquals("tllxdyhgsyocogj", - response.iterator().next().properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(true, response.iterator().next().properties().enableDiagnosticsSupport()); - Assertions.assertEquals("vcikhnvpamqgx", - response.iterator().next().properties().logging().storageAccount().accountName()); - Assertions.assertEquals("u", - response.iterator().next().properties().logging().storageAccount().containerName()); - Assertions.assertEquals(1817330156, response.iterator().next().properties().scalingProperties().capacity()); - Assertions.assertEquals("ggxkallatmelwuip", - response.iterator().next().properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(555730544, - response.iterator().next().properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(1103817240, - response.iterator().next().properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("hyrnxxmu", - response.iterator().next().properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("ndrdvstkwq", response.iterator().next().properties().userProfile().preferredEmail()); - Assertions.assertEquals("chea", response.iterator().next().sku().name()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/IdentityPropertiesTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/IdentityPropertiesTests.java deleted file mode 100644 index b3a3c0b38f8a1..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/IdentityPropertiesTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.IdentityProperties; -import com.azure.resourcemanager.nginx.models.IdentityType; -import com.azure.resourcemanager.nginx.models.UserIdentityProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IdentityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IdentityProperties model = BinaryData.fromString( - "{\"principalId\":\"k\",\"tenantId\":\"xo\",\"type\":\"None\",\"userAssignedIdentities\":{\"whijcoejctbza\":{\"principalId\":\"pimexgstxgcpodg\",\"clientId\":\"ajrmvdjwzrlovmc\"},\"xaxcfjpgddtocjjx\":{\"principalId\":\"qsycbkbfkgu\",\"clientId\":\"kexxppof\"},\"jnxqbzvddntwn\":{\"principalId\":\"pmouexhdz\",\"clientId\":\"bqe\"}}}") - .toObject(IdentityProperties.class); - Assertions.assertEquals(IdentityType.NONE, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IdentityProperties model = new IdentityProperties().withType(IdentityType.NONE) - .withUserAssignedIdentities(mapOf("whijcoejctbza", new UserIdentityProperties(), "xaxcfjpgddtocjjx", - new UserIdentityProperties(), "jnxqbzvddntwn", new UserIdentityProperties())); - model = BinaryData.fromObject(model).toObject(IdentityProperties.class); - Assertions.assertEquals(IdentityType.NONE, model.type()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationFileTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationFileTests.java deleted file mode 100644 index c9a296152dad8..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationFileTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.NginxConfigurationFile; -import org.junit.jupiter.api.Assertions; - -public final class NginxConfigurationFileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxConfigurationFile model - = BinaryData.fromString("{\"content\":\"fdosyg\",\"virtualPath\":\"paojakhmsbzjh\"}") - .toObject(NginxConfigurationFile.class); - Assertions.assertEquals("fdosyg", model.content()); - Assertions.assertEquals("paojakhmsbzjh", model.virtualPath()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxConfigurationFile model - = new NginxConfigurationFile().withContent("fdosyg").withVirtualPath("paojakhmsbzjh"); - model = BinaryData.fromObject(model).toObject(NginxConfigurationFile.class); - Assertions.assertEquals("fdosyg", model.content()); - Assertions.assertEquals("paojakhmsbzjh", model.virtualPath()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationInnerTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationInnerTests.java deleted file mode 100644 index 7098d709ac23c..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationInnerTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.fluent.models.NginxConfigurationInner; -import com.azure.resourcemanager.nginx.models.NginxConfigurationFile; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import com.azure.resourcemanager.nginx.models.NginxConfigurationProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NginxConfigurationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxConfigurationInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Failed\",\"files\":[{\"content\":\"fp\",\"virtualPath\":\"qobmtukk\"},{\"content\":\"yrtih\",\"virtualPath\":\"tijbpzvgnwzsymgl\"},{\"content\":\"fcyzkohdbihanufh\",\"virtualPath\":\"bj\"}],\"protectedFiles\":[{\"content\":\"ithxqhabifpi\",\"virtualPath\":\"wczbys\"}],\"package\":{\"data\":\"q\",\"protectedFiles\":[\"ivyqniwbybrkxvd\"]},\"rootFile\":\"jgrtfwvukxga\"},\"location\":\"ccsnhsjc\",\"id\":\"ejhkry\",\"name\":\"tnapczwlokjyemkk\",\"type\":\"ni\"}") - .toObject(NginxConfigurationInner.class); - Assertions.assertEquals("fp", model.properties().files().get(0).content()); - Assertions.assertEquals("qobmtukk", model.properties().files().get(0).virtualPath()); - Assertions.assertEquals("ithxqhabifpi", model.properties().protectedFiles().get(0).content()); - Assertions.assertEquals("wczbys", model.properties().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("q", model.properties().packageProperty().data()); - Assertions.assertEquals("ivyqniwbybrkxvd", model.properties().packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("jgrtfwvukxga", model.properties().rootFile()); - Assertions.assertEquals("ccsnhsjc", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxConfigurationInner model = new NginxConfigurationInner().withProperties(new NginxConfigurationProperties() - .withFiles(Arrays.asList(new NginxConfigurationFile().withContent("fp").withVirtualPath("qobmtukk"), - new NginxConfigurationFile().withContent("yrtih").withVirtualPath("tijbpzvgnwzsymgl"), - new NginxConfigurationFile().withContent("fcyzkohdbihanufh").withVirtualPath("bj"))) - .withProtectedFiles( - Arrays.asList(new NginxConfigurationFile().withContent("ithxqhabifpi").withVirtualPath("wczbys"))) - .withPackageProperty( - new NginxConfigurationPackage().withData("q").withProtectedFiles(Arrays.asList("ivyqniwbybrkxvd"))) - .withRootFile("jgrtfwvukxga")).withLocation("ccsnhsjc"); - model = BinaryData.fromObject(model).toObject(NginxConfigurationInner.class); - Assertions.assertEquals("fp", model.properties().files().get(0).content()); - Assertions.assertEquals("qobmtukk", model.properties().files().get(0).virtualPath()); - Assertions.assertEquals("ithxqhabifpi", model.properties().protectedFiles().get(0).content()); - Assertions.assertEquals("wczbys", model.properties().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("q", model.properties().packageProperty().data()); - Assertions.assertEquals("ivyqniwbybrkxvd", model.properties().packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("jgrtfwvukxga", model.properties().rootFile()); - Assertions.assertEquals("ccsnhsjc", model.location()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationListResponseTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationListResponseTests.java deleted file mode 100644 index 49ee1a677106d..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationListResponseTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.fluent.models.NginxConfigurationInner; -import com.azure.resourcemanager.nginx.models.NginxConfigurationFile; -import com.azure.resourcemanager.nginx.models.NginxConfigurationListResponse; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import com.azure.resourcemanager.nginx.models.NginxConfigurationProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NginxConfigurationListResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxConfigurationListResponse model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"files\":[{\"content\":\"mtqio\",\"virtualPath\":\"zehtbmu\"},{\"content\":\"ownoizhw\",\"virtualPath\":\"xybqsoqij\"},{\"content\":\"dmbpazlobcufpdz\",\"virtualPath\":\"btcqq\"}],\"protectedFiles\":[{\"content\":\"lhqgnufooojy\",\"virtualPath\":\"fsqesaagdfmglzlh\"},{\"content\":\"rifkwm\",\"virtualPath\":\"ktsizntocipaou\"}],\"package\":{\"data\":\"s\",\"protectedFiles\":[\"mpoyfd\",\"fogknygjofjdde\",\"s\",\"deupewnwrei\"]},\"rootFile\":\"zyf\"},\"location\":\"sarhmofc\",\"id\":\"smy\",\"name\":\"rkdtmlxh\",\"type\":\"kuksjtxukcdm\"}],\"nextLink\":\"rcryuanzwuxzdxta\"}") - .toObject(NginxConfigurationListResponse.class); - Assertions.assertEquals("mtqio", model.value().get(0).properties().files().get(0).content()); - Assertions.assertEquals("zehtbmu", model.value().get(0).properties().files().get(0).virtualPath()); - Assertions.assertEquals("lhqgnufooojy", model.value().get(0).properties().protectedFiles().get(0).content()); - Assertions.assertEquals("fsqesaagdfmglzlh", - model.value().get(0).properties().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("s", model.value().get(0).properties().packageProperty().data()); - Assertions.assertEquals("mpoyfd", model.value().get(0).properties().packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("zyf", model.value().get(0).properties().rootFile()); - Assertions.assertEquals("sarhmofc", model.value().get(0).location()); - Assertions.assertEquals("rcryuanzwuxzdxta", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxConfigurationListResponse model - = new NginxConfigurationListResponse() - .withValue(Arrays.asList( - new NginxConfigurationInner() - .withProperties( - new NginxConfigurationProperties() - .withFiles(Arrays.asList( - new NginxConfigurationFile().withContent("mtqio").withVirtualPath("zehtbmu"), - new NginxConfigurationFile().withContent("ownoizhw").withVirtualPath("xybqsoqij"), - new NginxConfigurationFile().withContent("dmbpazlobcufpdz") - .withVirtualPath("btcqq"))) - .withProtectedFiles(Arrays.asList( - new NginxConfigurationFile().withContent("lhqgnufooojy") - .withVirtualPath("fsqesaagdfmglzlh"), - new NginxConfigurationFile().withContent("rifkwm") - .withVirtualPath("ktsizntocipaou"))) - .withPackageProperty(new NginxConfigurationPackage().withData("s") - .withProtectedFiles(Arrays.asList("mpoyfd", "fogknygjofjdde", "s", "deupewnwrei"))) - .withRootFile("zyf")) - .withLocation("sarhmofc"))) - .withNextLink("rcryuanzwuxzdxta"); - model = BinaryData.fromObject(model).toObject(NginxConfigurationListResponse.class); - Assertions.assertEquals("mtqio", model.value().get(0).properties().files().get(0).content()); - Assertions.assertEquals("zehtbmu", model.value().get(0).properties().files().get(0).virtualPath()); - Assertions.assertEquals("lhqgnufooojy", model.value().get(0).properties().protectedFiles().get(0).content()); - Assertions.assertEquals("fsqesaagdfmglzlh", - model.value().get(0).properties().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("s", model.value().get(0).properties().packageProperty().data()); - Assertions.assertEquals("mpoyfd", model.value().get(0).properties().packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("zyf", model.value().get(0).properties().rootFile()); - Assertions.assertEquals("sarhmofc", model.value().get(0).location()); - Assertions.assertEquals("rcryuanzwuxzdxta", model.nextLink()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationPackageTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationPackageTests.java deleted file mode 100644 index f2fcf2200e051..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationPackageTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NginxConfigurationPackageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxConfigurationPackage model - = BinaryData.fromString("{\"data\":\"zevdphlx\",\"protectedFiles\":[\"thqt\",\"gqjbpfzfsin\",\"gvfcj\"]}") - .toObject(NginxConfigurationPackage.class); - Assertions.assertEquals("zevdphlx", model.data()); - Assertions.assertEquals("thqt", model.protectedFiles().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxConfigurationPackage model = new NginxConfigurationPackage().withData("zevdphlx") - .withProtectedFiles(Arrays.asList("thqt", "gqjbpfzfsin", "gvfcj")); - model = BinaryData.fromObject(model).toObject(NginxConfigurationPackage.class); - Assertions.assertEquals("zevdphlx", model.data()); - Assertions.assertEquals("thqt", model.protectedFiles().get(0)); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationPropertiesTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationPropertiesTests.java deleted file mode 100644 index 1584502804e66..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationPropertiesTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.NginxConfigurationFile; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import com.azure.resourcemanager.nginx.models.NginxConfigurationProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NginxConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxConfigurationProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Updating\",\"files\":[{\"content\":\"nchgej\",\"virtualPath\":\"odmailzyd\"}],\"protectedFiles\":[{\"content\":\"wyahuxinpmqnja\",\"virtualPath\":\"ixjsprozvcputeg\"}],\"package\":{\"data\":\"mfdatscmdvpj\",\"protectedFiles\":[\"suuv\",\"kjozkrwfnd\",\"odjpslwejd\",\"vwryoqpso\"]},\"rootFile\":\"ctazakljlahbcryf\"}") - .toObject(NginxConfigurationProperties.class); - Assertions.assertEquals("nchgej", model.files().get(0).content()); - Assertions.assertEquals("odmailzyd", model.files().get(0).virtualPath()); - Assertions.assertEquals("wyahuxinpmqnja", model.protectedFiles().get(0).content()); - Assertions.assertEquals("ixjsprozvcputeg", model.protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("mfdatscmdvpj", model.packageProperty().data()); - Assertions.assertEquals("suuv", model.packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("ctazakljlahbcryf", model.rootFile()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxConfigurationProperties model = new NginxConfigurationProperties() - .withFiles(Arrays.asList(new NginxConfigurationFile().withContent("nchgej").withVirtualPath("odmailzyd"))) - .withProtectedFiles(Arrays - .asList(new NginxConfigurationFile().withContent("wyahuxinpmqnja").withVirtualPath("ixjsprozvcputeg"))) - .withPackageProperty(new NginxConfigurationPackage().withData("mfdatscmdvpj") - .withProtectedFiles(Arrays.asList("suuv", "kjozkrwfnd", "odjpslwejd", "vwryoqpso"))) - .withRootFile("ctazakljlahbcryf"); - model = BinaryData.fromObject(model).toObject(NginxConfigurationProperties.class); - Assertions.assertEquals("nchgej", model.files().get(0).content()); - Assertions.assertEquals("odmailzyd", model.files().get(0).virtualPath()); - Assertions.assertEquals("wyahuxinpmqnja", model.protectedFiles().get(0).content()); - Assertions.assertEquals("ixjsprozvcputeg", model.protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("mfdatscmdvpj", model.packageProperty().data()); - Assertions.assertEquals("suuv", model.packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("ctazakljlahbcryf", model.rootFile()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentInnerTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentInnerTests.java deleted file mode 100644 index 9594323571d68..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentInnerTests.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentInner; -import com.azure.resourcemanager.nginx.models.AutoUpgradeProfile; -import com.azure.resourcemanager.nginx.models.IdentityProperties; -import com.azure.resourcemanager.nginx.models.IdentityType; -import com.azure.resourcemanager.nginx.models.NginxDeploymentProperties; -import com.azure.resourcemanager.nginx.models.NginxDeploymentScalingProperties; -import com.azure.resourcemanager.nginx.models.NginxDeploymentUserProfile; -import com.azure.resourcemanager.nginx.models.NginxFrontendIpConfiguration; -import com.azure.resourcemanager.nginx.models.NginxLogging; -import com.azure.resourcemanager.nginx.models.NginxNetworkInterfaceConfiguration; -import com.azure.resourcemanager.nginx.models.NginxNetworkProfile; -import com.azure.resourcemanager.nginx.models.NginxPrivateIpAddress; -import com.azure.resourcemanager.nginx.models.NginxPrivateIpAllocationMethod; -import com.azure.resourcemanager.nginx.models.NginxPublicIpAddress; -import com.azure.resourcemanager.nginx.models.NginxStorageAccount; -import com.azure.resourcemanager.nginx.models.ResourceSku; -import com.azure.resourcemanager.nginx.models.ScaleProfile; -import com.azure.resourcemanager.nginx.models.ScaleProfileCapacity; -import com.azure.resourcemanager.nginx.models.UserIdentityProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NginxDeploymentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxDeploymentInner model = BinaryData.fromString( - "{\"identity\":{\"principalId\":\"tnwu\",\"tenantId\":\"gazxuf\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"kfthwxmntei\":{\"principalId\":\"fihrfi\",\"clientId\":\"vzwdzuhtymwis\"}}},\"properties\":{\"provisioningState\":\"Deleting\",\"nginxVersion\":\"km\",\"managedResourceGroup\":\"c\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{\"id\":\"fufsrpymzi\"},{\"id\":\"sezcxtb\"},{\"id\":\"gfycc\"}],\"privateIPAddresses\":[{\"privateIPAddress\":\"mdwzjeiachboo\",\"privateIPAllocationMethod\":\"Static\",\"subnetId\":\"ro\"},{\"privateIPAddress\":\"qpteeh\",\"privateIPAllocationMethod\":\"Dynamic\",\"subnetId\":\"pyqr\"}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"inpvswjdkirsoodq\"}},\"ipAddress\":\"crmnohjtckwhds\",\"enableDiagnosticsSupport\":true,\"logging\":{\"storageAccount\":{\"accountName\":\"pjxsqwpgrjbznor\",\"containerName\":\"xv\"}},\"scalingProperties\":{\"capacity\":1906799262,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"abnmocpcyshu\",\"capacity\":{\"min\":818060655,\"max\":2023442123}},{\"name\":\"fblj\",\"capacity\":{\"min\":844718571,\"max\":527758336}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"toqcjmklja\"},\"userProfile\":{\"preferredEmail\":\"idtqajzyu\"}},\"sku\":{\"name\":\"kudjkrlkhb\"},\"location\":\"fepgzgq\",\"tags\":{\"c\":\"locx\"},\"id\":\"aierhhb\",\"name\":\"sglumma\",\"type\":\"tjaodxobnb\"}") - .toObject(NginxDeploymentInner.class); - Assertions.assertEquals("fepgzgq", model.location()); - Assertions.assertEquals("locx", model.tags().get("c")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("c", model.properties().managedResourceGroup()); - Assertions.assertEquals("fufsrpymzi", - model.properties().networkProfile().frontEndIpConfiguration().publicIpAddresses().get(0).id()); - Assertions.assertEquals("mdwzjeiachboo", - model.properties() - .networkProfile() - .frontEndIpConfiguration() - .privateIpAddresses() - .get(0) - .privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.STATIC, - model.properties() - .networkProfile() - .frontEndIpConfiguration() - .privateIpAddresses() - .get(0) - .privateIpAllocationMethod()); - Assertions.assertEquals("ro", - model.properties().networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).subnetId()); - Assertions.assertEquals("inpvswjdkirsoodq", - model.properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(true, model.properties().enableDiagnosticsSupport()); - Assertions.assertEquals("pjxsqwpgrjbznor", model.properties().logging().storageAccount().accountName()); - Assertions.assertEquals("xv", model.properties().logging().storageAccount().containerName()); - Assertions.assertEquals(1906799262, model.properties().scalingProperties().capacity()); - Assertions.assertEquals("abnmocpcyshu", model.properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(818060655, model.properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(2023442123, model.properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("toqcjmklja", model.properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("idtqajzyu", model.properties().userProfile().preferredEmail()); - Assertions.assertEquals("kudjkrlkhb", model.sku().name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentInner model - = new NginxDeploymentInner().withLocation("fepgzgq") - .withTags(mapOf("c", "locx")) - .withIdentity(new IdentityProperties().withType(IdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("kfthwxmntei", new UserIdentityProperties()))) - .withProperties( - new NginxDeploymentProperties().withManagedResourceGroup("c") - .withNetworkProfile( - new NginxNetworkProfile() - .withFrontEndIpConfiguration( - new NginxFrontendIpConfiguration() - .withPublicIpAddresses( - Arrays.asList(new NginxPublicIpAddress().withId("fufsrpymzi"), - new NginxPublicIpAddress().withId("sezcxtb"), - new NginxPublicIpAddress().withId("gfycc"))) - .withPrivateIpAddresses( - Arrays.asList( - new NginxPrivateIpAddress().withPrivateIpAddress("mdwzjeiachboo") - .withPrivateIpAllocationMethod( - NginxPrivateIpAllocationMethod.STATIC) - .withSubnetId("ro"), - new NginxPrivateIpAddress().withPrivateIpAddress("qpteeh") - .withPrivateIpAllocationMethod( - NginxPrivateIpAllocationMethod.DYNAMIC) - .withSubnetId("pyqr")))) - .withNetworkInterfaceConfiguration( - new NginxNetworkInterfaceConfiguration().withSubnetId("inpvswjdkirsoodq"))) - .withEnableDiagnosticsSupport(true) - .withLogging(new NginxLogging().withStorageAccount( - new NginxStorageAccount().withAccountName("pjxsqwpgrjbznor").withContainerName("xv"))) - .withScalingProperties(new NginxDeploymentScalingProperties().withCapacity(1906799262) - .withProfiles(Arrays.asList( - new ScaleProfile().withName("abnmocpcyshu") - .withCapacity(new ScaleProfileCapacity().withMin(818060655).withMax(2023442123)), - new ScaleProfile().withName("fblj") - .withCapacity(new ScaleProfileCapacity().withMin(844718571).withMax(527758336))))) - .withAutoUpgradeProfile(new AutoUpgradeProfile().withUpgradeChannel("toqcjmklja")) - .withUserProfile(new NginxDeploymentUserProfile().withPreferredEmail("idtqajzyu"))) - .withSku(new ResourceSku().withName("kudjkrlkhb")); - model = BinaryData.fromObject(model).toObject(NginxDeploymentInner.class); - Assertions.assertEquals("fepgzgq", model.location()); - Assertions.assertEquals("locx", model.tags().get("c")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("c", model.properties().managedResourceGroup()); - Assertions.assertEquals("fufsrpymzi", - model.properties().networkProfile().frontEndIpConfiguration().publicIpAddresses().get(0).id()); - Assertions.assertEquals("mdwzjeiachboo", - model.properties() - .networkProfile() - .frontEndIpConfiguration() - .privateIpAddresses() - .get(0) - .privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.STATIC, - model.properties() - .networkProfile() - .frontEndIpConfiguration() - .privateIpAddresses() - .get(0) - .privateIpAllocationMethod()); - Assertions.assertEquals("ro", - model.properties().networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).subnetId()); - Assertions.assertEquals("inpvswjdkirsoodq", - model.properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(true, model.properties().enableDiagnosticsSupport()); - Assertions.assertEquals("pjxsqwpgrjbznor", model.properties().logging().storageAccount().accountName()); - Assertions.assertEquals("xv", model.properties().logging().storageAccount().containerName()); - Assertions.assertEquals(1906799262, model.properties().scalingProperties().capacity()); - Assertions.assertEquals("abnmocpcyshu", model.properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(818060655, model.properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(2023442123, model.properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("toqcjmklja", model.properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("idtqajzyu", model.properties().userProfile().preferredEmail()); - Assertions.assertEquals("kudjkrlkhb", model.sku().name()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentListResponseTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentListResponseTests.java deleted file mode 100644 index 3e942f1abb722..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentListResponseTests.java +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentInner; -import com.azure.resourcemanager.nginx.models.AutoUpgradeProfile; -import com.azure.resourcemanager.nginx.models.IdentityProperties; -import com.azure.resourcemanager.nginx.models.IdentityType; -import com.azure.resourcemanager.nginx.models.NginxDeploymentListResponse; -import com.azure.resourcemanager.nginx.models.NginxDeploymentProperties; -import com.azure.resourcemanager.nginx.models.NginxDeploymentScalingProperties; -import com.azure.resourcemanager.nginx.models.NginxDeploymentUserProfile; -import com.azure.resourcemanager.nginx.models.NginxFrontendIpConfiguration; -import com.azure.resourcemanager.nginx.models.NginxLogging; -import com.azure.resourcemanager.nginx.models.NginxNetworkInterfaceConfiguration; -import com.azure.resourcemanager.nginx.models.NginxNetworkProfile; -import com.azure.resourcemanager.nginx.models.NginxPrivateIpAddress; -import com.azure.resourcemanager.nginx.models.NginxPublicIpAddress; -import com.azure.resourcemanager.nginx.models.NginxStorageAccount; -import com.azure.resourcemanager.nginx.models.ResourceSku; -import com.azure.resourcemanager.nginx.models.ScaleProfile; -import com.azure.resourcemanager.nginx.models.ScaleProfileCapacity; -import com.azure.resourcemanager.nginx.models.UserIdentityProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NginxDeploymentListResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxDeploymentListResponse model = BinaryData.fromString( - "{\"value\":[{\"identity\":{\"principalId\":\"xoegukgjnpiucgy\",\"tenantId\":\"vqzntypmrbpizcdr\",\"type\":\"None\",\"userAssignedIdentities\":{\"ishc\":{\"principalId\":\"dnfyhxdeoejzicwi\",\"clientId\":\"jttgzf\"}}},\"properties\":{\"provisioningState\":\"Creating\",\"nginxVersion\":\"deyeamdphagalpbu\",\"managedResourceGroup\":\"gipwhonowkg\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{},{},{}],\"privateIPAddresses\":[{},{},{},{}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"bin\"}},\"ipAddress\":\"pu\",\"enableDiagnosticsSupport\":false,\"logging\":{\"storageAccount\":{\"accountName\":\"nuzo\",\"containerName\":\"tiyqzrnkcqv\"}},\"scalingProperties\":{\"capacity\":798441434,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"lsicohoqqnwv\",\"capacity\":{\"min\":1444459691,\"max\":759862878}},{\"name\":\"avwhheunm\",\"capacity\":{\"min\":1861834573,\"max\":375848936}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"yxzk\"},\"userProfile\":{\"preferredEmail\":\"cukoklyaxuconu\"}},\"sku\":{\"name\":\"zf\"},\"location\":\"eyp\",\"tags\":{\"enhwlrs\":\"mjmwvvjektcx\",\"qylihkaetckt\":\"frzpwvlqdqgb\",\"ctq\":\"fcivfsnkym\"},\"id\":\"jf\",\"name\":\"ebrjcxe\",\"type\":\"fuwutttxf\"},{\"identity\":{\"principalId\":\"birphxepcyva\",\"tenantId\":\"nljky\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"oxgvclt\":{\"principalId\":\"j\",\"clientId\":\"idokgjlj\"},\"gx\":{\"principalId\":\"sncghkjeszz\",\"clientId\":\"ijhtxf\"},\"odebfqkkrbmpu\":{\"principalId\":\"smx\",\"clientId\":\"hmpvecx\"},\"cispnqzahmgkbr\":{\"principalId\":\"riwflzlfb\",\"clientId\":\"puz\"}}},\"properties\":{\"provisioningState\":\"Updating\",\"nginxVersion\":\"ibnuqqkpik\",\"managedResourceGroup\":\"rgvtqag\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{},{},{}],\"privateIPAddresses\":[{},{},{}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"gmebfsiarbutrcv\"}},\"ipAddress\":\"azzmhjrunmpxt\",\"enableDiagnosticsSupport\":false,\"logging\":{\"storageAccount\":{\"accountName\":\"nlankxmyskpb\",\"containerName\":\"nbtkcxywnytnr\"}},\"scalingProperties\":{\"capacity\":1641130583,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"dybyxczfclhaa\",\"capacity\":{\"min\":1122692891,\"max\":904573366}},{\"name\":\"abphlw\",\"capacity\":{\"min\":77204722,\"max\":2142840160}},{\"name\":\"fkts\",\"capacity\":{\"min\":1572483367,\"max\":1927626418}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"cocmnyyaztt\"},\"userProfile\":{\"preferredEmail\":\"wrqpue\"}},\"sku\":{\"name\":\"kzywbiex\"},\"location\":\"eyueaxibxujwb\",\"tags\":{\"cuxrhdwbavx\":\"almuzyoxaepdkzja\"},\"id\":\"niwdjsw\",\"name\":\"tsdbpgn\",\"type\":\"ytxhp\"},{\"identity\":{\"principalId\":\"zpfzabglc\",\"tenantId\":\"xwtctyqiklbbovpl\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"mg\":{\"principalId\":\"yuguosvmkfssx\",\"clientId\":\"kkfpl\"},\"wzbaiue\":{\"principalId\":\"nkjzkdeslpvlop\",\"clientId\":\"yighxpk\"}}},\"properties\":{\"provisioningState\":\"Canceled\",\"nginxVersion\":\"nyqupedeojnabck\",\"managedResourceGroup\":\"mtxpsiebtfh\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{},{}],\"privateIPAddresses\":[{},{},{}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"dqmh\"}},\"ipAddress\":\"dhtldwkyz\",\"enableDiagnosticsSupport\":false,\"logging\":{\"storageAccount\":{\"accountName\":\"cwscwsvlx\",\"containerName\":\"ogtwrupqsxvnmi\"}},\"scalingProperties\":{\"capacity\":560100496,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"o\",\"capacity\":{\"min\":579723655,\"max\":1739821364}},{\"name\":\"lo\",\"capacity\":{\"min\":1344905503,\"max\":660644635}},{\"name\":\"tyfjfcnjbkcnxdhb\",\"capacity\":{\"min\":1418382226,\"max\":657781919}},{\"name\":\"phywpnvj\",\"capacity\":{\"min\":597860603,\"max\":1633235296}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"ermclfplphoxuscr\"},\"userProfile\":{\"preferredEmail\":\"gyepsbjt\"}},\"sku\":{\"name\":\"qugxywpmueefjzwf\"},\"location\":\"q\",\"tags\":{\"cq\":\"dsuyonobgla\"},\"id\":\"tcc\",\"name\":\"g\",\"type\":\"udxytlmoyrx\"}],\"nextLink\":\"fudwpznt\"}") - .toObject(NginxDeploymentListResponse.class); - Assertions.assertEquals("eyp", model.value().get(0).location()); - Assertions.assertEquals("mjmwvvjektcx", model.value().get(0).tags().get("enhwlrs")); - Assertions.assertEquals(IdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals("gipwhonowkg", model.value().get(0).properties().managedResourceGroup()); - Assertions.assertEquals("bin", - model.value().get(0).properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(false, model.value().get(0).properties().enableDiagnosticsSupport()); - Assertions.assertEquals("nuzo", model.value().get(0).properties().logging().storageAccount().accountName()); - Assertions.assertEquals("tiyqzrnkcqv", - model.value().get(0).properties().logging().storageAccount().containerName()); - Assertions.assertEquals(798441434, model.value().get(0).properties().scalingProperties().capacity()); - Assertions.assertEquals("lsicohoqqnwv", - model.value().get(0).properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(1444459691, - model.value().get(0).properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(759862878, - model.value().get(0).properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("yxzk", model.value().get(0).properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("cukoklyaxuconu", model.value().get(0).properties().userProfile().preferredEmail()); - Assertions.assertEquals("zf", model.value().get(0).sku().name()); - Assertions.assertEquals("fudwpznt", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentListResponse model - = new NginxDeploymentListResponse() - .withValue( - Arrays - .asList( - new NginxDeploymentInner().withLocation("eyp") - .withTags(mapOf("enhwlrs", "mjmwvvjektcx", "qylihkaetckt", "frzpwvlqdqgb", "ctq", - "fcivfsnkym")) - .withIdentity(new IdentityProperties().withType(IdentityType.NONE) - .withUserAssignedIdentities(mapOf("ishc", new UserIdentityProperties()))) - .withProperties( - new NginxDeploymentProperties().withManagedResourceGroup("gipwhonowkg") - .withNetworkProfile( - new NginxNetworkProfile() - .withFrontEndIpConfiguration(new NginxFrontendIpConfiguration() - .withPublicIpAddresses(Arrays.asList(new NginxPublicIpAddress(), - new NginxPublicIpAddress(), new NginxPublicIpAddress())) - .withPrivateIpAddresses(Arrays.asList(new NginxPrivateIpAddress(), - new NginxPrivateIpAddress(), new NginxPrivateIpAddress(), - new NginxPrivateIpAddress()))) - .withNetworkInterfaceConfiguration( - new NginxNetworkInterfaceConfiguration().withSubnetId("bin"))) - .withEnableDiagnosticsSupport(false) - .withLogging(new NginxLogging().withStorageAccount( - new NginxStorageAccount().withAccountName("nuzo") - .withContainerName("tiyqzrnkcqv"))) - .withScalingProperties(new NginxDeploymentScalingProperties().withCapacity( - 798441434) - .withProfiles(Arrays.asList( - new ScaleProfile().withName("lsicohoqqnwv") - .withCapacity(new ScaleProfileCapacity().withMin(1444459691) - .withMax(759862878)), - new ScaleProfile().withName("avwhheunm") - .withCapacity(new ScaleProfileCapacity().withMin(1861834573) - .withMax(375848936))))) - .withAutoUpgradeProfile(new AutoUpgradeProfile().withUpgradeChannel("yxzk")) - .withUserProfile( - new NginxDeploymentUserProfile().withPreferredEmail("cukoklyaxuconu"))) - .withSku(new ResourceSku().withName("zf")), - new NginxDeploymentInner().withLocation("eyueaxibxujwb") - .withTags(mapOf("cuxrhdwbavx", "almuzyoxaepdkzja")) - .withIdentity(new IdentityProperties().withType(IdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("oxgvclt", new UserIdentityProperties(), "gx", - new UserIdentityProperties(), "odebfqkkrbmpu", new UserIdentityProperties(), - "cispnqzahmgkbr", new UserIdentityProperties()))) - .withProperties( - new NginxDeploymentProperties().withManagedResourceGroup("rgvtqag") - .withNetworkProfile( - new NginxNetworkProfile() - .withFrontEndIpConfiguration(new NginxFrontendIpConfiguration() - .withPublicIpAddresses(Arrays.asList(new NginxPublicIpAddress(), - new NginxPublicIpAddress(), new NginxPublicIpAddress())) - .withPrivateIpAddresses(Arrays.asList(new NginxPrivateIpAddress(), - new NginxPrivateIpAddress(), new NginxPrivateIpAddress()))) - .withNetworkInterfaceConfiguration( - new NginxNetworkInterfaceConfiguration() - .withSubnetId("gmebfsiarbutrcv"))) - .withEnableDiagnosticsSupport(false) - .withLogging(new NginxLogging().withStorageAccount( - new NginxStorageAccount().withAccountName("nlankxmyskpb") - .withContainerName("nbtkcxywnytnr"))) - .withScalingProperties(new NginxDeploymentScalingProperties().withCapacity( - 1641130583) - .withProfiles(Arrays.asList( - new ScaleProfile().withName("dybyxczfclhaa") - .withCapacity(new ScaleProfileCapacity().withMin(1122692891) - .withMax(904573366)), - new ScaleProfile().withName("abphlw") - .withCapacity(new ScaleProfileCapacity().withMin(77204722) - .withMax(2142840160)), - new ScaleProfile().withName("fkts") - .withCapacity(new ScaleProfileCapacity().withMin(1572483367) - .withMax(1927626418))))) - .withAutoUpgradeProfile( - new AutoUpgradeProfile().withUpgradeChannel("cocmnyyaztt")) - .withUserProfile(new NginxDeploymentUserProfile().withPreferredEmail("wrqpue"))) - .withSku(new ResourceSku().withName("kzywbiex")), - new NginxDeploymentInner().withLocation("q") - .withTags(mapOf("cq", "dsuyonobgla")) - .withIdentity(new IdentityProperties().withType(IdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("mg", new UserIdentityProperties(), "wzbaiue", - new UserIdentityProperties()))) - .withProperties( - new NginxDeploymentProperties().withManagedResourceGroup("mtxpsiebtfh") - .withNetworkProfile(new NginxNetworkProfile() - .withFrontEndIpConfiguration(new NginxFrontendIpConfiguration() - .withPublicIpAddresses(Arrays.asList(new NginxPublicIpAddress(), - new NginxPublicIpAddress())) - .withPrivateIpAddresses(Arrays.asList(new NginxPrivateIpAddress(), - new NginxPrivateIpAddress(), new NginxPrivateIpAddress()))) - .withNetworkInterfaceConfiguration( - new NginxNetworkInterfaceConfiguration().withSubnetId("dqmh"))) - .withEnableDiagnosticsSupport(false) - .withLogging(new NginxLogging() - .withStorageAccount(new NginxStorageAccount().withAccountName("cwscwsvlx") - .withContainerName("ogtwrupqsxvnmi"))) - .withScalingProperties( - new NginxDeploymentScalingProperties().withCapacity(560100496) - .withProfiles(Arrays.asList( - new ScaleProfile().withName("o") - .withCapacity(new ScaleProfileCapacity().withMin(579723655) - .withMax(1739821364)), - new ScaleProfile().withName("lo") - .withCapacity(new ScaleProfileCapacity().withMin(1344905503) - .withMax(660644635)), - new ScaleProfile().withName("tyfjfcnjbkcnxdhb") - .withCapacity(new ScaleProfileCapacity().withMin(1418382226) - .withMax(657781919)), - new ScaleProfile().withName("phywpnvj") - .withCapacity(new ScaleProfileCapacity().withMin(597860603) - .withMax(1633235296))))) - .withAutoUpgradeProfile( - new AutoUpgradeProfile().withUpgradeChannel("ermclfplphoxuscr")) - .withUserProfile( - new NginxDeploymentUserProfile().withPreferredEmail("gyepsbjt"))) - .withSku(new ResourceSku().withName("qugxywpmueefjzwf")))) - .withNextLink("fudwpznt"); - model = BinaryData.fromObject(model).toObject(NginxDeploymentListResponse.class); - Assertions.assertEquals("eyp", model.value().get(0).location()); - Assertions.assertEquals("mjmwvvjektcx", model.value().get(0).tags().get("enhwlrs")); - Assertions.assertEquals(IdentityType.NONE, model.value().get(0).identity().type()); - Assertions.assertEquals("gipwhonowkg", model.value().get(0).properties().managedResourceGroup()); - Assertions.assertEquals("bin", - model.value().get(0).properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(false, model.value().get(0).properties().enableDiagnosticsSupport()); - Assertions.assertEquals("nuzo", model.value().get(0).properties().logging().storageAccount().accountName()); - Assertions.assertEquals("tiyqzrnkcqv", - model.value().get(0).properties().logging().storageAccount().containerName()); - Assertions.assertEquals(798441434, model.value().get(0).properties().scalingProperties().capacity()); - Assertions.assertEquals("lsicohoqqnwv", - model.value().get(0).properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(1444459691, - model.value().get(0).properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(759862878, - model.value().get(0).properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("yxzk", model.value().get(0).properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("cukoklyaxuconu", model.value().get(0).properties().userProfile().preferredEmail()); - Assertions.assertEquals("zf", model.value().get(0).sku().name()); - Assertions.assertEquals("fudwpznt", model.nextLink()); - } - - // 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/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentPropertiesTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentPropertiesTests.java deleted file mode 100644 index b6987bdcab1dd..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentPropertiesTests.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.AutoUpgradeProfile; -import com.azure.resourcemanager.nginx.models.NginxDeploymentProperties; -import com.azure.resourcemanager.nginx.models.NginxDeploymentScalingProperties; -import com.azure.resourcemanager.nginx.models.NginxDeploymentUserProfile; -import com.azure.resourcemanager.nginx.models.NginxFrontendIpConfiguration; -import com.azure.resourcemanager.nginx.models.NginxLogging; -import com.azure.resourcemanager.nginx.models.NginxNetworkInterfaceConfiguration; -import com.azure.resourcemanager.nginx.models.NginxNetworkProfile; -import com.azure.resourcemanager.nginx.models.NginxPrivateIpAddress; -import com.azure.resourcemanager.nginx.models.NginxPrivateIpAllocationMethod; -import com.azure.resourcemanager.nginx.models.NginxPublicIpAddress; -import com.azure.resourcemanager.nginx.models.NginxStorageAccount; -import com.azure.resourcemanager.nginx.models.ScaleProfile; -import com.azure.resourcemanager.nginx.models.ScaleProfileCapacity; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NginxDeploymentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxDeploymentProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Creating\",\"nginxVersion\":\"jqkwpyeicx\",\"managedResourceGroup\":\"ciwqvhk\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{\"id\":\"dtopbob\"},{\"id\":\"ghmewuam\"},{\"id\":\"hrzayvvtpgvdf\"}],\"privateIPAddresses\":[{\"privateIPAddress\":\"kftutqxlngxlefg\",\"privateIPAllocationMethod\":\"Static\",\"subnetId\":\"krxd\"},{\"privateIPAddress\":\"i\",\"privateIPAllocationMethod\":\"Static\",\"subnetId\":\"zrvqdr\"},{\"privateIPAddress\":\"hjybigehoqfbo\",\"privateIPAllocationMethod\":\"Dynamic\",\"subnetId\":\"nyktzlcuiy\"},{\"privateIPAddress\":\"qyw\",\"privateIPAllocationMethod\":\"Static\",\"subnetId\":\"vynhzgpphrcg\"}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"ocpecfvmmco\"}},\"ipAddress\":\"sxlzevgbmqj\",\"enableDiagnosticsSupport\":false,\"logging\":{\"storageAccount\":{\"accountName\":\"mivkwlzuvcc\",\"containerName\":\"nfnbacfionlebxe\"}},\"scalingProperties\":{\"capacity\":853562932,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"dpnqbq\",\"capacity\":{\"min\":1376492737,\"max\":1208210765}},{\"name\":\"rjfeallnwsubisnj\",\"capacity\":{\"min\":1708150837,\"max\":1066254045}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"ngnzscxaqwoochc\"},\"userProfile\":{\"preferredEmail\":\"qvpkvlrxnjeaseip\"}}") - .toObject(NginxDeploymentProperties.class); - Assertions.assertEquals("ciwqvhk", model.managedResourceGroup()); - Assertions.assertEquals("dtopbob", - model.networkProfile().frontEndIpConfiguration().publicIpAddresses().get(0).id()); - Assertions.assertEquals("kftutqxlngxlefg", - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.STATIC, - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("krxd", - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).subnetId()); - Assertions.assertEquals("ocpecfvmmco", model.networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(false, model.enableDiagnosticsSupport()); - Assertions.assertEquals("mivkwlzuvcc", model.logging().storageAccount().accountName()); - Assertions.assertEquals("nfnbacfionlebxe", model.logging().storageAccount().containerName()); - Assertions.assertEquals(853562932, model.scalingProperties().capacity()); - Assertions.assertEquals("dpnqbq", model.scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(1376492737, model.scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(1208210765, model.scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("ngnzscxaqwoochc", model.autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("qvpkvlrxnjeaseip", model.userProfile().preferredEmail()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentProperties model = new NginxDeploymentProperties().withManagedResourceGroup("ciwqvhk") - .withNetworkProfile(new NginxNetworkProfile().withFrontEndIpConfiguration(new NginxFrontendIpConfiguration() - .withPublicIpAddresses(Arrays.asList(new NginxPublicIpAddress().withId("dtopbob"), - new NginxPublicIpAddress().withId("ghmewuam"), new NginxPublicIpAddress().withId("hrzayvvtpgvdf"))) - .withPrivateIpAddresses(Arrays.asList( - new NginxPrivateIpAddress().withPrivateIpAddress("kftutqxlngxlefg") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.STATIC) - .withSubnetId("krxd"), - new NginxPrivateIpAddress().withPrivateIpAddress("i") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.STATIC) - .withSubnetId("zrvqdr"), - new NginxPrivateIpAddress().withPrivateIpAddress("hjybigehoqfbo") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.DYNAMIC) - .withSubnetId("nyktzlcuiy"), - new NginxPrivateIpAddress().withPrivateIpAddress("qyw") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.STATIC) - .withSubnetId("vynhzgpphrcg")))) - .withNetworkInterfaceConfiguration( - new NginxNetworkInterfaceConfiguration().withSubnetId("ocpecfvmmco"))) - .withEnableDiagnosticsSupport(false) - .withLogging(new NginxLogging().withStorageAccount( - new NginxStorageAccount().withAccountName("mivkwlzuvcc").withContainerName("nfnbacfionlebxe"))) - .withScalingProperties(new NginxDeploymentScalingProperties().withCapacity(853562932) - .withProfiles(Arrays.asList( - new ScaleProfile().withName("dpnqbq") - .withCapacity(new ScaleProfileCapacity().withMin(1376492737).withMax(1208210765)), - new ScaleProfile().withName("rjfeallnwsubisnj") - .withCapacity(new ScaleProfileCapacity().withMin(1708150837).withMax(1066254045))))) - .withAutoUpgradeProfile(new AutoUpgradeProfile().withUpgradeChannel("ngnzscxaqwoochc")) - .withUserProfile(new NginxDeploymentUserProfile().withPreferredEmail("qvpkvlrxnjeaseip")); - model = BinaryData.fromObject(model).toObject(NginxDeploymentProperties.class); - Assertions.assertEquals("ciwqvhk", model.managedResourceGroup()); - Assertions.assertEquals("dtopbob", - model.networkProfile().frontEndIpConfiguration().publicIpAddresses().get(0).id()); - Assertions.assertEquals("kftutqxlngxlefg", - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.STATIC, - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("krxd", - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).subnetId()); - Assertions.assertEquals("ocpecfvmmco", model.networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(false, model.enableDiagnosticsSupport()); - Assertions.assertEquals("mivkwlzuvcc", model.logging().storageAccount().accountName()); - Assertions.assertEquals("nfnbacfionlebxe", model.logging().storageAccount().containerName()); - Assertions.assertEquals(853562932, model.scalingProperties().capacity()); - Assertions.assertEquals("dpnqbq", model.scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(1376492737, model.scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(1208210765, model.scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("ngnzscxaqwoochc", model.autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("qvpkvlrxnjeaseip", model.userProfile().preferredEmail()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentScalingPropertiesAutoScaleSettingsTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentScalingPropertiesAutoScaleSettingsTests.java deleted file mode 100644 index af9b15811e2aa..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentScalingPropertiesAutoScaleSettingsTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentScalingPropertiesAutoScaleSettings; -import com.azure.resourcemanager.nginx.models.ScaleProfile; -import com.azure.resourcemanager.nginx.models.ScaleProfileCapacity; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NginxDeploymentScalingPropertiesAutoScaleSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxDeploymentScalingPropertiesAutoScaleSettings model = BinaryData.fromString( - "{\"profiles\":[{\"name\":\"opjmcmatuokthfui\",\"capacity\":{\"min\":94424945,\"max\":1958511129}},{\"name\":\"dsfcpkvxodpuoz\",\"capacity\":{\"min\":1621494681,\"max\":2044584540}}]}") - .toObject(NginxDeploymentScalingPropertiesAutoScaleSettings.class); - Assertions.assertEquals("opjmcmatuokthfui", model.profiles().get(0).name()); - Assertions.assertEquals(94424945, model.profiles().get(0).capacity().min()); - Assertions.assertEquals(1958511129, model.profiles().get(0).capacity().max()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentScalingPropertiesAutoScaleSettings model - = new NginxDeploymentScalingPropertiesAutoScaleSettings().withProfiles(Arrays.asList( - new ScaleProfile().withName("opjmcmatuokthfui") - .withCapacity(new ScaleProfileCapacity().withMin(94424945).withMax(1958511129)), - new ScaleProfile().withName("dsfcpkvxodpuoz") - .withCapacity(new ScaleProfileCapacity().withMin(1621494681).withMax(2044584540)))); - model = BinaryData.fromObject(model).toObject(NginxDeploymentScalingPropertiesAutoScaleSettings.class); - Assertions.assertEquals("opjmcmatuokthfui", model.profiles().get(0).name()); - Assertions.assertEquals(94424945, model.profiles().get(0).capacity().min()); - Assertions.assertEquals(1958511129, model.profiles().get(0).capacity().max()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentScalingPropertiesTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentScalingPropertiesTests.java deleted file mode 100644 index 133567f300db1..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentScalingPropertiesTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.NginxDeploymentScalingProperties; -import com.azure.resourcemanager.nginx.models.ScaleProfile; -import com.azure.resourcemanager.nginx.models.ScaleProfileCapacity; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NginxDeploymentScalingPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxDeploymentScalingProperties model = BinaryData.fromString( - "{\"capacity\":1493374876,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"pngjcrcczsqpjhvm\",\"capacity\":{\"min\":747144042,\"max\":330627677}},{\"name\":\"v\",\"capacity\":{\"min\":1022740915,\"max\":1223642392}},{\"name\":\"ounqecano\",\"capacity\":{\"min\":1054713689,\"max\":996084293}},{\"name\":\"pfhyhl\",\"capacity\":{\"min\":2062075015,\"max\":1743077422}}]}}") - .toObject(NginxDeploymentScalingProperties.class); - Assertions.assertEquals(1493374876, model.capacity()); - Assertions.assertEquals("pngjcrcczsqpjhvm", model.profiles().get(0).name()); - Assertions.assertEquals(747144042, model.profiles().get(0).capacity().min()); - Assertions.assertEquals(330627677, model.profiles().get(0).capacity().max()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentScalingProperties model = new NginxDeploymentScalingProperties().withCapacity(1493374876) - .withProfiles(Arrays.asList( - new ScaleProfile().withName("pngjcrcczsqpjhvm") - .withCapacity(new ScaleProfileCapacity().withMin(747144042).withMax(330627677)), - new ScaleProfile().withName("v") - .withCapacity(new ScaleProfileCapacity().withMin(1022740915).withMax(1223642392)), - new ScaleProfile().withName("ounqecano") - .withCapacity(new ScaleProfileCapacity().withMin(1054713689).withMax(996084293)), - new ScaleProfile().withName("pfhyhl") - .withCapacity(new ScaleProfileCapacity().withMin(2062075015).withMax(1743077422)))); - model = BinaryData.fromObject(model).toObject(NginxDeploymentScalingProperties.class); - Assertions.assertEquals(1493374876, model.capacity()); - Assertions.assertEquals("pngjcrcczsqpjhvm", model.profiles().get(0).name()); - Assertions.assertEquals(747144042, model.profiles().get(0).capacity().min()); - Assertions.assertEquals(330627677, model.profiles().get(0).capacity().max()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentUpdateParametersTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentUpdateParametersTests.java deleted file mode 100644 index 3cc7405acfe11..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentUpdateParametersTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.AutoUpgradeProfile; -import com.azure.resourcemanager.nginx.models.IdentityProperties; -import com.azure.resourcemanager.nginx.models.IdentityType; -import com.azure.resourcemanager.nginx.models.NginxDeploymentScalingProperties; -import com.azure.resourcemanager.nginx.models.NginxDeploymentUpdateParameters; -import com.azure.resourcemanager.nginx.models.NginxDeploymentUpdateProperties; -import com.azure.resourcemanager.nginx.models.NginxDeploymentUserProfile; -import com.azure.resourcemanager.nginx.models.NginxLogging; -import com.azure.resourcemanager.nginx.models.NginxStorageAccount; -import com.azure.resourcemanager.nginx.models.ResourceSku; -import com.azure.resourcemanager.nginx.models.ScaleProfile; -import com.azure.resourcemanager.nginx.models.ScaleProfileCapacity; -import com.azure.resourcemanager.nginx.models.UserIdentityProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NginxDeploymentUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxDeploymentUpdateParameters model = BinaryData.fromString( - "{\"identity\":{\"principalId\":\"ocfs\",\"tenantId\":\"s\",\"type\":\"None\",\"userAssignedIdentities\":{\"oczvy\":{\"principalId\":\"tki\",\"clientId\":\"xhqyudxorrqnb\"}}},\"tags\":{\"vdfwatkpn\":\"rvkdvjsllrm\",\"wiqzbqjvsovmyo\":\"ulexxbczwtr\"},\"sku\":{\"name\":\"cspkwlhzdobpxjmf\"},\"location\":\"vvnchrkcc\",\"properties\":{\"enableDiagnosticsSupport\":true,\"logging\":{\"storageAccount\":{\"accountName\":\"khrs\",\"containerName\":\"iwkuofos\"}},\"scalingProperties\":{\"capacity\":1623882899,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"uimjmvx\",\"capacity\":{\"min\":1584034364,\"max\":192455104}},{\"name\":\"uugidyjrrfby\",\"capacity\":{\"min\":1774598517,\"max\":1874197992}},{\"name\":\"v\",\"capacity\":{\"min\":499062312,\"max\":766224962}},{\"name\":\"sonpclhocohs\",\"capacity\":{\"min\":1118484246,\"max\":442163665}}]}},\"userProfile\":{\"preferredEmail\":\"eggzfb\"},\"autoUpgradeProfile\":{\"upgradeChannel\":\"fmvfaxkffeiit\"}}}") - .toObject(NginxDeploymentUpdateParameters.class); - Assertions.assertEquals(IdentityType.NONE, model.identity().type()); - Assertions.assertEquals("rvkdvjsllrm", model.tags().get("vdfwatkpn")); - Assertions.assertEquals("cspkwlhzdobpxjmf", model.sku().name()); - Assertions.assertEquals("vvnchrkcc", model.location()); - Assertions.assertEquals(true, model.properties().enableDiagnosticsSupport()); - Assertions.assertEquals("khrs", model.properties().logging().storageAccount().accountName()); - Assertions.assertEquals("iwkuofos", model.properties().logging().storageAccount().containerName()); - Assertions.assertEquals(1623882899, model.properties().scalingProperties().capacity()); - Assertions.assertEquals("uimjmvx", model.properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(1584034364, model.properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(192455104, model.properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("eggzfb", model.properties().userProfile().preferredEmail()); - Assertions.assertEquals("fmvfaxkffeiit", model.properties().autoUpgradeProfile().upgradeChannel()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentUpdateParameters model = new NginxDeploymentUpdateParameters() - .withIdentity(new IdentityProperties().withType(IdentityType.NONE) - .withUserAssignedIdentities(mapOf("oczvy", new UserIdentityProperties()))) - .withTags(mapOf("vdfwatkpn", "rvkdvjsllrm", "wiqzbqjvsovmyo", "ulexxbczwtr")) - .withSku(new ResourceSku().withName("cspkwlhzdobpxjmf")) - .withLocation("vvnchrkcc") - .withProperties(new NginxDeploymentUpdateProperties().withEnableDiagnosticsSupport(true) - .withLogging(new NginxLogging().withStorageAccount( - new NginxStorageAccount().withAccountName("khrs").withContainerName("iwkuofos"))) - .withScalingProperties(new NginxDeploymentScalingProperties().withCapacity(1623882899) - .withProfiles(Arrays.asList( - new ScaleProfile().withName("uimjmvx") - .withCapacity(new ScaleProfileCapacity().withMin(1584034364).withMax(192455104)), - new ScaleProfile().withName("uugidyjrrfby") - .withCapacity(new ScaleProfileCapacity().withMin(1774598517).withMax(1874197992)), - new ScaleProfile().withName("v") - .withCapacity(new ScaleProfileCapacity().withMin(499062312).withMax(766224962)), - new ScaleProfile().withName("sonpclhocohs") - .withCapacity(new ScaleProfileCapacity().withMin(1118484246).withMax(442163665))))) - .withUserProfile(new NginxDeploymentUserProfile().withPreferredEmail("eggzfb")) - .withAutoUpgradeProfile(new AutoUpgradeProfile().withUpgradeChannel("fmvfaxkffeiit"))); - model = BinaryData.fromObject(model).toObject(NginxDeploymentUpdateParameters.class); - Assertions.assertEquals(IdentityType.NONE, model.identity().type()); - Assertions.assertEquals("rvkdvjsllrm", model.tags().get("vdfwatkpn")); - Assertions.assertEquals("cspkwlhzdobpxjmf", model.sku().name()); - Assertions.assertEquals("vvnchrkcc", model.location()); - Assertions.assertEquals(true, model.properties().enableDiagnosticsSupport()); - Assertions.assertEquals("khrs", model.properties().logging().storageAccount().accountName()); - Assertions.assertEquals("iwkuofos", model.properties().logging().storageAccount().containerName()); - Assertions.assertEquals(1623882899, model.properties().scalingProperties().capacity()); - Assertions.assertEquals("uimjmvx", model.properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(1584034364, model.properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(192455104, model.properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("eggzfb", model.properties().userProfile().preferredEmail()); - Assertions.assertEquals("fmvfaxkffeiit", model.properties().autoUpgradeProfile().upgradeChannel()); - } - - // 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/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentUpdatePropertiesTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentUpdatePropertiesTests.java deleted file mode 100644 index 45a72f89a8fad..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentUpdatePropertiesTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.AutoUpgradeProfile; -import com.azure.resourcemanager.nginx.models.NginxDeploymentScalingProperties; -import com.azure.resourcemanager.nginx.models.NginxDeploymentUpdateProperties; -import com.azure.resourcemanager.nginx.models.NginxDeploymentUserProfile; -import com.azure.resourcemanager.nginx.models.NginxLogging; -import com.azure.resourcemanager.nginx.models.NginxStorageAccount; -import com.azure.resourcemanager.nginx.models.ScaleProfile; -import com.azure.resourcemanager.nginx.models.ScaleProfileCapacity; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NginxDeploymentUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxDeploymentUpdateProperties model = BinaryData.fromString( - "{\"enableDiagnosticsSupport\":false,\"logging\":{\"storageAccount\":{\"accountName\":\"yvshxmz\",\"containerName\":\"bzoggigrx\"}},\"scalingProperties\":{\"capacity\":849896725,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"xxjnspydptk\",\"capacity\":{\"min\":668833312,\"max\":1482419493}}]}},\"userProfile\":{\"preferredEmail\":\"uknvudwti\"},\"autoUpgradeProfile\":{\"upgradeChannel\":\"bldngkpoc\"}}") - .toObject(NginxDeploymentUpdateProperties.class); - Assertions.assertEquals(false, model.enableDiagnosticsSupport()); - Assertions.assertEquals("yvshxmz", model.logging().storageAccount().accountName()); - Assertions.assertEquals("bzoggigrx", model.logging().storageAccount().containerName()); - Assertions.assertEquals(849896725, model.scalingProperties().capacity()); - Assertions.assertEquals("xxjnspydptk", model.scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(668833312, model.scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(1482419493, model.scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("uknvudwti", model.userProfile().preferredEmail()); - Assertions.assertEquals("bldngkpoc", model.autoUpgradeProfile().upgradeChannel()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentUpdateProperties model - = new NginxDeploymentUpdateProperties().withEnableDiagnosticsSupport(false) - .withLogging(new NginxLogging().withStorageAccount( - new NginxStorageAccount().withAccountName("yvshxmz").withContainerName("bzoggigrx"))) - .withScalingProperties(new NginxDeploymentScalingProperties().withCapacity(849896725) - .withProfiles(Arrays.asList(new ScaleProfile().withName("xxjnspydptk") - .withCapacity(new ScaleProfileCapacity().withMin(668833312).withMax(1482419493))))) - .withUserProfile(new NginxDeploymentUserProfile().withPreferredEmail("uknvudwti")) - .withAutoUpgradeProfile(new AutoUpgradeProfile().withUpgradeChannel("bldngkpoc")); - model = BinaryData.fromObject(model).toObject(NginxDeploymentUpdateProperties.class); - Assertions.assertEquals(false, model.enableDiagnosticsSupport()); - Assertions.assertEquals("yvshxmz", model.logging().storageAccount().accountName()); - Assertions.assertEquals("bzoggigrx", model.logging().storageAccount().containerName()); - Assertions.assertEquals(849896725, model.scalingProperties().capacity()); - Assertions.assertEquals("xxjnspydptk", model.scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(668833312, model.scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(1482419493, model.scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("uknvudwti", model.userProfile().preferredEmail()); - Assertions.assertEquals("bldngkpoc", model.autoUpgradeProfile().upgradeChannel()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentUserProfileTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentUserProfileTests.java deleted file mode 100644 index a4b7369b7639d..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentUserProfileTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.NginxDeploymentUserProfile; -import org.junit.jupiter.api.Assertions; - -public final class NginxDeploymentUserProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxDeploymentUserProfile model - = BinaryData.fromString("{\"preferredEmail\":\"wqsmbsur\"}").toObject(NginxDeploymentUserProfile.class); - Assertions.assertEquals("wqsmbsur", model.preferredEmail()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentUserProfile model = new NginxDeploymentUserProfile().withPreferredEmail("wqsmbsur"); - model = BinaryData.fromObject(model).toObject(NginxDeploymentUserProfile.class); - Assertions.assertEquals("wqsmbsur", model.preferredEmail()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxFrontendIpConfigurationTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxFrontendIpConfigurationTests.java deleted file mode 100644 index c3f211c5bf765..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxFrontendIpConfigurationTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.NginxFrontendIpConfiguration; -import com.azure.resourcemanager.nginx.models.NginxPrivateIpAddress; -import com.azure.resourcemanager.nginx.models.NginxPrivateIpAllocationMethod; -import com.azure.resourcemanager.nginx.models.NginxPublicIpAddress; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NginxFrontendIpConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxFrontendIpConfiguration model = BinaryData.fromString( - "{\"publicIPAddresses\":[{\"id\":\"nzwdejba\"},{\"id\":\"rxzdmohctbqvudwx\"}],\"privateIPAddresses\":[{\"privateIPAddress\":\"vo\",\"privateIPAllocationMethod\":\"Dynamic\",\"subnetId\":\"jugwdkcglhsl\"},{\"privateIPAddress\":\"jdyggdtji\",\"privateIPAllocationMethod\":\"Static\",\"subnetId\":\"uofqwe\"}]}") - .toObject(NginxFrontendIpConfiguration.class); - Assertions.assertEquals("nzwdejba", model.publicIpAddresses().get(0).id()); - Assertions.assertEquals("vo", model.privateIpAddresses().get(0).privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.DYNAMIC, - model.privateIpAddresses().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("jugwdkcglhsl", model.privateIpAddresses().get(0).subnetId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxFrontendIpConfiguration model = new NginxFrontendIpConfiguration() - .withPublicIpAddresses(Arrays.asList(new NginxPublicIpAddress().withId("nzwdejba"), - new NginxPublicIpAddress().withId("rxzdmohctbqvudwx"))) - .withPrivateIpAddresses(Arrays.asList( - new NginxPrivateIpAddress().withPrivateIpAddress("vo") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.DYNAMIC) - .withSubnetId("jugwdkcglhsl"), - new NginxPrivateIpAddress().withPrivateIpAddress("jdyggdtji") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.STATIC) - .withSubnetId("uofqwe"))); - model = BinaryData.fromObject(model).toObject(NginxFrontendIpConfiguration.class); - Assertions.assertEquals("nzwdejba", model.publicIpAddresses().get(0).id()); - Assertions.assertEquals("vo", model.privateIpAddresses().get(0).privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.DYNAMIC, - model.privateIpAddresses().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("jugwdkcglhsl", model.privateIpAddresses().get(0).subnetId()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxLoggingTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxLoggingTests.java deleted file mode 100644 index 16bce87e1554f..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxLoggingTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.NginxLogging; -import com.azure.resourcemanager.nginx.models.NginxStorageAccount; -import org.junit.jupiter.api.Assertions; - -public final class NginxLoggingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxLogging model = BinaryData - .fromString("{\"storageAccount\":{\"accountName\":\"scjeypv\",\"containerName\":\"zrkgqhcjrefovg\"}}") - .toObject(NginxLogging.class); - Assertions.assertEquals("scjeypv", model.storageAccount().accountName()); - Assertions.assertEquals("zrkgqhcjrefovg", model.storageAccount().containerName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxLogging model = new NginxLogging().withStorageAccount( - new NginxStorageAccount().withAccountName("scjeypv").withContainerName("zrkgqhcjrefovg")); - model = BinaryData.fromObject(model).toObject(NginxLogging.class); - Assertions.assertEquals("scjeypv", model.storageAccount().accountName()); - Assertions.assertEquals("zrkgqhcjrefovg", model.storageAccount().containerName()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxNetworkInterfaceConfigurationTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxNetworkInterfaceConfigurationTests.java deleted file mode 100644 index 33d34137fb599..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxNetworkInterfaceConfigurationTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.NginxNetworkInterfaceConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class NginxNetworkInterfaceConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxNetworkInterfaceConfiguration model - = BinaryData.fromString("{\"subnetId\":\"eh\"}").toObject(NginxNetworkInterfaceConfiguration.class); - Assertions.assertEquals("eh", model.subnetId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxNetworkInterfaceConfiguration model = new NginxNetworkInterfaceConfiguration().withSubnetId("eh"); - model = BinaryData.fromObject(model).toObject(NginxNetworkInterfaceConfiguration.class); - Assertions.assertEquals("eh", model.subnetId()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxNetworkProfileTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxNetworkProfileTests.java deleted file mode 100644 index e1d302f553564..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxNetworkProfileTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.NginxFrontendIpConfiguration; -import com.azure.resourcemanager.nginx.models.NginxNetworkInterfaceConfiguration; -import com.azure.resourcemanager.nginx.models.NginxNetworkProfile; -import com.azure.resourcemanager.nginx.models.NginxPrivateIpAddress; -import com.azure.resourcemanager.nginx.models.NginxPrivateIpAllocationMethod; -import com.azure.resourcemanager.nginx.models.NginxPublicIpAddress; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NginxNetworkProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxNetworkProfile model = BinaryData.fromString( - "{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{\"id\":\"okeyyienj\"}],\"privateIPAddresses\":[{\"privateIPAddress\":\"tgrhpdjpjumas\",\"privateIPAllocationMethod\":\"Static\",\"subnetId\":\"pqyegualhbxxh\"},{\"privateIPAddress\":\"jzzvdud\",\"privateIPAllocationMethod\":\"Dynamic\",\"subnetId\":\"lfh\"},{\"privateIPAddress\":\"wmc\",\"privateIPAllocationMethod\":\"Static\",\"subnetId\":\"lbjnpgacftadehx\"}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"yfsoppu\"}}") - .toObject(NginxNetworkProfile.class); - Assertions.assertEquals("okeyyienj", model.frontEndIpConfiguration().publicIpAddresses().get(0).id()); - Assertions.assertEquals("tgrhpdjpjumas", - model.frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.STATIC, - model.frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("pqyegualhbxxh", - model.frontEndIpConfiguration().privateIpAddresses().get(0).subnetId()); - Assertions.assertEquals("yfsoppu", model.networkInterfaceConfiguration().subnetId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxNetworkProfile model = new NginxNetworkProfile() - .withFrontEndIpConfiguration(new NginxFrontendIpConfiguration() - .withPublicIpAddresses(Arrays.asList(new NginxPublicIpAddress().withId("okeyyienj"))) - .withPrivateIpAddresses(Arrays.asList( - new NginxPrivateIpAddress().withPrivateIpAddress("tgrhpdjpjumas") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.STATIC) - .withSubnetId("pqyegualhbxxh"), - new NginxPrivateIpAddress().withPrivateIpAddress("jzzvdud") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.DYNAMIC) - .withSubnetId("lfh"), - new NginxPrivateIpAddress().withPrivateIpAddress("wmc") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.STATIC) - .withSubnetId("lbjnpgacftadehx")))) - .withNetworkInterfaceConfiguration(new NginxNetworkInterfaceConfiguration().withSubnetId("yfsoppu")); - model = BinaryData.fromObject(model).toObject(NginxNetworkProfile.class); - Assertions.assertEquals("okeyyienj", model.frontEndIpConfiguration().publicIpAddresses().get(0).id()); - Assertions.assertEquals("tgrhpdjpjumas", - model.frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.STATIC, - model.frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("pqyegualhbxxh", - model.frontEndIpConfiguration().privateIpAddresses().get(0).subnetId()); - Assertions.assertEquals("yfsoppu", model.networkInterfaceConfiguration().subnetId()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxPrivateIpAddressTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxPrivateIpAddressTests.java deleted file mode 100644 index eec26e0105e5c..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxPrivateIpAddressTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.NginxPrivateIpAddress; -import com.azure.resourcemanager.nginx.models.NginxPrivateIpAllocationMethod; -import org.junit.jupiter.api.Assertions; - -public final class NginxPrivateIpAddressTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxPrivateIpAddress model = BinaryData - .fromString( - "{\"privateIPAddress\":\"vyvdcs\",\"privateIPAllocationMethod\":\"Static\",\"subnetId\":\"naamde\"}") - .toObject(NginxPrivateIpAddress.class); - Assertions.assertEquals("vyvdcs", model.privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.STATIC, model.privateIpAllocationMethod()); - Assertions.assertEquals("naamde", model.subnetId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxPrivateIpAddress model = new NginxPrivateIpAddress().withPrivateIpAddress("vyvdcs") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.STATIC) - .withSubnetId("naamde"); - model = BinaryData.fromObject(model).toObject(NginxPrivateIpAddress.class); - Assertions.assertEquals("vyvdcs", model.privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.STATIC, model.privateIpAllocationMethod()); - Assertions.assertEquals("naamde", model.subnetId()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxPublicIpAddressTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxPublicIpAddressTests.java deleted file mode 100644 index 82806f541fed4..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxPublicIpAddressTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.NginxPublicIpAddress; -import org.junit.jupiter.api.Assertions; - -public final class NginxPublicIpAddressTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxPublicIpAddress model - = BinaryData.fromString("{\"id\":\"hmenevfyexfwhybc\"}").toObject(NginxPublicIpAddress.class); - Assertions.assertEquals("hmenevfyexfwhybc", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxPublicIpAddress model = new NginxPublicIpAddress().withId("hmenevfyexfwhybc"); - model = BinaryData.fromObject(model).toObject(NginxPublicIpAddress.class); - Assertions.assertEquals("hmenevfyexfwhybc", model.id()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxStorageAccountTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxStorageAccountTests.java deleted file mode 100644 index feaeabbaa3f4c..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxStorageAccountTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.NginxStorageAccount; -import org.junit.jupiter.api.Assertions; - -public final class NginxStorageAccountTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxStorageAccount model = BinaryData.fromString("{\"accountName\":\"qsl\",\"containerName\":\"yvxyqjp\"}") - .toObject(NginxStorageAccount.class); - Assertions.assertEquals("qsl", model.accountName()); - Assertions.assertEquals("yvxyqjp", model.containerName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxStorageAccount model = new NginxStorageAccount().withAccountName("qsl").withContainerName("yvxyqjp"); - model = BinaryData.fromObject(model).toObject(NginxStorageAccount.class); - Assertions.assertEquals("qsl", model.accountName()); - Assertions.assertEquals("yvxyqjp", model.containerName()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/OperationDisplayTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/OperationDisplayTests.java deleted file mode 100644 index e8a6f616274cd..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/OperationDisplayTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData - .fromString( - "{\"provider\":\"ali\",\"resource\":\"rqhakauha\",\"operation\":\"sfwxosowzxc\",\"description\":\"i\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("ali", model.provider()); - Assertions.assertEquals("rqhakauha", model.resource()); - Assertions.assertEquals("sfwxosowzxc", model.operation()); - Assertions.assertEquals("i", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("ali") - .withResource("rqhakauha") - .withOperation("sfwxosowzxc") - .withDescription("i"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("ali", model.provider()); - Assertions.assertEquals("rqhakauha", model.resource()); - Assertions.assertEquals("sfwxosowzxc", model.operation()); - Assertions.assertEquals("i", model.description()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/OperationListResultTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/OperationListResultTests.java deleted file mode 100644 index a0c87b83ff482..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/OperationListResultTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.fluent.models.OperationResultInner; -import com.azure.resourcemanager.nginx.models.OperationDisplay; -import com.azure.resourcemanager.nginx.models.OperationListResult; -import java.util.Arrays; -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\":\"hl\",\"display\":{\"provider\":\"bh\",\"resource\":\"frlh\",\"operation\":\"sbkyvpycanuzbp\",\"description\":\"afkuwb\"},\"isDataAction\":false},{\"name\":\"bmehh\",\"display\":{\"provider\":\"v\",\"resource\":\"srtslhspkdeem\",\"operation\":\"fm\",\"description\":\"gkvtmelmqkrhah\"},\"isDataAction\":true}],\"nextLink\":\"ahaquh\"}") - .toObject(OperationListResult.class); - Assertions.assertEquals("hl", model.value().get(0).name()); - Assertions.assertEquals("bh", model.value().get(0).display().provider()); - Assertions.assertEquals("frlh", model.value().get(0).display().resource()); - Assertions.assertEquals("sbkyvpycanuzbp", model.value().get(0).display().operation()); - Assertions.assertEquals("afkuwb", model.value().get(0).display().description()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("ahaquh", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult().withValue(Arrays.asList( - new OperationResultInner().withName("hl") - .withDisplay(new OperationDisplay().withProvider("bh") - .withResource("frlh") - .withOperation("sbkyvpycanuzbp") - .withDescription("afkuwb")) - .withIsDataAction(false), - new OperationResultInner().withName("bmehh") - .withDisplay(new OperationDisplay().withProvider("v") - .withResource("srtslhspkdeem") - .withOperation("fm") - .withDescription("gkvtmelmqkrhah")) - .withIsDataAction(true))) - .withNextLink("ahaquh"); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - Assertions.assertEquals("hl", model.value().get(0).name()); - Assertions.assertEquals("bh", model.value().get(0).display().provider()); - Assertions.assertEquals("frlh", model.value().get(0).display().resource()); - Assertions.assertEquals("sbkyvpycanuzbp", model.value().get(0).display().operation()); - Assertions.assertEquals("afkuwb", model.value().get(0).display().description()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("ahaquh", model.nextLink()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/OperationResultInnerTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/OperationResultInnerTests.java deleted file mode 100644 index c2efc4ddf0b84..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/OperationResultInnerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.fluent.models.OperationResultInner; -import com.azure.resourcemanager.nginx.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationResultInner model = BinaryData.fromString( - "{\"name\":\"hmdua\",\"display\":{\"provider\":\"xqpvfadmw\",\"resource\":\"crgvxpvgom\",\"operation\":\"fmisg\",\"description\":\"nbbelda\"},\"isDataAction\":true}") - .toObject(OperationResultInner.class); - Assertions.assertEquals("hmdua", model.name()); - Assertions.assertEquals("xqpvfadmw", model.display().provider()); - Assertions.assertEquals("crgvxpvgom", model.display().resource()); - Assertions.assertEquals("fmisg", model.display().operation()); - Assertions.assertEquals("nbbelda", model.display().description()); - Assertions.assertEquals(true, model.isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationResultInner model = new OperationResultInner().withName("hmdua") - .withDisplay(new OperationDisplay().withProvider("xqpvfadmw") - .withResource("crgvxpvgom") - .withOperation("fmisg") - .withDescription("nbbelda")) - .withIsDataAction(true); - model = BinaryData.fromObject(model).toObject(OperationResultInner.class); - Assertions.assertEquals("hmdua", model.name()); - Assertions.assertEquals("xqpvfadmw", model.display().provider()); - Assertions.assertEquals("crgvxpvgom", model.display().resource()); - Assertions.assertEquals("fmisg", model.display().operation()); - Assertions.assertEquals("nbbelda", model.display().description()); - Assertions.assertEquals(true, model.isDataAction()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/OperationsListMockTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/OperationsListMockTests.java deleted file mode 100644 index 0c472d4844591..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/OperationsListMockTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.OperationResult; -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 OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"mzqhoftrmaequi\",\"display\":{\"provider\":\"icslfaoq\",\"resource\":\"iyylhalnswhccsp\",\"operation\":\"aivwitqscywu\",\"description\":\"woluhczbwemhair\"},\"isDataAction\":true}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - NginxManager manager = NginxManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("mzqhoftrmaequi", response.iterator().next().name()); - Assertions.assertEquals("icslfaoq", response.iterator().next().display().provider()); - Assertions.assertEquals("iyylhalnswhccsp", response.iterator().next().display().resource()); - Assertions.assertEquals("aivwitqscywu", response.iterator().next().display().operation()); - Assertions.assertEquals("woluhczbwemhair", response.iterator().next().display().description()); - Assertions.assertEquals(true, response.iterator().next().isDataAction()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ResourceSkuTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ResourceSkuTests.java deleted file mode 100644 index f4df07d8e1cf6..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ResourceSkuTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.ResourceSku; -import org.junit.jupiter.api.Assertions; - -public final class ResourceSkuTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceSku model = BinaryData.fromString("{\"name\":\"xim\"}").toObject(ResourceSku.class); - Assertions.assertEquals("xim", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceSku model = new ResourceSku().withName("xim"); - model = BinaryData.fromObject(model).toObject(ResourceSku.class); - Assertions.assertEquals("xim", model.name()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ScaleProfileCapacityTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ScaleProfileCapacityTests.java deleted file mode 100644 index d8d059d002267..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ScaleProfileCapacityTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.ScaleProfileCapacity; -import org.junit.jupiter.api.Assertions; - -public final class ScaleProfileCapacityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScaleProfileCapacity model - = BinaryData.fromString("{\"min\":1016147904,\"max\":269303909}").toObject(ScaleProfileCapacity.class); - Assertions.assertEquals(1016147904, model.min()); - Assertions.assertEquals(269303909, model.max()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScaleProfileCapacity model = new ScaleProfileCapacity().withMin(1016147904).withMax(269303909); - model = BinaryData.fromObject(model).toObject(ScaleProfileCapacity.class); - Assertions.assertEquals(1016147904, model.min()); - Assertions.assertEquals(269303909, model.max()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ScaleProfileTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ScaleProfileTests.java deleted file mode 100644 index 391c755f4b7bb..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ScaleProfileTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.ScaleProfile; -import com.azure.resourcemanager.nginx.models.ScaleProfileCapacity; -import org.junit.jupiter.api.Assertions; - -public final class ScaleProfileTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScaleProfile model - = BinaryData.fromString("{\"name\":\"ydagfuaxbe\",\"capacity\":{\"min\":45811298,\"max\":427242708}}") - .toObject(ScaleProfile.class); - Assertions.assertEquals("ydagfuaxbe", model.name()); - Assertions.assertEquals(45811298, model.capacity().min()); - Assertions.assertEquals(427242708, model.capacity().max()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScaleProfile model = new ScaleProfile().withName("ydagfuaxbe") - .withCapacity(new ScaleProfileCapacity().withMin(45811298).withMax(427242708)); - model = BinaryData.fromObject(model).toObject(ScaleProfile.class); - Assertions.assertEquals("ydagfuaxbe", model.name()); - Assertions.assertEquals(45811298, model.capacity().min()); - Assertions.assertEquals(427242708, model.capacity().max()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/UserIdentityPropertiesTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/UserIdentityPropertiesTests.java deleted file mode 100644 index 4bfe1543df25b..0000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/UserIdentityPropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.UserIdentityProperties; - -public final class UserIdentityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserIdentityProperties model - = BinaryData.fromString("{\"principalId\":\"icbtwnpzao\",\"clientId\":\"uhrhcffcyddgl\"}") - .toObject(UserIdentityProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserIdentityProperties model = new UserIdentityProperties(); - model = BinaryData.fromObject(model).toObject(UserIdentityProperties.class); - } -}