diff --git a/sdk/nginx/azure-resourcemanager-nginx/CHANGELOG.md b/sdk/nginx/azure-resourcemanager-nginx/CHANGELOG.md index 6023bd0fb9f0..db7a319d4a62 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/CHANGELOG.md +++ b/sdk/nginx/azure-resourcemanager-nginx/CHANGELOG.md @@ -1,14 +1,307 @@ # Release History -## 1.1.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2025-05-12) -### Features Added +- Azure Resource Manager Nginx client library for Java. This package contains Microsoft Azure SDK for Nginx Management SDK. Package tag package-2025-03-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.OperationResult` was removed + +#### `models.NginxConfiguration` was removed + +#### `models.NginxConfiguration$Update` was removed + +#### `models.NginxConfiguration$Definition` was removed + +#### `models.NginxConfiguration$DefinitionStages` was removed + +#### `models.NginxConfiguration$UpdateStages` was removed + +#### `models.NginxConfigurationProperties` was removed + +#### `models.OperationDisplay` was modified + +* `withDescription(java.lang.String)` was removed +* `withProvider(java.lang.String)` was removed +* `withOperation(java.lang.String)` was removed +* `withResource(java.lang.String)` was removed + +#### `models.NginxDeploymentProperties` was modified + +* `withManagedResourceGroup(java.lang.String)` was removed +* `managedResourceGroup()` was removed + +#### `models.OperationListResult` was modified + +* `withValue(java.util.List)` was removed +* `withNextLink(java.lang.String)` was removed + +#### `models.NginxCertificate$Definition` was modified + +* `withRegion(com.azure.core.management.Region)` was removed +* `withRegion(java.lang.String)` was removed + +#### `models.NginxCertificate` was modified + +* `location()` was removed +* `region()` was removed +* `regionName()` was removed + +#### `models.Configurations` was modified + +* `models.NginxConfiguration getById(java.lang.String)` -> `models.NginxConfigurationResponse getById(java.lang.String)` +* `models.NginxConfiguration get(java.lang.String,java.lang.String,java.lang.String)` -> `models.NginxConfigurationResponse get(java.lang.String,java.lang.String,java.lang.String)` +* `models.NginxConfiguration$DefinitionStages$Blank define(java.lang.String)` -> `models.NginxConfigurationResponse$DefinitionStages$Blank define(java.lang.String)` + +### Features Added + +* `models.NginxDeploymentDefaultWafPolicyListResponse` was added + +* `models.NginxConfigurationResponse$Update` was added + +* `models.WebApplicationFirewallSettings` was added + +* `models.NginxDeploymentWafPolicy$Definition` was added + +* `models.AnalysisDiagnostic` was added + +* `models.NginxDeploymentApiKeyResponse$Definition` was added + +* `models.NginxDeploymentApiKeyResponse$DefinitionStages` was added + +* `models.WafPolicies` was added + +* `models.NginxConfigurationResponse$UpdateStages` was added + +* `models.NginxCertificateErrorResponseBody` was added + +* `models.NginxConfigurationResponse$Definition` was added + +* `models.Level` was added + +* `models.DiagnosticItem` was added + +* `models.ActivationState` was added + +* `models.ActionType` was added + +* `models.NginxDeploymentApiKeyListResponse` was added + +* `models.NginxDeploymentApiKeyResponse$Update` was added + +* `models.NginxDeploymentApiKeyRequest` was added + +* `models.ScaleProfile` was added + +* `models.NginxDeploymentWafPolicyMetadataProperties` was added + +* `models.NginxDeploymentWafPolicyApplyingStatusCode` was added + +* `models.NginxDeploymentWafPolicy` was added + +* `models.NginxConfigurationRequestProperties` was added + +* `models.NginxDeploymentApiKeyResponse` was added + +* `models.NginxConfigurationResponseProperties` was added + +* `models.NginxDeploymentDefaultWafPolicyProperties` was added + +* `models.NginxDeploymentWafPolicyCompilingStatus` was added + +* `models.NginxDeploymentWafPolicyProperties` was added + +* `models.NginxDeploymentWafPolicyCompilingStatusCode` was added + +* `models.NginxConfigurationRequest` was added + +* `models.NginxDeploymentApiKeyResponseProperties` was added + +* `models.WebApplicationFirewallComponentVersions` was added + +* `models.NginxConfigurationProtectedFileRequest` was added + +* `models.Origin` was added + +* `models.WebApplicationFirewallStatus` was added + +* `models.NginxDeploymentWafPolicyMetadata` was added + +* `models.Operation` was added + +* `models.NginxConfigurationResponse$DefinitionStages` was added + +* `models.NginxDeploymentWafPolicy$DefinitionStages` was added + +* `models.NginxDeploymentApiKeyResponse$UpdateStages` was added + +* `models.WebApplicationFirewallPackage` was added + +* `models.ApiKeys` was added + +* `models.AutoUpgradeProfile` was added + +* `models.NginxDeploymentWafPolicyApplyingStatus` was added + +* `models.AnalysisCreate` was added + +* `models.NginxConfigurationResponse` was added + +* `models.NginxConfigurationProtectedFileResponse` was added + +* `models.NginxDeploymentApiKeyRequestProperties` was added + +* `models.AnalysisResult` was added + +* `models.DefaultWafPolicies` was added + +* `models.NginxDeploymentWafPolicyListResponse` 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.NginxDeploymentScalingProperties` was modified + +* `profiles()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` 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.NginxFrontendIpConfiguration` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OperationDisplay` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.NginxDeploymentUserProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.NginxDeploymentUpdateProperties` was modified + +* `webApplicationFirewallSettings()` was added +* `autoUpgradeProfile()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `networkProfile()` was added +* `withNetworkProfile(models.NginxNetworkProfile)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `withAutoUpgradeProfile(models.AutoUpgradeProfile)` was added +* `withWebApplicationFirewallSettings(models.WebApplicationFirewallSettings)` was added + +#### `models.NginxLogging` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.NginxDeploymentProperties` was modified + +* `withAutoUpgradeProfile(models.AutoUpgradeProfile)` was added +* `webApplicationFirewallSettings()` was added +* `withWebApplicationFirewallSettings(models.WebApplicationFirewallSettings)` was added +* `webApplicationFirewallStatus()` was added +* `dataplaneApiEndpoint()` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `autoUpgradeProfile()` was added + +#### `models.NginxCertificateProperties` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `keyVaultSecretVersion()` was added +* `sha1Thumbprint()` was added +* `certificateError()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `keyVaultSecretCreated()` was added +* `withCertificateError(models.NginxCertificateErrorResponseBody)` was added + +#### `models.NginxNetworkProfile` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.NginxCertificateListResponse` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.IdentityProperties` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `models.OperationListResult` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NginxConfigurationFile` 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.NginxDeploymentUpdateParameters` was modified + +* `toJson(com.azure.json.JsonWriter)` was added +* `fromJson(com.azure.json.JsonReader)` was added + +#### `NginxManager` was modified + +* `defaultWafPolicies()` was added +* `wafPolicies()` was added +* `apiKeys()` 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.NginxPublicIpAddress` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.NginxConfigurationPackage` was modified + +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added + +#### `models.ResourceSku` 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.NginxPrivateIpAddress` was modified -### Other Changes +* `fromJson(com.azure.json.JsonReader)` was added +* `toJson(com.azure.json.JsonWriter)` was added ## 1.1.0-beta.3 (2025-02-26) diff --git a/sdk/nginx/azure-resourcemanager-nginx/README.md b/sdk/nginx/azure-resourcemanager-nginx/README.md index a4cef05c1551..4fdc3f01c067 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-11-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-2025-03-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 diff --git a/sdk/nginx/azure-resourcemanager-nginx/SAMPLE.md b/sdk/nginx/azure-resourcemanager-nginx/SAMPLE.md index 690718f9390c..29989fd32d10 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/SAMPLE.md +++ b/sdk/nginx/azure-resourcemanager-nginx/SAMPLE.md @@ -23,6 +23,10 @@ - [Get](#configurations_get) - [List](#configurations_list) +## DefaultWafPolicy + +- [List](#defaultwafpolicy_list) + ## Deployments - [CreateOrUpdate](#deployments_createorupdate) @@ -35,25 +39,31 @@ ## Operations - [List](#operations_list) + +## WafPolicy + +- [Create](#wafpolicy_create) +- [Delete](#wafpolicy_delete) +- [Get](#wafpolicy_get) +- [List](#wafpolicy_list) ### ApiKeys_CreateOrUpdate ```java /** - * Samples for ApiKeys CreateOrUpdate. + * Samples for Certificates Delete. */ -public final class ApiKeysCreateOrUpdateSamples { +public final class CertificatesDeleteSamples { /* * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_CreateOrUpdate. - * json + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/Certificates_Delete.json */ /** - * Sample code: ApiKeys_CreateOrUpdate. + * Sample code: Certificates_Delete. * * @param manager Entry point to NginxManager. */ - public static void apiKeysCreateOrUpdate(com.azure.resourcemanager.nginx.NginxManager manager) { - manager.apiKeys().define("myApiKey").withExistingNginxDeployment("myResourceGroup", "myDeployment").create(); + public static void certificatesDelete(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.certificates().delete("myResourceGroup", "myDeployment", "default", com.azure.core.util.Context.NONE); } } ``` @@ -61,22 +71,43 @@ public final class ApiKeysCreateOrUpdateSamples { ### ApiKeys_Delete ```java +import com.azure.resourcemanager.nginx.models.NginxDeployment; + /** - * Samples for ApiKeys Delete. + * Samples for Deployments Update. */ -public final class ApiKeysDeleteSamples { +public final class DeploymentsUpdateSamples { /* * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_Delete.json + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/Deployments_Update.json */ /** - * Sample code: ApiKeys_Delete. + * Sample code: Deployments_Update. * * @param manager Entry point to NginxManager. */ - public static void apiKeysDelete(com.azure.resourcemanager.nginx.NginxManager manager) { - manager.apiKeys() - .deleteWithResponse("myResourceGroup", "myDeployment", "myApiKey", com.azure.core.util.Context.NONE); + public static void deploymentsUpdate(com.azure.resourcemanager.nginx.NginxManager manager) { + NginxDeployment resource = manager.deployments() + .getByResourceGroupWithResponse("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); + } + + /* + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/Deployments_UpdateSubnet + * .json + */ + /** + * Sample code: Deployments_UpdateSubnet. + * + * @param manager Entry point to NginxManager. + */ + public static void deploymentsUpdateSubnet(com.azure.resourcemanager.nginx.NginxManager manager) { + NginxDeployment resource = manager.deployments() + .getByResourceGroupWithResponse("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE) + .getValue(); + resource.update().apply(); } } ``` @@ -85,21 +116,21 @@ public final class ApiKeysDeleteSamples { ```java /** - * Samples for ApiKeys Get. + * Samples for ApiKeys CreateOrUpdate. */ -public final class ApiKeysGetSamples { +public final class ApiKeysCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_Get.json + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/ApiKeys_CreateOrUpdate. + * json */ /** - * Sample code: ApiKeys_Get. + * Sample code: ApiKeys_CreateOrUpdate. * * @param manager Entry point to NginxManager. */ - public static void apiKeysGet(com.azure.resourcemanager.nginx.NginxManager manager) { - manager.apiKeys() - .getWithResponse("myResourceGroup", "myDeployment", "myApiKey", com.azure.core.util.Context.NONE); + public static void apiKeysCreateOrUpdate(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.apiKeys().define("myApiKey").withExistingNginxDeployment("myResourceGroup", "myDeployment").create(); } } ``` @@ -108,33 +139,74 @@ public final class ApiKeysGetSamples { ```java /** - * Samples for ApiKeys List. + * Samples for Deployments CreateOrUpdate. */ -public final class ApiKeysListSamples { +public final class DeploymentsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ApiKeys_List.json + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/Deployments_Create.json */ /** - * Sample code: ApiKeys_List. + * Sample code: Deployments_Create. * * @param manager Entry point to NginxManager. */ - public static void apiKeysList(com.azure.resourcemanager.nginx.NginxManager manager) { - manager.apiKeys().list("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE); + public static void deploymentsCreate(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.deployments() + .define("myDeployment") + .withRegion((String) null) + .withExistingResourceGroup("myResourceGroup") + .create(); } } ``` ### Certificates_CreateOrUpdate +```java +/** + * Samples for Deployments GetByResourceGroup. + */ +public final class DeploymentsGetByResourceGroupSamples { + /* + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/Deployments_Get.json + */ + /** + * Sample code: Deployments_Get. + * + * @param manager Entry point to NginxManager. + */ + public static void deploymentsGet(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.deployments() + .getByResourceGroupWithResponse("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/ + * Deployments_Get_AutoScale.json + */ + /** + * Sample code: Deployments_Get_AutoScale. + * + * @param manager Entry point to NginxManager. + */ + public static void deploymentsGetAutoScale(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.deployments() + .getByResourceGroupWithResponse("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE); + } +} +``` + +### Certificates_Delete + ```java /** * Samples for Certificates CreateOrUpdate. */ public final class CertificatesCreateOrUpdateSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/ * Certificates_CreateOrUpdate.json */ /** @@ -151,52 +223,54 @@ public final class CertificatesCreateOrUpdateSamples { } ``` -### Certificates_Delete +### Certificates_Get ```java /** - * Samples for Certificates Delete. + * Samples for Configurations List. */ -public final class CertificatesDeleteSamples { +public final class ConfigurationsListSamples { /* * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_Delete.json + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/Configurations_List.json */ /** - * Sample code: Certificates_Delete. + * Sample code: Configurations_List. * * @param manager Entry point to NginxManager. */ - public static void certificatesDelete(com.azure.resourcemanager.nginx.NginxManager manager) { - manager.certificates().delete("myResourceGroup", "myDeployment", "default", com.azure.core.util.Context.NONE); + public static void configurationsList(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.configurations().list("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE); } } ``` -### Certificates_Get +### Certificates_List ```java /** - * Samples for Certificates Get. + * Samples for WafPolicy Create. */ -public final class CertificatesGetSamples { +public final class WafPolicyCreateSamples { /* * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_Get.json + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/WafPolicy_Create.json */ /** - * Sample code: Certificates_Get. + * Sample code: WafPolicy_Create. * * @param manager Entry point to NginxManager. */ - public static void certificatesGet(com.azure.resourcemanager.nginx.NginxManager manager) { - manager.certificates() - .getWithResponse("myResourceGroup", "myDeployment", "default", com.azure.core.util.Context.NONE); + public static void wafPolicyCreate(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.wafPolicies() + .define("myWafPolicy") + .withExistingNginxDeployment("myResourceGroup", "myDeployment") + .create(); } } ``` -### Certificates_List +### Configurations_Analysis ```java /** @@ -205,7 +279,7 @@ public final class CertificatesGetSamples { public final class CertificatesListSamples { /* * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Certificates_List.json + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/Certificates_List.json */ /** * Sample code: Certificates_List. @@ -218,7 +292,30 @@ public final class CertificatesListSamples { } ``` -### Configurations_Analysis +### Configurations_CreateOrUpdate + +```java +/** + * Samples for ApiKeys Delete. + */ +public final class ApiKeysDeleteSamples { + /* + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/ApiKeys_Delete.json + */ + /** + * Sample code: ApiKeys_Delete. + * + * @param manager Entry point to NginxManager. + */ + public static void apiKeysDelete(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.apiKeys() + .deleteWithResponse("myResourceGroup", "myDeployment", "myApiKey", com.azure.core.util.Context.NONE); + } +} +``` + +### Configurations_Delete ```java @@ -228,7 +325,7 @@ public final class CertificatesListSamples { public final class ConfigurationsAnalysisSamples { /* * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_Analysis. + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/Configurations_Analysis. * json */ /** @@ -243,290 +340,321 @@ public final class ConfigurationsAnalysisSamples { } ``` -### Configurations_CreateOrUpdate +### Configurations_Get ```java /** - * Samples for Configurations CreateOrUpdate. + * Samples for WafPolicy Delete. */ -public final class ConfigurationsCreateOrUpdateSamples { +public final class WafPolicyDeleteSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ - * Configurations_CreateOrUpdate.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/WafPolicy_Delete.json */ /** - * Sample code: Configurations_CreateOrUpdate. + * Sample code: WafPolicy_Delete. * * @param manager Entry point to NginxManager. */ - public static void configurationsCreateOrUpdate(com.azure.resourcemanager.nginx.NginxManager manager) { - manager.configurations() - .define("default") - .withExistingNginxDeployment("myResourceGroup", "myDeployment") - .create(); + public static void wafPolicyDelete(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.wafPolicies() + .delete("myResourceGroup", "myDeployment", "myWafPolicy", com.azure.core.util.Context.NONE); } } ``` -### Configurations_Delete +### Configurations_List ```java /** - * Samples for Configurations Delete. + * Samples for ApiKeys Get. */ -public final class ConfigurationsDeleteSamples { +public final class ApiKeysGetSamples { /* * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_Delete. - * json + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/ApiKeys_Get.json */ /** - * Sample code: Configurations_Delete. + * Sample code: ApiKeys_Get. * * @param manager Entry point to NginxManager. */ - public static void configurationsDelete(com.azure.resourcemanager.nginx.NginxManager manager) { - manager.configurations().delete("myResourceGroup", "myDeployment", "default", com.azure.core.util.Context.NONE); + public static void apiKeysGet(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.apiKeys() + .getWithResponse("myResourceGroup", "myDeployment", "myApiKey", com.azure.core.util.Context.NONE); } } ``` -### Configurations_Get +### DefaultWafPolicy_List ```java /** - * Samples for Configurations Get. + * Samples for Operations List. */ -public final class ConfigurationsGetSamples { +public final class OperationsListSamples { /* * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_Get.json + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/Operations_List.json */ /** - * Sample code: Configurations_Get. + * Sample code: Operations_List. * * @param manager Entry point to NginxManager. */ - public static void configurationsGet(com.azure.resourcemanager.nginx.NginxManager manager) { - manager.configurations() - .getWithResponse("myResourceGroup", "myDeployment", "default", com.azure.core.util.Context.NONE); + public static void operationsList(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` -### Configurations_List +### Deployments_CreateOrUpdate ```java /** - * Samples for Configurations List. + * Samples for Deployments ListByResourceGroup. */ -public final class ConfigurationsListSamples { +public final class DeploymentsListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Configurations_List.json + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/ + * Deployments_ListByResourceGroup.json */ /** - * Sample code: Configurations_List. + * Sample code: Deployments_ListByResourceGroup. * * @param manager Entry point to NginxManager. */ - public static void configurationsList(com.azure.resourcemanager.nginx.NginxManager manager) { - manager.configurations().list("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE); + public static void deploymentsListByResourceGroup(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.deployments().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); } } ``` -### Deployments_CreateOrUpdate +### Deployments_Delete ```java /** - * Samples for Deployments CreateOrUpdate. + * Samples for ApiKeys List. */ -public final class DeploymentsCreateOrUpdateSamples { +public final class ApiKeysListSamples { /* * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Create.json + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/ApiKeys_List.json */ /** - * Sample code: Deployments_Create. + * Sample code: ApiKeys_List. * * @param manager Entry point to NginxManager. */ - public static void deploymentsCreate(com.azure.resourcemanager.nginx.NginxManager manager) { - manager.deployments() - .define("myDeployment") - .withRegion((String) null) - .withExistingResourceGroup("myResourceGroup") - .create(); + public static void apiKeysList(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.apiKeys().list("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE); } } ``` -### Deployments_Delete +### Deployments_GetByResourceGroup ```java /** - * Samples for Deployments Delete. + * Samples for Deployments List. */ -public final class DeploymentsDeleteSamples { +public final class DeploymentsListSamples { /* * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Delete.json + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/Deployments_List.json */ /** - * Sample code: Deployments_Delete. + * Sample code: Deployments_List. * * @param manager Entry point to NginxManager. */ - public static void deploymentsDelete(com.azure.resourcemanager.nginx.NginxManager manager) { - manager.deployments().delete("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE); + public static void deploymentsList(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.deployments().list(com.azure.core.util.Context.NONE); } } ``` -### Deployments_GetByResourceGroup +### Deployments_List ```java /** - * Samples for Deployments GetByResourceGroup. + * Samples for WafPolicy List. */ -public final class DeploymentsGetByResourceGroupSamples { +public final class WafPolicyListSamples { /* * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Get.json + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/WafPolicy_List.json */ /** - * Sample code: Deployments_Get. + * Sample code: WafPolicy_List. * * @param manager Entry point to NginxManager. */ - public static void deploymentsGet(com.azure.resourcemanager.nginx.NginxManager manager) { - manager.deployments() - .getByResourceGroupWithResponse("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE); + public static void wafPolicyList(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.wafPolicies().list("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE); } +} +``` +### Deployments_ListByResourceGroup + +```java +/** + * Samples for Certificates Get. + */ +public final class CertificatesGetSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ - * Deployments_Get_AutoScale.json + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/Certificates_Get.json */ /** - * Sample code: Deployments_Get_AutoScale. + * Sample code: Certificates_Get. * * @param manager Entry point to NginxManager. */ - public static void deploymentsGetAutoScale(com.azure.resourcemanager.nginx.NginxManager manager) { - manager.deployments() - .getByResourceGroupWithResponse("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE); + public static void certificatesGet(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.certificates() + .getWithResponse("myResourceGroup", "myDeployment", "default", com.azure.core.util.Context.NONE); } } ``` -### Deployments_List +### Deployments_Update ```java /** - * Samples for Deployments List. + * Samples for Configurations Get. */ -public final class DeploymentsListSamples { +public final class ConfigurationsGetSamples { /* * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_List.json + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/Configurations_Get.json */ /** - * Sample code: Deployments_List. + * Sample code: Configurations_Get. * * @param manager Entry point to NginxManager. */ - public static void deploymentsList(com.azure.resourcemanager.nginx.NginxManager manager) { - manager.deployments().list(com.azure.core.util.Context.NONE); + public static void configurationsGet(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.configurations() + .getWithResponse("myResourceGroup", "myDeployment", "default", com.azure.core.util.Context.NONE); } } ``` -### Deployments_ListByResourceGroup +### Operations_List ```java /** - * Samples for Deployments ListByResourceGroup. + * Samples for Configurations CreateOrUpdate. */ -public final class DeploymentsListByResourceGroupSamples { +public final class ConfigurationsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/ - * Deployments_ListByResourceGroup.json + * x-ms-original-file: specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/ + * Configurations_CreateOrUpdate.json */ /** - * Sample code: Deployments_ListByResourceGroup. + * Sample code: Configurations_CreateOrUpdate. * * @param manager Entry point to NginxManager. */ - public static void deploymentsListByResourceGroup(com.azure.resourcemanager.nginx.NginxManager manager) { - manager.deployments().listByResourceGroup("myResourceGroup", com.azure.core.util.Context.NONE); + public static void configurationsCreateOrUpdate(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.configurations() + .define("default") + .withExistingNginxDeployment("myResourceGroup", "myDeployment") + .create(); } } ``` -### Deployments_Update +### WafPolicy_Create ```java -import com.azure.resourcemanager.nginx.models.NginxDeployment; +/** + * Samples for DefaultWafPolicy List. + */ +public final class DefaultWafPolicyListSamples { + /* + * x-ms-original-file: + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/DefaultWafPolicy_List. + * json + */ + /** + * Sample code: DefaultWafPolicy_List. + * + * @param manager Entry point to NginxManager. + */ + public static void defaultWafPolicyList(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.defaultWafPolicies() + .listWithResponse("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE); + } +} +``` +### WafPolicy_Delete + +```java /** - * Samples for Deployments Update. + * Samples for Deployments Delete. */ -public final class DeploymentsUpdateSamples { +public final class DeploymentsDeleteSamples { /* * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_Update.json + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/Deployments_Delete.json */ /** - * Sample code: Deployments_Update. + * Sample code: Deployments_Delete. * * @param manager Entry point to NginxManager. */ - public static void deploymentsUpdate(com.azure.resourcemanager.nginx.NginxManager manager) { - NginxDeployment resource = manager.deployments() - .getByResourceGroupWithResponse("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().apply(); + public static void deploymentsDelete(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.deployments().delete("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE); } +} +``` +### WafPolicy_Get + +```java +/** + * Samples for WafPolicy Get. + */ +public final class WafPolicyGetSamples { /* * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Deployments_UpdateSubnet - * .json + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/WafPolicy_Get.json */ /** - * Sample code: Deployments_UpdateSubnet. + * Sample code: WafPolicy_Get. * * @param manager Entry point to NginxManager. */ - public static void deploymentsUpdateSubnet(com.azure.resourcemanager.nginx.NginxManager manager) { - NginxDeployment resource = manager.deployments() - .getByResourceGroupWithResponse("myResourceGroup", "myDeployment", com.azure.core.util.Context.NONE) - .getValue(); - resource.update().apply(); + public static void wafPolicyGet(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.wafPolicies() + .getWithResponse("myResourceGroup", "myDeployment", "myWafPolicy", com.azure.core.util.Context.NONE); } } ``` -### Operations_List +### WafPolicy_List ```java /** - * Samples for Operations List. + * Samples for Configurations Delete. */ -public final class OperationsListSamples { +public final class ConfigurationsDeleteSamples { /* * x-ms-original-file: - * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-11-01-preview/examples/Operations_List.json + * specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2025-03-01-preview/examples/Configurations_Delete. + * json */ /** - * Sample code: Operations_List. + * Sample code: Configurations_Delete. * * @param manager Entry point to NginxManager. */ - public static void operationsList(com.azure.resourcemanager.nginx.NginxManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void configurationsDelete(com.azure.resourcemanager.nginx.NginxManager manager) { + manager.configurations().delete("myResourceGroup", "myDeployment", "default", com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/nginx/azure-resourcemanager-nginx/pom.xml b/sdk/nginx/azure-resourcemanager-nginx/pom.xml index da8138f8ae29..992ee6724335 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-11-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-2025-03-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -46,7 +46,6 @@ 0 0 true - false 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 663857029f3a..7680bc2f13c8 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 @@ -28,14 +28,18 @@ import com.azure.resourcemanager.nginx.implementation.ApiKeysImpl; import com.azure.resourcemanager.nginx.implementation.CertificatesImpl; import com.azure.resourcemanager.nginx.implementation.ConfigurationsImpl; +import com.azure.resourcemanager.nginx.implementation.DefaultWafPoliciesImpl; import com.azure.resourcemanager.nginx.implementation.DeploymentsImpl; import com.azure.resourcemanager.nginx.implementation.NginxManagementClientBuilder; import com.azure.resourcemanager.nginx.implementation.OperationsImpl; +import com.azure.resourcemanager.nginx.implementation.WafPoliciesImpl; import com.azure.resourcemanager.nginx.models.ApiKeys; import com.azure.resourcemanager.nginx.models.Certificates; import com.azure.resourcemanager.nginx.models.Configurations; +import com.azure.resourcemanager.nginx.models.DefaultWafPolicies; import com.azure.resourcemanager.nginx.models.Deployments; import com.azure.resourcemanager.nginx.models.Operations; +import com.azure.resourcemanager.nginx.models.WafPolicies; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -56,6 +60,10 @@ public final class NginxManager { private Deployments deployments; + private WafPolicies wafPolicies; + + private DefaultWafPolicies defaultWafPolicies; + private Operations operations; private final NginxManagementClient clientObject; @@ -321,6 +329,30 @@ public Deployments deployments() { return deployments; } + /** + * Gets the resource collection API of WafPolicies. It manages NginxDeploymentWafPolicy. + * + * @return Resource collection API of WafPolicies. + */ + public WafPolicies wafPolicies() { + if (this.wafPolicies == null) { + this.wafPolicies = new WafPoliciesImpl(clientObject.getWafPolicies(), this); + } + return wafPolicies; + } + + /** + * Gets the resource collection API of DefaultWafPolicies. + * + * @return Resource collection API of DefaultWafPolicies. + */ + public DefaultWafPolicies defaultWafPolicies() { + if (this.defaultWafPolicies == null) { + this.defaultWafPolicies = new DefaultWafPoliciesImpl(clientObject.getDefaultWafPolicies(), this); + } + return defaultWafPolicies; + } + /** * Gets the resource collection API of Operations. * diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/ApiKeysClient.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/ApiKeysClient.java index ce0eef06bc5a..5e484d992278 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/ApiKeysClient.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/ApiKeysClient.java @@ -27,7 +27,7 @@ public interface ApiKeysClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return nginx Deployment Api Key Response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse(String resourceGroupName, @@ -42,7 +42,7 @@ Response createOrUpdateWithResponse(String r * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Deployment Api Key Response. */ @ServiceMethod(returns = ReturnType.SINGLE) NginxDeploymentApiKeyResponseInner createOrUpdate(String resourceGroupName, String deploymentName, @@ -115,7 +115,7 @@ Response getWithResponse(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment Api Key List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String deploymentName); @@ -129,7 +129,7 @@ Response getWithResponse(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment Api Key List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String deploymentName, diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/CertificatesClient.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/CertificatesClient.java index 9d7709226326..6928585f106f 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/CertificatesClient.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/CertificatesClient.java @@ -56,7 +56,7 @@ Response getWithResponse(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Certificate. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, NginxCertificateInner> beginCreateOrUpdate(String resourceGroupName, @@ -73,7 +73,7 @@ SyncPoller, NginxCertificateInner> beginCreate * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Certificate. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, NginxCertificateInner> beginCreateOrUpdate(String resourceGroupName, @@ -88,7 +88,7 @@ SyncPoller, NginxCertificateInner> beginCreate * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Certificate. */ @ServiceMethod(returns = ReturnType.SINGLE) NginxCertificateInner createOrUpdate(String resourceGroupName, String deploymentName, String certificateName); @@ -104,7 +104,7 @@ SyncPoller, NginxCertificateInner> beginCreate * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Certificate. */ @ServiceMethod(returns = ReturnType.SINGLE) NginxCertificateInner createOrUpdate(String resourceGroupName, String deploymentName, String certificateName, @@ -176,7 +176,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Certificate List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String deploymentName); @@ -190,7 +190,7 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Certificate List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String deploymentName, Context context); diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/ConfigurationsClient.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/ConfigurationsClient.java index 3cfa48548954..e4662801b0dc 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/ConfigurationsClient.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/ConfigurationsClient.java @@ -28,7 +28,7 @@ public interface ConfigurationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation as paginated response with {@link PagedIterable}. + * @return nginx Configuration List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String deploymentName); @@ -42,7 +42,7 @@ public interface ConfigurationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation as paginated response with {@link PagedIterable}. + * @return nginx Configuration List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String resourceGroupName, String deploymentName, @@ -90,7 +90,7 @@ Response getWithResponse(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Configuration Response. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, NginxConfigurationResponseInner> @@ -108,7 +108,7 @@ Response getWithResponse(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Configuration Response. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, NginxConfigurationResponseInner> beginCreateOrUpdate( @@ -125,7 +125,7 @@ SyncPoller, NginxConfigurationRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Configuration Response. */ @ServiceMethod(returns = ReturnType.SINGLE) NginxConfigurationResponseInner createOrUpdate(String resourceGroupName, String deploymentName, @@ -143,7 +143,7 @@ NginxConfigurationResponseInner createOrUpdate(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Configuration Response. */ @ServiceMethod(returns = ReturnType.SINGLE) NginxConfigurationResponseInner createOrUpdate(String resourceGroupName, String deploymentName, diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/DefaultWafPoliciesClient.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/DefaultWafPoliciesClient.java new file mode 100644 index 000000000000..30bd338292ad --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/DefaultWafPoliciesClient.java @@ -0,0 +1,44 @@ +// 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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentDefaultWafPolicyListResponseInner; + +/** + * An instance of this class provides access to all the operations defined in DefaultWafPoliciesClient. + */ +public interface DefaultWafPoliciesClient { + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(String resourceGroupName, + String deploymentName, Context context); + + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxDeploymentDefaultWafPolicyListResponseInner list(String resourceGroupName, String deploymentName); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/DeploymentsClient.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/DeploymentsClient.java index 085c67ff307f..660d41862c07 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/DeploymentsClient.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/DeploymentsClient.java @@ -54,7 +54,7 @@ Response getByResourceGroupWithResponse(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Deployment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, NginxDeploymentInner> beginCreateOrUpdate(String resourceGroupName, @@ -65,12 +65,12 @@ SyncPoller, NginxDeploymentInner> beginCreateOr * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. + * @param body The Nginx deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Deployment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, NginxDeploymentInner> beginCreateOrUpdate(String resourceGroupName, @@ -84,7 +84,7 @@ SyncPoller, NginxDeploymentInner> beginCreateOr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) NginxDeploymentInner createOrUpdate(String resourceGroupName, String deploymentName); @@ -94,12 +94,12 @@ SyncPoller, NginxDeploymentInner> beginCreateOr * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. + * @param body The Nginx deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) NginxDeploymentInner createOrUpdate(String resourceGroupName, String deploymentName, NginxDeploymentInner body, @@ -113,7 +113,7 @@ NginxDeploymentInner createOrUpdate(String resourceGroupName, String deploymentN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Deployment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, NginxDeploymentInner> beginUpdate(String resourceGroupName, @@ -124,12 +124,12 @@ SyncPoller, NginxDeploymentInner> beginUpdate(S * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. + * @param body The Nginx deployment update parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Deployment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, NginxDeploymentInner> beginUpdate(String resourceGroupName, @@ -143,7 +143,7 @@ SyncPoller, NginxDeploymentInner> beginUpdate(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) NginxDeploymentInner update(String resourceGroupName, String deploymentName); @@ -153,12 +153,12 @@ SyncPoller, NginxDeploymentInner> beginUpdate(S * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. + * @param body The Nginx deployment update parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) NginxDeploymentInner update(String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body, @@ -221,7 +221,7 @@ NginxDeploymentInner update(String resourceGroupName, String deploymentName, Ngi * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -233,7 +233,7 @@ NginxDeploymentInner update(String resourceGroupName, String deploymentName, Ngi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -245,7 +245,7 @@ NginxDeploymentInner update(String resourceGroupName, String deploymentName, Ngi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -258,7 +258,7 @@ NginxDeploymentInner update(String resourceGroupName, String deploymentName, Ngi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/NginxManagementClient.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/NginxManagementClient.java index 61c60ad89dff..788511ae39cb 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/NginxManagementClient.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/NginxManagementClient.java @@ -74,6 +74,20 @@ public interface NginxManagementClient { */ DeploymentsClient getDeployments(); + /** + * Gets the WafPoliciesClient object to access its operations. + * + * @return the WafPoliciesClient object. + */ + WafPoliciesClient getWafPolicies(); + + /** + * Gets the DefaultWafPoliciesClient object to access its operations. + * + * @return the DefaultWafPoliciesClient object. + */ + DefaultWafPoliciesClient getDefaultWafPolicies(); + /** * Gets the OperationsClient object to access its operations. * 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 1613e2f07bea..58fbfd197ad1 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 @@ -8,7 +8,7 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.nginx.fluent.models.OperationResultInner; +import com.azure.resourcemanager.nginx.fluent.models.OperationInner; /** * An instance of this class provides access to all the operations defined in OperationsClient. @@ -19,11 +19,11 @@ public interface OperationsClient { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of GET request to list Nginx.NginxPlus operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable list(); /** * List all operations provided by Nginx.NginxPlus for the 2024-11-01-preview api version. @@ -32,9 +32,9 @@ public interface OperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of GET request to list Nginx.NginxPlus operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/WafPoliciesClient.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/WafPoliciesClient.java new file mode 100644 index 000000000000..2f84ed0f59d2 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/WafPoliciesClient.java @@ -0,0 +1,200 @@ +// 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.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentWafPolicyInner; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentWafPolicyMetadataInner; + +/** + * An instance of this class provides access to all the operations defined in WafPoliciesClient. + */ +public interface WafPoliciesClient { + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String deploymentName, + String wafPolicyName, Context context); + + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxDeploymentWafPolicyInner get(String resourceGroupName, String deploymentName, String wafPolicyName); + + /** + * Create or update the Nginx Waf Policy for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of nginx Deployment Waf Policy. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NginxDeploymentWafPolicyInner> + beginCreate(String resourceGroupName, String deploymentName, String wafPolicyName); + + /** + * Create or update the Nginx Waf Policy for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param body The Nginx Deployment Waf Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of nginx Deployment Waf Policy. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NginxDeploymentWafPolicyInner> beginCreate( + String resourceGroupName, String deploymentName, String wafPolicyName, NginxDeploymentWafPolicyInner body, + Context context); + + /** + * Create or update the Nginx Waf Policy for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxDeploymentWafPolicyInner create(String resourceGroupName, String deploymentName, String wafPolicyName); + + /** + * Create or update the Nginx Waf Policy for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param body The Nginx Deployment Waf Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NginxDeploymentWafPolicyInner create(String resourceGroupName, String deploymentName, String wafPolicyName, + NginxDeploymentWafPolicyInner body, Context context); + + /** + * Reset the Nginx Waf Policy of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName, + String wafPolicyName); + + /** + * Reset the Nginx Waf Policy of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName, + String wafPolicyName, Context context); + + /** + * Reset the Nginx Waf Policy of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String deploymentName, String wafPolicyName); + + /** + * Reset the Nginx Waf Policy of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String deploymentName, String wafPolicyName, Context context); + + /** + * List Waf Policies of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy List Response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String deploymentName); + + /** + * List Waf Policies of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy List Response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String deploymentName, + Context context); +} 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/fluent/models/AnalysisCreateConfig.java similarity index 93% rename from sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisCreateConfig.java rename to sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/AnalysisCreateConfig.java index 88e4389ca21f..540b01b02864 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/fluent/models/AnalysisCreateConfig.java @@ -2,13 +2,16 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.nginx.models; +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.NginxConfigurationFile; +import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; +import com.azure.resourcemanager.nginx.models.NginxConfigurationProtectedFileRequest; import java.io.IOException; import java.util.List; @@ -33,7 +36,7 @@ public final class AnalysisCreateConfig implements JsonSerializable protectedFiles; /* - * The package property. + * Nginx Configuration Package */ private NginxConfigurationPackage packageProperty; @@ -104,7 +107,7 @@ public AnalysisCreateConfig withProtectedFiles(List errors() { + return this.innerData() == null ? null : this.innerData().errors(); + } + + /** + * Set the errors property: The errors property. + * + * @param errors the errors value to set. * @return the AnalysisResultInner object itself. */ - public AnalysisResultInner withData(AnalysisResultData data) { - this.data = data; + public AnalysisResultInner withErrors(List errors) { + if (this.innerData() == null) { + this.innerData = new AnalysisResultData(); + } + this.innerData().withErrors(errors); + return this; + } + + /** + * Get the diagnostics property: The diagnostics property. + * + * @return the diagnostics value. + */ + public List diagnostics() { + return this.innerData() == null ? null : this.innerData().diagnostics(); + } + + /** + * Set the diagnostics property: The diagnostics property. + * + * @param diagnostics the diagnostics value to set. + * @return the AnalysisResultInner object itself. + */ + public AnalysisResultInner withDiagnostics(List diagnostics) { + if (this.innerData() == null) { + this.innerData = new AnalysisResultData(); + } + this.innerData().withDiagnostics(diagnostics); return this; } @@ -84,8 +121,8 @@ public void validate() { throw LOGGER.atError() .log(new IllegalArgumentException("Missing required property status in model AnalysisResultInner")); } - if (data() != null) { - data().validate(); + if (innerData() != null) { + innerData().validate(); } } @@ -98,7 +135,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("status", this.status); - jsonWriter.writeJsonField("data", this.data); + jsonWriter.writeJsonField("data", this.innerData); return jsonWriter.writeEndObject(); } @@ -121,7 +158,7 @@ public static AnalysisResultInner fromJson(JsonReader jsonReader) throws IOExcep if ("status".equals(fieldName)) { deserializedAnalysisResultInner.status = reader.getString(); } else if ("data".equals(fieldName)) { - deserializedAnalysisResultInner.data = AnalysisResultData.fromJson(reader); + deserializedAnalysisResultInner.innerData = AnalysisResultData.fromJson(reader); } else { reader.skipChildren(); } 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 c509ccde8031..4a52a8e60555 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 @@ -14,20 +14,15 @@ import java.io.IOException; /** - * The NginxCertificate model. + * Nginx Certificate. */ @Fluent public final class NginxCertificateInner extends ProxyResource { /* - * The properties property. + * Nginx Certificate Properties */ private NginxCertificateProperties properties; - /* - * The location property. - */ - private String location; - /* * Metadata pertaining to creation and last modification of the resource. */ @@ -55,7 +50,7 @@ public NginxCertificateInner() { } /** - * Get the properties property: The properties property. + * Get the properties property: Nginx Certificate Properties. * * @return the properties value. */ @@ -64,7 +59,7 @@ public NginxCertificateProperties properties() { } /** - * Set the properties property: The properties property. + * Set the properties property: Nginx Certificate Properties. * * @param properties the properties value to set. * @return the NginxCertificateInner object itself. @@ -74,26 +69,6 @@ public NginxCertificateInner withProperties(NginxCertificateProperties propertie return this; } - /** - * Get the location property: The location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The location property. - * - * @param location the location value to set. - * @return the NginxCertificateInner object itself. - */ - public NginxCertificateInner withLocation(String location) { - this.location = location; - return this; - } - /** * Get the systemData property: Metadata pertaining to creation and last modification of the resource. * @@ -151,7 +126,6 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("properties", this.properties); - jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -179,8 +153,6 @@ public static NginxCertificateInner fromJson(JsonReader jsonReader) throws IOExc 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 { diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxConfigurationResponseInner.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxConfigurationResponseInner.java index cc1ab7dd7cde..85235eaa3d4c 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxConfigurationResponseInner.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxConfigurationResponseInner.java @@ -14,12 +14,12 @@ import java.io.IOException; /** - * The NginxConfigurationResponse model. + * Nginx Configuration Response. */ @Fluent public final class NginxConfigurationResponseInner extends ProxyResource { /* - * The properties property. + * Nginx Configuration Response Properties */ private NginxConfigurationResponseProperties properties; @@ -50,7 +50,7 @@ public NginxConfigurationResponseInner() { } /** - * Get the properties property: The properties property. + * Get the properties property: Nginx Configuration Response Properties. * * @return the properties value. */ @@ -59,7 +59,7 @@ public NginxConfigurationResponseProperties properties() { } /** - * Set the properties property: The properties property. + * Set the properties property: Nginx Configuration Response Properties. * * @param properties the properties value to set. * @return the NginxConfigurationResponseInner object itself. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentApiKeyResponseInner.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentApiKeyResponseInner.java index 12805d1b8293..9bac07f2f4cd 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentApiKeyResponseInner.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentApiKeyResponseInner.java @@ -6,6 +6,7 @@ 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; @@ -13,15 +14,20 @@ import java.io.IOException; /** - * The NginxDeploymentApiKeyResponse model. + * Nginx Deployment Api Key Response. */ @Fluent public final class NginxDeploymentApiKeyResponseInner extends ProxyResource { /* - * The properties property. + * Nginx Deployment Api Key Response Properties */ private NginxDeploymentApiKeyResponseProperties properties; + /* + * Metadata pertaining to creation and last modification of the resource. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -44,7 +50,7 @@ public NginxDeploymentApiKeyResponseInner() { } /** - * Get the properties property: The properties property. + * Get the properties property: Nginx Deployment Api Key Response Properties. * * @return the properties value. */ @@ -53,7 +59,7 @@ public NginxDeploymentApiKeyResponseProperties properties() { } /** - * Set the properties property: The properties property. + * Set the properties property: Nginx Deployment Api Key Response Properties. * * @param properties the properties value to set. * @return the NginxDeploymentApiKeyResponseInner object itself. @@ -63,6 +69,15 @@ public NginxDeploymentApiKeyResponseInner withProperties(NginxDeploymentApiKeyRe return this; } + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -140,6 +155,8 @@ public static NginxDeploymentApiKeyResponseInner fromJson(JsonReader jsonReader) } else if ("properties".equals(fieldName)) { deserializedNginxDeploymentApiKeyResponseInner.properties = NginxDeploymentApiKeyResponseProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNginxDeploymentApiKeyResponseInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentDefaultWafPolicyListResponseInner.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentDefaultWafPolicyListResponseInner.java new file mode 100644 index 000000000000..a80c82d0b503 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentDefaultWafPolicyListResponseInner.java @@ -0,0 +1,131 @@ +// 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.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.NginxDeploymentDefaultWafPolicyProperties; +import java.io.IOException; +import java.util.List; + +/** + * Nginx Deployment Default Waf Policy List Response. + */ +@Fluent +public final class NginxDeploymentDefaultWafPolicyListResponseInner + implements JsonSerializable { + /* + * The value property. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of NginxDeploymentDefaultWafPolicyListResponseInner class. + */ + public NginxDeploymentDefaultWafPolicyListResponseInner() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the NginxDeploymentDefaultWafPolicyListResponseInner object itself. + */ + public NginxDeploymentDefaultWafPolicyListResponseInner + withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the NginxDeploymentDefaultWafPolicyListResponseInner object itself. + */ + public NginxDeploymentDefaultWafPolicyListResponseInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + 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 NginxDeploymentDefaultWafPolicyListResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentDefaultWafPolicyListResponseInner 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 NginxDeploymentDefaultWafPolicyListResponseInner. + */ + public static NginxDeploymentDefaultWafPolicyListResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentDefaultWafPolicyListResponseInner deserializedNginxDeploymentDefaultWafPolicyListResponseInner + = new NginxDeploymentDefaultWafPolicyListResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NginxDeploymentDefaultWafPolicyProperties.fromJson(reader1)); + deserializedNginxDeploymentDefaultWafPolicyListResponseInner.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNginxDeploymentDefaultWafPolicyListResponseInner.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentDefaultWafPolicyListResponseInner; + }); + } +} 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 64521a2b6b5d..0c8134d6f8e6 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 @@ -17,22 +17,22 @@ import java.util.Map; /** - * The NginxDeployment model. + * Nginx Deployment. */ @Fluent public final class NginxDeploymentInner extends Resource { /* - * The identity property. + * Identity Properties */ private IdentityProperties identity; /* - * The properties property. + * Nginx Deployment Properties */ private NginxDeploymentProperties properties; /* - * The sku property. + * Resource Sku */ private ResourceSku sku; @@ -63,7 +63,7 @@ public NginxDeploymentInner() { } /** - * Get the identity property: The identity property. + * Get the identity property: Identity Properties. * * @return the identity value. */ @@ -72,7 +72,7 @@ public IdentityProperties identity() { } /** - * Set the identity property: The identity property. + * Set the identity property: Identity Properties. * * @param identity the identity value to set. * @return the NginxDeploymentInner object itself. @@ -83,7 +83,7 @@ public NginxDeploymentInner withIdentity(IdentityProperties identity) { } /** - * Get the properties property: The properties property. + * Get the properties property: Nginx Deployment Properties. * * @return the properties value. */ @@ -92,7 +92,7 @@ public NginxDeploymentProperties properties() { } /** - * Set the properties property: The properties property. + * Set the properties property: Nginx Deployment Properties. * * @param properties the properties value to set. * @return the NginxDeploymentInner object itself. @@ -103,7 +103,7 @@ public NginxDeploymentInner withProperties(NginxDeploymentProperties properties) } /** - * Get the sku property: The sku property. + * Get the sku property: Resource Sku. * * @return the sku value. */ @@ -112,7 +112,7 @@ public ResourceSku sku() { } /** - * Set the sku property: The sku property. + * Set the sku property: Resource Sku. * * @param sku the sku value to set. * @return the NginxDeploymentInner object itself. 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/fluent/models/NginxDeploymentPropertiesNginxAppProtect.java similarity index 96% rename from sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentPropertiesNginxAppProtect.java rename to sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentPropertiesNginxAppProtect.java index c91903f50bf8..0c131763202a 100644 --- 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/fluent/models/NginxDeploymentPropertiesNginxAppProtect.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.nginx.models; +package com.azure.resourcemanager.nginx.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; @@ -10,6 +10,8 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.nginx.models.WebApplicationFirewallSettings; +import com.azure.resourcemanager.nginx.models.WebApplicationFirewallStatus; import java.io.IOException; /** 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/fluent/models/NginxDeploymentUpdatePropertiesNginxAppProtect.java similarity index 96% rename from sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentUpdatePropertiesNginxAppProtect.java rename to sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentUpdatePropertiesNginxAppProtect.java index 1768e1e1bfb4..05093c95dccb 100644 --- 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/fluent/models/NginxDeploymentUpdatePropertiesNginxAppProtect.java @@ -2,13 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.nginx.models; +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.WebApplicationFirewallSettings; import java.io.IOException; /** diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentWafPolicyInner.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentWafPolicyInner.java new file mode 100644 index 000000000000..38d2dc41e473 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentWafPolicyInner.java @@ -0,0 +1,168 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.nginx.models.NginxDeploymentWafPolicyProperties; +import java.io.IOException; + +/** + * Nginx Deployment Waf Policy. + */ +@Fluent +public final class NginxDeploymentWafPolicyInner extends ProxyResource { + /* + * Nginx Deployment Waf Policy Properties + */ + private NginxDeploymentWafPolicyProperties properties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of NginxDeploymentWafPolicyInner class. + */ + public NginxDeploymentWafPolicyInner() { + } + + /** + * Get the properties property: Nginx Deployment Waf Policy Properties. + * + * @return the properties value. + */ + public NginxDeploymentWafPolicyProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Nginx Deployment Waf Policy Properties. + * + * @param properties the properties value to set. + * @return the NginxDeploymentWafPolicyInner object itself. + */ + public NginxDeploymentWafPolicyInner withProperties(NginxDeploymentWafPolicyProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxDeploymentWafPolicyInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentWafPolicyInner 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 NginxDeploymentWafPolicyInner. + */ + public static NginxDeploymentWafPolicyInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentWafPolicyInner deserializedNginxDeploymentWafPolicyInner + = new NginxDeploymentWafPolicyInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyInner.properties + = NginxDeploymentWafPolicyProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentWafPolicyInner; + }); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentWafPolicyMetadataInner.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentWafPolicyMetadataInner.java new file mode 100644 index 000000000000..f708b2f01005 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/NginxDeploymentWafPolicyMetadataInner.java @@ -0,0 +1,168 @@ +// 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.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.nginx.models.NginxDeploymentWafPolicyMetadataProperties; +import java.io.IOException; + +/** + * Nginx Deployment Waf Policy Metadata. + */ +@Fluent +public final class NginxDeploymentWafPolicyMetadataInner extends ProxyResource { + /* + * Nginx Deployment Waf Policy Metadata Properties + */ + private NginxDeploymentWafPolicyMetadataProperties properties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of NginxDeploymentWafPolicyMetadataInner class. + */ + public NginxDeploymentWafPolicyMetadataInner() { + } + + /** + * Get the properties property: Nginx Deployment Waf Policy Metadata Properties. + * + * @return the properties value. + */ + public NginxDeploymentWafPolicyMetadataProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Nginx Deployment Waf Policy Metadata Properties. + * + * @param properties the properties value to set. + * @return the NginxDeploymentWafPolicyMetadataInner object itself. + */ + public NginxDeploymentWafPolicyMetadataInner withProperties(NginxDeploymentWafPolicyMetadataProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxDeploymentWafPolicyMetadataInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentWafPolicyMetadataInner 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 NginxDeploymentWafPolicyMetadataInner. + */ + public static NginxDeploymentWafPolicyMetadataInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentWafPolicyMetadataInner deserializedNginxDeploymentWafPolicyMetadataInner + = new NginxDeploymentWafPolicyMetadataInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyMetadataInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyMetadataInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyMetadataInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyMetadataInner.properties + = NginxDeploymentWafPolicyMetadataProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyMetadataInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentWafPolicyMetadataInner; + }); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/OperationInner.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/OperationInner.java new file mode 100644 index 000000000000..b3934add8a72 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/OperationInner.java @@ -0,0 +1,172 @@ +// 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.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.ActionType; +import com.azure.resourcemanager.nginx.models.OperationDisplay; +import com.azure.resourcemanager.nginx.models.Origin; +import java.io.IOException; + +/** + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. + */ +@Fluent +public final class OperationInner implements JsonSerializable { + /* + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + */ + private String name; + + /* + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for + * ARM/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. + */ + private OperationDisplay display; + + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + + /** + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Localized display information for this particular operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + public Origin origin() { + return this.origin; + } + + /** + * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + public ActionType actionType() { + return this.actionType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/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 deleted file mode 100644 index 624a3ec16a28..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/OperationResultInner.java +++ /dev/null @@ -1,153 +0,0 @@ -// 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.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 java.io.IOException; - -/** - * A Nginx.NginxPlus REST API operation. - */ -@Fluent -public final class OperationResultInner implements JsonSerializable { - /* - * Operation name: {provider}/{resource}/{operation} - */ - private String name; - - /* - * The object that represents the operation. - */ - private OperationDisplay display; - - /* - * Indicates whether the operation is a data action - */ - private Boolean isDataAction; - - /** - * Creates an instance of OperationResultInner class. - */ - public OperationResultInner() { - } - - /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Operation name: {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the OperationResultInner object itself. - */ - public OperationResultInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the display property: The object that represents the operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: The object that represents the operation. - * - * @param display the display value to set. - * @return the OperationResultInner object itself. - */ - public OperationResultInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the isDataAction property: Indicates whether the operation is a data action. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Set the isDataAction property: Indicates whether the operation is a data action. - * - * @param isDataAction the isDataAction value to set. - * @return the OperationResultInner object itself. - */ - public OperationResultInner withIsDataAction(Boolean isDataAction) { - this.isDataAction = isDataAction; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - 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/models/ScaleProfileCapacity.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/ScaleProfileCapacity.java similarity index 98% rename from sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ScaleProfileCapacity.java rename to sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/fluent/models/ScaleProfileCapacity.java index d4571e5b2405..d0fa73525abf 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/fluent/models/ScaleProfileCapacity.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.nginx.models; +package com.azure.resourcemanager.nginx.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/AnalysisResultImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/AnalysisResultImpl.java index b46c97fc6aea..bc4707bb491a 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/AnalysisResultImpl.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/AnalysisResultImpl.java @@ -5,8 +5,11 @@ package com.azure.resourcemanager.nginx.implementation; import com.azure.resourcemanager.nginx.fluent.models.AnalysisResultInner; +import com.azure.resourcemanager.nginx.models.AnalysisDiagnostic; import com.azure.resourcemanager.nginx.models.AnalysisResult; -import com.azure.resourcemanager.nginx.models.AnalysisResultData; +import com.azure.resourcemanager.nginx.models.DiagnosticItem; +import java.util.Collections; +import java.util.List; public final class AnalysisResultImpl implements AnalysisResult { private AnalysisResultInner innerObject; @@ -22,8 +25,22 @@ public String status() { return this.innerModel().status(); } - public AnalysisResultData data() { - return this.innerModel().data(); + public List errors() { + List inner = this.innerModel().errors(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List diagnostics() { + List inner = this.innerModel().diagnostics(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } } public AnalysisResultInner innerModel() { diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/ApiKeysClientImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/ApiKeysClientImpl.java index d7bedf8a4f91..e91d14b6814f 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/ApiKeysClientImpl.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/ApiKeysClientImpl.java @@ -28,6 +28,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.nginx.fluent.ApiKeysClient; import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentApiKeyResponseInner; import com.azure.resourcemanager.nginx.models.NginxDeploymentApiKeyListResponse; @@ -77,6 +78,18 @@ Mono> createOrUpdate(@HostParam("$h @BodyParam("application/json") NginxDeploymentApiKeyRequest body, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @PathParam("apiKeyName") String apiKeyName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NginxDeploymentApiKeyRequest body, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}") @ExpectedResponses({ 200, 204 }) @@ -87,6 +100,16 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("deploymentName") String deploymentName, @PathParam("apiKeyName") String apiKeyName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @PathParam("apiKeyName") String apiKeyName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}") @ExpectedResponses({ 200 }) @@ -97,6 +120,16 @@ Mono> get(@HostParam("$host") Strin @PathParam("deploymentName") String deploymentName, @PathParam("apiKeyName") String apiKeyName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys/{apiKeyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @PathParam("apiKeyName") String apiKeyName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys") @ExpectedResponses({ 200 }) @@ -107,6 +140,16 @@ Mono> list(@HostParam("$host") Strin @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/apiKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -114,6 +157,14 @@ Mono> list(@HostParam("$host") Strin Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -126,7 +177,7 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return nginx Deployment Api Key Response along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -159,49 +210,6 @@ private Mono> createOrUpdateWithRes .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Create or update an API Key for the Nginx deployment in order to access the dataplane API endpoint. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of targeted NGINX deployment. - * @param apiKeyName The resource name of the API key. - * @param body The API Key object containing fields (e.g. secret text, expiration date) to upsert the key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String deploymentName, String apiKeyName, NginxDeploymentApiKeyRequest body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (apiKeyName == null) { - return Mono.error(new IllegalArgumentException("Parameter apiKeyName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - deploymentName, apiKeyName, this.client.getApiVersion(), body, accept, context); - } - /** * Create or update an API Key for the Nginx deployment in order to access the dataplane API endpoint. * @@ -211,7 +219,7 @@ private Mono> createOrUpdateWithRes * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return nginx Deployment Api Key Response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, @@ -232,12 +240,39 @@ private Mono createOrUpdateAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. + * @return nginx Deployment Api Key Response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String deploymentName, String apiKeyName, NginxDeploymentApiKeyRequest body, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, deploymentName, apiKeyName, body, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (apiKeyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter apiKeyName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, apiKeyName, this.client.getApiVersion(), body, accept, context); } /** @@ -249,7 +284,7 @@ public Response createOrUpdateWithResponse(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Deployment Api Key Response. */ @ServiceMethod(returns = ReturnType.SINGLE) public NginxDeploymentApiKeyResponseInner createOrUpdate(String resourceGroupName, String deploymentName, @@ -297,45 +332,6 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Delete API key for Nginx deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of targeted NGINX deployment. - * @param apiKeyName The resource name of the API key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String deploymentName, - String apiKeyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (apiKeyName == null) { - return Mono.error(new IllegalArgumentException("Parameter apiKeyName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - deploymentName, apiKeyName, this.client.getApiVersion(), accept, context); - } - /** * Delete API key for Nginx deployment. * @@ -367,7 +363,31 @@ private Mono deleteAsync(String resourceGroupName, String deploymentName, @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String deploymentName, String apiKeyName, Context context) { - return deleteWithResponseAsync(resourceGroupName, deploymentName, apiKeyName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (apiKeyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter apiKeyName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, apiKeyName, this.client.getApiVersion(), accept, context); } /** @@ -425,46 +445,6 @@ private Mono> getWithResponseAsync( .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get the specified API Key of the given Nginx deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of targeted NGINX deployment. - * @param apiKeyName The resource name of the API key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified API Key of the given Nginx deployment along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String deploymentName, String apiKeyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (apiKeyName == null) { - return Mono.error(new IllegalArgumentException("Parameter apiKeyName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - deploymentName, apiKeyName, this.client.getApiVersion(), accept, context); - } - /** * Get the specified API Key of the given Nginx deployment. * @@ -498,7 +478,31 @@ private Mono getAsync(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String deploymentName, String apiKeyName, Context context) { - return getWithResponseAsync(resourceGroupName, deploymentName, apiKeyName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (apiKeyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter apiKeyName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, apiKeyName, this.client.getApiVersion(), accept, context); } /** @@ -525,7 +529,8 @@ public NginxDeploymentApiKeyResponseInner get(String resourceGroupName, String d * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Deployment Api Key List Response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, @@ -559,37 +564,15 @@ private Mono> listSinglePageAs * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Deployment Api Key List Response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, deploymentName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String deploymentName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, deploymentName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -600,12 +583,35 @@ private Mono> listSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. + * @return nginx Deployment Api Key List Response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String deploymentName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, deploymentName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String deploymentName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -617,13 +623,35 @@ private PagedFlux listAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. + * @return nginx Deployment Api Key List Response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String deploymentName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, deploymentName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -634,11 +662,12 @@ private PagedFlux listAsync(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment Api Key List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String deploymentName) { - return new PagedIterable<>(listAsync(resourceGroupName, deploymentName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, deploymentName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -650,12 +679,13 @@ public PagedIterable list(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment Api Key List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String deploymentName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, deploymentName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, deploymentName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -665,7 +695,8 @@ public PagedIterable list(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Deployment Api Key List Response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -683,6 +714,33 @@ private Mono> listNextSinglePa .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Api Key List Response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -691,22 +749,25 @@ private Mono> listNextSinglePa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Deployment Api Key List Response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(ApiKeysClientImpl.class); } 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 14126560be26..33bbc85c22c5 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 @@ -27,8 +27,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.nginx.fluent.CertificatesClient; @@ -80,6 +82,16 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("deploymentName") String deploymentName, @PathParam("certificateName") String certificateName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @PathParam("certificateName") String certificateName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}") @ExpectedResponses({ 200, 201 }) @@ -91,9 +103,20 @@ Mono>> createOrUpdate(@HostParam("$host") String endpo @QueryParam("api-version") String apiVersion, @BodyParam("application/json") NginxCertificateInner body, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @PathParam("certificateName") String certificateName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") NginxCertificateInner body, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @@ -101,6 +124,16 @@ Mono>> delete(@HostParam("$host") String endpoint, @PathParam("deploymentName") String deploymentName, @PathParam("certificateName") String certificateName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates/{certificateName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @PathParam("certificateName") String certificateName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates") @ExpectedResponses({ 200 }) @@ -111,6 +144,16 @@ Mono> list(@HostParam("$host") String end @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/certificates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -118,6 +161,14 @@ Mono> list(@HostParam("$host") String end Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -161,47 +212,6 @@ private Mono> getWithResponseAsync(String resour .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get a certificate of given NGINX deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of targeted NGINX deployment. - * @param certificateName The name of certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a certificate of given NGINX deployment along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String deploymentName, - String certificateName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (certificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - deploymentName, certificateName, this.client.getApiVersion(), accept, context); - } - /** * Get a certificate of given NGINX deployment. * @@ -235,7 +245,31 @@ private Mono getAsync(String resourceGroupName, String de @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String deploymentName, String certificateName, Context context) { - return getWithResponseAsync(resourceGroupName, deploymentName, certificateName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (certificateName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, certificateName, this.client.getApiVersion(), accept, context); } /** @@ -264,7 +298,7 @@ public NginxCertificateInner get(String resourceGroupName, String deploymentName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return nginx Certificate along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -298,6 +332,51 @@ private Mono>> createOrUpdateWithResponseAsync(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Create or update the NGINX certificates for given NGINX deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param certificateName The name of certificate. + * @param body The certificate. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Certificate along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String deploymentName, + String certificateName, NginxCertificateInner body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (certificateName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, certificateName, this.client.getApiVersion(), body, accept, Context.NONE); + } + /** * Create or update the NGINX certificates for given NGINX deployment. * @@ -309,36 +388,38 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return nginx Certificate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String deploymentName, String certificateName, NginxCertificateInner body, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String deploymentName, + String certificateName, NginxCertificateInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } if (certificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, deploymentName, certificateName, this.client.getApiVersion(), body, accept, context); } @@ -352,7 +433,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of nginx Certificate. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, NginxCertificateInner> beginCreateOrUpdateAsync( @@ -373,7 +454,7 @@ private PollerFlux, NginxCertificateInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of nginx Certificate. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, NginxCertificateInner> @@ -393,21 +474,18 @@ private PollerFlux, NginxCertificateInner> beg * @param deploymentName The name of targeted NGINX deployment. * @param certificateName The name of certificate. * @param body The certificate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Certificate. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, NginxCertificateInner> beginCreateOrUpdateAsync( - String resourceGroupName, String deploymentName, String certificateName, NginxCertificateInner body, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, deploymentName, certificateName, body, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), NginxCertificateInner.class, NginxCertificateInner.class, context); + public SyncPoller, NginxCertificateInner> beginCreateOrUpdate( + String resourceGroupName, String deploymentName, String certificateName, NginxCertificateInner body) { + Response response + = createOrUpdateWithResponse(resourceGroupName, deploymentName, certificateName, body); + return this.client.getLroResult(response, + NginxCertificateInner.class, NginxCertificateInner.class, Context.NONE); } /** @@ -419,13 +497,16 @@ private PollerFlux, NginxCertificateInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Certificate. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, NginxCertificateInner> beginCreateOrUpdate(String resourceGroupName, String deploymentName, String certificateName) { final NginxCertificateInner body = null; - return this.beginCreateOrUpdateAsync(resourceGroupName, deploymentName, certificateName, body).getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, deploymentName, certificateName, body); + return this.client.getLroResult(response, + NginxCertificateInner.class, NginxCertificateInner.class, Context.NONE); } /** @@ -439,14 +520,16 @@ private PollerFlux, NginxCertificateInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Certificate. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, NginxCertificateInner> beginCreateOrUpdate( String resourceGroupName, String deploymentName, String certificateName, NginxCertificateInner body, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, deploymentName, certificateName, body, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, deploymentName, certificateName, body, context); + return this.client.getLroResult(response, + NginxCertificateInner.class, NginxCertificateInner.class, context); } /** @@ -459,7 +542,7 @@ public SyncPoller, NginxCertificateInner> begi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return nginx Certificate on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String deploymentName, @@ -477,7 +560,7 @@ private Mono createOrUpdateAsync(String resourceGroupName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return nginx Certificate on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String deploymentName, @@ -493,36 +576,16 @@ private Mono createOrUpdateAsync(String resourceGroupName * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. * @param certificateName The name of certificate. - * @param body The certificate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String deploymentName, - String certificateName, NginxCertificateInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, certificateName, body, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update the NGINX certificates for given NGINX deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of targeted NGINX deployment. - * @param certificateName The name of certificate. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Certificate. */ @ServiceMethod(returns = ReturnType.SINGLE) public NginxCertificateInner createOrUpdate(String resourceGroupName, String deploymentName, String certificateName) { final NginxCertificateInner body = null; - return createOrUpdateAsync(resourceGroupName, deploymentName, certificateName, body).block(); + return beginCreateOrUpdate(resourceGroupName, deploymentName, certificateName, body).getFinalResult(); } /** @@ -536,12 +599,12 @@ public NginxCertificateInner createOrUpdate(String resourceGroupName, String dep * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Certificate. */ @ServiceMethod(returns = ReturnType.SINGLE) public NginxCertificateInner createOrUpdate(String resourceGroupName, String deploymentName, String certificateName, NginxCertificateInner body, Context context) { - return createOrUpdateAsync(resourceGroupName, deploymentName, certificateName, body, context).block(); + return beginCreateOrUpdate(resourceGroupName, deploymentName, certificateName, body, context).getFinalResult(); } /** @@ -590,38 +653,39 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. * @param certificateName The name of certificate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String deploymentName, - String certificateName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String deploymentName, + String certificateName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } if (certificateName == null) { - return Mono - .error(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - deploymentName, certificateName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, certificateName, this.client.getApiVersion(), accept, Context.NONE); } /** @@ -630,18 +694,40 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. * @param certificateName The name of certificate. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentName, - String certificateName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, deploymentName, certificateName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String deploymentName, + String certificateName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (certificateName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter certificateName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, certificateName, this.client.getApiVersion(), accept, context); } /** @@ -650,7 +736,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. * @param certificateName The name of certificate. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -658,12 +743,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentName, - String certificateName, Context context) { - context = this.client.mergeContext(context); + String certificateName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, deploymentName, certificateName, context); + = deleteWithResponseAsync(resourceGroupName, deploymentName, certificateName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -680,7 +764,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName, String certificateName) { - return this.beginDeleteAsync(resourceGroupName, deploymentName, certificateName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, deploymentName, certificateName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -698,7 +783,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName, String certificateName, Context context) { - return this.beginDeleteAsync(resourceGroupName, deploymentName, certificateName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, deploymentName, certificateName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -718,25 +804,6 @@ private Mono deleteAsync(String resourceGroupName, String deploymentName, .flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes a certificate from the NGINX deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of targeted NGINX deployment. - * @param certificateName The name of certificate. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String deploymentName, String certificateName, - Context context) { - return beginDeleteAsync(resourceGroupName, deploymentName, certificateName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Deletes a certificate from the NGINX deployment. * @@ -749,7 +816,7 @@ private Mono deleteAsync(String resourceGroupName, String deploymentName, */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String deploymentName, String certificateName) { - deleteAsync(resourceGroupName, deploymentName, certificateName).block(); + beginDelete(resourceGroupName, deploymentName, certificateName).getFinalResult(); } /** @@ -765,7 +832,7 @@ public void delete(String resourceGroupName, String deploymentName, String certi */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String deploymentName, String certificateName, Context context) { - deleteAsync(resourceGroupName, deploymentName, certificateName, context).block(); + beginDelete(resourceGroupName, deploymentName, certificateName, context).getFinalResult(); } /** @@ -776,7 +843,8 @@ public void delete(String resourceGroupName, String deploymentName, String certi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Certificate List Response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, @@ -810,37 +878,15 @@ private Mono> listSinglePageAsync(String re * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Certificate List Response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, deploymentName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String deploymentName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, deploymentName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -851,12 +897,34 @@ private Mono> listSinglePageAsync(String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. + * @return nginx Certificate List Response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String deploymentName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, deploymentName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String deploymentName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -868,13 +936,35 @@ private PagedFlux listAsync(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. + * @return nginx Certificate List Response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String deploymentName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String deploymentName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, deploymentName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -885,11 +975,12 @@ private PagedFlux listAsync(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Certificate List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String deploymentName) { - return new PagedIterable<>(listAsync(resourceGroupName, deploymentName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, deploymentName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -901,11 +992,12 @@ public PagedIterable list(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Certificate List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String deploymentName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, deploymentName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, deploymentName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -915,7 +1007,8 @@ public PagedIterable list(String resourceGroupName, Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Certificate List Response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -933,6 +1026,33 @@ private Mono> listNextSinglePageAsync(Strin .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Certificate List Response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -941,21 +1061,25 @@ private Mono> listNextSinglePageAsync(Strin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Certificate List Response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(CertificatesClientImpl.class); } 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 1ce9464f24d0..3403b68b7db4 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 @@ -28,8 +28,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.nginx.fluent.ConfigurationsClient; @@ -84,6 +86,16 @@ Mono> list(@HostParam("$host") String e @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}") @ExpectedResponses({ 200 }) @@ -95,6 +107,17 @@ Mono> get(@HostParam("$host") String e @PathParam("configurationName") String configurationName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @PathParam("configurationName") String configurationName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}") @ExpectedResponses({ 200, 201 }) @@ -107,9 +130,21 @@ Mono>> createOrUpdate(@HostParam("$host") String endpo @BodyParam("application/json") NginxConfigurationRequest body, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @PathParam("configurationName") String configurationName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NginxConfigurationRequest body, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @@ -118,6 +153,17 @@ Mono>> delete(@HostParam("$host") String endpoint, @PathParam("configurationName") String configurationName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @PathParam("configurationName") String configurationName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}/analyze") @ExpectedResponses({ 200 }) @@ -129,6 +175,17 @@ Mono> analysis(@HostParam("$host") String endpoint @PathParam("configurationName") String configurationName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") AnalysisCreate body, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/configurations/{configurationName}/analyze") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response analysisSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, + @PathParam("configurationName") String configurationName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AnalysisCreate body, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -136,6 +193,14 @@ Mono> analysis(@HostParam("$host") String endpoint Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -146,7 +211,8 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Configuration List Response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String resourceGroupName, @@ -180,37 +246,15 @@ private Mono> listSinglePageAsync * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Configuration List Response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, deploymentName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String deploymentName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, deploymentName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -221,12 +265,35 @@ private Mono> listSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation as paginated response with {@link PagedFlux}. + * @return nginx Configuration List Response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String deploymentName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, deploymentName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String deploymentName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -238,13 +305,35 @@ private PagedFlux listAsync(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation as paginated response with {@link PagedFlux}. + * @return nginx Configuration List Response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String deploymentName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, deploymentName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -255,11 +344,12 @@ private PagedFlux listAsync(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation as paginated response with {@link PagedIterable}. + * @return nginx Configuration List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String deploymentName) { - return new PagedIterable<>(listAsync(resourceGroupName, deploymentName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, deploymentName), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -271,12 +361,13 @@ public PagedIterable list(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation as paginated response with {@link PagedIterable}. + * @return nginx Configuration List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String deploymentName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, deploymentName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, deploymentName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -321,48 +412,6 @@ private Mono> getWithResponseAsync(Str .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get the NGINX configuration of given NGINX deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of targeted NGINX deployment. - * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of - * NGINX conf. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the NGINX configuration of given NGINX deployment along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String deploymentName, String configurationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (configurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - deploymentName, configurationName, this.client.getApiVersion(), accept, context); - } - /** * Get the NGINX configuration of given NGINX deployment. * @@ -398,7 +447,31 @@ private Mono getAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String deploymentName, String configurationName, Context context) { - return getWithResponseAsync(resourceGroupName, deploymentName, configurationName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (configurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, configurationName, this.client.getApiVersion(), accept, context); } /** @@ -430,7 +503,7 @@ public NginxConfigurationResponseInner get(String resourceGroupName, String depl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return nginx Configuration Response along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -465,6 +538,52 @@ private Mono>> createOrUpdateWithResponseAsync(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Create or update the NGINX configuration for given NGINX deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of + * NGINX conf. + * @param body The NGINX configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Configuration Response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String deploymentName, + String configurationName, NginxConfigurationRequest body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (configurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, configurationName, this.client.getApiVersion(), body, accept, Context.NONE); + } + /** * Create or update the NGINX configuration for given NGINX deployment. * @@ -477,36 +596,38 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return nginx Configuration Response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String deploymentName, String configurationName, NginxConfigurationRequest body, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String deploymentName, + String configurationName, NginxConfigurationRequest body, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } if (configurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, deploymentName, configurationName, this.client.getApiVersion(), body, accept, context); } @@ -521,7 +642,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of nginx Configuration Response. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, NginxConfigurationResponseInner> @@ -544,7 +665,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of nginx Configuration Response. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, NginxConfigurationResponseInner> @@ -565,22 +686,18 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of * NGINX conf. * @param body The NGINX configuration. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Configuration Response. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, NginxConfigurationResponseInner> - beginCreateOrUpdateAsync(String resourceGroupName, String deploymentName, String configurationName, - NginxConfigurationRequest body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, deploymentName, configurationName, body, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), NginxConfigurationResponseInner.class, NginxConfigurationResponseInner.class, - context); + public SyncPoller, NginxConfigurationResponseInner> beginCreateOrUpdate( + String resourceGroupName, String deploymentName, String configurationName, NginxConfigurationRequest body) { + Response response + = createOrUpdateWithResponse(resourceGroupName, deploymentName, configurationName, body); + return this.client.getLroResult(response, + NginxConfigurationResponseInner.class, NginxConfigurationResponseInner.class, Context.NONE); } /** @@ -593,14 +710,16 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Configuration Response. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, NginxConfigurationResponseInner> beginCreateOrUpdate(String resourceGroupName, String deploymentName, String configurationName) { final NginxConfigurationRequest body = null; - return this.beginCreateOrUpdateAsync(resourceGroupName, deploymentName, configurationName, body) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, deploymentName, configurationName, body); + return this.client.getLroResult(response, + NginxConfigurationResponseInner.class, NginxConfigurationResponseInner.class, Context.NONE); } /** @@ -615,14 +734,16 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Configuration Response. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, NginxConfigurationResponseInner> beginCreateOrUpdate( String resourceGroupName, String deploymentName, String configurationName, NginxConfigurationRequest body, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, deploymentName, configurationName, body, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, deploymentName, configurationName, body, context); + return this.client.getLroResult(response, + NginxConfigurationResponseInner.class, NginxConfigurationResponseInner.class, context); } /** @@ -636,7 +757,7 @@ public SyncPoller, NginxConfiguratio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return nginx Configuration Response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String deploymentName, @@ -655,7 +776,7 @@ private Mono createOrUpdateAsync(String resourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return nginx Configuration Response on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String deploymentName, @@ -672,37 +793,16 @@ private Mono createOrUpdateAsync(String resourc * @param deploymentName The name of targeted NGINX deployment. * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of * NGINX conf. - * @param body The NGINX configuration. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String deploymentName, - String configurationName, NginxConfigurationRequest body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, configurationName, body, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update the NGINX configuration for given NGINX deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of targeted NGINX deployment. - * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of - * NGINX conf. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Configuration Response. */ @ServiceMethod(returns = ReturnType.SINGLE) public NginxConfigurationResponseInner createOrUpdate(String resourceGroupName, String deploymentName, String configurationName) { final NginxConfigurationRequest body = null; - return createOrUpdateAsync(resourceGroupName, deploymentName, configurationName, body).block(); + return beginCreateOrUpdate(resourceGroupName, deploymentName, configurationName, body).getFinalResult(); } /** @@ -717,12 +817,13 @@ public NginxConfigurationResponseInner createOrUpdate(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Configuration Response. */ @ServiceMethod(returns = ReturnType.SINGLE) public NginxConfigurationResponseInner createOrUpdate(String resourceGroupName, String deploymentName, String configurationName, NginxConfigurationRequest body, Context context) { - return createOrUpdateAsync(resourceGroupName, deploymentName, configurationName, body, context).block(); + return beginCreateOrUpdate(resourceGroupName, deploymentName, configurationName, body, context) + .getFinalResult(); } /** @@ -773,38 +874,39 @@ private Mono>> deleteWithResponseAsync(String resource * @param deploymentName The name of targeted NGINX deployment. * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of * NGINX conf. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String deploymentName, - String configurationName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String deploymentName, + String configurationName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } if (configurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - deploymentName, configurationName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, configurationName, this.client.getApiVersion(), accept, Context.NONE); } /** @@ -814,18 +916,40 @@ private Mono>> deleteWithResponseAsync(String resource * @param deploymentName The name of targeted NGINX deployment. * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of * NGINX conf. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentName, - String configurationName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, deploymentName, configurationName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String deploymentName, + String configurationName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (configurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, configurationName, this.client.getApiVersion(), accept, context); } /** @@ -835,7 +959,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param deploymentName The name of targeted NGINX deployment. * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of * NGINX conf. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -843,12 +966,11 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentName, - String configurationName, Context context) { - context = this.client.mergeContext(context); + String configurationName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, deploymentName, configurationName, context); + = deleteWithResponseAsync(resourceGroupName, deploymentName, configurationName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -866,7 +988,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName, String configurationName) { - return this.beginDeleteAsync(resourceGroupName, deploymentName, configurationName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, deploymentName, configurationName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -885,7 +1008,9 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName, String configurationName, Context context) { - return this.beginDeleteAsync(resourceGroupName, deploymentName, configurationName, context).getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, deploymentName, configurationName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -906,26 +1031,6 @@ private Mono deleteAsync(String resourceGroupName, String deploymentName, .flatMap(this.client::getLroFinalResultOrError); } - /** - * Reset the NGINX configuration of given NGINX deployment to default. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of targeted NGINX deployment. - * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of - * NGINX conf. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String deploymentName, String configurationName, - Context context) { - return beginDeleteAsync(resourceGroupName, deploymentName, configurationName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Reset the NGINX configuration of given NGINX deployment to default. * @@ -939,7 +1044,7 @@ private Mono deleteAsync(String resourceGroupName, String deploymentName, */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String deploymentName, String configurationName) { - deleteAsync(resourceGroupName, deploymentName, configurationName).block(); + beginDelete(resourceGroupName, deploymentName, configurationName).getFinalResult(); } /** @@ -956,7 +1061,7 @@ public void delete(String resourceGroupName, String deploymentName, String confi */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String deploymentName, String configurationName, Context context) { - deleteAsync(resourceGroupName, deploymentName, configurationName, context).block(); + beginDelete(resourceGroupName, deploymentName, configurationName, context).getFinalResult(); } /** @@ -1006,52 +1111,6 @@ private Mono> analysisWithResponseAsync(String res .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Analyze an NGINX configuration without applying it to the NGINXaaS deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of targeted NGINX deployment. - * @param configurationName The name of configuration, only 'default' is supported value due to the singleton of - * NGINX conf. - * @param body The NGINX configuration to analyze. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body for an analysis request along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> analysisWithResponseAsync(String resourceGroupName, - String deploymentName, String configurationName, AnalysisCreate body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - if (configurationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.analysis(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - deploymentName, configurationName, this.client.getApiVersion(), body, accept, context); - } - /** * Analyze an NGINX configuration without applying it to the NGINXaaS deployment. * @@ -1089,7 +1148,34 @@ private Mono analysisAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) public Response analysisWithResponse(String resourceGroupName, String deploymentName, String configurationName, AnalysisCreate body, Context context) { - return analysisWithResponseAsync(resourceGroupName, deploymentName, configurationName, body, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (configurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter configurationName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return service.analysisSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, configurationName, this.client.getApiVersion(), body, accept, context); } /** @@ -1118,7 +1204,8 @@ public AnalysisResultInner analysis(String resourceGroupName, String deploymentN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Configuration List Response along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1136,6 +1223,33 @@ private Mono> listNextSinglePageA .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Configuration List Response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1144,22 +1258,25 @@ private Mono> listNextSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Configuration List Response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(ConfigurationsClientImpl.class); } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/DefaultWafPoliciesClientImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/DefaultWafPoliciesClientImpl.java new file mode 100644 index 000000000000..b8da061af26b --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/DefaultWafPoliciesClientImpl.java @@ -0,0 +1,188 @@ +// 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.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.nginx.fluent.DefaultWafPoliciesClient; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentDefaultWafPolicyListResponseInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DefaultWafPoliciesClient. + */ +public final class DefaultWafPoliciesClientImpl implements DefaultWafPoliciesClient { + /** + * The proxy service used to perform REST calls. + */ + private final DefaultWafPoliciesService service; + + /** + * The service client containing this operation class. + */ + private final NginxManagementClientImpl client; + + /** + * Initializes an instance of DefaultWafPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DefaultWafPoliciesClientImpl(NginxManagementClientImpl client) { + this.service = RestProxy.create(DefaultWafPoliciesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NginxManagementClientDefaultWafPolicies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NginxManagementClien") + public interface DefaultWafPoliciesService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/listDefaultWafPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/listDefaultWafPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listWithResponseAsync(String resourceGroupName, String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, deploymentName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, + String deploymentName) { + return listWithResponseAsync(resourceGroupName, deploymentName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(String resourceGroupName, + String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, this.client.getApiVersion(), accept, context); + } + + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxDeploymentDefaultWafPolicyListResponseInner list(String resourceGroupName, String deploymentName) { + return listWithResponse(resourceGroupName, deploymentName, Context.NONE).getValue(); + } + + private static final ClientLogger LOGGER = new ClientLogger(DefaultWafPoliciesClientImpl.class); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/DefaultWafPoliciesImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/DefaultWafPoliciesImpl.java new file mode 100644 index 000000000000..8081381a91ba --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/DefaultWafPoliciesImpl.java @@ -0,0 +1,58 @@ +// 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.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.nginx.fluent.DefaultWafPoliciesClient; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentDefaultWafPolicyListResponseInner; +import com.azure.resourcemanager.nginx.models.DefaultWafPolicies; +import com.azure.resourcemanager.nginx.models.NginxDeploymentDefaultWafPolicyListResponse; + +public final class DefaultWafPoliciesImpl implements DefaultWafPolicies { + private static final ClientLogger LOGGER = new ClientLogger(DefaultWafPoliciesImpl.class); + + private final DefaultWafPoliciesClient innerClient; + + private final com.azure.resourcemanager.nginx.NginxManager serviceManager; + + public DefaultWafPoliciesImpl(DefaultWafPoliciesClient innerClient, + com.azure.resourcemanager.nginx.NginxManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse(String resourceGroupName, + String deploymentName, Context context) { + Response inner + = this.serviceClient().listWithResponse(resourceGroupName, deploymentName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NginxDeploymentDefaultWafPolicyListResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NginxDeploymentDefaultWafPolicyListResponse list(String resourceGroupName, String deploymentName) { + NginxDeploymentDefaultWafPolicyListResponseInner inner + = this.serviceClient().list(resourceGroupName, deploymentName); + if (inner != null) { + return new NginxDeploymentDefaultWafPolicyListResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private DefaultWafPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.nginx.NginxManager manager() { + return this.serviceManager; + } +} 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 e000914c8d27..be7fc4fb50a8 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 @@ -28,8 +28,10 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.nginx.fluent.DeploymentsClient; @@ -82,6 +84,16 @@ Mono> getByResourceGroup(@HostParam("$host") Stri @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}") @ExpectedResponses({ 200, 201 }) @@ -94,9 +106,20 @@ Mono>> createOrUpdate(@HostParam("$host") String endpo Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NginxDeploymentInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @@ -104,9 +127,20 @@ Mono>> update(@HostParam("$host") String endpoint, @BodyParam("application/json") NginxDeploymentUpdateParameters body, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NginxDeploymentUpdateParameters body, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}") - @ExpectedResponses({ 200, 202, 204 }) + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @@ -114,6 +148,16 @@ Mono>> delete(@HostParam("$host") String endpoint, @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Nginx.NginxPlus/nginxDeployments") @ExpectedResponses({ 200 }) @@ -122,6 +166,14 @@ Mono> list(@HostParam("$host") String endp @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Nginx.NginxPlus/nginxDeployments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments") @ExpectedResponses({ 200 }) @@ -131,6 +183,15 @@ Mono> listByResourceGroup(@HostParam("$hos @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -139,6 +200,14 @@ Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -146,6 +215,14 @@ Mono> listNext( Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -184,41 +261,6 @@ private Mono> getByResourceGroupWithResponseAsync .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get the NGINX deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of targeted NGINX deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the NGINX deployment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String deploymentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - deploymentName, this.client.getApiVersion(), accept, context); - } - /** * Get the NGINX deployment. * @@ -249,7 +291,27 @@ private Mono getByResourceGroupAsync(String resourceGroupN @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String deploymentName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, deploymentName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, deploymentName, this.client.getApiVersion(), accept, context); } /** @@ -272,11 +334,11 @@ public NginxDeploymentInner getByResourceGroup(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. + * @param body The Nginx deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return nginx Deployment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, @@ -311,37 +373,79 @@ private Mono>> createOrUpdateWithResponseAsync(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. + * @param body The Nginx deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String deploymentName, + NginxDeploymentInner body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, this.client.getApiVersion(), body, accept, Context.NONE); + } + + /** + * Create or update the NGINX deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param body The Nginx deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return nginx Deployment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String deploymentName, NginxDeploymentInner body, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String deploymentName, + NginxDeploymentInner body, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, deploymentName, this.client.getApiVersion(), body, accept, context); } @@ -350,11 +454,11 @@ private Mono>> createOrUpdateWithResponseAsync(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. + * @param body The Nginx deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of nginx Deployment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, NginxDeploymentInner> @@ -373,7 +477,7 @@ private Mono>> createOrUpdateWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of nginx Deployment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, NginxDeploymentInner> @@ -390,21 +494,18 @@ private Mono>> createOrUpdateWithResponseAsync(String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. - * @param context The context to associate with this operation. + * @param body The Nginx deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Deployment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, NginxDeploymentInner> beginCreateOrUpdateAsync( - String resourceGroupName, String deploymentName, NginxDeploymentInner body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, deploymentName, body, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - NginxDeploymentInner.class, NginxDeploymentInner.class, context); + public SyncPoller, NginxDeploymentInner> + beginCreateOrUpdate(String resourceGroupName, String deploymentName, NginxDeploymentInner body) { + Response response = createOrUpdateWithResponse(resourceGroupName, deploymentName, body); + return this.client.getLroResult(response, + NginxDeploymentInner.class, NginxDeploymentInner.class, Context.NONE); } /** @@ -415,13 +516,15 @@ private PollerFlux, NginxDeploymentInner> begin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Deployment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, NginxDeploymentInner> beginCreateOrUpdate(String resourceGroupName, String deploymentName) { final NginxDeploymentInner body = null; - return this.beginCreateOrUpdateAsync(resourceGroupName, deploymentName, body).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, deploymentName, body); + return this.client.getLroResult(response, + NginxDeploymentInner.class, NginxDeploymentInner.class, Context.NONE); } /** @@ -429,17 +532,19 @@ private PollerFlux, NginxDeploymentInner> begin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. + * @param body The Nginx deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Deployment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, NginxDeploymentInner> beginCreateOrUpdate( String resourceGroupName, String deploymentName, NginxDeploymentInner body, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, deploymentName, body, context).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, deploymentName, body, context); + return this.client.getLroResult(response, + NginxDeploymentInner.class, NginxDeploymentInner.class, context); } /** @@ -447,11 +552,11 @@ public SyncPoller, NginxDeploymentInner> beginC * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. + * @param body The Nginx deployment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return nginx Deployment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String deploymentName, @@ -468,7 +573,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return nginx Deployment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String deploymentName) { @@ -482,34 +587,15 @@ private Mono createOrUpdateAsync(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String deploymentName, - NginxDeploymentInner body, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, body, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create or update the NGINX deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of targeted NGINX deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) public NginxDeploymentInner createOrUpdate(String resourceGroupName, String deploymentName) { final NginxDeploymentInner body = null; - return createOrUpdateAsync(resourceGroupName, deploymentName, body).block(); + return beginCreateOrUpdate(resourceGroupName, deploymentName, body).getFinalResult(); } /** @@ -517,17 +603,17 @@ public NginxDeploymentInner createOrUpdate(String resourceGroupName, String depl * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. + * @param body The Nginx deployment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) public NginxDeploymentInner createOrUpdate(String resourceGroupName, String deploymentName, NginxDeploymentInner body, Context context) { - return createOrUpdateAsync(resourceGroupName, deploymentName, body, context).block(); + return beginCreateOrUpdate(resourceGroupName, deploymentName, body, context).getFinalResult(); } /** @@ -535,11 +621,11 @@ public NginxDeploymentInner createOrUpdate(String resourceGroupName, String depl * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. + * @param body The Nginx deployment update parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return nginx Deployment along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String deploymentName, @@ -574,37 +660,79 @@ private Mono>> updateWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. + * @param body The Nginx deployment update parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String deploymentName, + NginxDeploymentUpdateParameters body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, this.client.getApiVersion(), body, accept, Context.NONE); + } + + /** + * Update the NGINX deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param body The Nginx deployment update parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return nginx Deployment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String deploymentName, + private Response updateWithResponse(String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } if (body != null) { body.validate(); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, deploymentName, this.client.getApiVersion(), body, accept, context); } @@ -613,11 +741,11 @@ private Mono>> updateWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. + * @param body The Nginx deployment update parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of nginx Deployment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, NginxDeploymentInner> @@ -635,7 +763,7 @@ private Mono>> updateWithResponseAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of nginx Deployment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, NginxDeploymentInner> @@ -651,21 +779,18 @@ private Mono>> updateWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. - * @param context The context to associate with this operation. + * @param body The Nginx deployment update parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Deployment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, NginxDeploymentInner> beginUpdateAsync( - String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, deploymentName, body, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - NginxDeploymentInner.class, NginxDeploymentInner.class, context); + public SyncPoller, NginxDeploymentInner> beginUpdate(String resourceGroupName, + String deploymentName, NginxDeploymentUpdateParameters body) { + Response response = updateWithResponse(resourceGroupName, deploymentName, body); + return this.client.getLroResult(response, + NginxDeploymentInner.class, NginxDeploymentInner.class, Context.NONE); } /** @@ -676,13 +801,15 @@ private PollerFlux, NginxDeploymentInner> begin * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Deployment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, NginxDeploymentInner> beginUpdate(String resourceGroupName, String deploymentName) { final NginxDeploymentUpdateParameters body = null; - return this.beginUpdateAsync(resourceGroupName, deploymentName, body).getSyncPoller(); + Response response = updateWithResponse(resourceGroupName, deploymentName, body); + return this.client.getLroResult(response, + NginxDeploymentInner.class, NginxDeploymentInner.class, Context.NONE); } /** @@ -690,17 +817,19 @@ public SyncPoller, NginxDeploymentInner> beginU * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. + * @param body The Nginx deployment update parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of nginx Deployment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, NginxDeploymentInner> beginUpdate(String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body, Context context) { - return this.beginUpdateAsync(resourceGroupName, deploymentName, body, context).getSyncPoller(); + Response response = updateWithResponse(resourceGroupName, deploymentName, body, context); + return this.client.getLroResult(response, + NginxDeploymentInner.class, NginxDeploymentInner.class, context); } /** @@ -708,11 +837,11 @@ public SyncPoller, NginxDeploymentInner> beginU * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. + * @param body The Nginx deployment update parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return nginx Deployment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String deploymentName, @@ -729,7 +858,7 @@ private Mono updateAsync(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return nginx Deployment on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String deploymentName) { @@ -743,34 +872,15 @@ private Mono updateAsync(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String deploymentName, - NginxDeploymentUpdateParameters body, Context context) { - return beginUpdateAsync(resourceGroupName, deploymentName, body, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update the NGINX deployment. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of targeted NGINX deployment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) public NginxDeploymentInner update(String resourceGroupName, String deploymentName) { final NginxDeploymentUpdateParameters body = null; - return updateAsync(resourceGroupName, deploymentName, body).block(); + return beginUpdate(resourceGroupName, deploymentName, body).getFinalResult(); } /** @@ -778,17 +888,17 @@ public NginxDeploymentInner update(String resourceGroupName, String deploymentNa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param body The body parameter. + * @param body The Nginx deployment update parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return nginx Deployment. */ @ServiceMethod(returns = ReturnType.SINGLE) public NginxDeploymentInner update(String resourceGroupName, String deploymentName, NginxDeploymentUpdateParameters body, Context context) { - return updateAsync(resourceGroupName, deploymentName, body, context).block(); + return beginUpdate(resourceGroupName, deploymentName, body, context).getFinalResult(); } /** @@ -830,34 +940,34 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String deploymentName, - Context context) { + private Response deleteWithResponse(String resourceGroupName, String deploymentName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (deploymentName == null) { - return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - deploymentName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, this.client.getApiVersion(), accept, Context.NONE); } /** @@ -865,16 +975,35 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, deploymentName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, this.client.getApiVersion(), accept, context); } /** @@ -882,19 +1011,16 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of targeted NGINX deployment. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, deploymentName, context); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, deploymentName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -909,7 +1035,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName) { - return this.beginDeleteAsync(resourceGroupName, deploymentName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, deploymentName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -926,7 +1053,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName, Context context) { - return this.beginDeleteAsync(resourceGroupName, deploymentName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, deploymentName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -945,23 +1073,6 @@ private Mono deleteAsync(String resourceGroupName, String deploymentName) .flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete the NGINX deployment resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param deploymentName The name of targeted NGINX deployment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String deploymentName, Context context) { - return beginDeleteAsync(resourceGroupName, deploymentName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete the NGINX deployment resource. * @@ -973,7 +1084,7 @@ private Mono deleteAsync(String resourceGroupName, String deploymentName, */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String deploymentName) { - deleteAsync(resourceGroupName, deploymentName).block(); + beginDelete(resourceGroupName, deploymentName).getFinalResult(); } /** @@ -988,7 +1099,7 @@ public void delete(String resourceGroupName, String deploymentName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String deploymentName, Context context) { - deleteAsync(resourceGroupName, deploymentName, context).block(); + beginDelete(resourceGroupName, deploymentName, context).getFinalResult(); } /** @@ -996,7 +1107,7 @@ public void delete(String resourceGroupName, String deploymentName, Context cont * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Deployment List Response along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -1020,29 +1131,13 @@ private Mono> listSinglePageAsync() { /** * List the NGINX deployments resources. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Deployment List Response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -1050,11 +1145,25 @@ private Mono> listSinglePageAsync(Context co * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. + * @return nginx Deployment List Response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1064,12 +1173,25 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. + * @return nginx Deployment List Response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1077,11 +1199,11 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -1091,11 +1213,11 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -1105,7 +1227,7 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Deployment List Response along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { @@ -1134,34 +1256,15 @@ private Mono> listByResourceGroupSinglePageA * List all NGINX deployments under the specified resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Deployment List Response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** @@ -1171,12 +1274,29 @@ private Mono> listByResourceGroupSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. + * @return nginx Deployment List Response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1187,12 +1307,30 @@ private PagedFlux listByResourceGroupAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. + * @return nginx Deployment List Response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1202,11 +1340,12 @@ private PagedFlux listByResourceGroupAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** @@ -1217,11 +1356,12 @@ public PagedIterable listByResourceGroup(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment List Response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** @@ -1231,7 +1371,7 @@ public PagedIterable listByResourceGroup(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Deployment List Response along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1249,6 +1389,33 @@ private Mono> listNextSinglePageAsync(String .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment List Response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1257,22 +1424,24 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Deployment List Response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1282,7 +1451,7 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Deployment List Response along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1302,6 +1471,33 @@ private Mono> listByResourceGroupNextSingleP .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment List Response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1310,22 +1506,25 @@ private Mono> listByResourceGroupNextSingleP * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return nginx Deployment List Response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(DeploymentsClientImpl.class); } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxCertificateImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxCertificateImpl.java index f390f2b2fed1..7ef848b8a92c 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxCertificateImpl.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxCertificateImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.nginx.implementation; -import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.nginx.fluent.models.NginxCertificateInner; @@ -33,22 +32,10 @@ public NginxCertificateProperties properties() { return this.innerModel().properties(); } - public String location() { - return this.innerModel().location(); - } - public SystemData systemData() { return this.innerModel().systemData(); } - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - public String resourceGroupName() { return resourceGroupName; } @@ -136,16 +123,6 @@ public NginxCertificate refresh(Context context) { return this; } - public NginxCertificateImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public NginxCertificateImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - public NginxCertificateImpl withProperties(NginxCertificateProperties properties) { this.innerModel().withProperties(properties); return this; diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxDeploymentApiKeyResponseImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxDeploymentApiKeyResponseImpl.java index 8106e9bfb425..73c20351dabd 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxDeploymentApiKeyResponseImpl.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxDeploymentApiKeyResponseImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.nginx.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentApiKeyResponseInner; import com.azure.resourcemanager.nginx.models.NginxDeploymentApiKeyRequest; @@ -33,6 +34,10 @@ public NginxDeploymentApiKeyResponseProperties properties() { return this.innerModel().properties(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String resourceGroupName() { return resourceGroupName; } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxDeploymentDefaultWafPolicyListResponseImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxDeploymentDefaultWafPolicyListResponseImpl.java new file mode 100644 index 000000000000..16ed09e2d151 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxDeploymentDefaultWafPolicyListResponseImpl.java @@ -0,0 +1,45 @@ +// 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.implementation; + +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentDefaultWafPolicyListResponseInner; +import com.azure.resourcemanager.nginx.models.NginxDeploymentDefaultWafPolicyListResponse; +import com.azure.resourcemanager.nginx.models.NginxDeploymentDefaultWafPolicyProperties; +import java.util.Collections; +import java.util.List; + +public final class NginxDeploymentDefaultWafPolicyListResponseImpl + implements NginxDeploymentDefaultWafPolicyListResponse { + private NginxDeploymentDefaultWafPolicyListResponseInner innerObject; + + private final com.azure.resourcemanager.nginx.NginxManager serviceManager; + + NginxDeploymentDefaultWafPolicyListResponseImpl(NginxDeploymentDefaultWafPolicyListResponseInner innerObject, + com.azure.resourcemanager.nginx.NginxManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public String nextLink() { + return this.innerModel().nextLink(); + } + + public NginxDeploymentDefaultWafPolicyListResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.nginx.NginxManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxDeploymentWafPolicyImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxDeploymentWafPolicyImpl.java new file mode 100644 index 000000000000..8d9ad4701a26 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxDeploymentWafPolicyImpl.java @@ -0,0 +1,105 @@ +// 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.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentWafPolicyInner; +import com.azure.resourcemanager.nginx.models.NginxDeploymentWafPolicy; +import com.azure.resourcemanager.nginx.models.NginxDeploymentWafPolicyProperties; + +public final class NginxDeploymentWafPolicyImpl + implements NginxDeploymentWafPolicy, NginxDeploymentWafPolicy.Definition { + private NginxDeploymentWafPolicyInner innerObject; + + private final com.azure.resourcemanager.nginx.NginxManager serviceManager; + + NginxDeploymentWafPolicyImpl(NginxDeploymentWafPolicyInner innerObject, + com.azure.resourcemanager.nginx.NginxManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public NginxDeploymentWafPolicyProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public NginxDeploymentWafPolicyInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.nginx.NginxManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String deploymentName; + + private String wafPolicyName; + + public NginxDeploymentWafPolicyImpl withExistingNginxDeployment(String resourceGroupName, String deploymentName) { + this.resourceGroupName = resourceGroupName; + this.deploymentName = deploymentName; + return this; + } + + public NginxDeploymentWafPolicy create() { + this.innerObject = serviceManager.serviceClient() + .getWafPolicies() + .create(resourceGroupName, deploymentName, wafPolicyName, this.innerModel(), Context.NONE); + return this; + } + + public NginxDeploymentWafPolicy create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWafPolicies() + .create(resourceGroupName, deploymentName, wafPolicyName, this.innerModel(), context); + return this; + } + + NginxDeploymentWafPolicyImpl(String name, com.azure.resourcemanager.nginx.NginxManager serviceManager) { + this.innerObject = new NginxDeploymentWafPolicyInner(); + this.serviceManager = serviceManager; + this.wafPolicyName = name; + } + + public NginxDeploymentWafPolicy refresh() { + this.innerObject = serviceManager.serviceClient() + .getWafPolicies() + .getWithResponse(resourceGroupName, deploymentName, wafPolicyName, Context.NONE) + .getValue(); + return this; + } + + public NginxDeploymentWafPolicy refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getWafPolicies() + .getWithResponse(resourceGroupName, deploymentName, wafPolicyName, context) + .getValue(); + return this; + } + + public NginxDeploymentWafPolicyImpl withProperties(NginxDeploymentWafPolicyProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxDeploymentWafPolicyMetadataImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxDeploymentWafPolicyMetadataImpl.java new file mode 100644 index 000000000000..0946bff5c04a --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/NginxDeploymentWafPolicyMetadataImpl.java @@ -0,0 +1,50 @@ +// 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.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentWafPolicyMetadataInner; +import com.azure.resourcemanager.nginx.models.NginxDeploymentWafPolicyMetadata; +import com.azure.resourcemanager.nginx.models.NginxDeploymentWafPolicyMetadataProperties; + +public final class NginxDeploymentWafPolicyMetadataImpl implements NginxDeploymentWafPolicyMetadata { + private NginxDeploymentWafPolicyMetadataInner innerObject; + + private final com.azure.resourcemanager.nginx.NginxManager serviceManager; + + NginxDeploymentWafPolicyMetadataImpl(NginxDeploymentWafPolicyMetadataInner innerObject, + com.azure.resourcemanager.nginx.NginxManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public NginxDeploymentWafPolicyMetadataProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public NginxDeploymentWafPolicyMetadataInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.nginx.NginxManager manager() { + return this.serviceManager; + } +} 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 72ac3670635f..cc748a9aad25 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 @@ -15,20 +15,25 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.nginx.fluent.ApiKeysClient; import com.azure.resourcemanager.nginx.fluent.CertificatesClient; import com.azure.resourcemanager.nginx.fluent.ConfigurationsClient; +import com.azure.resourcemanager.nginx.fluent.DefaultWafPoliciesClient; import com.azure.resourcemanager.nginx.fluent.DeploymentsClient; import com.azure.resourcemanager.nginx.fluent.NginxManagementClient; import com.azure.resourcemanager.nginx.fluent.OperationsClient; +import com.azure.resourcemanager.nginx.fluent.WafPoliciesClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -183,6 +188,34 @@ public DeploymentsClient getDeployments() { return this.deployments; } + /** + * The WafPoliciesClient object to access its operations. + */ + private final WafPoliciesClient wafPolicies; + + /** + * Gets the WafPoliciesClient object to access its operations. + * + * @return the WafPoliciesClient object. + */ + public WafPoliciesClient getWafPolicies() { + return this.wafPolicies; + } + + /** + * The DefaultWafPoliciesClient object to access its operations. + */ + private final DefaultWafPoliciesClient defaultWafPolicies; + + /** + * Gets the DefaultWafPoliciesClient object to access its operations. + * + * @return the DefaultWafPoliciesClient object. + */ + public DefaultWafPoliciesClient getDefaultWafPolicies() { + return this.defaultWafPolicies; + } + /** * The OperationsClient object to access its operations. */ @@ -214,11 +247,13 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-11-01-preview"; + this.apiVersion = "2025-03-01-preview"; this.apiKeys = new ApiKeysClientImpl(this); this.certificates = new CertificatesClientImpl(this); this.configurations = new ConfigurationsClientImpl(this); this.deployments = new DeploymentsClientImpl(this); + this.wafPolicies = new WafPoliciesClientImpl(this); + this.defaultWafPolicies = new DefaultWafPoliciesClientImpl(this); this.operations = new OperationsClientImpl(this); } @@ -259,6 +294,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationResultImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationImpl.java similarity index 56% rename from sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationResultImpl.java rename to sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationImpl.java index 6825039391fc..0b3c9a7b60ff 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationResultImpl.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationImpl.java @@ -4,16 +4,18 @@ package com.azure.resourcemanager.nginx.implementation; -import com.azure.resourcemanager.nginx.fluent.models.OperationResultInner; +import com.azure.resourcemanager.nginx.fluent.models.OperationInner; +import com.azure.resourcemanager.nginx.models.ActionType; +import com.azure.resourcemanager.nginx.models.Operation; import com.azure.resourcemanager.nginx.models.OperationDisplay; -import com.azure.resourcemanager.nginx.models.OperationResult; +import com.azure.resourcemanager.nginx.models.Origin; -public final class OperationResultImpl implements OperationResult { - private OperationResultInner innerObject; +public final class OperationImpl implements Operation { + private OperationInner innerObject; private final com.azure.resourcemanager.nginx.NginxManager serviceManager; - OperationResultImpl(OperationResultInner innerObject, com.azure.resourcemanager.nginx.NginxManager serviceManager) { + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.nginx.NginxManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -22,15 +24,23 @@ public String name() { return this.innerModel().name(); } + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + public OperationDisplay display() { return this.innerModel().display(); } - public Boolean isDataAction() { - return this.innerModel().isDataAction(); + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); } - public OperationResultInner innerModel() { + public OperationInner innerModel() { return this.innerObject; } 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 c657baf67306..f40dc8be171b 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 @@ -25,8 +25,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.nginx.fluent.OperationsClient; -import com.azure.resourcemanager.nginx.fluent.models.OperationResultInner; +import com.azure.resourcemanager.nginx.fluent.models.OperationInner; import com.azure.resourcemanager.nginx.models.OperationListResult; import reactor.core.publisher.Mono; @@ -69,12 +70,26 @@ public interface OperationsService { Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Nginx.NginxPlus/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -82,11 +97,11 @@ Mono> listNext(@PathParam(value = "nextLink", enco * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of GET request to list Nginx.NginxPlus operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -95,32 +110,22 @@ private Mono> listSinglePageAsync() { return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List all operations provided by Nginx.NginxPlus for the 2024-11-01-preview api version. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of GET request to list Nginx.NginxPlus operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -128,11 +133,20 @@ private Mono> listSinglePageAsync(Context co * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of GET request to list Nginx.NginxPlus operations as paginated response with {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -142,12 +156,20 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of GET request to list Nginx.NginxPlus operations as paginated response with {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -155,12 +177,12 @@ private PagedFlux listAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of GET request to list Nginx.NginxPlus operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -170,12 +192,12 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of GET request to list Nginx.NginxPlus operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -185,11 +207,11 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of GET request to list Nginx.NginxPlus operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -199,11 +221,38 @@ private Mono> listNextSinglePageAsync(String } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -212,22 +261,24 @@ private Mono> listNextSinglePageAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of GET request to list Nginx.NginxPlus operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationsImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationsImpl.java index 4d72726532ef..14d5d4ce6f5d 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationsImpl.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/OperationsImpl.java @@ -8,8 +8,8 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.nginx.fluent.OperationsClient; -import com.azure.resourcemanager.nginx.fluent.models.OperationResultInner; -import com.azure.resourcemanager.nginx.models.OperationResult; +import com.azure.resourcemanager.nginx.fluent.models.OperationInner; +import com.azure.resourcemanager.nginx.models.Operation; import com.azure.resourcemanager.nginx.models.Operations; public final class OperationsImpl implements Operations { @@ -24,14 +24,14 @@ public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.ng this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager())); + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/WafPoliciesClientImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/WafPoliciesClientImpl.java new file mode 100644 index 000000000000..1e62ada730b5 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/WafPoliciesClientImpl.java @@ -0,0 +1,1085 @@ +// 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.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.nginx.fluent.WafPoliciesClient; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentWafPolicyInner; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentWafPolicyMetadataInner; +import com.azure.resourcemanager.nginx.models.NginxDeploymentWafPolicyListResponse; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in WafPoliciesClient. + */ +public final class WafPoliciesClientImpl implements WafPoliciesClient { + /** + * The proxy service used to perform REST calls. + */ + private final WafPoliciesService service; + + /** + * The service client containing this operation class. + */ + private final NginxManagementClientImpl client; + + /** + * Initializes an instance of WafPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + WafPoliciesClientImpl(NginxManagementClientImpl client) { + this.service + = RestProxy.create(WafPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NginxManagementClientWafPolicies to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "NginxManagementClien") + public interface WafPoliciesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @PathParam("wafPolicyName") String wafPolicyName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @PathParam("wafPolicyName") String wafPolicyName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @PathParam("wafPolicyName") String wafPolicyName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NginxDeploymentWafPolicyInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @PathParam("wafPolicyName") String wafPolicyName, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") NginxDeploymentWafPolicyInner body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @PathParam("wafPolicyName") String wafPolicyName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies/{wafPolicyName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @PathParam("wafPolicyName") String wafPolicyName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Nginx.NginxPlus/nginxDeployments/{deploymentName}/wafPolicies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String deploymentName, String wafPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (wafPolicyName == null) { + return Mono.error(new IllegalArgumentException("Parameter wafPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, deploymentName, wafPolicyName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String deploymentName, + String wafPolicyName) { + return getWithResponseAsync(resourceGroupName, deploymentName, wafPolicyName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String deploymentName, + String wafPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (wafPolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter wafPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, wafPolicyName, this.client.getApiVersion(), accept, context); + } + + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxDeploymentWafPolicyInner get(String resourceGroupName, String deploymentName, String wafPolicyName) { + return getWithResponse(resourceGroupName, deploymentName, wafPolicyName, Context.NONE).getValue(); + } + + /** + * Create or update the Nginx Waf Policy for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param body The Nginx Deployment Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, String deploymentName, + String wafPolicyName, NginxDeploymentWafPolicyInner body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (wafPolicyName == null) { + return Mono.error(new IllegalArgumentException("Parameter wafPolicyName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, deploymentName, wafPolicyName, this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update the Nginx Waf Policy for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param body The Nginx Deployment Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String deploymentName, + String wafPolicyName, NginxDeploymentWafPolicyInner body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (wafPolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter wafPolicyName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, wafPolicyName, this.client.getApiVersion(), body, accept, Context.NONE); + } + + /** + * Create or update the Nginx Waf Policy for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param body The Nginx Deployment Waf Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String deploymentName, + String wafPolicyName, NginxDeploymentWafPolicyInner body, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (wafPolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter wafPolicyName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, wafPolicyName, this.client.getApiVersion(), body, accept, context); + } + + /** + * Create or update the Nginx Waf Policy for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param body The Nginx Deployment Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of nginx Deployment Waf Policy. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NginxDeploymentWafPolicyInner> beginCreateAsync( + String resourceGroupName, String deploymentName, String wafPolicyName, NginxDeploymentWafPolicyInner body) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, deploymentName, wafPolicyName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NginxDeploymentWafPolicyInner.class, NginxDeploymentWafPolicyInner.class, + this.client.getContext()); + } + + /** + * Create or update the Nginx Waf Policy for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of nginx Deployment Waf Policy. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, NginxDeploymentWafPolicyInner> + beginCreateAsync(String resourceGroupName, String deploymentName, String wafPolicyName) { + final NginxDeploymentWafPolicyInner body = null; + Mono>> mono + = createWithResponseAsync(resourceGroupName, deploymentName, wafPolicyName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), NginxDeploymentWafPolicyInner.class, NginxDeploymentWafPolicyInner.class, + this.client.getContext()); + } + + /** + * Create or update the Nginx Waf Policy for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param body The Nginx Deployment Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of nginx Deployment Waf Policy. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NginxDeploymentWafPolicyInner> beginCreate( + String resourceGroupName, String deploymentName, String wafPolicyName, NginxDeploymentWafPolicyInner body) { + Response response = createWithResponse(resourceGroupName, deploymentName, wafPolicyName, body); + return this.client.getLroResult(response, + NginxDeploymentWafPolicyInner.class, NginxDeploymentWafPolicyInner.class, Context.NONE); + } + + /** + * Create or update the Nginx Waf Policy for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of nginx Deployment Waf Policy. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NginxDeploymentWafPolicyInner> + beginCreate(String resourceGroupName, String deploymentName, String wafPolicyName) { + final NginxDeploymentWafPolicyInner body = null; + Response response = createWithResponse(resourceGroupName, deploymentName, wafPolicyName, body); + return this.client.getLroResult(response, + NginxDeploymentWafPolicyInner.class, NginxDeploymentWafPolicyInner.class, Context.NONE); + } + + /** + * Create or update the Nginx Waf Policy for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param body The Nginx Deployment Waf Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of nginx Deployment Waf Policy. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NginxDeploymentWafPolicyInner> beginCreate( + String resourceGroupName, String deploymentName, String wafPolicyName, NginxDeploymentWafPolicyInner body, + Context context) { + Response response + = createWithResponse(resourceGroupName, deploymentName, wafPolicyName, body, context); + return this.client.getLroResult(response, + NginxDeploymentWafPolicyInner.class, NginxDeploymentWafPolicyInner.class, context); + } + + /** + * Create or update the Nginx Waf Policy for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param body The Nginx Deployment Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String deploymentName, + String wafPolicyName, NginxDeploymentWafPolicyInner body) { + return beginCreateAsync(resourceGroupName, deploymentName, wafPolicyName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the Nginx Waf Policy for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String deploymentName, + String wafPolicyName) { + final NginxDeploymentWafPolicyInner body = null; + return beginCreateAsync(resourceGroupName, deploymentName, wafPolicyName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update the Nginx Waf Policy for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxDeploymentWafPolicyInner create(String resourceGroupName, String deploymentName, String wafPolicyName) { + final NginxDeploymentWafPolicyInner body = null; + return beginCreate(resourceGroupName, deploymentName, wafPolicyName, body).getFinalResult(); + } + + /** + * Create or update the Nginx Waf Policy for given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param body The Nginx Deployment Waf Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NginxDeploymentWafPolicyInner create(String resourceGroupName, String deploymentName, String wafPolicyName, + NginxDeploymentWafPolicyInner body, Context context) { + return beginCreate(resourceGroupName, deploymentName, wafPolicyName, body, context).getFinalResult(); + } + + /** + * Reset the Nginx Waf Policy of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String deploymentName, + String wafPolicyName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (wafPolicyName == null) { + return Mono.error(new IllegalArgumentException("Parameter wafPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, deploymentName, wafPolicyName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reset the Nginx Waf Policy of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String deploymentName, + String wafPolicyName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (wafPolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter wafPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, wafPolicyName, this.client.getApiVersion(), accept, Context.NONE); + } + + /** + * Reset the Nginx Waf Policy of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String deploymentName, + String wafPolicyName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + if (wafPolicyName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter wafPolicyName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, wafPolicyName, this.client.getApiVersion(), accept, context); + } + + /** + * Reset the Nginx Waf Policy of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String deploymentName, + String wafPolicyName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, deploymentName, wafPolicyName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Reset the Nginx Waf Policy of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName, + String wafPolicyName) { + Response response = deleteWithResponse(resourceGroupName, deploymentName, wafPolicyName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Reset the Nginx Waf Policy of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String deploymentName, + String wafPolicyName, Context context) { + Response response = deleteWithResponse(resourceGroupName, deploymentName, wafPolicyName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Reset the Nginx Waf Policy of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String deploymentName, String wafPolicyName) { + return beginDeleteAsync(resourceGroupName, deploymentName, wafPolicyName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reset the Nginx Waf Policy of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String deploymentName, String wafPolicyName) { + beginDelete(resourceGroupName, deploymentName, wafPolicyName).getFinalResult(); + } + + /** + * Reset the Nginx Waf Policy of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String deploymentName, String wafPolicyName, Context context) { + beginDelete(resourceGroupName, deploymentName, wafPolicyName, context).getFinalResult(); + } + + /** + * List Waf Policies of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy List Response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String deploymentName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, deploymentName, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Waf Policies of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy List Response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String deploymentName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, deploymentName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Waf Policies of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy List Response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String deploymentName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Waf Policies of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy List Response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String deploymentName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (deploymentName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter deploymentName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + deploymentName, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * List Waf Policies of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy List Response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String deploymentName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, deploymentName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * List Waf Policies of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy List Response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String deploymentName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, deploymentName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy List Response along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy List Response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy List Response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(WafPoliciesClientImpl.class); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/WafPoliciesImpl.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/WafPoliciesImpl.java new file mode 100644 index 000000000000..9a982505908e --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/implementation/WafPoliciesImpl.java @@ -0,0 +1,163 @@ +// 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.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.nginx.fluent.WafPoliciesClient; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentWafPolicyInner; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentWafPolicyMetadataInner; +import com.azure.resourcemanager.nginx.models.NginxDeploymentWafPolicy; +import com.azure.resourcemanager.nginx.models.NginxDeploymentWafPolicyMetadata; +import com.azure.resourcemanager.nginx.models.WafPolicies; + +public final class WafPoliciesImpl implements WafPolicies { + private static final ClientLogger LOGGER = new ClientLogger(WafPoliciesImpl.class); + + private final WafPoliciesClient innerClient; + + private final com.azure.resourcemanager.nginx.NginxManager serviceManager; + + public WafPoliciesImpl(WafPoliciesClient innerClient, com.azure.resourcemanager.nginx.NginxManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceGroupName, String deploymentName, + String wafPolicyName, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, deploymentName, wafPolicyName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NginxDeploymentWafPolicyImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NginxDeploymentWafPolicy get(String resourceGroupName, String deploymentName, String wafPolicyName) { + NginxDeploymentWafPolicyInner inner + = this.serviceClient().get(resourceGroupName, deploymentName, wafPolicyName); + if (inner != null) { + return new NginxDeploymentWafPolicyImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String deploymentName, String wafPolicyName) { + this.serviceClient().delete(resourceGroupName, deploymentName, wafPolicyName); + } + + public void delete(String resourceGroupName, String deploymentName, String wafPolicyName, Context context) { + this.serviceClient().delete(resourceGroupName, deploymentName, wafPolicyName, context); + } + + public PagedIterable list(String resourceGroupName, String deploymentName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, deploymentName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new NginxDeploymentWafPolicyMetadataImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String deploymentName, + Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, deploymentName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new NginxDeploymentWafPolicyMetadataImpl(inner1, this.manager())); + } + + public NginxDeploymentWafPolicy getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "nginxDeployments"); + if (deploymentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'nginxDeployments'.", id))); + } + String wafPolicyName = ResourceManagerUtils.getValueFromIdByName(id, "wafPolicies"); + if (wafPolicyName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'wafPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, deploymentName, wafPolicyName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "nginxDeployments"); + if (deploymentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'nginxDeployments'.", id))); + } + String wafPolicyName = ResourceManagerUtils.getValueFromIdByName(id, "wafPolicies"); + if (wafPolicyName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'wafPolicies'.", id))); + } + return this.getWithResponse(resourceGroupName, deploymentName, wafPolicyName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "nginxDeployments"); + if (deploymentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'nginxDeployments'.", id))); + } + String wafPolicyName = ResourceManagerUtils.getValueFromIdByName(id, "wafPolicies"); + if (wafPolicyName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'wafPolicies'.", id))); + } + this.delete(resourceGroupName, deploymentName, wafPolicyName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String deploymentName = ResourceManagerUtils.getValueFromIdByName(id, "nginxDeployments"); + if (deploymentName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'nginxDeployments'.", id))); + } + String wafPolicyName = ResourceManagerUtils.getValueFromIdByName(id, "wafPolicies"); + if (wafPolicyName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'wafPolicies'.", id))); + } + this.delete(resourceGroupName, deploymentName, wafPolicyName, context); + } + + private WafPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.nginx.NginxManager manager() { + return this.serviceManager; + } + + public NginxDeploymentWafPolicyImpl define(String name) { + return new NginxDeploymentWafPolicyImpl(name, this.manager()); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ActionType.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ActionType.java new file mode 100644 index 000000000000..fe85443e6493 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ActionType.java @@ -0,0 +1,46 @@ +// 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; + +/** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Static value Internal for ActionType. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/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 11fef865899a..ea4f6551adaf 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 @@ -10,7 +10,9 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.nginx.fluent.models.AnalysisCreateConfig; import java.io.IOException; +import java.util.List; /** * The request body for creating an analysis for an NGINX configuration. @@ -20,7 +22,7 @@ public final class AnalysisCreate implements JsonSerializable { /* * The config property. */ - private AnalysisCreateConfig config; + private AnalysisCreateConfig innerConfig = new AnalysisCreateConfig(); /** * Creates an instance of AnalysisCreate class. @@ -29,22 +31,103 @@ public AnalysisCreate() { } /** - * Get the config property: The config property. + * Get the innerConfig property: The config property. * - * @return the config value. + * @return the innerConfig value. */ - public AnalysisCreateConfig config() { - return this.config; + private AnalysisCreateConfig innerConfig() { + return this.innerConfig; } /** - * Set the config property: The config property. + * Get the rootFile property: The root file of the NGINX config file(s). It must match one of the files' filepath. * - * @param config the config value to set. + * @return the rootFile value. + */ + public String rootFile() { + return this.innerConfig() == null ? null : this.innerConfig().rootFile(); + } + + /** + * Set the rootFile property: The root file of the NGINX config file(s). It must match one of the files' filepath. + * + * @param rootFile the rootFile value to set. * @return the AnalysisCreate object itself. */ - public AnalysisCreate withConfig(AnalysisCreateConfig config) { - this.config = config; + public AnalysisCreate withRootFile(String rootFile) { + if (this.innerConfig() == null) { + this.innerConfig = new AnalysisCreateConfig(); + } + this.innerConfig().withRootFile(rootFile); + return this; + } + + /** + * Get the files property: The files property. + * + * @return the files value. + */ + public List files() { + return this.innerConfig() == null ? null : this.innerConfig().files(); + } + + /** + * Set the files property: The files property. + * + * @param files the files value to set. + * @return the AnalysisCreate object itself. + */ + public AnalysisCreate withFiles(List files) { + if (this.innerConfig() == null) { + this.innerConfig = new AnalysisCreateConfig(); + } + this.innerConfig().withFiles(files); + return this; + } + + /** + * Get the protectedFiles property: The protectedFiles property. + * + * @return the protectedFiles value. + */ + public List protectedFiles() { + return this.innerConfig() == null ? null : this.innerConfig().protectedFiles(); + } + + /** + * Set the protectedFiles property: The protectedFiles property. + * + * @param protectedFiles the protectedFiles value to set. + * @return the AnalysisCreate object itself. + */ + public AnalysisCreate withProtectedFiles(List protectedFiles) { + if (this.innerConfig() == null) { + this.innerConfig = new AnalysisCreateConfig(); + } + this.innerConfig().withProtectedFiles(protectedFiles); + return this; + } + + /** + * Get the packageProperty property: Nginx Configuration Package. + * + * @return the packageProperty value. + */ + public NginxConfigurationPackage packageProperty() { + return this.innerConfig() == null ? null : this.innerConfig().packageProperty(); + } + + /** + * Set the packageProperty property: Nginx Configuration Package. + * + * @param packageProperty the packageProperty value to set. + * @return the AnalysisCreate object itself. + */ + public AnalysisCreate withPackageProperty(NginxConfigurationPackage packageProperty) { + if (this.innerConfig() == null) { + this.innerConfig = new AnalysisCreateConfig(); + } + this.innerConfig().withPackageProperty(packageProperty); return this; } @@ -54,11 +137,11 @@ public AnalysisCreate withConfig(AnalysisCreateConfig config) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (config() == null) { + if (innerConfig() == null) { throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property config in model AnalysisCreate")); + .log(new IllegalArgumentException("Missing required property innerConfig in model AnalysisCreate")); } else { - config().validate(); + innerConfig().validate(); } } @@ -70,7 +153,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("config", this.config); + jsonWriter.writeJsonField("config", this.innerConfig); return jsonWriter.writeEndObject(); } @@ -91,7 +174,7 @@ public static AnalysisCreate fromJson(JsonReader jsonReader) throws IOException reader.nextToken(); if ("config".equals(fieldName)) { - deserializedAnalysisCreate.config = AnalysisCreateConfig.fromJson(reader); + deserializedAnalysisCreate.innerConfig = AnalysisCreateConfig.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisResult.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisResult.java index dfaaeff7f660..fadb05bd9ca0 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisResult.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/AnalysisResult.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.nginx.models; import com.azure.resourcemanager.nginx.fluent.models.AnalysisResultInner; +import java.util.List; /** * An immutable client-side representation of AnalysisResult. @@ -18,11 +19,18 @@ public interface AnalysisResult { String status(); /** - * Gets the data property: The data property. + * Gets the errors property: The errors property. * - * @return the data value. + * @return the errors value. */ - AnalysisResultData data(); + List errors(); + + /** + * Gets the diagnostics property: The diagnostics property. + * + * @return the diagnostics value. + */ + List diagnostics(); /** * Gets the inner com.azure.resourcemanager.nginx.fluent.models.AnalysisResultInner object. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ApiKeys.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ApiKeys.java index 9d0cb5785046..d1ecb73c8f0f 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ApiKeys.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/ApiKeys.java @@ -75,7 +75,7 @@ Response getWithResponse(String resourceGroupName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment Api Key List Response as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String deploymentName); @@ -88,7 +88,7 @@ Response getWithResponse(String resourceGroupName * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment Api Key List Response as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String deploymentName, Context context); diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Certificates.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Certificates.java index cda2da1af76f..8f375a8b3b80 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Certificates.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Certificates.java @@ -73,7 +73,7 @@ Response getWithResponse(String resourceGroupName, String depl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Certificate List Response as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String deploymentName); @@ -86,7 +86,7 @@ Response getWithResponse(String resourceGroupName, String depl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Certificate List Response as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String deploymentName, Context context); diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Configurations.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Configurations.java index fbb71b302ee9..a254b01851d3 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Configurations.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Configurations.java @@ -20,7 +20,7 @@ public interface Configurations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation as paginated response with {@link PagedIterable}. + * @return nginx Configuration List Response as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String deploymentName); @@ -33,7 +33,7 @@ public interface Configurations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of a list operation as paginated response with {@link PagedIterable}. + * @return nginx Configuration List Response as paginated response with {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String deploymentName, Context context); diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/DefaultWafPolicies.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/DefaultWafPolicies.java new file mode 100644 index 000000000000..2a01667d81dd --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/DefaultWafPolicies.java @@ -0,0 +1,39 @@ +// 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.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of DefaultWafPolicies. + */ +public interface DefaultWafPolicies { + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment along with {@link Response}. + */ + Response listWithResponse(String resourceGroupName, + String deploymentName, Context context); + + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment. + */ + NginxDeploymentDefaultWafPolicyListResponse list(String resourceGroupName, String deploymentName); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Deployments.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Deployments.java index 783777d050d2..e51f15753ad1 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Deployments.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Deployments.java @@ -66,7 +66,7 @@ Response getByResourceGroupWithResponse(String resourceGroupNam * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment List Response as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -77,7 +77,7 @@ Response getByResourceGroupWithResponse(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment List Response as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -88,7 +88,7 @@ Response getByResourceGroupWithResponse(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment List Response as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -100,7 +100,7 @@ Response getByResourceGroupWithResponse(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. + * @return nginx Deployment List Response as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); 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 d5c34d2ab24a..5a8d08444b91 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 @@ -13,7 +13,7 @@ import java.util.Map; /** - * The IdentityProperties model. + * Identity Properties. */ @Fluent public final class IdentityProperties implements JsonSerializable { @@ -28,7 +28,7 @@ public final class IdentityProperties implements JsonSerializable { /** diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificate.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificate.java index 56bd3758cb7d..969927e75b75 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificate.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxCertificate.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.nginx.models; -import com.azure.core.management.Region; import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.nginx.fluent.models.NginxCertificateInner; @@ -35,19 +34,12 @@ public interface NginxCertificate { String type(); /** - * Gets the properties property: The properties property. + * Gets the properties property: Nginx Certificate Properties. * * @return the properties value. */ NginxCertificateProperties properties(); - /** - * Gets the location property: The location property. - * - * @return the location value. - */ - String location(); - /** * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. * @@ -55,20 +47,6 @@ public interface NginxCertificate { */ SystemData systemData(); - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - /** * Gets the name of the resource group. * @@ -118,7 +96,7 @@ interface WithParentResource { * The stage of the NginxCertificate definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.WithProperties { + interface WithCreate extends DefinitionStages.WithProperties { /** * Executes the create request. * @@ -135,35 +113,14 @@ interface WithCreate extends DefinitionStages.WithLocation, DefinitionStages.Wit NginxCertificate create(Context context); } - /** - * The stage of the NginxCertificate definition allowing to specify location. - */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The location property. - * @return the next definition stage. - */ - WithCreate withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The location property. - * @return the next definition stage. - */ - WithCreate withRegion(String location); - } - /** * The stage of the NginxCertificate definition allowing to specify properties. */ interface WithProperties { /** - * Specifies the properties property: The properties property.. + * Specifies the properties property: Nginx Certificate Properties. * - * @param properties The properties property. + * @param properties Nginx Certificate Properties. * @return the next definition stage. */ WithCreate withProperties(NginxCertificateProperties properties); @@ -206,9 +163,9 @@ interface UpdateStages { */ interface WithProperties { /** - * Specifies the properties property: The properties property.. + * Specifies the properties property: Nginx Certificate Properties. * - * @param properties The properties property. + * @param properties Nginx Certificate Properties. * @return the next definition stage. */ Update withProperties(NginxCertificateProperties properties); 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 7b682e5a9ce1..e1715bfed66c 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 @@ -12,7 +12,7 @@ import java.io.IOException; /** - * The NginxCertificateErrorResponseBody model. + * Nginx Certificate Error Response Body. */ @Fluent public final class NginxCertificateErrorResponseBody implements JsonSerializable { 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 6bdc7aa6a911..8a2328922a7c 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 @@ -14,7 +14,7 @@ import java.util.List; /** - * The NginxCertificateListResponse model. + * Nginx Certificate List Response. */ @Fluent public final class NginxCertificateListResponse implements JsonSerializable { 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 b70bf2fb879f..e7be8880a9f4 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 @@ -14,12 +14,12 @@ import java.time.OffsetDateTime; /** - * The NginxCertificateProperties model. + * Nginx Certificate Properties. */ @Fluent public final class NginxCertificateProperties implements JsonSerializable { /* - * The provisioningState property. + * Provisioning State */ private ProvisioningState provisioningState; @@ -54,7 +54,7 @@ public final class NginxCertificateProperties implements JsonSerializable { 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 9e7889a84e27..2265800c3b34 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 @@ -14,6 +14,8 @@ import java.util.List; /** + * Nginx Configuration List Response + * * Response of a list operation. */ @Fluent 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 c4c698758208..c6ee52d4b9cd 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 @@ -13,7 +13,7 @@ import java.util.List; /** - * The NginxConfigurationPackage model. + * Nginx Configuration Package. */ @Fluent public final class NginxConfigurationPackage implements JsonSerializable { diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationProtectedFileRequest.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationProtectedFileRequest.java index d66eb577e2a7..6d44b521682f 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationProtectedFileRequest.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationProtectedFileRequest.java @@ -12,7 +12,7 @@ import java.io.IOException; /** - * The NginxConfigurationProtectedFileRequest model. + * Nginx Configuration Protected File Request. */ @Fluent public final class NginxConfigurationProtectedFileRequest diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationProtectedFileResponse.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationProtectedFileResponse.java index 29704220e9ec..39fd23e19fa5 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationProtectedFileResponse.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationProtectedFileResponse.java @@ -12,7 +12,7 @@ import java.io.IOException; /** - * The NginxConfigurationProtectedFileResponse model. + * Nginx Configuration Protected File Response. */ @Fluent public final class NginxConfigurationProtectedFileResponse diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationRequest.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationRequest.java index 663283221b76..9361a27b5c3d 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationRequest.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationRequest.java @@ -13,12 +13,12 @@ import java.io.IOException; /** - * The NginxConfigurationRequest model. + * Nginx Configuration Request. */ @Fluent public final class NginxConfigurationRequest extends ProxyResource { /* - * The properties property. + * Nginx Configuration Request Properties */ private NginxConfigurationRequestProperties properties; @@ -49,7 +49,7 @@ public NginxConfigurationRequest() { } /** - * Get the properties property: The properties property. + * Get the properties property: Nginx Configuration Request Properties. * * @return the properties value. */ @@ -58,7 +58,7 @@ public NginxConfigurationRequestProperties properties() { } /** - * Set the properties property: The properties property. + * Set the properties property: Nginx Configuration Request Properties. * * @param properties the properties value to set. * @return the NginxConfigurationRequest object itself. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationRequestProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationRequestProperties.java index 26a3b66cbbf5..c86ad45e0469 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationRequestProperties.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationRequestProperties.java @@ -13,13 +13,13 @@ import java.util.List; /** - * The NginxConfigurationRequestProperties model. + * Nginx Configuration Request Properties. */ @Fluent public final class NginxConfigurationRequestProperties implements JsonSerializable { /* - * The provisioningState property. + * Provisioning State */ private ProvisioningState provisioningState; @@ -34,7 +34,7 @@ public final class NginxConfigurationRequestProperties private List protectedFiles; /* - * The package property. + * Nginx Configuration Package */ private NginxConfigurationPackage packageProperty; @@ -50,7 +50,7 @@ public NginxConfigurationRequestProperties() { } /** - * Get the provisioningState property: The provisioningState property. + * Get the provisioningState property: Provisioning State. * * @return the provisioningState value. */ @@ -100,7 +100,7 @@ public List protectedFiles() { } /** - * Get the packageProperty property: The package property. + * Get the packageProperty property: Nginx Configuration Package. * * @return the packageProperty value. */ @@ -109,7 +109,7 @@ public NginxConfigurationPackage packageProperty() { } /** - * Set the packageProperty property: The package property. + * Set the packageProperty property: Nginx Configuration Package. * * @param packageProperty the packageProperty value to set. * @return the NginxConfigurationRequestProperties object itself. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationResponse.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationResponse.java index 4033ef9df6c2..92d1aeaf7094 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationResponse.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationResponse.java @@ -35,7 +35,7 @@ public interface NginxConfigurationResponse { String type(); /** - * Gets the properties property: The properties property. + * Gets the properties property: Nginx Configuration Response Properties. * * @return the properties value. */ @@ -119,9 +119,9 @@ interface WithCreate extends DefinitionStages.WithProperties { */ interface WithProperties { /** - * Specifies the properties property: The properties property.. + * Specifies the properties property: Nginx Configuration Request Properties. * - * @param properties The properties property. + * @param properties Nginx Configuration Request Properties. * @return the next definition stage. */ WithCreate withProperties(NginxConfigurationRequestProperties properties); @@ -164,9 +164,9 @@ interface UpdateStages { */ interface WithProperties { /** - * Specifies the properties property: The properties property.. + * Specifies the properties property: Nginx Configuration Request Properties. * - * @param properties The properties property. + * @param properties Nginx Configuration Request Properties. * @return the next definition stage. */ Update withProperties(NginxConfigurationRequestProperties properties); diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationResponseProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationResponseProperties.java index 0d8977b17c2a..63453839b2b4 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationResponseProperties.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxConfigurationResponseProperties.java @@ -13,13 +13,13 @@ import java.util.List; /** - * The NginxConfigurationResponseProperties model. + * Nginx Configuration Response Properties. */ @Fluent public final class NginxConfigurationResponseProperties implements JsonSerializable { /* - * The provisioningState property. + * Provisioning State */ private ProvisioningState provisioningState; @@ -34,7 +34,7 @@ public final class NginxConfigurationResponseProperties private List protectedFiles; /* - * The package property. + * Nginx Configuration Package */ private NginxConfigurationPackage packageProperty; @@ -50,7 +50,7 @@ public NginxConfigurationResponseProperties() { } /** - * Get the provisioningState property: The provisioningState property. + * Get the provisioningState property: Provisioning State. * * @return the provisioningState value. */ @@ -100,7 +100,7 @@ public List protectedFiles() { } /** - * Get the packageProperty property: The package property. + * Get the packageProperty property: Nginx Configuration Package. * * @return the packageProperty value. */ @@ -109,7 +109,7 @@ public NginxConfigurationPackage packageProperty() { } /** - * Set the packageProperty property: The package property. + * Set the packageProperty property: Nginx Configuration Package. * * @param packageProperty the packageProperty value to set. * @return the NginxConfigurationResponseProperties object itself. diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeployment.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeployment.java index 566bef89647f..185254ebe896 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeployment.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeployment.java @@ -50,21 +50,21 @@ public interface NginxDeployment { Map tags(); /** - * Gets the identity property: The identity property. + * Gets the identity property: Identity Properties. * * @return the identity value. */ IdentityProperties identity(); /** - * Gets the properties property: The properties property. + * Gets the properties property: Nginx Deployment Properties. * * @return the properties value. */ NginxDeploymentProperties properties(); /** - * Gets the sku property: The sku property. + * Gets the sku property: Resource Sku. * * @return the sku value. */ @@ -196,9 +196,9 @@ interface WithTags { */ interface WithIdentity { /** - * Specifies the identity property: The identity property.. + * Specifies the identity property: Identity Properties. * - * @param identity The identity property. + * @param identity Identity Properties. * @return the next definition stage. */ WithCreate withIdentity(IdentityProperties identity); @@ -209,9 +209,9 @@ interface WithIdentity { */ interface WithProperties { /** - * Specifies the properties property: The properties property.. + * Specifies the properties property: Nginx Deployment Properties. * - * @param properties The properties property. + * @param properties Nginx Deployment Properties. * @return the next definition stage. */ WithCreate withProperties(NginxDeploymentProperties properties); @@ -222,9 +222,9 @@ interface WithProperties { */ interface WithSku { /** - * Specifies the sku property: The sku property.. + * Specifies the sku property: Resource Sku. * - * @param sku The sku property. + * @param sku Resource Sku. * @return the next definition stage. */ WithCreate withSku(ResourceSku sku); @@ -281,9 +281,9 @@ interface WithTags { */ interface WithIdentity { /** - * Specifies the identity property: The identity property.. + * Specifies the identity property: Identity Properties. * - * @param identity The identity property. + * @param identity Identity Properties. * @return the next definition stage. */ Update withIdentity(IdentityProperties identity); @@ -294,9 +294,9 @@ interface WithIdentity { */ interface WithSku { /** - * Specifies the sku property: The sku property.. + * Specifies the sku property: Resource Sku. * - * @param sku The sku property. + * @param sku Resource Sku. * @return the next definition stage. */ Update withSku(ResourceSku sku); @@ -307,9 +307,9 @@ interface WithSku { */ interface WithProperties { /** - * Specifies the properties property: The properties property.. + * Specifies the properties property: Nginx Deployment Update Properties. * - * @param properties The properties property. + * @param properties Nginx Deployment Update Properties. * @return the next definition stage. */ Update withProperties(NginxDeploymentUpdateProperties properties); diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyListResponse.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyListResponse.java index 8a83b6f42ca9..9ccee2e3829f 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyListResponse.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyListResponse.java @@ -14,7 +14,7 @@ import java.util.List; /** - * The NginxDeploymentApiKeyListResponse model. + * Nginx Deployment Api Key List Response. */ @Fluent public final class NginxDeploymentApiKeyListResponse implements JsonSerializable { diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyRequest.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyRequest.java index 9620b8a05044..8525915d3a9f 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyRequest.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyRequest.java @@ -6,21 +6,27 @@ 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 java.io.IOException; /** - * The NginxDeploymentApiKeyRequest model. + * Nginx Deployment Api Key Request. */ @Fluent public final class NginxDeploymentApiKeyRequest extends ProxyResource { /* - * The properties property. + * Nginx Deployment Api Key Request Properties */ private NginxDeploymentApiKeyRequestProperties properties; + /* + * Metadata pertaining to creation and last modification of the resource. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -43,7 +49,7 @@ public NginxDeploymentApiKeyRequest() { } /** - * Get the properties property: The properties property. + * Get the properties property: Nginx Deployment Api Key Request Properties. * * @return the properties value. */ @@ -52,7 +58,7 @@ public NginxDeploymentApiKeyRequestProperties properties() { } /** - * Set the properties property: The properties property. + * Set the properties property: Nginx Deployment Api Key Request Properties. * * @param properties the properties value to set. * @return the NginxDeploymentApiKeyRequest object itself. @@ -62,6 +68,15 @@ public NginxDeploymentApiKeyRequest withProperties(NginxDeploymentApiKeyRequestP return this; } + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -138,6 +153,8 @@ public static NginxDeploymentApiKeyRequest fromJson(JsonReader jsonReader) throw } else if ("properties".equals(fieldName)) { deserializedNginxDeploymentApiKeyRequest.properties = NginxDeploymentApiKeyRequestProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNginxDeploymentApiKeyRequest.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyRequestProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyRequestProperties.java index 6f0267f43088..7a0ccfa692c8 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyRequestProperties.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyRequestProperties.java @@ -15,7 +15,7 @@ import java.time.format.DateTimeFormatter; /** - * The NginxDeploymentApiKeyRequestProperties model. + * Nginx Deployment Api Key Request Properties. */ @Fluent public final class NginxDeploymentApiKeyRequestProperties diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyResponse.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyResponse.java index 495111fb4f98..36ec8ef7bdd2 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyResponse.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyResponse.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.nginx.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentApiKeyResponseInner; @@ -33,12 +34,19 @@ public interface NginxDeploymentApiKeyResponse { String type(); /** - * Gets the properties property: The properties property. + * Gets the properties property: Nginx Deployment Api Key Response Properties. * * @return the properties value. */ NginxDeploymentApiKeyResponseProperties properties(); + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the name of the resource group. * @@ -110,9 +118,9 @@ interface WithCreate extends DefinitionStages.WithProperties { */ interface WithProperties { /** - * Specifies the properties property: The properties property.. + * Specifies the properties property: Nginx Deployment Api Key Request Properties. * - * @param properties The properties property. + * @param properties Nginx Deployment Api Key Request Properties. * @return the next definition stage. */ WithCreate withProperties(NginxDeploymentApiKeyRequestProperties properties); @@ -155,9 +163,9 @@ interface UpdateStages { */ interface WithProperties { /** - * Specifies the properties property: The properties property.. + * Specifies the properties property: Nginx Deployment Api Key Request Properties. * - * @param properties The properties property. + * @param properties Nginx Deployment Api Key Request Properties. * @return the next definition stage. */ Update withProperties(NginxDeploymentApiKeyRequestProperties properties); diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyResponseProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyResponseProperties.java index ee4df20ad2ce..b83f64538493 100644 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyResponseProperties.java +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentApiKeyResponseProperties.java @@ -15,7 +15,7 @@ import java.time.format.DateTimeFormatter; /** - * The NginxDeploymentApiKeyResponseProperties model. + * Nginx Deployment Api Key Response Properties. */ @Fluent public final class NginxDeploymentApiKeyResponseProperties diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentDefaultWafPolicyListResponse.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentDefaultWafPolicyListResponse.java new file mode 100644 index 000000000000..8bc4bcc211c6 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentDefaultWafPolicyListResponse.java @@ -0,0 +1,35 @@ +// 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.resourcemanager.nginx.fluent.models.NginxDeploymentDefaultWafPolicyListResponseInner; +import java.util.List; + +/** + * An immutable client-side representation of NginxDeploymentDefaultWafPolicyListResponse. + */ +public interface NginxDeploymentDefaultWafPolicyListResponse { + /** + * Gets the value property: The value property. + * + * @return the value value. + */ + List value(); + + /** + * Gets the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + String nextLink(); + + /** + * Gets the inner com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentDefaultWafPolicyListResponseInner + * object. + * + * @return the inner object. + */ + NginxDeploymentDefaultWafPolicyListResponseInner innerModel(); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentDefaultWafPolicyProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentDefaultWafPolicyProperties.java new file mode 100644 index 000000000000..dba78d75d4a4 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentDefaultWafPolicyProperties.java @@ -0,0 +1,100 @@ +// 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.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; + +/** + * Nginx Deployment Default Waf Policy Properties. + */ +@Immutable +public final class NginxDeploymentDefaultWafPolicyProperties + implements JsonSerializable { + /* + * The content property. + */ + private byte[] content; + + /* + * The filepath property. + */ + private String filepath; + + /** + * Creates an instance of NginxDeploymentDefaultWafPolicyProperties class. + */ + public NginxDeploymentDefaultWafPolicyProperties() { + } + + /** + * Get the content property: The content property. + * + * @return the content value. + */ + public byte[] content() { + return CoreUtils.clone(this.content); + } + + /** + * Get the filepath property: The filepath property. + * + * @return the filepath value. + */ + public String filepath() { + return this.filepath; + } + + /** + * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxDeploymentDefaultWafPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentDefaultWafPolicyProperties 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 NginxDeploymentDefaultWafPolicyProperties. + */ + public static NginxDeploymentDefaultWafPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentDefaultWafPolicyProperties deserializedNginxDeploymentDefaultWafPolicyProperties + = new NginxDeploymentDefaultWafPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("content".equals(fieldName)) { + deserializedNginxDeploymentDefaultWafPolicyProperties.content = reader.getBinary(); + } else if ("filepath".equals(fieldName)) { + deserializedNginxDeploymentDefaultWafPolicyProperties.filepath = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentDefaultWafPolicyProperties; + }); + } +} 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 414e6e86c381..26ec3583fe62 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 @@ -14,7 +14,7 @@ import java.util.List; /** - * The NginxDeploymentListResponse model. + * Nginx Deployment List Response. */ @Fluent public final class NginxDeploymentListResponse implements JsonSerializable { 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 46524fff8778..0162caf2bbe1 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 @@ -9,15 +9,16 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentPropertiesNginxAppProtect; import java.io.IOException; /** - * The NginxDeploymentProperties model. + * Nginx Deployment Properties. */ @Fluent public final class NginxDeploymentProperties implements JsonSerializable { /* - * The provisioningState property. + * Provisioning State */ private ProvisioningState provisioningState; @@ -27,7 +28,7 @@ public final class NginxDeploymentProperties implements JsonSerializable { /* - * The identity property. + * Identity Properties */ private IdentityProperties identity; @@ -28,17 +28,17 @@ public final class NginxDeploymentUpdateParameters implements JsonSerializable tags; /* - * The sku property. + * Resource Sku */ private ResourceSku sku; /* - * The location property. + * The geo-location where the resource lives */ private String location; /* - * The properties property. + * Nginx Deployment Update Properties */ private NginxDeploymentUpdateProperties properties; @@ -49,7 +49,7 @@ public NginxDeploymentUpdateParameters() { } /** - * Get the identity property: The identity property. + * Get the identity property: Identity Properties. * * @return the identity value. */ @@ -58,7 +58,7 @@ public IdentityProperties identity() { } /** - * Set the identity property: The identity property. + * Set the identity property: Identity Properties. * * @param identity the identity value to set. * @return the NginxDeploymentUpdateParameters object itself. @@ -89,7 +89,7 @@ public NginxDeploymentUpdateParameters withTags(Map tags) { } /** - * Get the sku property: The sku property. + * Get the sku property: Resource Sku. * * @return the sku value. */ @@ -98,7 +98,7 @@ public ResourceSku sku() { } /** - * Set the sku property: The sku property. + * Set the sku property: Resource Sku. * * @param sku the sku value to set. * @return the NginxDeploymentUpdateParameters object itself. @@ -109,7 +109,7 @@ public NginxDeploymentUpdateParameters withSku(ResourceSku sku) { } /** - * Get the location property: The location property. + * Get the location property: The geo-location where the resource lives. * * @return the location value. */ @@ -118,7 +118,7 @@ public String location() { } /** - * Set the location property: The location property. + * Set the location property: The geo-location where the resource lives. * * @param location the location value to set. * @return the NginxDeploymentUpdateParameters object itself. @@ -129,7 +129,7 @@ public NginxDeploymentUpdateParameters withLocation(String location) { } /** - * Get the properties property: The properties property. + * Get the properties property: Nginx Deployment Update Properties. * * @return the properties value. */ @@ -138,7 +138,7 @@ public NginxDeploymentUpdateProperties properties() { } /** - * Set the properties property: The properties property. + * Set the properties property: Nginx Deployment Update Properties. * * @param properties the properties value to set. * @return the NginxDeploymentUpdateParameters object itself. 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 e4a1aa82c6a8..74b79dba5a01 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 @@ -9,10 +9,11 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentUpdatePropertiesNginxAppProtect; import java.io.IOException; /** - * The NginxDeploymentUpdateProperties model. + * Nginx Deployment Update Properties. */ @Fluent public final class NginxDeploymentUpdateProperties implements JsonSerializable { @@ -22,7 +23,7 @@ public final class NginxDeploymentUpdateProperties implements JsonSerializable { diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicy.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicy.java new file mode 100644 index 000000000000..8f3fee01e4fd --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicy.java @@ -0,0 +1,137 @@ +// 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.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentWafPolicyInner; + +/** + * An immutable client-side representation of NginxDeploymentWafPolicy. + */ +public interface NginxDeploymentWafPolicy { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Nginx Deployment Waf Policy Properties. + * + * @return the properties value. + */ + NginxDeploymentWafPolicyProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentWafPolicyInner object. + * + * @return the inner object. + */ + NginxDeploymentWafPolicyInner innerModel(); + + /** + * The entirety of the NginxDeploymentWafPolicy definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The NginxDeploymentWafPolicy definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the NginxDeploymentWafPolicy definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the NginxDeploymentWafPolicy definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, deploymentName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @return the next definition stage. + */ + WithCreate withExistingNginxDeployment(String resourceGroupName, String deploymentName); + } + + /** + * The stage of the NginxDeploymentWafPolicy definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + NginxDeploymentWafPolicy create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + NginxDeploymentWafPolicy create(Context context); + } + + /** + * The stage of the NginxDeploymentWafPolicy definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Nginx Deployment Waf Policy Properties. + * + * @param properties Nginx Deployment Waf Policy Properties. + * @return the next definition stage. + */ + WithCreate withProperties(NginxDeploymentWafPolicyProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + NginxDeploymentWafPolicy refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + NginxDeploymentWafPolicy refresh(Context context); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyApplyingStatus.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyApplyingStatus.java new file mode 100644 index 000000000000..eb5b3350978d --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyApplyingStatus.java @@ -0,0 +1,117 @@ +// 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; + +/** + * Nginx Deployment Waf Policy Applying Status. + */ +@Immutable +public final class NginxDeploymentWafPolicyApplyingStatus + implements JsonSerializable { + /* + * Machine readable code indicating the applying status code of a WAF Policy. + */ + private NginxDeploymentWafPolicyApplyingStatusCode code; + + /* + * A readable string of the current status, and sometimes have the reason for the current state. + */ + private String displayStatus; + + /* + * The date and time in UTC the current applying status was set. + */ + private String time; + + /** + * Creates an instance of NginxDeploymentWafPolicyApplyingStatus class. + */ + public NginxDeploymentWafPolicyApplyingStatus() { + } + + /** + * Get the code property: Machine readable code indicating the applying status code of a WAF Policy. + * + * @return the code value. + */ + public NginxDeploymentWafPolicyApplyingStatusCode code() { + return this.code; + } + + /** + * Get the displayStatus property: A readable string of the current status, and sometimes have the reason for the + * current state. + * + * @return the displayStatus value. + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Get the time property: The date and time in UTC the current applying status was set. + * + * @return the time value. + */ + public String time() { + return this.time; + } + + /** + * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxDeploymentWafPolicyApplyingStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentWafPolicyApplyingStatus 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 NginxDeploymentWafPolicyApplyingStatus. + */ + public static NginxDeploymentWafPolicyApplyingStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentWafPolicyApplyingStatus deserializedNginxDeploymentWafPolicyApplyingStatus + = new NginxDeploymentWafPolicyApplyingStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyApplyingStatus.code + = NginxDeploymentWafPolicyApplyingStatusCode.fromString(reader.getString()); + } else if ("displayStatus".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyApplyingStatus.displayStatus = reader.getString(); + } else if ("time".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyApplyingStatus.time = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentWafPolicyApplyingStatus; + }); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyApplyingStatusCode.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyApplyingStatusCode.java new file mode 100644 index 000000000000..baf4617b1f4e --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyApplyingStatusCode.java @@ -0,0 +1,67 @@ +// 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; + +/** + * Machine readable code indicating the applying status code of a WAF Policy. + */ +public final class NginxDeploymentWafPolicyApplyingStatusCode + extends ExpandableStringEnum { + /** + * Static value NotApplied for NginxDeploymentWafPolicyApplyingStatusCode. + */ + public static final NginxDeploymentWafPolicyApplyingStatusCode NOT_APPLIED = fromString("NotApplied"); + + /** + * Static value Applying for NginxDeploymentWafPolicyApplyingStatusCode. + */ + public static final NginxDeploymentWafPolicyApplyingStatusCode APPLYING = fromString("Applying"); + + /** + * Static value Succeeded for NginxDeploymentWafPolicyApplyingStatusCode. + */ + public static final NginxDeploymentWafPolicyApplyingStatusCode SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for NginxDeploymentWafPolicyApplyingStatusCode. + */ + public static final NginxDeploymentWafPolicyApplyingStatusCode FAILED = fromString("Failed"); + + /** + * Static value Removing for NginxDeploymentWafPolicyApplyingStatusCode. + */ + public static final NginxDeploymentWafPolicyApplyingStatusCode REMOVING = fromString("Removing"); + + /** + * Creates a new instance of NginxDeploymentWafPolicyApplyingStatusCode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NginxDeploymentWafPolicyApplyingStatusCode() { + } + + /** + * Creates or finds a NginxDeploymentWafPolicyApplyingStatusCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding NginxDeploymentWafPolicyApplyingStatusCode. + */ + public static NginxDeploymentWafPolicyApplyingStatusCode fromString(String name) { + return fromString(name, NginxDeploymentWafPolicyApplyingStatusCode.class); + } + + /** + * Gets known NginxDeploymentWafPolicyApplyingStatusCode values. + * + * @return known NginxDeploymentWafPolicyApplyingStatusCode values. + */ + public static Collection values() { + return values(NginxDeploymentWafPolicyApplyingStatusCode.class); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyCompilingStatus.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyCompilingStatus.java new file mode 100644 index 000000000000..92b4c0629cb1 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyCompilingStatus.java @@ -0,0 +1,118 @@ +// 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; + +/** + * Nginx Deployment Waf Policy Compiling Status. + */ +@Immutable +public final class NginxDeploymentWafPolicyCompilingStatus + implements JsonSerializable { + /* + * Machine readable code indicating the compilation status of a WAF Policy. + */ + private NginxDeploymentWafPolicyCompilingStatusCode code; + + /* + * A readable string of the current status, and sometimes have the reason for the current state. If the + * CompilingStatus is Failed the Display Status will be The waf Policy failed to compile. + */ + private String displayStatus; + + /* + * The date and time the policy was compiled in UTC. + */ + private String time; + + /** + * Creates an instance of NginxDeploymentWafPolicyCompilingStatus class. + */ + public NginxDeploymentWafPolicyCompilingStatus() { + } + + /** + * Get the code property: Machine readable code indicating the compilation status of a WAF Policy. + * + * @return the code value. + */ + public NginxDeploymentWafPolicyCompilingStatusCode code() { + return this.code; + } + + /** + * Get the displayStatus property: A readable string of the current status, and sometimes have the reason for the + * current state. If the CompilingStatus is Failed the Display Status will be The waf Policy failed to compile. + * + * @return the displayStatus value. + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Get the time property: The date and time the policy was compiled in UTC. + * + * @return the time value. + */ + public String time() { + return this.time; + } + + /** + * 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(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxDeploymentWafPolicyCompilingStatus from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentWafPolicyCompilingStatus 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 NginxDeploymentWafPolicyCompilingStatus. + */ + public static NginxDeploymentWafPolicyCompilingStatus fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentWafPolicyCompilingStatus deserializedNginxDeploymentWafPolicyCompilingStatus + = new NginxDeploymentWafPolicyCompilingStatus(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("code".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyCompilingStatus.code + = NginxDeploymentWafPolicyCompilingStatusCode.fromString(reader.getString()); + } else if ("displayStatus".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyCompilingStatus.displayStatus = reader.getString(); + } else if ("time".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyCompilingStatus.time = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentWafPolicyCompilingStatus; + }); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyCompilingStatusCode.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyCompilingStatusCode.java new file mode 100644 index 000000000000..a3274af9e50d --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyCompilingStatusCode.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.nginx.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Machine readable code indicating the compilation status of a WAF Policy. + */ +public final class NginxDeploymentWafPolicyCompilingStatusCode + extends ExpandableStringEnum { + /** + * Static value NotStarted for NginxDeploymentWafPolicyCompilingStatusCode. + */ + public static final NginxDeploymentWafPolicyCompilingStatusCode NOT_STARTED = fromString("NotStarted"); + + /** + * Static value InProgress for NginxDeploymentWafPolicyCompilingStatusCode. + */ + public static final NginxDeploymentWafPolicyCompilingStatusCode IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Succeeded for NginxDeploymentWafPolicyCompilingStatusCode. + */ + public static final NginxDeploymentWafPolicyCompilingStatusCode SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for NginxDeploymentWafPolicyCompilingStatusCode. + */ + public static final NginxDeploymentWafPolicyCompilingStatusCode FAILED = fromString("Failed"); + + /** + * Creates a new instance of NginxDeploymentWafPolicyCompilingStatusCode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NginxDeploymentWafPolicyCompilingStatusCode() { + } + + /** + * Creates or finds a NginxDeploymentWafPolicyCompilingStatusCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding NginxDeploymentWafPolicyCompilingStatusCode. + */ + public static NginxDeploymentWafPolicyCompilingStatusCode fromString(String name) { + return fromString(name, NginxDeploymentWafPolicyCompilingStatusCode.class); + } + + /** + * Gets known NginxDeploymentWafPolicyCompilingStatusCode values. + * + * @return known NginxDeploymentWafPolicyCompilingStatusCode values. + */ + public static Collection values() { + return values(NginxDeploymentWafPolicyCompilingStatusCode.class); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyListResponse.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyListResponse.java new file mode 100644 index 000000000000..931a3c377cbf --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyListResponse.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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentWafPolicyMetadataInner; +import java.io.IOException; +import java.util.List; + +/** + * Nginx Deployment Waf Policy List Response. + */ +@Fluent +public final class NginxDeploymentWafPolicyListResponse + implements JsonSerializable { + /* + * The value property. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of NginxDeploymentWafPolicyListResponse class. + */ + public NginxDeploymentWafPolicyListResponse() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the NginxDeploymentWafPolicyListResponse object itself. + */ + public NginxDeploymentWafPolicyListResponse withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The nextLink property. + * + * @param nextLink the nextLink value to set. + * @return the NginxDeploymentWafPolicyListResponse object itself. + */ + public NginxDeploymentWafPolicyListResponse withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + 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 NginxDeploymentWafPolicyListResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentWafPolicyListResponse 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 NginxDeploymentWafPolicyListResponse. + */ + public static NginxDeploymentWafPolicyListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentWafPolicyListResponse deserializedNginxDeploymentWafPolicyListResponse + = new NginxDeploymentWafPolicyListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NginxDeploymentWafPolicyMetadataInner.fromJson(reader1)); + deserializedNginxDeploymentWafPolicyListResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentWafPolicyListResponse; + }); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyMetadata.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyMetadata.java new file mode 100644 index 000000000000..b1eda31e5b0f --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyMetadata.java @@ -0,0 +1,55 @@ +// 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.management.SystemData; +import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentWafPolicyMetadataInner; + +/** + * An immutable client-side representation of NginxDeploymentWafPolicyMetadata. + */ +public interface NginxDeploymentWafPolicyMetadata { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Nginx Deployment Waf Policy Metadata Properties. + * + * @return the properties value. + */ + NginxDeploymentWafPolicyMetadataProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentWafPolicyMetadataInner object. + * + * @return the inner object. + */ + NginxDeploymentWafPolicyMetadataInner innerModel(); +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyMetadataProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyMetadataProperties.java new file mode 100644 index 000000000000..48a785010f7d --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyMetadataProperties.java @@ -0,0 +1,140 @@ +// 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; + +/** + * Nginx Deployment Waf Policy Metadata Properties. + */ +@Immutable +public final class NginxDeploymentWafPolicyMetadataProperties + implements JsonSerializable { + /* + * The filepath property. + */ + private String filepath; + + /* + * Provisioning State + */ + private ProvisioningState provisioningState; + + /* + * Nginx Deployment Waf Policy Compiling Status + */ + private NginxDeploymentWafPolicyCompilingStatus compilingState; + + /* + * Nginx Deployment Waf Policy Applying Status + */ + private NginxDeploymentWafPolicyApplyingStatus applyingState; + + /** + * Creates an instance of NginxDeploymentWafPolicyMetadataProperties class. + */ + public NginxDeploymentWafPolicyMetadataProperties() { + } + + /** + * Get the filepath property: The filepath property. + * + * @return the filepath value. + */ + public String filepath() { + return this.filepath; + } + + /** + * Get the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the compilingState property: Nginx Deployment Waf Policy Compiling Status. + * + * @return the compilingState value. + */ + public NginxDeploymentWafPolicyCompilingStatus compilingState() { + return this.compilingState; + } + + /** + * Get the applyingState property: Nginx Deployment Waf Policy Applying Status. + * + * @return the applyingState value. + */ + public NginxDeploymentWafPolicyApplyingStatus applyingState() { + return this.applyingState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (compilingState() != null) { + compilingState().validate(); + } + if (applyingState() != null) { + applyingState().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxDeploymentWafPolicyMetadataProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentWafPolicyMetadataProperties 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 NginxDeploymentWafPolicyMetadataProperties. + */ + public static NginxDeploymentWafPolicyMetadataProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentWafPolicyMetadataProperties deserializedNginxDeploymentWafPolicyMetadataProperties + = new NginxDeploymentWafPolicyMetadataProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("filepath".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyMetadataProperties.filepath = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyMetadataProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("compilingState".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyMetadataProperties.compilingState + = NginxDeploymentWafPolicyCompilingStatus.fromJson(reader); + } else if ("applyingState".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyMetadataProperties.applyingState + = NginxDeploymentWafPolicyApplyingStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentWafPolicyMetadataProperties; + }); + } +} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyProperties.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyProperties.java new file mode 100644 index 000000000000..d579ee1586ae --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/NginxDeploymentWafPolicyProperties.java @@ -0,0 +1,180 @@ +// 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.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Nginx Deployment Waf Policy Properties. + */ +@Fluent +public final class NginxDeploymentWafPolicyProperties implements JsonSerializable { + /* + * Provisioning State + */ + private ProvisioningState provisioningState; + + /* + * The byte content of the Policy + */ + private byte[] content; + + /* + * The file path where the Policy is to be saved + */ + private String filepath; + + /* + * Nginx Deployment Waf Policy Compiling Status + */ + private NginxDeploymentWafPolicyCompilingStatus compilingState; + + /* + * Nginx Deployment Waf Policy Applying Status + */ + private NginxDeploymentWafPolicyApplyingStatus applyingState; + + /** + * Creates an instance of NginxDeploymentWafPolicyProperties class. + */ + public NginxDeploymentWafPolicyProperties() { + } + + /** + * Get the provisioningState property: Provisioning State. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the content property: The byte content of the Policy. + * + * @return the content value. + */ + public byte[] content() { + return CoreUtils.clone(this.content); + } + + /** + * Set the content property: The byte content of the Policy. + * + * @param content the content value to set. + * @return the NginxDeploymentWafPolicyProperties object itself. + */ + public NginxDeploymentWafPolicyProperties withContent(byte[] content) { + this.content = CoreUtils.clone(content); + return this; + } + + /** + * Get the filepath property: The file path where the Policy is to be saved. + * + * @return the filepath value. + */ + public String filepath() { + return this.filepath; + } + + /** + * Set the filepath property: The file path where the Policy is to be saved. + * + * @param filepath the filepath value to set. + * @return the NginxDeploymentWafPolicyProperties object itself. + */ + public NginxDeploymentWafPolicyProperties withFilepath(String filepath) { + this.filepath = filepath; + return this; + } + + /** + * Get the compilingState property: Nginx Deployment Waf Policy Compiling Status. + * + * @return the compilingState value. + */ + public NginxDeploymentWafPolicyCompilingStatus compilingState() { + return this.compilingState; + } + + /** + * Get the applyingState property: Nginx Deployment Waf Policy Applying Status. + * + * @return the applyingState value. + */ + public NginxDeploymentWafPolicyApplyingStatus applyingState() { + return this.applyingState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (compilingState() != null) { + compilingState().validate(); + } + if (applyingState() != null) { + applyingState().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBinaryField("content", this.content); + jsonWriter.writeStringField("filepath", this.filepath); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NginxDeploymentWafPolicyProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NginxDeploymentWafPolicyProperties 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 NginxDeploymentWafPolicyProperties. + */ + public static NginxDeploymentWafPolicyProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NginxDeploymentWafPolicyProperties deserializedNginxDeploymentWafPolicyProperties + = new NginxDeploymentWafPolicyProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("content".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyProperties.content = reader.getBinary(); + } else if ("filepath".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyProperties.filepath = reader.getString(); + } else if ("compilingState".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyProperties.compilingState + = NginxDeploymentWafPolicyCompilingStatus.fromJson(reader); + } else if ("applyingState".equals(fieldName)) { + deserializedNginxDeploymentWafPolicyProperties.applyingState + = NginxDeploymentWafPolicyApplyingStatus.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNginxDeploymentWafPolicyProperties; + }); + } +} 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 e156910eb28c..1d877fe323f0 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 @@ -13,7 +13,7 @@ import java.util.List; /** - * The NginxFrontendIpConfiguration model. + * Nginx Frontend IP Configuration. */ @Fluent public final class NginxFrontendIpConfiguration implements JsonSerializable { 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 7739d08b0026..ac8b0a5e1ee0 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 @@ -12,12 +12,12 @@ import java.io.IOException; /** - * The NginxLogging model. + * Nginx Logging. */ @Fluent public final class NginxLogging implements JsonSerializable { /* - * The storageAccount property. + * Nginx Storage Account */ private NginxStorageAccount storageAccount; @@ -28,7 +28,7 @@ public NginxLogging() { } /** - * Get the storageAccount property: The storageAccount property. + * Get the storageAccount property: Nginx Storage Account. * * @return the storageAccount value. */ @@ -37,7 +37,7 @@ public NginxStorageAccount storageAccount() { } /** - * Set the storageAccount property: The storageAccount property. + * Set the storageAccount property: Nginx Storage Account. * * @param storageAccount the storageAccount value to set. * @return the NginxLogging object itself. 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 1163a4f1783b..c29d5d6f54fd 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 @@ -12,7 +12,7 @@ import java.io.IOException; /** - * The NginxNetworkInterfaceConfiguration model. + * Nginx Network Interface Configuration. */ @Fluent public final class NginxNetworkInterfaceConfiguration implements JsonSerializable { 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 3ab5e43a29d9..5c015ae4e525 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 @@ -12,17 +12,17 @@ import java.io.IOException; /** - * The NginxNetworkProfile model. + * Nginx Network Profile. */ @Fluent public final class NginxNetworkProfile implements JsonSerializable { /* - * The frontEndIPConfiguration property. + * Nginx Frontend IP Configuration */ private NginxFrontendIpConfiguration frontEndIpConfiguration; /* - * The networkInterfaceConfiguration property. + * Nginx Network Interface Configuration */ private NginxNetworkInterfaceConfiguration networkInterfaceConfiguration; @@ -33,7 +33,7 @@ public NginxNetworkProfile() { } /** - * Get the frontEndIpConfiguration property: The frontEndIPConfiguration property. + * Get the frontEndIpConfiguration property: Nginx Frontend IP Configuration. * * @return the frontEndIpConfiguration value. */ @@ -42,7 +42,7 @@ public NginxFrontendIpConfiguration frontEndIpConfiguration() { } /** - * Set the frontEndIpConfiguration property: The frontEndIPConfiguration property. + * Set the frontEndIpConfiguration property: Nginx Frontend IP Configuration. * * @param frontEndIpConfiguration the frontEndIpConfiguration value to set. * @return the NginxNetworkProfile object itself. @@ -53,7 +53,7 @@ public NginxNetworkProfile withFrontEndIpConfiguration(NginxFrontendIpConfigurat } /** - * Get the networkInterfaceConfiguration property: The networkInterfaceConfiguration property. + * Get the networkInterfaceConfiguration property: Nginx Network Interface Configuration. * * @return the networkInterfaceConfiguration value. */ @@ -62,7 +62,7 @@ public NginxNetworkInterfaceConfiguration networkInterfaceConfiguration() { } /** - * Set the networkInterfaceConfiguration property: The networkInterfaceConfiguration property. + * Set the networkInterfaceConfiguration property: Nginx Network Interface Configuration. * * @param networkInterfaceConfiguration the networkInterfaceConfiguration value to set. * @return the NginxNetworkProfile object itself. 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 5aad1df53a6f..6db1abc3674a 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 @@ -12,7 +12,7 @@ import java.io.IOException; /** - * The NginxPrivateIpAddress model. + * Nginx Private IP Address. */ @Fluent public final class NginxPrivateIpAddress implements JsonSerializable { @@ -22,7 +22,7 @@ public final class NginxPrivateIpAddress implements JsonSerializable { /** 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 40172dd30eae..33f2df197f98 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 @@ -12,7 +12,7 @@ import java.io.IOException; /** - * The NginxPublicIpAddress model. + * Nginx Public IP Address. */ @Fluent public final class NginxPublicIpAddress implements JsonSerializable { 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 a0141417dce2..5c1bd4740b3d 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 @@ -12,7 +12,7 @@ import java.io.IOException; /** - * The NginxStorageAccount model. + * Nginx Storage Account. */ @Fluent public final class NginxStorageAccount implements JsonSerializable { diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Operation.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Operation.java new file mode 100644 index 000000000000..b0b2f66b0f49 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Operation.java @@ -0,0 +1,58 @@ +// 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.resourcemanager.nginx.fluent.models.OperationInner; + +/** + * An immutable client-side representation of Operation. + */ +public interface Operation { + /** + * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for ARM/control-plane operations. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Localized display information for this particular operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". + * + * @return the origin value. + */ + Origin origin(); + + /** + * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal + * only APIs. + * + * @return the actionType value. + */ + ActionType actionType(); + + /** + * Gets the inner com.azure.resourcemanager.nginx.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} 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 67b46fae38ad..280bd2cc1a6a 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 @@ -4,7 +4,7 @@ package com.azure.resourcemanager.nginx.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -12,27 +12,30 @@ import java.io.IOException; /** - * The object that represents the operation. + * Localized display information for this particular operation. */ -@Fluent +@Immutable public final class OperationDisplay implements JsonSerializable { /* - * Service provider: Nginx.NginxPlus + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". */ private String provider; /* - * Type on which the operation is performed, e.g., 'deployments'. + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". */ private String resource; /* - * Operation type, e.g., read, write, delete, etc. + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". */ private String operation; /* - * Description of the operation, e.g., 'Write deployments'. + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ private String description; @@ -43,7 +46,8 @@ public OperationDisplay() { } /** - * Get the provider property: Service provider: Nginx.NginxPlus. + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". * * @return the provider value. */ @@ -52,18 +56,8 @@ public String provider() { } /** - * Set the provider property: Service provider: Nginx.NginxPlus. - * - * @param provider the provider value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withProvider(String provider) { - this.provider = provider; - return this; - } - - /** - * Get the resource property: Type on which the operation is performed, e.g., 'deployments'. + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". * * @return the resource value. */ @@ -72,18 +66,8 @@ public String resource() { } /** - * Set the resource property: Type on which the operation is performed, e.g., 'deployments'. - * - * @param resource the resource value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withResource(String resource) { - this.resource = resource; - return this; - } - - /** - * Get the operation property: Operation type, e.g., read, write, delete, etc. + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". * * @return the operation value. */ @@ -92,18 +76,8 @@ public String operation() { } /** - * Set the operation property: Operation type, e.g., read, write, delete, etc. - * - * @param operation the operation value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withOperation(String operation) { - this.operation = operation; - return this; - } - - /** - * Get the description property: Description of the operation, e.g., 'Write deployments'. + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. * * @return the description value. */ @@ -111,17 +85,6 @@ public String description() { return this.description; } - /** - * Set the description property: Description of the operation, e.g., 'Write deployments'. - * - * @param description the description value to set. - * @return the OperationDisplay object itself. - */ - public OperationDisplay withDescription(String description) { - this.description = description; - return this; - } - /** * Validates the instance. * @@ -136,10 +99,6 @@ public void validate() { @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(); } 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 bd478aed5d0b..e53dd019cb9f 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 @@ -4,27 +4,28 @@ package com.azure.resourcemanager.nginx.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.nginx.fluent.models.OperationResultInner; +import com.azure.resourcemanager.nginx.fluent.models.OperationInner; import java.io.IOException; import java.util.List; /** - * Result of GET request to list Nginx.NginxPlus operations. + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. */ -@Fluent +@Immutable public final class OperationListResult implements JsonSerializable { /* - * List of operations supported by the Nginx.NginxPlus provider. + * List of operations supported by the resource provider */ - private List value; + private List value; /* - * URL to get the next set of operation list results if there are any. + * URL to get the next set of operation list results (if there are any). */ private String nextLink; @@ -35,27 +36,16 @@ public OperationListResult() { } /** - * Get the value property: List of operations supported by the Nginx.NginxPlus provider. + * Get the value property: List of operations supported by the resource provider. * * @return the value value. */ - public List value() { + public List value() { return this.value; } /** - * Set the value property: List of operations supported by the Nginx.NginxPlus provider. - * - * @param value the value value to set. - * @return the OperationListResult object itself. - */ - public OperationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. + * Get the nextLink property: URL to get the next set of operation list results (if there are any). * * @return the nextLink value. */ @@ -63,17 +53,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: URL to get the next set of operation list results if there are any. - * - * @param nextLink the nextLink value to set. - * @return the OperationListResult object itself. - */ - public OperationListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * @@ -91,8 +70,6 @@ public void validate() { @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(); } @@ -112,8 +89,7 @@ public static OperationListResult fromJson(JsonReader jsonReader) throws IOExcep reader.nextToken(); if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> OperationResultInner.fromJson(reader1)); + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); deserializedOperationListResult.value = value; } else if ("nextLink".equals(fieldName)) { deserializedOperationListResult.nextLink = reader.getString(); diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationResult.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationResult.java deleted file mode 100644 index 7b7c4b4fe9f2..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/OperationResult.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.models; - -import com.azure.resourcemanager.nginx.fluent.models.OperationResultInner; - -/** - * An immutable client-side representation of OperationResult. - */ -public interface OperationResult { - /** - * Gets the name property: Operation name: {provider}/{resource}/{operation}. - * - * @return the name value. - */ - String name(); - - /** - * Gets the display property: The object that represents the operation. - * - * @return the display value. - */ - OperationDisplay display(); - - /** - * Gets the isDataAction property: Indicates whether the operation is a data action. - * - * @return the isDataAction value. - */ - Boolean isDataAction(); - - /** - * Gets the inner com.azure.resourcemanager.nginx.fluent.models.OperationResultInner object. - * - * @return the inner object. - */ - OperationResultInner innerModel(); -} 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 aacae2479104..16d02348ae79 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 @@ -16,10 +16,10 @@ public interface Operations { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of GET request to list Nginx.NginxPlus operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ - PagedIterable list(); + PagedIterable list(); /** * List all operations provided by Nginx.NginxPlus for the 2024-11-01-preview api version. @@ -28,8 +28,8 @@ public interface Operations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of GET request to list Nginx.NginxPlus operations as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ - PagedIterable list(Context context); + PagedIterable list(Context context); } diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Origin.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Origin.java new file mode 100644 index 000000000000..455a9791a356 --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/Origin.java @@ -0,0 +1,57 @@ +// 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 intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Static value user for Origin. + */ + public static final Origin USER = fromString("user"); + + /** + * Static value system for Origin. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Static value user,system for Origin. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/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 b4ca02477a9a..34191ab3fc27 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 @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Defines values for ProvisioningState. + * Provisioning State. */ public final class ProvisioningState extends ExpandableStringEnum { /** 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 d41e0997138f..37ef0b5fefcc 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 @@ -13,7 +13,7 @@ import java.io.IOException; /** - * The ResourceSku model. + * Resource Sku. */ @Fluent public final class ResourceSku implements JsonSerializable { 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 99ebf154151d..36e2c98fb91e 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 @@ -10,6 +10,7 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.nginx.fluent.models.ScaleProfileCapacity; import java.io.IOException; /** @@ -25,7 +26,7 @@ public final class ScaleProfile implements JsonSerializable { /* * The capacity parameters of the profile. */ - private ScaleProfileCapacity capacity; + private ScaleProfileCapacity innerCapacity = new ScaleProfileCapacity(); /** * Creates an instance of ScaleProfile class. @@ -54,22 +55,57 @@ public ScaleProfile withName(String name) { } /** - * Get the capacity property: The capacity parameters of the profile. + * Get the innerCapacity property: The capacity parameters of the profile. * - * @return the capacity value. + * @return the innerCapacity value. */ - public ScaleProfileCapacity capacity() { - return this.capacity; + private ScaleProfileCapacity innerCapacity() { + return this.innerCapacity; } /** - * Set the capacity property: The capacity parameters of the profile. + * Get the min property: The minimum number of NCUs the deployment can be autoscaled to. * - * @param capacity the capacity value to set. + * @return the min value. + */ + public int min() { + return this.innerCapacity() == null ? 0 : this.innerCapacity().min(); + } + + /** + * Set the min property: The minimum number of NCUs the deployment can be autoscaled to. + * + * @param min the min value to set. * @return the ScaleProfile object itself. */ - public ScaleProfile withCapacity(ScaleProfileCapacity capacity) { - this.capacity = capacity; + public ScaleProfile withMin(int min) { + if (this.innerCapacity() == null) { + this.innerCapacity = new ScaleProfileCapacity(); + } + this.innerCapacity().withMin(min); + return this; + } + + /** + * Get the max property: The maximum number of NCUs the deployment can be autoscaled to. + * + * @return the max value. + */ + public int max() { + return this.innerCapacity() == null ? 0 : this.innerCapacity().max(); + } + + /** + * Set the max property: The maximum number of NCUs the deployment can be autoscaled to. + * + * @param max the max value to set. + * @return the ScaleProfile object itself. + */ + public ScaleProfile withMax(int max) { + if (this.innerCapacity() == null) { + this.innerCapacity = new ScaleProfileCapacity(); + } + this.innerCapacity().withMax(max); return this; } @@ -83,11 +119,11 @@ public void validate() { throw LOGGER.atError() .log(new IllegalArgumentException("Missing required property name in model ScaleProfile")); } - if (capacity() == null) { + if (innerCapacity() == null) { throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property capacity in model ScaleProfile")); + .log(new IllegalArgumentException("Missing required property innerCapacity in model ScaleProfile")); } else { - capacity().validate(); + innerCapacity().validate(); } } @@ -100,7 +136,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", this.name); - jsonWriter.writeJsonField("capacity", this.capacity); + jsonWriter.writeJsonField("capacity", this.innerCapacity); return jsonWriter.writeEndObject(); } @@ -123,7 +159,7 @@ public static ScaleProfile fromJson(JsonReader jsonReader) throws IOException { if ("name".equals(fieldName)) { deserializedScaleProfile.name = reader.getString(); } else if ("capacity".equals(fieldName)) { - deserializedScaleProfile.capacity = ScaleProfileCapacity.fromJson(reader); + deserializedScaleProfile.innerCapacity = ScaleProfileCapacity.fromJson(reader); } else { reader.skipChildren(); } 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 c75461d15625..c9fa0884b634 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 @@ -12,7 +12,7 @@ import java.io.IOException; /** - * The UserIdentityProperties model. + * User Identity Properties. */ @Immutable public final class UserIdentityProperties implements JsonSerializable { diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/WafPolicies.java b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/WafPolicies.java new file mode 100644 index 000000000000..e5c9dad30bea --- /dev/null +++ b/sdk/nginx/azure-resourcemanager-nginx/src/main/java/com/azure/resourcemanager/nginx/models/WafPolicies.java @@ -0,0 +1,145 @@ +// 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.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of WafPolicies. + */ +public interface WafPolicies { + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String deploymentName, + String wafPolicyName, Context context); + + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment. + */ + NginxDeploymentWafPolicy get(String resourceGroupName, String deploymentName, String wafPolicyName); + + /** + * Reset the Nginx Waf Policy of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String deploymentName, String wafPolicyName); + + /** + * Reset the Nginx Waf Policy of given Nginx deployment to default. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param wafPolicyName The name of Waf Policy. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String deploymentName, String wafPolicyName, Context context); + + /** + * List Waf Policies of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy List Response as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String deploymentName); + + /** + * List Waf Policies of given Nginx deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of targeted NGINX deployment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return nginx Deployment Waf Policy List Response as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String deploymentName, + Context context); + + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment along with {@link Response}. + */ + NginxDeploymentWafPolicy getById(String id); + + /** + * Get the Nginx Waf Policy of given Nginx deployment. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the Nginx Waf Policy of given Nginx deployment along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Reset the Nginx Waf Policy of given Nginx deployment to default. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Reset the Nginx Waf Policy of given Nginx deployment to default. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new NginxDeploymentWafPolicy resource. + * + * @param name resource name. + * @return the first stage of the new NginxDeploymentWafPolicy definition. + */ + NginxDeploymentWafPolicy.DefinitionStages.Blank define(String name); +} 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 index 44c0238e6a22..6526e796b2a4 100644 --- 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 @@ -4,7 +4,7 @@ package com.azure.resourcemanager.nginx.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,8 +14,13 @@ /** * The status of the NGINX App Protect Web Application Firewall. */ -@Immutable +@Fluent public final class WebApplicationFirewallStatus implements JsonSerializable { + /* + * NGINX App Protect WAF release version + */ + private String wafRelease; + /* * Package containing attack signatures for the NGINX App Protect Web Application Firewall (WAF). */ @@ -42,6 +47,26 @@ public final class WebApplicationFirewallStatus implements JsonSerializable 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.apiKeys().deleteWithResponse("wzsyyceuzs", "i", "judpfrxt", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ApiKeysGetWithResponseMockTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ApiKeysGetWithResponseMockTests.java deleted file mode 100644 index 552ff6d6a0db..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ApiKeysGetWithResponseMockTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.NginxDeploymentApiKeyResponse; -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 ApiKeysGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"hint\":\"axoruzfgsquy\",\"endDateTime\":\"2021-03-18T06:01:03Z\"},\"id\":\"xxle\",\"name\":\"tramxjez\",\"type\":\"lwnwxuqlcvydyp\"}"; - - 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - NginxDeploymentApiKeyResponse response = manager.apiKeys() - .getWithResponse("thzvaytdwkqbrqu", "paxh", "xiilivpdtiirqt", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(OffsetDateTime.parse("2021-03-18T06:01:03Z"), response.properties().endDateTime()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ApiKeysListMockTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ApiKeysListMockTests.java deleted file mode 100644 index 37ffa75624ab..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ApiKeysListMockTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.NginxDeploymentApiKeyResponse; -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 ApiKeysListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"hint\":\"jhemms\",\"endDateTime\":\"2021-07-03T07:44:33Z\"},\"id\":\"kcrodtjinfw\",\"name\":\"lfltka\",\"type\":\"jvefkdlfoakggkfp\"}]}"; - - 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response - = manager.apiKeys().list("tdooaoj", "niodkooeb", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(OffsetDateTime.parse("2021-07-03T07:44:33Z"), - response.iterator().next().properties().endDateTime()); - } -} 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 2cb59bc60cc9..000000000000 --- 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\":\"c\"}").toObject(AutoUpgradeProfile.class); - Assertions.assertEquals("c", model.upgradeChannel()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoUpgradeProfile model = new AutoUpgradeProfile().withUpgradeChannel("c"); - model = BinaryData.fromObject(model).toObject(AutoUpgradeProfile.class); - Assertions.assertEquals("c", 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 357681a891c3..000000000000 --- 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.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.certificates().delete("yfzqwhxxbu", "qa", "zfeqztppri", 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 538f67771ca8..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsAnalysisWithResponseMockTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.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.Level; -import com.azure.resourcemanager.nginx.models.NginxConfigurationFile; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import com.azure.resourcemanager.nginx.models.NginxConfigurationProtectedFileRequest; -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\":\"lmdjrkvfgbvfvpdb\",\"data\":{\"errors\":[{\"id\":\"zsjqlh\",\"directive\":\"rribd\",\"description\":\"ibqipqkg\",\"file\":\"vxndz\",\"line\":86.36127,\"message\":\"krefajpjo\",\"rule\":\"wkqnyhg\"},{\"id\":\"j\",\"directive\":\"jivfxzsjabib\",\"description\":\"ystawfsdjpvkvp\",\"file\":\"jxbkzbzkdvn\",\"line\":76.89379,\"message\":\"abudurgk\",\"rule\":\"kmokz\"},{\"id\":\"jk\",\"directive\":\"ffhmouwqlgzr\",\"description\":\"zeeyebi\",\"file\":\"ikayuhqlbjbsybb\",\"line\":12.803698,\"message\":\"r\",\"rule\":\"t\"},{\"id\":\"gmfpgvmp\",\"directive\":\"paslthaqfxssmwu\",\"description\":\"wbdsr\",\"file\":\"zpdrhneu\",\"line\":67.33827,\"message\":\"wqkdwytisibi\",\"rule\":\"cgpik\"}],\"diagnostics\":[{\"id\":\"ejzanlfz\",\"directive\":\"iavrm\",\"description\":\"zonokixrjqci\",\"file\":\"gzpfrla\",\"line\":33.48236,\"message\":\"zrnw\",\"rule\":\"iin\",\"level\":\"Warning\",\"category\":\"wp\"},{\"id\":\"lwbtlhf\",\"directive\":\"sj\",\"description\":\"dhszfjv\",\"file\":\"bgofeljag\",\"line\":66.963486,\"message\":\"mqhldvrii\",\"rule\":\"ojnal\",\"level\":\"Warning\",\"category\":\"kvtvsexso\"}]}}"; - - 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - AnalysisResult response = manager.configurations() - .analysisWithResponse("rmaequ", "ah", "icslfaoq", new AnalysisCreate().withConfig(new AnalysisCreateConfig() - .withRootFile("iyylhalnswhccsp") - .withFiles(Arrays.asList(new NginxConfigurationFile().withContent("vwitqscyw").withVirtualPath("gwol"), - new NginxConfigurationFile().withContent("czbwemhairsbr").withVirtualPath("dwmsweypqwd"), - new NginxConfigurationFile().withContent("gicccnxqhuex").withVirtualPath("ttlstvlzywemhz"))) - .withProtectedFiles(Arrays.asList( - new NginxConfigurationProtectedFileRequest().withContent("dtclusiypb") - .withVirtualPath("gytguslfead") - .withContentHash("gq"), - new NginxConfigurationProtectedFileRequest().withContent("yhejhzisxgfp") - .withVirtualPath("olppvksrpqvujz") - .withContentHash("ehtwdwrft"), - new NginxConfigurationProtectedFileRequest().withContent("iby") - .withVirtualPath("dl") - .withContentHash("shfwpracstwity"), - new NginxConfigurationProtectedFileRequest().withContent("evxccedcp") - .withVirtualPath("dyodnwzxltj") - .withContentHash("nhltiugcxn"))) - .withPackageProperty( - new NginxConfigurationPackage().withData("wxqibyq").withProtectedFiles(Arrays.asList("owx")))), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("lmdjrkvfgbvfvpdb", response.status()); - Assertions.assertEquals("zsjqlh", response.data().errors().get(0).id()); - Assertions.assertEquals("rribd", response.data().errors().get(0).directive()); - Assertions.assertEquals("ibqipqkg", response.data().errors().get(0).description()); - Assertions.assertEquals("vxndz", response.data().errors().get(0).file()); - Assertions.assertEquals(86.36127f, response.data().errors().get(0).line()); - Assertions.assertEquals("krefajpjo", response.data().errors().get(0).message()); - Assertions.assertEquals("wkqnyhg", response.data().errors().get(0).rule()); - Assertions.assertEquals("ejzanlfz", response.data().diagnostics().get(0).id()); - Assertions.assertEquals("iavrm", response.data().diagnostics().get(0).directive()); - Assertions.assertEquals("zonokixrjqci", response.data().diagnostics().get(0).description()); - Assertions.assertEquals("gzpfrla", response.data().diagnostics().get(0).file()); - Assertions.assertEquals(33.48236f, response.data().diagnostics().get(0).line()); - Assertions.assertEquals("zrnw", response.data().diagnostics().get(0).message()); - Assertions.assertEquals("iin", response.data().diagnostics().get(0).rule()); - Assertions.assertEquals(Level.WARNING, response.data().diagnostics().get(0).level()); - Assertions.assertEquals("wp", response.data().diagnostics().get(0).category()); - } -} 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 90f9481b40e4..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsCreateOrUpdateMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.NginxConfigurationFile; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import com.azure.resourcemanager.nginx.models.NginxConfigurationProtectedFileRequest; -import com.azure.resourcemanager.nginx.models.NginxConfigurationRequestProperties; -import com.azure.resourcemanager.nginx.models.NginxConfigurationResponse; -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\":\"ypgik\",\"virtualPath\":\"szywkbirryu\"},{\"content\":\"lhkjoqrvqq\",\"virtualPath\":\"t\"},{\"content\":\"nrvgoupmfiibfgg\",\"virtualPath\":\"ool\"}],\"protectedFiles\":[{\"virtualPath\":\"kvtkkg\",\"contentHash\":\"qwjygvja\"},{\"virtualPath\":\"blmhvkzuhb\",\"contentHash\":\"vyhgs\"},{\"virtualPath\":\"byrqufeg\",\"contentHash\":\"vwz\"}],\"package\":{\"data\":\"hlmctlpdngitvgb\",\"protectedFiles\":[\"ixkwmyijejveg\",\"hbpnaixexccbd\",\"eaxhcexdrrvqahqk\",\"htpwij\"]},\"rootFile\":\"yjsvfyc\"},\"id\":\"bfvoowvrv\",\"name\":\"t\",\"type\":\"jqppyostronzmy\"}"; - - 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - NginxConfigurationResponse response = manager.configurations() - .define("ughftqsx") - .withExistingNginxDeployment("ueluqhhahhxvrhmz", "wpjgwws") - .withProperties(new NginxConfigurationRequestProperties() - .withFiles( - Arrays.asList(new NginxConfigurationFile().withContent("kndxdigrjgu").withVirtualPath("zdmsyqtfi"), - new NginxConfigurationFile().withContent("hbotzingamvppho").withVirtualPath("qzudphq"), - new NginxConfigurationFile().withContent("vdkfwynwcvtbvk").withVirtualPath("hmtnvy"))) - .withProtectedFiles(Arrays.asList( - new NginxConfigurationProtectedFileRequest().withContent("kzwpcnpw") - .withVirtualPath("jaesgvvsccya") - .withContentHash("uq"), - new NginxConfigurationProtectedFileRequest().withContent("wygzlvdnkfxusem") - .withVirtualPath("zrmuhapfcqdps") - .withContentHash("qvpsvuoymg"), - new NginxConfigurationProtectedFileRequest().withContent("elvezrypq") - .withVirtualPath("feo") - .withContentHash("rqwky"))) - .withPackageProperty(new NginxConfigurationPackage().withData("bopgxedkowepbqp") - .withProtectedFiles(Arrays.asList("kbwcc"))) - .withRootFile("jvcdwxlpqekf")) - .create(); - - Assertions.assertEquals("ypgik", response.properties().files().get(0).content()); - Assertions.assertEquals("szywkbirryu", response.properties().files().get(0).virtualPath()); - Assertions.assertEquals("kvtkkg", response.properties().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("qwjygvja", response.properties().protectedFiles().get(0).contentHash()); - Assertions.assertEquals("hlmctlpdngitvgb", response.properties().packageProperty().data()); - Assertions.assertEquals("ixkwmyijejveg", response.properties().packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("yjsvfyc", response.properties().rootFile()); - } -} 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 0a6f8c0dfd15..000000000000 --- 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.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.configurations().delete("bminrfdwoyuhhzi", "iefozbhdmsml", "zqhof", 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 1b7de8a7c393..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/ConfigurationsGetWithResponseMockTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.NginxConfigurationResponse; -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\":\"NotSpecified\",\"files\":[{\"content\":\"oyzko\",\"virtualPath\":\"tlmngu\"}],\"protectedFiles\":[{\"virtualPath\":\"aldsy\",\"contentHash\":\"ximerqfobwyznk\"},{\"virtualPath\":\"kutwpf\",\"contentHash\":\"a\"}],\"package\":{\"data\":\"r\",\"protectedFiles\":[\"snfdsdoakgtdl\",\"kkze\",\"dlhewp\",\"sdsttwvog\"]},\"rootFile\":\"bejdcn\"},\"id\":\"qmoa\",\"name\":\"ufgmjzrwrdg\",\"type\":\"twaenuuzko\"}"; - - 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - NginxConfigurationResponse response = manager.configurations() - .getWithResponse("zxkhnzbonlwnto", "gokdwbwhks", "zcmrvexztvb", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("oyzko", response.properties().files().get(0).content()); - Assertions.assertEquals("tlmngu", response.properties().files().get(0).virtualPath()); - Assertions.assertEquals("aldsy", response.properties().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("ximerqfobwyznk", response.properties().protectedFiles().get(0).contentHash()); - Assertions.assertEquals("r", response.properties().packageProperty().data()); - Assertions.assertEquals("snfdsdoakgtdl", response.properties().packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("bejdcn", response.properties().rootFile()); - } -} 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 e8dc29c6ea4d..000000000000 --- 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.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.NginxConfigurationResponse; -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\":\"NotSpecified\",\"files\":[{\"content\":\"kycgrauwj\",\"virtualPath\":\"taeburuvdm\"}],\"protectedFiles\":[{\"virtualPath\":\"zlxwabmqoefkifr\",\"contentHash\":\"puqujmqlgkfbtn\"}],\"package\":{\"data\":\"ongbjcnt\",\"protectedFiles\":[\"tcje\"]},\"rootFile\":\"twwaezkojvdcpzf\"},\"id\":\"ouicybxarzgszu\",\"name\":\"oxciqopidoamcio\",\"type\":\"hkh\"}]}"; - - 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response - = manager.configurations().list("bgdknnqv", "aznqntoru", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kycgrauwj", response.iterator().next().properties().files().get(0).content()); - Assertions.assertEquals("taeburuvdm", response.iterator().next().properties().files().get(0).virtualPath()); - Assertions.assertEquals("zlxwabmqoefkifr", - response.iterator().next().properties().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("puqujmqlgkfbtn", - response.iterator().next().properties().protectedFiles().get(0).contentHash()); - Assertions.assertEquals("ongbjcnt", response.iterator().next().properties().packageProperty().data()); - Assertions.assertEquals("tcje", - response.iterator().next().properties().packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("twwaezkojvdcpzf", response.iterator().next().properties().rootFile()); - } -} 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 e45e033f5d24..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,120 +0,0 @@ -// 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.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.ActivationState; -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.NginxDeploymentPropertiesNginxAppProtect; -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 com.azure.resourcemanager.nginx.models.WebApplicationFirewallSettings; -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\":\"cgxxlxs\",\"tenantId\":\"gcvizqzdwlvwlyou\",\"type\":\"SystemAssigned, UserAssigned\",\"userAssignedIdentities\":{\"g\":{\"principalId\":\"jub\",\"clientId\":\"hgkfmin\"},\"mmqtgqqqxhr\":{\"principalId\":\"zfttsttktlahb\",\"clientId\":\"ctxtgzukxi\"},\"azivjlfrqttbajl\":{\"principalId\":\"rxcpjuisavo\",\"clientId\":\"dzf\"},\"igovi\":{\"principalId\":\"tnwxy\",\"clientId\":\"pidkqqfkuvscxkdm\"}}},\"properties\":{\"provisioningState\":\"Succeeded\",\"nginxVersion\":\"mloazuru\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{}],\"privateIPAddresses\":[{}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"eoybfhjxakvvjgs\"}},\"ipAddress\":\"r\",\"enableDiagnosticsSupport\":true,\"logging\":{\"storageAccount\":{\"accountName\":\"wt\",\"containerName\":\"kxn\"}},\"scalingProperties\":{\"capacity\":2104896567,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"yvudtjuewbci\",\"capacity\":{\"min\":1871891438,\"max\":535543031}},{\"name\":\"uwhcjyxccybv\",\"capacity\":{\"min\":436827826,\"max\":940165825}},{\"name\":\"akkud\",\"capacity\":{\"min\":417091375,\"max\":1773964666}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"wjplma\"},\"userProfile\":{\"preferredEmail\":\"cyohpfkyrkdbd\"},\"nginxAppProtect\":{\"webApplicationFirewallSettings\":{\"activationState\":\"Enabled\"},\"webApplicationFirewallStatus\":{\"attackSignaturesPackage\":{\"version\":\"kmnwqjnobaiyhddv\",\"revisionDatetime\":\"2021-06-21T06:23:06Z\"},\"botSignaturesPackage\":{\"version\":\"egfnmntfpmvmemfn\",\"revisionDatetime\":\"2021-02-26T15:37:04Z\"},\"threatCampaignsPackage\":{\"version\":\"wvvb\",\"revisionDatetime\":\"2020-12-21T10:32:32Z\"},\"componentVersions\":{\"wafEngineVersion\":\"lllchpodb\",\"wafNginxVersion\":\"evwrdnhfuk\"}}},\"dataplaneApiEndpoint\":\"sjcswsmystuluqyp\"},\"sku\":{\"name\":\"vlerchpqbmfpjba\"},\"location\":\"idfcxsspuunnoxyh\",\"tags\":{\"dao\":\"qddrihpfhoqcaae\"},\"id\":\"djvlpj\",\"name\":\"xkzb\",\"type\":\"msgeivsiykzk\"}"; - - 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - NginxDeployment response = manager.deployments() - .define("jjziuxxpsh") - .withRegion("icc") - .withExistingResourceGroup("v") - .withTags(mapOf("dvoqyt", "fscjfnynszquji", "hjoxo", "byowbblgyavutp")) - .withIdentity(new IdentityProperties().withType(IdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("duvwpklvxwmygd", new UserIdentityProperties()))) - .withProperties(new NginxDeploymentProperties() - .withNetworkProfile(new NginxNetworkProfile() - .withFrontEndIpConfiguration(new NginxFrontendIpConfiguration() - .withPublicIpAddresses(Arrays.asList(new NginxPublicIpAddress(), new NginxPublicIpAddress(), - new NginxPublicIpAddress(), new NginxPublicIpAddress())) - .withPrivateIpAddresses( - Arrays.asList(new NginxPrivateIpAddress(), new NginxPrivateIpAddress()))) - .withNetworkInterfaceConfiguration( - new NginxNetworkInterfaceConfiguration().withSubnetId("ibbdaxconfoza"))) - .withEnableDiagnosticsSupport(true) - .withLogging(new NginxLogging().withStorageAccount( - new NginxStorageAccount().withAccountName("pzlrphw").withContainerName("oldweyuqdu"))) - .withScalingProperties(new NginxDeploymentScalingProperties().withCapacity(375067057) - .withProfiles(Arrays.asList( - new ScaleProfile().withName("wrbiorkt") - .withCapacity(new ScaleProfileCapacity().withMin(1451955961).withMax(476504183)), - new ScaleProfile().withName("wjhhgdnhxmsivf") - .withCapacity(new ScaleProfileCapacity().withMin(2010806413).withMax(601340793))))) - .withAutoUpgradeProfile(new AutoUpgradeProfile().withUpgradeChannel("ox")) - .withUserProfile(new NginxDeploymentUserProfile().withPreferredEmail("ufiqndieuzaof")) - .withNginxAppProtect(new NginxDeploymentPropertiesNginxAppProtect().withWebApplicationFirewallSettings( - new WebApplicationFirewallSettings().withActivationState(ActivationState.ENABLED)))) - .withSku(new ResourceSku().withName("rilbywdx")) - .create(); - - Assertions.assertEquals("idfcxsspuunnoxyh", response.location()); - Assertions.assertEquals("qddrihpfhoqcaae", response.tags().get("dao")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("eoybfhjxakvvjgs", - response.properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(true, response.properties().enableDiagnosticsSupport()); - Assertions.assertEquals("wt", response.properties().logging().storageAccount().accountName()); - Assertions.assertEquals("kxn", response.properties().logging().storageAccount().containerName()); - Assertions.assertEquals(2104896567, response.properties().scalingProperties().capacity()); - Assertions.assertEquals("yvudtjuewbci", response.properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(1871891438, - response.properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(535543031, - response.properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("wjplma", response.properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("cyohpfkyrkdbd", response.properties().userProfile().preferredEmail()); - Assertions.assertEquals(ActivationState.ENABLED, - response.properties().nginxAppProtect().webApplicationFirewallSettings().activationState()); - Assertions.assertEquals("vlerchpqbmfpjba", 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 3096d6d603f8..000000000000 --- 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.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - manager.deployments().delete("h", "rghxjb", 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 4bcc1d93834b..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsGetByResourceGroupWithResponseMockTests.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.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.ActivationState; -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\":\"tsgumhj\",\"tenantId\":\"ikkx\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"njwmwkpnbsazejj\":{\"principalId\":\"qpvuzlmvfelf\",\"clientId\":\"gplcrpwjxeznoigb\"},\"mkqjj\":{\"principalId\":\"kagfhsxtt\",\"clientId\":\"gzxnfaazpxdtnk\"},\"ixqtn\":{\"principalId\":\"uenvrkp\",\"clientId\":\"uaibrebqaaysj\"},\"mjihyeozphv\":{\"principalId\":\"tezlwff\",\"clientId\":\"akpjpqqmtedlt\"}}},\"properties\":{\"provisioningState\":\"Deleting\",\"nginxVersion\":\"ncyg\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{},{}],\"privateIPAddresses\":[{},{},{}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"cwxqu\"}},\"ipAddress\":\"vzhfstotxhoj\",\"enableDiagnosticsSupport\":false,\"logging\":{\"storageAccount\":{\"accountName\":\"lmcuvhixb\",\"containerName\":\"yfwnylr\"}},\"scalingProperties\":{\"capacity\":1448571025,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"tpkiwkkbnujry\",\"capacity\":{\"min\":429689436,\"max\":1368964811}},{\"name\":\"y\",\"capacity\":{\"min\":151793614,\"max\":2136343303}},{\"name\":\"pncur\",\"capacity\":{\"min\":1036989495,\"max\":913086384}},{\"name\":\"wiithtywub\",\"capacity\":{\"min\":1797172930,\"max\":709721668}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"h\"},\"userProfile\":{\"preferredEmail\":\"nfdn\"},\"nginxAppProtect\":{\"webApplicationFirewallSettings\":{\"activationState\":\"Disabled\"},\"webApplicationFirewallStatus\":{\"attackSignaturesPackage\":{\"version\":\"dgoihxumwctondzj\",\"revisionDatetime\":\"2021-05-20T02:25:29Z\"},\"botSignaturesPackage\":{\"version\":\"dfdlwggyts\",\"revisionDatetime\":\"2020-12-29T04:47:45Z\"},\"threatCampaignsPackage\":{\"version\":\"ovvtgseinqfiu\",\"revisionDatetime\":\"2021-02-21T15:59:19Z\"},\"componentVersions\":{\"wafEngineVersion\":\"knpirgnepttwq\",\"wafNginxVersion\":\"sniffc\"}}},\"dataplaneApiEndpoint\":\"qnrojlpijnkrxfrd\"},\"sku\":{\"name\":\"c\"},\"location\":\"tizzronasxif\",\"tags\":{\"wesgogczh\":\"qyzhf\"},\"id\":\"nnxk\",\"name\":\"lgnyhmo\",\"type\":\"sxkkg\"}"; - - 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - NginxDeployment response = manager.deployments() - .getByResourceGroupWithResponse("gfipnsxk", "cwaekrrjre", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("tizzronasxif", response.location()); - Assertions.assertEquals("qyzhf", response.tags().get("wesgogczh")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals("cwxqu", - response.properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(false, response.properties().enableDiagnosticsSupport()); - Assertions.assertEquals("lmcuvhixb", response.properties().logging().storageAccount().accountName()); - Assertions.assertEquals("yfwnylr", response.properties().logging().storageAccount().containerName()); - Assertions.assertEquals(1448571025, response.properties().scalingProperties().capacity()); - Assertions.assertEquals("tpkiwkkbnujry", response.properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(429689436, - response.properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(1368964811, - response.properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("h", response.properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("nfdn", response.properties().userProfile().preferredEmail()); - Assertions.assertEquals(ActivationState.DISABLED, - response.properties().nginxAppProtect().webApplicationFirewallSettings().activationState()); - Assertions.assertEquals("c", 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 40ff98c4d8e2..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsListByResourceGroupMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.ActivationState; -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\":\"iklbydvkhb\",\"tenantId\":\"dznx\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"eamtmcz\":{\"principalId\":\"njivolvtnovq\",\"clientId\":\"gemjdftuljltdu\"}}},\"properties\":{\"provisioningState\":\"Failed\",\"nginxVersion\":\"wcw\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{},{},{}],\"privateIPAddresses\":[{},{}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"mojmsvpkjprvkw\"}},\"ipAddress\":\"zqljyxgtczh\",\"enableDiagnosticsSupport\":false,\"logging\":{\"storageAccount\":{\"accountName\":\"shmkxmaehvbbxur\",\"containerName\":\"ltfnhtbaxkgx\"}},\"scalingProperties\":{\"capacity\":674255307,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"yklyhpluodpvruud\",\"capacity\":{\"min\":1795826446,\"max\":1016035136}},{\"name\":\"ibthostgktstvd\",\"capacity\":{\"min\":1128262143,\"max\":318971885}},{\"name\":\"lzedqbcvhzlhplo\",\"capacity\":{\"min\":1080296367,\"max\":695028965}},{\"name\":\"dlwwqfbumlkxt\",\"capacity\":{\"min\":983643035,\"max\":2123873865}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"smlmbtxhwgfwsrta\"},\"userProfile\":{\"preferredEmail\":\"ezbrhubskh\"},\"nginxAppProtect\":{\"webApplicationFirewallSettings\":{\"activationState\":\"Enabled\"},\"webApplicationFirewallStatus\":{\"attackSignaturesPackage\":{\"version\":\"okkqfqjbvleo\",\"revisionDatetime\":\"2020-12-31T22:39:11Z\"},\"botSignaturesPackage\":{\"version\":\"luiqtqzfavyvnqq\",\"revisionDatetime\":\"2021-05-23T06:21:06Z\"},\"threatCampaignsPackage\":{\"version\":\"ryeu\",\"revisionDatetime\":\"2021-02-15T18:43:44Z\"},\"componentVersions\":{\"wafEngineVersion\":\"kq\",\"wafNginxVersion\":\"bqgzslesjcbhern\"}}},\"dataplaneApiEndpoint\":\"iew\"},\"sku\":{\"name\":\"cv\"},\"location\":\"uwrbehwagoh\",\"tags\":{\"emvvhm\":\"fkmr\"},\"id\":\"tdrjfutacoebj\",\"name\":\"ewzcjznmwcp\",\"type\":\"guaadraufactkahz\"}]}"; - - 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response - = manager.deployments().listByResourceGroup("wrykqgai", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("uwrbehwagoh", response.iterator().next().location()); - Assertions.assertEquals("fkmr", response.iterator().next().tags().get("emvvhm")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("mojmsvpkjprvkw", - response.iterator().next().properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(false, response.iterator().next().properties().enableDiagnosticsSupport()); - Assertions.assertEquals("shmkxmaehvbbxur", - response.iterator().next().properties().logging().storageAccount().accountName()); - Assertions.assertEquals("ltfnhtbaxkgx", - response.iterator().next().properties().logging().storageAccount().containerName()); - Assertions.assertEquals(674255307, response.iterator().next().properties().scalingProperties().capacity()); - Assertions.assertEquals("yklyhpluodpvruud", - response.iterator().next().properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(1795826446, - response.iterator().next().properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(1016035136, - response.iterator().next().properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("smlmbtxhwgfwsrta", - response.iterator().next().properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("ezbrhubskh", response.iterator().next().properties().userProfile().preferredEmail()); - Assertions.assertEquals(ActivationState.ENABLED, - response.iterator() - .next() - .properties() - .nginxAppProtect() - .webApplicationFirewallSettings() - .activationState()); - Assertions.assertEquals("cv", 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 c2b865b57f20..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DeploymentsListMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.nginx.NginxManager; -import com.azure.resourcemanager.nginx.models.ActivationState; -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\":\"xvcxgfrpdsofbshr\",\"tenantId\":\"vbuswd\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"wnopqgikyzirtx\":{\"principalId\":\"cnunvjsr\",\"clientId\":\"f\"},\"qukrydxt\":{\"principalId\":\"uxzejntpsew\",\"clientId\":\"oi\"},\"pjbi\":{\"principalId\":\"ieoxorggufhyaomt\",\"clientId\":\"hhavgrvkffovjz\"},\"nbkfezzxscy\":{\"principalId\":\"jmfxumvf\",\"clientId\":\"uyovw\"}}},\"properties\":{\"provisioningState\":\"Deleting\",\"nginxVersion\":\"irujbz\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{},{},{},{}],\"privateIPAddresses\":[{},{},{},{}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"c\"}},\"ipAddress\":\"pniyujviyl\",\"enableDiagnosticsSupport\":true,\"logging\":{\"storageAccount\":{\"accountName\":\"snrbgyefrymsgao\",\"containerName\":\"mwn\"}},\"scalingProperties\":{\"capacity\":1012441055,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"hirctymoxoftpipi\",\"capacity\":{\"min\":420468172,\"max\":1383298252}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"uh\"},\"userProfile\":{\"preferredEmail\":\"pqjlihhyusps\"},\"nginxAppProtect\":{\"webApplicationFirewallSettings\":{\"activationState\":\"Disabled\"},\"webApplicationFirewallStatus\":{\"attackSignaturesPackage\":{\"version\":\"mfwdgzxu\",\"revisionDatetime\":\"2021-04-20T13:27:45Z\"},\"botSignaturesPackage\":{\"version\":\"vpa\",\"revisionDatetime\":\"2021-12-09T14:22:52Z\"},\"threatCampaignsPackage\":{\"version\":\"reuzvxurisjn\",\"revisionDatetime\":\"2021-02-10T22:06:59Z\"},\"componentVersions\":{\"wafEngineVersion\":\"txifqj\",\"wafNginxVersion\":\"gxmrhublwp\"}}},\"dataplaneApiEndpoint\":\"sutrgjup\"},\"sku\":{\"name\":\"utpwoqhihejqgw\"},\"location\":\"nfqn\",\"tags\":{\"imwkslircizj\":\"psxjvf\",\"t\":\"vydfceacvlhvygdy\",\"jslb\":\"mrtwna\"},\"id\":\"wkojgcyztsfmzn\",\"name\":\"aeqphchqnr\",\"type\":\"rpxeh\"}]}"; - - 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.deployments().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("nfqn", response.iterator().next().location()); - Assertions.assertEquals("psxjvf", response.iterator().next().tags().get("imwkslircizj")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("c", - response.iterator().next().properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(true, response.iterator().next().properties().enableDiagnosticsSupport()); - Assertions.assertEquals("snrbgyefrymsgao", - response.iterator().next().properties().logging().storageAccount().accountName()); - Assertions.assertEquals("mwn", - response.iterator().next().properties().logging().storageAccount().containerName()); - Assertions.assertEquals(1012441055, response.iterator().next().properties().scalingProperties().capacity()); - Assertions.assertEquals("hirctymoxoftpipi", - response.iterator().next().properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(420468172, - response.iterator().next().properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(1383298252, - response.iterator().next().properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("uh", response.iterator().next().properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("pqjlihhyusps", response.iterator().next().properties().userProfile().preferredEmail()); - Assertions.assertEquals(ActivationState.DISABLED, - response.iterator() - .next() - .properties() - .nginxAppProtect() - .webApplicationFirewallSettings() - .activationState()); - Assertions.assertEquals("utpwoqhihejqgw", response.iterator().next().sku().name()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DiagnosticItemTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DiagnosticItemTests.java deleted file mode 100644 index 55b42b2a7405..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/DiagnosticItemTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.DiagnosticItem; -import com.azure.resourcemanager.nginx.models.Level; -import org.junit.jupiter.api.Assertions; - -public final class DiagnosticItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiagnosticItem model = BinaryData.fromString( - "{\"id\":\"iwwzjuqk\",\"directive\":\"rsa\",\"description\":\"iwkuofos\",\"file\":\"ghsauuimjmvxied\",\"line\":44.474648,\"message\":\"gidyjrrf\",\"rule\":\"y\",\"level\":\"Warning\",\"category\":\"v\"}") - .toObject(DiagnosticItem.class); - Assertions.assertEquals("iwwzjuqk", model.id()); - Assertions.assertEquals("rsa", model.directive()); - Assertions.assertEquals("iwkuofos", model.description()); - Assertions.assertEquals("ghsauuimjmvxied", model.file()); - Assertions.assertEquals(44.474648f, model.line()); - Assertions.assertEquals("gidyjrrf", model.message()); - Assertions.assertEquals("y", model.rule()); - Assertions.assertEquals(Level.WARNING, model.level()); - Assertions.assertEquals("v", model.category()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiagnosticItem model = new DiagnosticItem().withId("iwwzjuqk") - .withDirective("rsa") - .withDescription("iwkuofos") - .withFile("ghsauuimjmvxied") - .withLine(44.474648f) - .withMessage("gidyjrrf") - .withRule("y") - .withLevel(Level.WARNING) - .withCategory("v"); - model = BinaryData.fromObject(model).toObject(DiagnosticItem.class); - Assertions.assertEquals("iwwzjuqk", model.id()); - Assertions.assertEquals("rsa", model.directive()); - Assertions.assertEquals("iwkuofos", model.description()); - Assertions.assertEquals("ghsauuimjmvxied", model.file()); - Assertions.assertEquals(44.474648f, model.line()); - Assertions.assertEquals("gidyjrrf", model.message()); - Assertions.assertEquals("y", model.rule()); - Assertions.assertEquals(Level.WARNING, model.level()); - Assertions.assertEquals("v", model.category()); - } -} 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 d47ccaccdda7..000000000000 --- 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\":\"cxgod\",\"tenantId\":\"fqkkr\",\"type\":\"None\",\"userAssignedIdentities\":{\"cispnqzahmgkbr\":{\"principalId\":\"riwflzlfb\",\"clientId\":\"puz\"},\"drgvtqagn\":{\"principalId\":\"y\",\"clientId\":\"ibnuqqkpik\"},\"zzmhjrunmpxttd\":{\"principalId\":\"ynhijggme\",\"clientId\":\"siarbutrcvpn\"}}}") - .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("cispnqzahmgkbr", new UserIdentityProperties(), "drgvtqagn", - new UserIdentityProperties(), "zzmhjrunmpxttd", 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 20541cd8af59..000000000000 --- 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\":\"fygxgispemvtzfk\",\"virtualPath\":\"ubljofxqe\"}") - .toObject(NginxConfigurationFile.class); - Assertions.assertEquals("fygxgispemvtzfk", model.content()); - Assertions.assertEquals("ubljofxqe", model.virtualPath()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxConfigurationFile model - = new NginxConfigurationFile().withContent("fygxgispemvtzfk").withVirtualPath("ubljofxqe"); - model = BinaryData.fromObject(model).toObject(NginxConfigurationFile.class); - Assertions.assertEquals("fygxgispemvtzfk", model.content()); - Assertions.assertEquals("ubljofxqe", model.virtualPath()); - } -} 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 2cd17672a8a2..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationListResponseTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.fluent.models.NginxConfigurationResponseInner; -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.NginxConfigurationProtectedFileResponse; -import com.azure.resourcemanager.nginx.models.NginxConfigurationResponseProperties; -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\":\"Deleting\",\"files\":[{\"content\":\"ddeqsrdeupewnwre\",\"virtualPath\":\"jzyflu\"},{\"content\":\"rh\",\"virtualPath\":\"fcqhsmyurkd\"}],\"protectedFiles\":[{\"virtualPath\":\"he\",\"contentHash\":\"k\"}],\"package\":{\"data\":\"xukcdmpar\",\"protectedFiles\":[\"uanzwuxzdx\"]},\"rootFile\":\"yrlhmwhfpmrqobm\"},\"id\":\"kknryrtihf\",\"name\":\"tijbpzvgnwzsymgl\",\"type\":\"uf\"}],\"nextLink\":\"zk\"}") - .toObject(NginxConfigurationListResponse.class); - Assertions.assertEquals("ddeqsrdeupewnwre", model.value().get(0).properties().files().get(0).content()); - Assertions.assertEquals("jzyflu", model.value().get(0).properties().files().get(0).virtualPath()); - Assertions.assertEquals("he", model.value().get(0).properties().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("k", model.value().get(0).properties().protectedFiles().get(0).contentHash()); - Assertions.assertEquals("xukcdmpar", model.value().get(0).properties().packageProperty().data()); - Assertions.assertEquals("uanzwuxzdx", - model.value().get(0).properties().packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("yrlhmwhfpmrqobm", model.value().get(0).properties().rootFile()); - Assertions.assertEquals("zk", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxConfigurationListResponse model - = new NginxConfigurationListResponse() - .withValue( - Arrays - .asList(new NginxConfigurationResponseInner() - .withProperties(new NginxConfigurationResponseProperties() - .withFiles(Arrays.asList( - new NginxConfigurationFile().withContent("ddeqsrdeupewnwre") - .withVirtualPath("jzyflu"), - new NginxConfigurationFile().withContent("rh").withVirtualPath("fcqhsmyurkd"))) - .withProtectedFiles( - Arrays.asList(new NginxConfigurationProtectedFileResponse().withVirtualPath("he") - .withContentHash("k"))) - .withPackageProperty(new NginxConfigurationPackage().withData("xukcdmpar") - .withProtectedFiles(Arrays.asList("uanzwuxzdx"))) - .withRootFile("yrlhmwhfpmrqobm")))) - .withNextLink("zk"); - model = BinaryData.fromObject(model).toObject(NginxConfigurationListResponse.class); - Assertions.assertEquals("ddeqsrdeupewnwre", model.value().get(0).properties().files().get(0).content()); - Assertions.assertEquals("jzyflu", model.value().get(0).properties().files().get(0).virtualPath()); - Assertions.assertEquals("he", model.value().get(0).properties().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("k", model.value().get(0).properties().protectedFiles().get(0).contentHash()); - Assertions.assertEquals("xukcdmpar", model.value().get(0).properties().packageProperty().data()); - Assertions.assertEquals("uanzwuxzdx", - model.value().get(0).properties().packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("yrlhmwhfpmrqobm", model.value().get(0).properties().rootFile()); - Assertions.assertEquals("zk", 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 16bf0d49f335..000000000000 --- 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\":\"qulngsntnbybkzgc\",\"protectedFiles\":[\"clxxwrljdo\",\"skcqvkocrcjd\"]}") - .toObject(NginxConfigurationPackage.class); - Assertions.assertEquals("qulngsntnbybkzgc", model.data()); - Assertions.assertEquals("clxxwrljdo", model.protectedFiles().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxConfigurationPackage model = new NginxConfigurationPackage().withData("qulngsntnbybkzgc") - .withProtectedFiles(Arrays.asList("clxxwrljdo", "skcqvkocrcjd")); - model = BinaryData.fromObject(model).toObject(NginxConfigurationPackage.class); - Assertions.assertEquals("qulngsntnbybkzgc", model.data()); - Assertions.assertEquals("clxxwrljdo", model.protectedFiles().get(0)); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationProtectedFileRequestTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationProtectedFileRequestTests.java deleted file mode 100644 index 141fcd23e7b2..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationProtectedFileRequestTests.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.util.BinaryData; -import com.azure.resourcemanager.nginx.models.NginxConfigurationProtectedFileRequest; -import org.junit.jupiter.api.Assertions; - -public final class NginxConfigurationProtectedFileRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxConfigurationProtectedFileRequest model = BinaryData - .fromString("{\"content\":\"ufizuckyf\",\"virtualPath\":\"rfidfvzwdz\",\"contentHash\":\"tymw\"}") - .toObject(NginxConfigurationProtectedFileRequest.class); - Assertions.assertEquals("ufizuckyf", model.content()); - Assertions.assertEquals("rfidfvzwdz", model.virtualPath()); - Assertions.assertEquals("tymw", model.contentHash()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxConfigurationProtectedFileRequest model - = new NginxConfigurationProtectedFileRequest().withContent("ufizuckyf") - .withVirtualPath("rfidfvzwdz") - .withContentHash("tymw"); - model = BinaryData.fromObject(model).toObject(NginxConfigurationProtectedFileRequest.class); - Assertions.assertEquals("ufizuckyf", model.content()); - Assertions.assertEquals("rfidfvzwdz", model.virtualPath()); - Assertions.assertEquals("tymw", model.contentHash()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationProtectedFileResponseTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationProtectedFileResponseTests.java deleted file mode 100644 index 2f5d756cf2ca..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationProtectedFileResponseTests.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.NginxConfigurationProtectedFileResponse; -import org.junit.jupiter.api.Assertions; - -public final class NginxConfigurationProtectedFileResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxConfigurationProtectedFileResponse model - = BinaryData.fromString("{\"virtualPath\":\"jaeq\",\"contentHash\":\"qjbasvms\"}") - .toObject(NginxConfigurationProtectedFileResponse.class); - Assertions.assertEquals("jaeq", model.virtualPath()); - Assertions.assertEquals("qjbasvms", model.contentHash()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxConfigurationProtectedFileResponse model - = new NginxConfigurationProtectedFileResponse().withVirtualPath("jaeq").withContentHash("qjbasvms"); - model = BinaryData.fromObject(model).toObject(NginxConfigurationProtectedFileResponse.class); - Assertions.assertEquals("jaeq", model.virtualPath()); - Assertions.assertEquals("qjbasvms", model.contentHash()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationRequestPropertiesTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationRequestPropertiesTests.java deleted file mode 100644 index 9c173864bf17..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationRequestPropertiesTests.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.util.BinaryData; -import com.azure.resourcemanager.nginx.models.NginxConfigurationFile; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import com.azure.resourcemanager.nginx.models.NginxConfigurationProtectedFileRequest; -import com.azure.resourcemanager.nginx.models.NginxConfigurationRequestProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NginxConfigurationRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxConfigurationRequestProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Succeeded\",\"files\":[{\"content\":\"modmglougpb\",\"virtualPath\":\"tmut\"}],\"protectedFiles\":[{\"content\":\"ta\",\"virtualPath\":\"pwgcuertu\",\"contentHash\":\"dosvqwhbmdgbbjf\"},{\"content\":\"gmbmbexppbh\",\"virtualPath\":\"qrolfpf\",\"contentHash\":\"algbquxigjyjg\"},{\"content\":\"aoyfhrtxilnerkuj\",\"virtualPath\":\"vlejuvfqa\",\"contentHash\":\"lyxwjkcprbnwbx\"},{\"content\":\"vtb\",\"virtualPath\":\"ysszdnrujqguh\",\"contentHash\":\"ouqfprwz\"}],\"package\":{\"data\":\"g\",\"protectedFiles\":[\"nwui\"]},\"rootFile\":\"a\"}") - .toObject(NginxConfigurationRequestProperties.class); - Assertions.assertEquals("modmglougpb", model.files().get(0).content()); - Assertions.assertEquals("tmut", model.files().get(0).virtualPath()); - Assertions.assertEquals("ta", model.protectedFiles().get(0).content()); - Assertions.assertEquals("pwgcuertu", model.protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("dosvqwhbmdgbbjf", model.protectedFiles().get(0).contentHash()); - Assertions.assertEquals("g", model.packageProperty().data()); - Assertions.assertEquals("nwui", model.packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("a", model.rootFile()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxConfigurationRequestProperties model = new NginxConfigurationRequestProperties() - .withFiles(Arrays.asList(new NginxConfigurationFile().withContent("modmglougpb").withVirtualPath("tmut"))) - .withProtectedFiles(Arrays.asList( - new NginxConfigurationProtectedFileRequest().withContent("ta") - .withVirtualPath("pwgcuertu") - .withContentHash("dosvqwhbmdgbbjf"), - new NginxConfigurationProtectedFileRequest().withContent("gmbmbexppbh") - .withVirtualPath("qrolfpf") - .withContentHash("algbquxigjyjg"), - new NginxConfigurationProtectedFileRequest().withContent("aoyfhrtxilnerkuj") - .withVirtualPath("vlejuvfqa") - .withContentHash("lyxwjkcprbnwbx"), - new NginxConfigurationProtectedFileRequest().withContent("vtb") - .withVirtualPath("ysszdnrujqguh") - .withContentHash("ouqfprwz"))) - .withPackageProperty( - new NginxConfigurationPackage().withData("g").withProtectedFiles(Arrays.asList("nwui"))) - .withRootFile("a"); - model = BinaryData.fromObject(model).toObject(NginxConfigurationRequestProperties.class); - Assertions.assertEquals("modmglougpb", model.files().get(0).content()); - Assertions.assertEquals("tmut", model.files().get(0).virtualPath()); - Assertions.assertEquals("ta", model.protectedFiles().get(0).content()); - Assertions.assertEquals("pwgcuertu", model.protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("dosvqwhbmdgbbjf", model.protectedFiles().get(0).contentHash()); - Assertions.assertEquals("g", model.packageProperty().data()); - Assertions.assertEquals("nwui", model.packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("a", model.rootFile()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationRequestTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationRequestTests.java deleted file mode 100644 index 2f382de48f57..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationRequestTests.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.util.BinaryData; -import com.azure.resourcemanager.nginx.models.NginxConfigurationFile; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import com.azure.resourcemanager.nginx.models.NginxConfigurationProtectedFileRequest; -import com.azure.resourcemanager.nginx.models.NginxConfigurationRequest; -import com.azure.resourcemanager.nginx.models.NginxConfigurationRequestProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NginxConfigurationRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxConfigurationRequest model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"NotSpecified\",\"files\":[{\"content\":\"njbiksqrglssain\",\"virtualPath\":\"jwnzlljfmp\"},{\"content\":\"ebvmgxsabkyqd\",\"virtualPath\":\"jitcjczdzevn\"},{\"content\":\"krwpdap\",\"virtualPath\":\"sbdkvwr\"}],\"protectedFiles\":[{\"content\":\"usnhutje\",\"virtualPath\":\"mrldhu\",\"contentHash\":\"zzd\"},{\"content\":\"qxhocdgeablgphut\",\"virtualPath\":\"ndv\",\"contentHash\":\"ozwyiftyhxhuro\"}],\"package\":{\"data\":\"yxolniwp\",\"protectedFiles\":[\"kjfkg\",\"awxklr\",\"plwckbas\",\"ypnddhsgcb\"]},\"rootFile\":\"phejkotynqgoulz\"},\"id\":\"likwyqkgfgib\",\"name\":\"adgakeqsrxybz\",\"type\":\"qedqytbciqfoufl\"}") - .toObject(NginxConfigurationRequest.class); - Assertions.assertEquals("njbiksqrglssain", model.properties().files().get(0).content()); - Assertions.assertEquals("jwnzlljfmp", model.properties().files().get(0).virtualPath()); - Assertions.assertEquals("usnhutje", model.properties().protectedFiles().get(0).content()); - Assertions.assertEquals("mrldhu", model.properties().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("zzd", model.properties().protectedFiles().get(0).contentHash()); - Assertions.assertEquals("yxolniwp", model.properties().packageProperty().data()); - Assertions.assertEquals("kjfkg", model.properties().packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("phejkotynqgoulz", model.properties().rootFile()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxConfigurationRequest model - = new NginxConfigurationRequest().withProperties(new NginxConfigurationRequestProperties() - .withFiles(Arrays.asList( - new NginxConfigurationFile().withContent("njbiksqrglssain").withVirtualPath("jwnzlljfmp"), - new NginxConfigurationFile().withContent("ebvmgxsabkyqd").withVirtualPath("jitcjczdzevn"), - new NginxConfigurationFile().withContent("krwpdap").withVirtualPath("sbdkvwr"))) - .withProtectedFiles(Arrays.asList( - new NginxConfigurationProtectedFileRequest().withContent("usnhutje") - .withVirtualPath("mrldhu") - .withContentHash("zzd"), - new NginxConfigurationProtectedFileRequest().withContent("qxhocdgeablgphut") - .withVirtualPath("ndv") - .withContentHash("ozwyiftyhxhuro"))) - .withPackageProperty(new NginxConfigurationPackage().withData("yxolniwp") - .withProtectedFiles(Arrays.asList("kjfkg", "awxklr", "plwckbas", "ypnddhsgcb"))) - .withRootFile("phejkotynqgoulz")); - model = BinaryData.fromObject(model).toObject(NginxConfigurationRequest.class); - Assertions.assertEquals("njbiksqrglssain", model.properties().files().get(0).content()); - Assertions.assertEquals("jwnzlljfmp", model.properties().files().get(0).virtualPath()); - Assertions.assertEquals("usnhutje", model.properties().protectedFiles().get(0).content()); - Assertions.assertEquals("mrldhu", model.properties().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("zzd", model.properties().protectedFiles().get(0).contentHash()); - Assertions.assertEquals("yxolniwp", model.properties().packageProperty().data()); - Assertions.assertEquals("kjfkg", model.properties().packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("phejkotynqgoulz", model.properties().rootFile()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationResponseInnerTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationResponseInnerTests.java deleted file mode 100644 index 2b0c530e18c7..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationResponseInnerTests.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.util.BinaryData; -import com.azure.resourcemanager.nginx.fluent.models.NginxConfigurationResponseInner; -import com.azure.resourcemanager.nginx.models.NginxConfigurationFile; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import com.azure.resourcemanager.nginx.models.NginxConfigurationProtectedFileResponse; -import com.azure.resourcemanager.nginx.models.NginxConfigurationResponseProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NginxConfigurationResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxConfigurationResponseInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Creating\",\"files\":[{\"content\":\"nufhf\",\"virtualPath\":\"jysagith\"},{\"content\":\"hab\",\"virtualPath\":\"pikxwczbyscnpqxu\"},{\"content\":\"vyq\",\"virtualPath\":\"wby\"},{\"content\":\"k\",\"virtualPath\":\"dumjgrtfwvuk\"}],\"protectedFiles\":[{\"virtualPath\":\"dcc\",\"contentHash\":\"h\"},{\"virtualPath\":\"cnyejhkryhtnapcz\",\"contentHash\":\"okjye\"},{\"virtualPath\":\"kvnipjoxz\",\"contentHash\":\"chgejspodm\"}],\"package\":{\"data\":\"zyde\",\"protectedFiles\":[\"wyahuxinpmqnja\",\"wixjsprozvcp\",\"tegjvwmf\",\"atscmd\"]},\"rootFile\":\"jhulsuuvmkjo\"},\"id\":\"rwfndiod\",\"name\":\"pslwejdpvw\",\"type\":\"yoqpsoaccta\"}") - .toObject(NginxConfigurationResponseInner.class); - Assertions.assertEquals("nufhf", model.properties().files().get(0).content()); - Assertions.assertEquals("jysagith", model.properties().files().get(0).virtualPath()); - Assertions.assertEquals("dcc", model.properties().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("h", model.properties().protectedFiles().get(0).contentHash()); - Assertions.assertEquals("zyde", model.properties().packageProperty().data()); - Assertions.assertEquals("wyahuxinpmqnja", model.properties().packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("jhulsuuvmkjo", model.properties().rootFile()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxConfigurationResponseInner model - = new NginxConfigurationResponseInner().withProperties(new NginxConfigurationResponseProperties() - .withFiles(Arrays.asList(new NginxConfigurationFile().withContent("nufhf").withVirtualPath("jysagith"), - new NginxConfigurationFile().withContent("hab").withVirtualPath("pikxwczbyscnpqxu"), - new NginxConfigurationFile().withContent("vyq").withVirtualPath("wby"), - new NginxConfigurationFile().withContent("k").withVirtualPath("dumjgrtfwvuk"))) - .withProtectedFiles(Arrays.asList( - new NginxConfigurationProtectedFileResponse().withVirtualPath("dcc").withContentHash("h"), - new NginxConfigurationProtectedFileResponse().withVirtualPath("cnyejhkryhtnapcz") - .withContentHash("okjye"), - new NginxConfigurationProtectedFileResponse().withVirtualPath("kvnipjoxz") - .withContentHash("chgejspodm"))) - .withPackageProperty(new NginxConfigurationPackage().withData("zyde") - .withProtectedFiles(Arrays.asList("wyahuxinpmqnja", "wixjsprozvcp", "tegjvwmf", "atscmd"))) - .withRootFile("jhulsuuvmkjo")); - model = BinaryData.fromObject(model).toObject(NginxConfigurationResponseInner.class); - Assertions.assertEquals("nufhf", model.properties().files().get(0).content()); - Assertions.assertEquals("jysagith", model.properties().files().get(0).virtualPath()); - Assertions.assertEquals("dcc", model.properties().protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("h", model.properties().protectedFiles().get(0).contentHash()); - Assertions.assertEquals("zyde", model.properties().packageProperty().data()); - Assertions.assertEquals("wyahuxinpmqnja", model.properties().packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("jhulsuuvmkjo", model.properties().rootFile()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationResponsePropertiesTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationResponsePropertiesTests.java deleted file mode 100644 index ec8ab28cefb1..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxConfigurationResponsePropertiesTests.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.NginxConfigurationFile; -import com.azure.resourcemanager.nginx.models.NginxConfigurationPackage; -import com.azure.resourcemanager.nginx.models.NginxConfigurationProtectedFileResponse; -import com.azure.resourcemanager.nginx.models.NginxConfigurationResponseProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NginxConfigurationResponsePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxConfigurationResponseProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Failed\",\"files\":[{\"content\":\"ahbc\",\"virtualPath\":\"ffdfdosygexpa\"}],\"protectedFiles\":[{\"virtualPath\":\"hmsbzjhcrzevdp\",\"contentHash\":\"xaolth\"},{\"virtualPath\":\"rgqjbpfzfsinzg\",\"contentHash\":\"cjrwzoxxjtfellu\"},{\"virtualPath\":\"zitonpeqfpjkjl\",\"contentHash\":\"fpdvhpfxxypi\"}],\"package\":{\"data\":\"mayhuybbkpodepoo\",\"protectedFiles\":[\"uvamiheognarxzxt\",\"eotusivyevc\",\"iqihn\"]},\"rootFile\":\"ngbwjz\"}") - .toObject(NginxConfigurationResponseProperties.class); - Assertions.assertEquals("ahbc", model.files().get(0).content()); - Assertions.assertEquals("ffdfdosygexpa", model.files().get(0).virtualPath()); - Assertions.assertEquals("hmsbzjhcrzevdp", model.protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("xaolth", model.protectedFiles().get(0).contentHash()); - Assertions.assertEquals("mayhuybbkpodepoo", model.packageProperty().data()); - Assertions.assertEquals("uvamiheognarxzxt", model.packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("ngbwjz", model.rootFile()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxConfigurationResponseProperties model = new NginxConfigurationResponseProperties() - .withFiles(Arrays.asList(new NginxConfigurationFile().withContent("ahbc").withVirtualPath("ffdfdosygexpa"))) - .withProtectedFiles(Arrays.asList( - new NginxConfigurationProtectedFileResponse().withVirtualPath("hmsbzjhcrzevdp") - .withContentHash("xaolth"), - new NginxConfigurationProtectedFileResponse().withVirtualPath("rgqjbpfzfsinzg") - .withContentHash("cjrwzoxxjtfellu"), - new NginxConfigurationProtectedFileResponse().withVirtualPath("zitonpeqfpjkjl") - .withContentHash("fpdvhpfxxypi"))) - .withPackageProperty(new NginxConfigurationPackage().withData("mayhuybbkpodepoo") - .withProtectedFiles(Arrays.asList("uvamiheognarxzxt", "eotusivyevc", "iqihn"))) - .withRootFile("ngbwjz"); - model = BinaryData.fromObject(model).toObject(NginxConfigurationResponseProperties.class); - Assertions.assertEquals("ahbc", model.files().get(0).content()); - Assertions.assertEquals("ffdfdosygexpa", model.files().get(0).virtualPath()); - Assertions.assertEquals("hmsbzjhcrzevdp", model.protectedFiles().get(0).virtualPath()); - Assertions.assertEquals("xaolth", model.protectedFiles().get(0).contentHash()); - Assertions.assertEquals("mayhuybbkpodepoo", model.packageProperty().data()); - Assertions.assertEquals("uvamiheognarxzxt", model.packageProperty().protectedFiles().get(0)); - Assertions.assertEquals("ngbwjz", model.rootFile()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentApiKeyListResponseTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentApiKeyListResponseTests.java deleted file mode 100644 index 554ad449374b..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentApiKeyListResponseTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.fluent.models.NginxDeploymentApiKeyResponseInner; -import com.azure.resourcemanager.nginx.models.NginxDeploymentApiKeyListResponse; -import com.azure.resourcemanager.nginx.models.NginxDeploymentApiKeyResponseProperties; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class NginxDeploymentApiKeyListResponseTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxDeploymentApiKeyListResponse model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"hint\":\"bqsoqijg\",\"endDateTime\":\"2021-10-01T09:23:29Z\"},\"id\":\"bpazlobcufpdzn\",\"name\":\"btcqq\",\"type\":\"nq\"},{\"properties\":{\"hint\":\"qgn\",\"endDateTime\":\"2021-06-16T07:30:55Z\"},\"id\":\"oo\",\"name\":\"ywifsqesaag\",\"type\":\"f\"}],\"nextLink\":\"lzl\"}") - .toObject(NginxDeploymentApiKeyListResponse.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-01T09:23:29Z"), - model.value().get(0).properties().endDateTime()); - Assertions.assertEquals("lzl", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentApiKeyListResponse model = new NginxDeploymentApiKeyListResponse().withValue(Arrays.asList( - new NginxDeploymentApiKeyResponseInner().withProperties(new NginxDeploymentApiKeyResponseProperties() - .withEndDateTime(OffsetDateTime.parse("2021-10-01T09:23:29Z"))), - new NginxDeploymentApiKeyResponseInner().withProperties(new NginxDeploymentApiKeyResponseProperties() - .withEndDateTime(OffsetDateTime.parse("2021-06-16T07:30:55Z"))))) - .withNextLink("lzl"); - model = BinaryData.fromObject(model).toObject(NginxDeploymentApiKeyListResponse.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-01T09:23:29Z"), - model.value().get(0).properties().endDateTime()); - Assertions.assertEquals("lzl", model.nextLink()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentApiKeyResponseInnerTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentApiKeyResponseInnerTests.java deleted file mode 100644 index 8499e7b64a47..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentApiKeyResponseInnerTests.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.fluent.models.NginxDeploymentApiKeyResponseInner; -import com.azure.resourcemanager.nginx.models.NginxDeploymentApiKeyResponseProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class NginxDeploymentApiKeyResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxDeploymentApiKeyResponseInner model = BinaryData.fromString( - "{\"properties\":{\"hint\":\"bsphrupidgsybbe\",\"endDateTime\":\"2021-02-20T13:53:07Z\"},\"id\":\"hoycm\",\"name\":\"xaobhdxbmtqioqjz\",\"type\":\"htbmuf\"}") - .toObject(NginxDeploymentApiKeyResponseInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-20T13:53:07Z"), model.properties().endDateTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentApiKeyResponseInner model - = new NginxDeploymentApiKeyResponseInner().withProperties(new NginxDeploymentApiKeyResponseProperties() - .withEndDateTime(OffsetDateTime.parse("2021-02-20T13:53:07Z"))); - model = BinaryData.fromObject(model).toObject(NginxDeploymentApiKeyResponseInner.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-20T13:53:07Z"), model.properties().endDateTime()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentApiKeyResponsePropertiesTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentApiKeyResponsePropertiesTests.java deleted file mode 100644 index 05df99ae758e..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentApiKeyResponsePropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.nginx.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.nginx.models.NginxDeploymentApiKeyResponseProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class NginxDeploymentApiKeyResponsePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxDeploymentApiKeyResponseProperties model - = BinaryData.fromString("{\"hint\":\"wnoi\",\"endDateTime\":\"2021-08-05T07:19:53Z\"}") - .toObject(NginxDeploymentApiKeyResponseProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-05T07:19:53Z"), model.endDateTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentApiKeyResponseProperties model = new NginxDeploymentApiKeyResponseProperties() - .withEndDateTime(OffsetDateTime.parse("2021-08-05T07:19:53Z")); - model = BinaryData.fromObject(model).toObject(NginxDeploymentApiKeyResponseProperties.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-05T07:19:53Z"), model.endDateTime()); - } -} 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 5dbb1427da62..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentInnerTests.java +++ /dev/null @@ -1,162 +0,0 @@ -// 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.ActivationState; -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.NginxDeploymentPropertiesNginxAppProtect; -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 com.azure.resourcemanager.nginx.models.WebApplicationFirewallSettings; -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\":\"sonpclhocohs\",\"tenantId\":\"ev\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"shxmzsbbzoggigrx\":{\"principalId\":\"buhfmvfaxkffeiit\",\"clientId\":\"vmezy\"},\"enkouknvudw\":{\"principalId\":\"ur\",\"clientId\":\"xxjnspydptk\"}}},\"properties\":{\"provisioningState\":\"Canceled\",\"nginxVersion\":\"ldngkpoci\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{\"id\":\"egukgjnpiucg\"},{\"id\":\"evqzntypmrbp\"},{\"id\":\"c\"},{\"id\":\"qjsdpydnfyhxdeo\"}],\"privateIPAddresses\":[{\"privateIPAddress\":\"cwif\",\"privateIPAllocationMethod\":\"Static\",\"subnetId\":\"gzfbishcbk\"}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"deyeamdphagalpbu\"}},\"ipAddress\":\"gipwhonowkg\",\"enableDiagnosticsSupport\":true,\"logging\":{\"storageAccount\":{\"accountName\":\"ixzbinjeputtmryw\",\"containerName\":\"zoqftiyqzrnkcqvy\"}},\"scalingProperties\":{\"capacity\":1062459417,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"sicohoqqnwvlry\",\"capacity\":{\"min\":1416786049,\"max\":240696862}},{\"name\":\"hheunmmqhgyx\",\"capacity\":{\"min\":1391467998,\"max\":1953555312}},{\"name\":\"noc\",\"capacity\":{\"min\":1493031892,\"max\":820959200}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"lyaxuc\"},\"userProfile\":{\"preferredEmail\":\"qszf\"},\"nginxAppProtect\":{\"webApplicationFirewallSettings\":{\"activationState\":\"Disabled\"},\"webApplicationFirewallStatus\":{\"attackSignaturesPackage\":{\"version\":\"wrmjmwvvjektc\",\"revisionDatetime\":\"2021-03-20T12:50:25Z\"},\"botSignaturesPackage\":{\"version\":\"nhwlrsffrzpwvl\",\"revisionDatetime\":\"2021-01-03T19:26:04Z\"},\"threatCampaignsPackage\":{\"version\":\"gbiqylihkaet\",\"revisionDatetime\":\"2021-03-28T05:06:34Z\"},\"componentVersions\":{\"wafEngineVersion\":\"vfcivfsnkymuc\",\"wafNginxVersion\":\"qhjfbebr\"}}},\"dataplaneApiEndpoint\":\"xerf\"},\"sku\":{\"name\":\"utttxfvjrbirp\"},\"location\":\"epcyvahfnlj\",\"tags\":{\"ljyoxgvcltb\":\"xjvuujqgidokg\"},\"id\":\"sncghkjeszz\",\"name\":\"bijhtxfvgxbf\",\"type\":\"mxnehmp\"}") - .toObject(NginxDeploymentInner.class); - Assertions.assertEquals("epcyvahfnlj", model.location()); - Assertions.assertEquals("xjvuujqgidokg", model.tags().get("ljyoxgvcltb")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("egukgjnpiucg", - model.properties().networkProfile().frontEndIpConfiguration().publicIpAddresses().get(0).id()); - Assertions.assertEquals("cwif", - model.properties() - .networkProfile() - .frontEndIpConfiguration() - .privateIpAddresses() - .get(0) - .privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.STATIC, - model.properties() - .networkProfile() - .frontEndIpConfiguration() - .privateIpAddresses() - .get(0) - .privateIpAllocationMethod()); - Assertions.assertEquals("gzfbishcbk", - model.properties().networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).subnetId()); - Assertions.assertEquals("deyeamdphagalpbu", - model.properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(true, model.properties().enableDiagnosticsSupport()); - Assertions.assertEquals("ixzbinjeputtmryw", model.properties().logging().storageAccount().accountName()); - Assertions.assertEquals("zoqftiyqzrnkcqvy", model.properties().logging().storageAccount().containerName()); - Assertions.assertEquals(1062459417, model.properties().scalingProperties().capacity()); - Assertions.assertEquals("sicohoqqnwvlry", model.properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(1416786049, model.properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(240696862, model.properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("lyaxuc", model.properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("qszf", model.properties().userProfile().preferredEmail()); - Assertions.assertEquals(ActivationState.DISABLED, - model.properties().nginxAppProtect().webApplicationFirewallSettings().activationState()); - Assertions.assertEquals("utttxfvjrbirp", model.sku().name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentInner model = new NginxDeploymentInner().withLocation("epcyvahfnlj") - .withTags(mapOf("ljyoxgvcltb", "xjvuujqgidokg")) - .withIdentity(new IdentityProperties().withType(IdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("shxmzsbbzoggigrx", new UserIdentityProperties(), "enkouknvudw", - new UserIdentityProperties()))) - .withProperties(new NginxDeploymentProperties() - .withNetworkProfile(new NginxNetworkProfile() - .withFrontEndIpConfiguration(new NginxFrontendIpConfiguration() - .withPublicIpAddresses(Arrays.asList(new NginxPublicIpAddress().withId("egukgjnpiucg"), - new NginxPublicIpAddress().withId("evqzntypmrbp"), new NginxPublicIpAddress().withId("c"), - new NginxPublicIpAddress().withId("qjsdpydnfyhxdeo"))) - .withPrivateIpAddresses(Arrays.asList(new NginxPrivateIpAddress().withPrivateIpAddress("cwif") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.STATIC) - .withSubnetId("gzfbishcbk")))) - .withNetworkInterfaceConfiguration( - new NginxNetworkInterfaceConfiguration().withSubnetId("deyeamdphagalpbu"))) - .withEnableDiagnosticsSupport(true) - .withLogging( - new NginxLogging().withStorageAccount(new NginxStorageAccount().withAccountName("ixzbinjeputtmryw") - .withContainerName("zoqftiyqzrnkcqvy"))) - .withScalingProperties(new NginxDeploymentScalingProperties().withCapacity(1062459417) - .withProfiles(Arrays.asList( - new ScaleProfile().withName("sicohoqqnwvlry") - .withCapacity(new ScaleProfileCapacity().withMin(1416786049).withMax(240696862)), - new ScaleProfile().withName("hheunmmqhgyx") - .withCapacity(new ScaleProfileCapacity().withMin(1391467998).withMax(1953555312)), - new ScaleProfile().withName("noc") - .withCapacity(new ScaleProfileCapacity().withMin(1493031892).withMax(820959200))))) - .withAutoUpgradeProfile(new AutoUpgradeProfile().withUpgradeChannel("lyaxuc")) - .withUserProfile(new NginxDeploymentUserProfile().withPreferredEmail("qszf")) - .withNginxAppProtect(new NginxDeploymentPropertiesNginxAppProtect().withWebApplicationFirewallSettings( - new WebApplicationFirewallSettings().withActivationState(ActivationState.DISABLED)))) - .withSku(new ResourceSku().withName("utttxfvjrbirp")); - model = BinaryData.fromObject(model).toObject(NginxDeploymentInner.class); - Assertions.assertEquals("epcyvahfnlj", model.location()); - Assertions.assertEquals("xjvuujqgidokg", model.tags().get("ljyoxgvcltb")); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("egukgjnpiucg", - model.properties().networkProfile().frontEndIpConfiguration().publicIpAddresses().get(0).id()); - Assertions.assertEquals("cwif", - model.properties() - .networkProfile() - .frontEndIpConfiguration() - .privateIpAddresses() - .get(0) - .privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.STATIC, - model.properties() - .networkProfile() - .frontEndIpConfiguration() - .privateIpAddresses() - .get(0) - .privateIpAllocationMethod()); - Assertions.assertEquals("gzfbishcbk", - model.properties().networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).subnetId()); - Assertions.assertEquals("deyeamdphagalpbu", - model.properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(true, model.properties().enableDiagnosticsSupport()); - Assertions.assertEquals("ixzbinjeputtmryw", model.properties().logging().storageAccount().accountName()); - Assertions.assertEquals("zoqftiyqzrnkcqvy", model.properties().logging().storageAccount().containerName()); - Assertions.assertEquals(1062459417, model.properties().scalingProperties().capacity()); - Assertions.assertEquals("sicohoqqnwvlry", model.properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(1416786049, model.properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(240696862, model.properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("lyaxuc", model.properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("qszf", model.properties().userProfile().preferredEmail()); - Assertions.assertEquals(ActivationState.DISABLED, - model.properties().nginxAppProtect().webApplicationFirewallSettings().activationState()); - Assertions.assertEquals("utttxfvjrbirp", 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 d3189705d238..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentListResponseTests.java +++ /dev/null @@ -1,260 +0,0 @@ -// 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.ActivationState; -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.NginxDeploymentPropertiesNginxAppProtect; -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 com.azure.resourcemanager.nginx.models.WebApplicationFirewallSettings; -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\":\"zfq\",\"tenantId\":\"huaoppp\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"rmfqjhhkxbpvj\":{\"principalId\":\"lzdahzxctobgbkdm\",\"clientId\":\"zpostmgrcfbu\"},\"wbxqzvszjfau\":{\"principalId\":\"jhxxjyn\",\"clientId\":\"divkrt\"},\"bhsfxob\":{\"principalId\":\"fdxxivetvtcqaqtd\",\"clientId\":\"mcbxvwvxysl\"}}},\"properties\":{\"provisioningState\":\"Updating\",\"nginxVersion\":\"lmpewwwfbkr\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{},{},{}],\"privateIPAddresses\":[{},{},{},{}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"ohxcrsbfova\"}},\"ipAddress\":\"ruvw\",\"enableDiagnosticsSupport\":true,\"logging\":{\"storageAccount\":{\"accountName\":\"ubcgjbirxb\",\"containerName\":\"bsrfbj\"}},\"scalingProperties\":{\"capacity\":157171235,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"otftpvjzbexilz\",\"capacity\":{\"min\":1948356330,\"max\":1551412306}},{\"name\":\"qqnvwpmq\",\"capacity\":{\"min\":1787439694,\"max\":1628769376}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"oujmkcjhwqytj\"},\"userProfile\":{\"preferredEmail\":\"n\"},\"nginxAppProtect\":{\"webApplicationFirewallSettings\":{\"activationState\":\"Disabled\"},\"webApplicationFirewallStatus\":{\"attackSignaturesPackage\":{\"version\":\"rjerv\",\"revisionDatetime\":\"2021-10-08T09:31:49Z\"},\"botSignaturesPackage\":{\"version\":\"nqpeh\",\"revisionDatetime\":\"2021-05-26T12:17:52Z\"},\"threatCampaignsPackage\":{\"version\":\"oygmift\",\"revisionDatetime\":\"2021-11-26T05:12:43Z\"},\"componentVersions\":{\"wafEngineVersion\":\"d\",\"wafNginxVersion\":\"dslgnayqigynduh\"}}},\"dataplaneApiEndpoint\":\"hqlkthumaqo\"},\"sku\":{\"name\":\"gycdu\"},\"location\":\"r\",\"tags\":{\"aolps\":\"cym\",\"dnbbglzps\":\"lqlfm\",\"adbzmnvdfznud\":\"iydmcwyhzdxs\",\"xzb\":\"od\"},\"id\":\"cblylpstdbhhxsr\",\"name\":\"dzu\",\"type\":\"erscdntne\"},{\"identity\":{\"principalId\":\"wjmy\",\"tenantId\":\"dsslswt\",\"type\":\"SystemAssigned, UserAssigned\",\"userAssignedIdentities\":{\"hhszh\":{\"principalId\":\"fzp\",\"clientId\":\"semwabnet\"}}},\"properties\":{\"provisioningState\":\"Succeeded\",\"nginxVersion\":\"wiwubm\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{},{},{},{}],\"privateIPAddresses\":[{},{},{},{}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"wwtppj\"}},\"ipAddress\":\"cxogaokonzm\",\"enableDiagnosticsSupport\":true,\"logging\":{\"storageAccount\":{\"accountName\":\"kqze\",\"containerName\":\"kdltfzxmhhvhg\"}},\"scalingProperties\":{\"capacity\":1748485864,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"wobdagxtibqdx\",\"capacity\":{\"min\":1020209011,\"max\":709641319}},{\"name\":\"akbogqxndlkzgxh\",\"capacity\":{\"min\":975056149,\"max\":1924988063}},{\"name\":\"plbpodxun\",\"capacity\":{\"min\":1102783029,\"max\":405149242}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"xmubyyntwlrbq\"},\"userProfile\":{\"preferredEmail\":\"ievseotgqrllt\"},\"nginxAppProtect\":{\"webApplicationFirewallSettings\":{\"activationState\":\"Disabled\"},\"webApplicationFirewallStatus\":{\"attackSignaturesPackage\":{\"version\":\"wzizxbmpgcjefuzm\",\"revisionDatetime\":\"2021-06-29T22:40:26Z\"},\"botSignaturesPackage\":{\"version\":\"bttdumorppxe\",\"revisionDatetime\":\"2021-08-17T23:26:57Z\"},\"threatCampaignsPackage\":{\"version\":\"zbtbhj\",\"revisionDatetime\":\"2021-08-30T17:38:27Z\"},\"componentVersions\":{\"wafEngineVersion\":\"kfgohdneue\",\"wafNginxVersion\":\"fphsdyhtozfikdow\"}}},\"dataplaneApiEndpoint\":\"uuvxz\"},\"sku\":{\"name\":\"lvithhqzonosgg\"},\"location\":\"c\",\"tags\":{\"iiswacffgdkzze\":\"wdsjnkalju\",\"pfuflrw\":\"kfvhqcrailvpn\"},\"id\":\"mh\",\"name\":\"lxyjr\",\"type\":\"sag\"},{\"identity\":{\"principalId\":\"nihgwqapnedg\",\"tenantId\":\"cvkcvqvpkeqdcv\",\"type\":\"None\",\"userAssignedIdentities\":{\"dldwmgxc\":{\"principalId\":\"dsotbobzd\",\"clientId\":\"cjwvn\"}}},\"properties\":{\"provisioningState\":\"Updating\",\"nginxVersion\":\"mutwuoe\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{},{},{}],\"privateIPAddresses\":[{},{},{}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"yqsluic\"}},\"ipAddress\":\"ggkzzlvmbmpa\",\"enableDiagnosticsSupport\":true,\"logging\":{\"storageAccount\":{\"accountName\":\"uefywsbpfvmwy\",\"containerName\":\"fouyf\"}},\"scalingProperties\":{\"capacity\":1378791233,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"wiyzvqtmnubexkp\",\"capacity\":{\"min\":1583015875,\"max\":1254452597}},{\"name\":\"mond\",\"capacity\":{\"min\":1929847054,\"max\":1007666972}},{\"name\":\"uxvypomgkopkwh\",\"capacity\":{\"min\":664596221,\"max\":10985850}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"ajqgxy\"},\"userProfile\":{\"preferredEmail\":\"cmbqfqvmk\"},\"nginxAppProtect\":{\"webApplicationFirewallSettings\":{\"activationState\":\"Enabled\"},\"webApplicationFirewallStatus\":{\"attackSignaturesPackage\":{\"version\":\"vhelxprglyatdd\",\"revisionDatetime\":\"2021-09-28T08:18:40Z\"},\"botSignaturesPackage\":{\"version\":\"bcuejrjxgci\",\"revisionDatetime\":\"2021-08-15T14:27:38Z\"},\"threatCampaignsPackage\":{\"version\":\"rhos\",\"revisionDatetime\":\"2021-01-18T20:01:11Z\"},\"componentVersions\":{\"wafEngineVersion\":\"qrhzoymibmrqyib\",\"wafNginxVersion\":\"hwflu\"}}},\"dataplaneApiEndpoint\":\"dtmhrkwofyyvoqa\"},\"sku\":{\"name\":\"iexpbtgiwbwo\"},\"location\":\"washr\",\"tags\":{\"ulpiuj\":\"kcnqxwbpo\",\"obyu\":\"aasipqi\"},\"id\":\"erpqlpqwcciuqg\",\"name\":\"dbutauvfbtkuwhh\",\"type\":\"hykojoxafnndlpic\"},{\"identity\":{\"principalId\":\"ymkcdyhb\",\"tenantId\":\"kpw\",\"type\":\"SystemAssigned, UserAssigned\",\"userAssignedIdentities\":{\"aeneqnzarrwl\":{\"principalId\":\"vvqfovljxyws\",\"clientId\":\"syrsndsytgadgvra\"},\"iipfpubj\":{\"principalId\":\"uijfqk\",\"clientId\":\"e\"},\"ynl\":{\"principalId\":\"wwiftohqkvpuv\",\"clientId\":\"gplsaknynf\"}}},\"properties\":{\"provisioningState\":\"Updating\",\"nginxVersion\":\"pxodlqiyntorzih\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{},{},{}],\"privateIPAddresses\":[{}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"mslyzrpzbchckqqz\"}},\"ipAddress\":\"ox\",\"enableDiagnosticsSupport\":true,\"logging\":{\"storageAccount\":{\"accountName\":\"zynkedya\",\"containerName\":\"wyhqmibzyhwits\"}},\"scalingProperties\":{\"capacity\":1679951474,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"pcdpumnz\",\"capacity\":{\"min\":998287381,\"max\":944462660}},{\"name\":\"z\",\"capacity\":{\"min\":1443914942,\"max\":1417683929}},{\"name\":\"biknsorgjhxbld\",\"capacity\":{\"min\":1166597262,\"max\":706339919}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"rlkdmtncvokotl\"},\"userProfile\":{\"preferredEmail\":\"yhgsy\"},\"nginxAppProtect\":{\"webApplicationFirewallSettings\":{\"activationState\":\"Disabled\"},\"webApplicationFirewallStatus\":{\"attackSignaturesPackage\":{\"version\":\"tdtbnnhadooc\",\"revisionDatetime\":\"2021-05-16T20:34:23Z\"},\"botSignaturesPackage\":{\"version\":\"cikhnv\",\"revisionDatetime\":\"2021-10-11T09:13:27Z\"},\"threatCampaignsPackage\":{\"version\":\"qgxqquezikyw\",\"revisionDatetime\":\"2021-03-04T16:24:34Z\"},\"componentVersions\":{\"wafEngineVersion\":\"kallatmel\",\"wafNginxVersion\":\"uipiccjzk\"}}},\"dataplaneApiEndpoint\":\"v\"},\"sku\":{\"name\":\"vc\"},\"location\":\"y\",\"tags\":{\"drd\":\"rnxxmueed\",\"alm\":\"stkwqqtch\",\"gdv\":\"mtdaa\"},\"id\":\"vgpiohgwxrt\",\"name\":\"udxepxgyqagv\",\"type\":\"vmnpkukghimdblx\"}],\"nextLink\":\"imfnjhfjx\"}") - .toObject(NginxDeploymentListResponse.class); - Assertions.assertEquals("r", model.value().get(0).location()); - Assertions.assertEquals("cym", model.value().get(0).tags().get("aolps")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("ohxcrsbfova", - model.value().get(0).properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(true, model.value().get(0).properties().enableDiagnosticsSupport()); - Assertions.assertEquals("ubcgjbirxb", - model.value().get(0).properties().logging().storageAccount().accountName()); - Assertions.assertEquals("bsrfbj", model.value().get(0).properties().logging().storageAccount().containerName()); - Assertions.assertEquals(157171235, model.value().get(0).properties().scalingProperties().capacity()); - Assertions.assertEquals("otftpvjzbexilz", - model.value().get(0).properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(1948356330, - model.value().get(0).properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(1551412306, - model.value().get(0).properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("oujmkcjhwqytj", - model.value().get(0).properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("n", model.value().get(0).properties().userProfile().preferredEmail()); - Assertions.assertEquals(ActivationState.DISABLED, - model.value().get(0).properties().nginxAppProtect().webApplicationFirewallSettings().activationState()); - Assertions.assertEquals("gycdu", model.value().get(0).sku().name()); - Assertions.assertEquals("imfnjhfjx", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentListResponse model - = new NginxDeploymentListResponse() - .withValue(Arrays.asList( - new NginxDeploymentInner().withLocation("r") - .withTags( - mapOf("aolps", "cym", "dnbbglzps", "lqlfm", "adbzmnvdfznud", "iydmcwyhzdxs", "xzb", "od")) - .withIdentity(new IdentityProperties() - .withType(IdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("rmfqjhhkxbpvj", new UserIdentityProperties(), - "wbxqzvszjfau", new UserIdentityProperties(), "bhsfxob", new UserIdentityProperties()))) - .withProperties(new NginxDeploymentProperties() - .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("ohxcrsbfova"))) - .withEnableDiagnosticsSupport(true) - .withLogging(new NginxLogging().withStorageAccount( - new NginxStorageAccount().withAccountName("ubcgjbirxb").withContainerName("bsrfbj"))) - .withScalingProperties( - new NginxDeploymentScalingProperties().withCapacity(157171235) - .withProfiles( - Arrays - .asList( - new ScaleProfile().withName("otftpvjzbexilz") - .withCapacity(new ScaleProfileCapacity().withMin(1948356330) - .withMax(1551412306)), - new ScaleProfile() - .withName("qqnvwpmq") - .withCapacity(new ScaleProfileCapacity() - .withMin(1787439694) - .withMax(1628769376))))) - .withAutoUpgradeProfile(new AutoUpgradeProfile().withUpgradeChannel("oujmkcjhwqytj")) - .withUserProfile(new NginxDeploymentUserProfile().withPreferredEmail("n")) - .withNginxAppProtect(new NginxDeploymentPropertiesNginxAppProtect() - .withWebApplicationFirewallSettings(new WebApplicationFirewallSettings() - .withActivationState(ActivationState.DISABLED)))) - .withSku(new ResourceSku().withName("gycdu")), - new NginxDeploymentInner().withLocation("c") - .withTags(mapOf("iiswacffgdkzze", "wdsjnkalju", "pfuflrw", "kfvhqcrailvpn")) - .withIdentity(new IdentityProperties() - .withType(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("hhszh", new UserIdentityProperties()))) - .withProperties(new NginxDeploymentProperties() - .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("wwtppj"))) - .withEnableDiagnosticsSupport(true) - .withLogging(new NginxLogging().withStorageAccount( - new NginxStorageAccount().withAccountName("kqze").withContainerName("kdltfzxmhhvhg"))) - .withScalingProperties( - new NginxDeploymentScalingProperties().withCapacity(1748485864) - .withProfiles( - Arrays - .asList( - new ScaleProfile().withName("wobdagxtibqdx") - .withCapacity(new ScaleProfileCapacity().withMin(1020209011) - .withMax(709641319)), - new ScaleProfile().withName("akbogqxndlkzgxh") - .withCapacity(new ScaleProfileCapacity().withMin(975056149) - .withMax(1924988063)), - new ScaleProfile().withName("plbpodxun") - .withCapacity(new ScaleProfileCapacity().withMin(1102783029) - .withMax(405149242))))) - .withAutoUpgradeProfile(new AutoUpgradeProfile().withUpgradeChannel("xmubyyntwlrbq")) - .withUserProfile(new NginxDeploymentUserProfile().withPreferredEmail("ievseotgqrllt")) - .withNginxAppProtect(new NginxDeploymentPropertiesNginxAppProtect() - .withWebApplicationFirewallSettings(new WebApplicationFirewallSettings() - .withActivationState(ActivationState.DISABLED)))) - .withSku(new ResourceSku().withName("lvithhqzonosgg")), - new NginxDeploymentInner().withLocation("washr") - .withTags(mapOf("ulpiuj", "kcnqxwbpo", "obyu", "aasipqi")) - .withIdentity(new IdentityProperties().withType(IdentityType.NONE) - .withUserAssignedIdentities(mapOf("dldwmgxc", new UserIdentityProperties()))) - .withProperties(new NginxDeploymentProperties() - .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("yqsluic"))) - .withEnableDiagnosticsSupport(true) - .withLogging(new NginxLogging().withStorageAccount( - new NginxStorageAccount().withAccountName("uefywsbpfvmwy").withContainerName("fouyf"))) - .withScalingProperties( - new NginxDeploymentScalingProperties().withCapacity(1378791233) - .withProfiles( - Arrays - .asList( - new ScaleProfile().withName("wiyzvqtmnubexkp") - .withCapacity(new ScaleProfileCapacity().withMin(1583015875) - .withMax(1254452597)), - new ScaleProfile().withName("mond") - .withCapacity(new ScaleProfileCapacity().withMin(1929847054) - .withMax(1007666972)), - new ScaleProfile().withName("uxvypomgkopkwh") - .withCapacity(new ScaleProfileCapacity().withMin(664596221) - .withMax(10985850))))) - .withAutoUpgradeProfile(new AutoUpgradeProfile().withUpgradeChannel("ajqgxy")) - .withUserProfile(new NginxDeploymentUserProfile().withPreferredEmail("cmbqfqvmk")) - .withNginxAppProtect( - new NginxDeploymentPropertiesNginxAppProtect().withWebApplicationFirewallSettings( - new WebApplicationFirewallSettings().withActivationState(ActivationState.ENABLED)))) - .withSku(new ResourceSku().withName("iexpbtgiwbwo")), - new NginxDeploymentInner().withLocation("y") - .withTags(mapOf("drd", "rnxxmueed", "alm", "stkwqqtch", "gdv", "mtdaa")) - .withIdentity(new IdentityProperties().withType(IdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("aeneqnzarrwl", new UserIdentityProperties(), "iipfpubj", - new UserIdentityProperties(), "ynl", new UserIdentityProperties()))) - .withProperties(new NginxDeploymentProperties() - .withNetworkProfile(new NginxNetworkProfile() - .withFrontEndIpConfiguration(new NginxFrontendIpConfiguration() - .withPublicIpAddresses(Arrays.asList(new NginxPublicIpAddress(), - new NginxPublicIpAddress(), new NginxPublicIpAddress())) - .withPrivateIpAddresses(Arrays.asList(new NginxPrivateIpAddress()))) - .withNetworkInterfaceConfiguration( - new NginxNetworkInterfaceConfiguration().withSubnetId("mslyzrpzbchckqqz"))) - .withEnableDiagnosticsSupport(true) - .withLogging(new NginxLogging() - .withStorageAccount(new NginxStorageAccount().withAccountName("zynkedya") - .withContainerName("wyhqmibzyhwits"))) - .withScalingProperties( - new NginxDeploymentScalingProperties().withCapacity(1679951474) - .withProfiles( - Arrays - .asList( - new ScaleProfile().withName("pcdpumnz") - .withCapacity(new ScaleProfileCapacity().withMin(998287381) - .withMax(944462660)), - new ScaleProfile().withName("z") - .withCapacity(new ScaleProfileCapacity().withMin(1443914942) - .withMax(1417683929)), - new ScaleProfile().withName("biknsorgjhxbld") - .withCapacity(new ScaleProfileCapacity().withMin(1166597262) - .withMax(706339919))))) - .withAutoUpgradeProfile(new AutoUpgradeProfile().withUpgradeChannel("rlkdmtncvokotl")) - .withUserProfile(new NginxDeploymentUserProfile().withPreferredEmail("yhgsy")) - .withNginxAppProtect(new NginxDeploymentPropertiesNginxAppProtect() - .withWebApplicationFirewallSettings(new WebApplicationFirewallSettings() - .withActivationState(ActivationState.DISABLED)))) - .withSku(new ResourceSku().withName("vc")))) - .withNextLink("imfnjhfjx"); - model = BinaryData.fromObject(model).toObject(NginxDeploymentListResponse.class); - Assertions.assertEquals("r", model.value().get(0).location()); - Assertions.assertEquals("cym", model.value().get(0).tags().get("aolps")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - Assertions.assertEquals("ohxcrsbfova", - model.value().get(0).properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(true, model.value().get(0).properties().enableDiagnosticsSupport()); - Assertions.assertEquals("ubcgjbirxb", - model.value().get(0).properties().logging().storageAccount().accountName()); - Assertions.assertEquals("bsrfbj", model.value().get(0).properties().logging().storageAccount().containerName()); - Assertions.assertEquals(157171235, model.value().get(0).properties().scalingProperties().capacity()); - Assertions.assertEquals("otftpvjzbexilz", - model.value().get(0).properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(1948356330, - model.value().get(0).properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(1551412306, - model.value().get(0).properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("oujmkcjhwqytj", - model.value().get(0).properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("n", model.value().get(0).properties().userProfile().preferredEmail()); - Assertions.assertEquals(ActivationState.DISABLED, - model.value().get(0).properties().nginxAppProtect().webApplicationFirewallSettings().activationState()); - Assertions.assertEquals("gycdu", model.value().get(0).sku().name()); - Assertions.assertEquals("imfnjhfjx", 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/NginxDeploymentPropertiesNginxAppProtectTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentPropertiesNginxAppProtectTests.java deleted file mode 100644 index be1dce89d066..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentPropertiesNginxAppProtectTests.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.ActivationState; -import com.azure.resourcemanager.nginx.models.NginxDeploymentPropertiesNginxAppProtect; -import com.azure.resourcemanager.nginx.models.WebApplicationFirewallSettings; -import org.junit.jupiter.api.Assertions; - -public final class NginxDeploymentPropertiesNginxAppProtectTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxDeploymentPropertiesNginxAppProtect model = BinaryData.fromString( - "{\"webApplicationFirewallSettings\":{\"activationState\":\"Enabled\"},\"webApplicationFirewallStatus\":{\"attackSignaturesPackage\":{\"version\":\"pvfadmwsrcr\",\"revisionDatetime\":\"2021-01-28T15:16:12Z\"},\"botSignaturesPackage\":{\"version\":\"pv\",\"revisionDatetime\":\"2021-07-02T00:35:52Z\"},\"threatCampaignsPackage\":{\"version\":\"zlfmisgwbnbbeld\",\"revisionDatetime\":\"2021-03-30T10:55:40Z\"},\"componentVersions\":{\"wafEngineVersion\":\"zbaliourqha\",\"wafNginxVersion\":\"auhashsfwx\"}}}") - .toObject(NginxDeploymentPropertiesNginxAppProtect.class); - Assertions.assertEquals(ActivationState.ENABLED, model.webApplicationFirewallSettings().activationState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentPropertiesNginxAppProtect model - = new NginxDeploymentPropertiesNginxAppProtect().withWebApplicationFirewallSettings( - new WebApplicationFirewallSettings().withActivationState(ActivationState.ENABLED)); - model = BinaryData.fromObject(model).toObject(NginxDeploymentPropertiesNginxAppProtect.class); - Assertions.assertEquals(ActivationState.ENABLED, model.webApplicationFirewallSettings().activationState()); - } -} 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 35bf7fc06233..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentPropertiesTests.java +++ /dev/null @@ -1,106 +0,0 @@ -// 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.ActivationState; -import com.azure.resourcemanager.nginx.models.AutoUpgradeProfile; -import com.azure.resourcemanager.nginx.models.NginxDeploymentProperties; -import com.azure.resourcemanager.nginx.models.NginxDeploymentPropertiesNginxAppProtect; -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 com.azure.resourcemanager.nginx.models.WebApplicationFirewallSettings; -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\":\"Succeeded\",\"nginxVersion\":\"yn\",\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{\"id\":\"yxczfclh\"},{\"id\":\"xdbabphlwr\"}],\"privateIPAddresses\":[{\"privateIPAddress\":\"tsthsucocm\",\"privateIPAllocationMethod\":\"Dynamic\",\"subnetId\":\"zt\"}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"wwrq\"}},\"ipAddress\":\"edckzywbiexzfey\",\"enableDiagnosticsSupport\":false,\"logging\":{\"storageAccount\":{\"accountName\":\"xujwbhqwalmuzyo\",\"containerName\":\"epdkzja\"}},\"scalingProperties\":{\"capacity\":1987726952,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"d\",\"capacity\":{\"min\":1400002261,\"max\":1879785159}},{\"name\":\"v\",\"capacity\":{\"min\":1605187994,\"max\":1767161087}},{\"name\":\"iwdjswztsdbpgn\",\"capacity\":{\"min\":1127167490,\"max\":862771413}},{\"name\":\"x\",\"capacity\":{\"min\":1275335894,\"max\":999605731}}]}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"bzpfzab\"},\"userProfile\":{\"preferredEmail\":\"uhxwtctyqiklbbov\"},\"nginxAppProtect\":{\"webApplicationFirewallSettings\":{\"activationState\":\"Disabled\"},\"webApplicationFirewallStatus\":{\"attackSignaturesPackage\":{\"version\":\"vgyuguos\",\"revisionDatetime\":\"2021-01-13T18:03:39Z\"},\"botSignaturesPackage\":{\"version\":\"fssxqukkfplg\",\"revisionDatetime\":\"2021-01-07T21:55:14Z\"},\"threatCampaignsPackage\":{\"version\":\"xnkjzkdesl\",\"revisionDatetime\":\"2021-03-03T09:58:01Z\"},\"componentVersions\":{\"wafEngineVersion\":\"opwi\",\"wafNginxVersion\":\"ighxpk\"}}},\"dataplaneApiEndpoint\":\"zb\"}") - .toObject(NginxDeploymentProperties.class); - Assertions.assertEquals("yxczfclh", - model.networkProfile().frontEndIpConfiguration().publicIpAddresses().get(0).id()); - Assertions.assertEquals("tsthsucocm", - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.DYNAMIC, - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("zt", - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).subnetId()); - Assertions.assertEquals("wwrq", model.networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(false, model.enableDiagnosticsSupport()); - Assertions.assertEquals("xujwbhqwalmuzyo", model.logging().storageAccount().accountName()); - Assertions.assertEquals("epdkzja", model.logging().storageAccount().containerName()); - Assertions.assertEquals(1987726952, model.scalingProperties().capacity()); - Assertions.assertEquals("d", model.scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(1400002261, model.scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(1879785159, model.scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("bzpfzab", model.autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("uhxwtctyqiklbbov", model.userProfile().preferredEmail()); - Assertions.assertEquals(ActivationState.DISABLED, - model.nginxAppProtect().webApplicationFirewallSettings().activationState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentProperties model = new NginxDeploymentProperties() - .withNetworkProfile(new NginxNetworkProfile() - .withFrontEndIpConfiguration(new NginxFrontendIpConfiguration() - .withPublicIpAddresses(Arrays.asList(new NginxPublicIpAddress().withId("yxczfclh"), - new NginxPublicIpAddress().withId("xdbabphlwr"))) - .withPrivateIpAddresses(Arrays.asList(new NginxPrivateIpAddress().withPrivateIpAddress("tsthsucocm") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.DYNAMIC) - .withSubnetId("zt")))) - .withNetworkInterfaceConfiguration(new NginxNetworkInterfaceConfiguration().withSubnetId("wwrq"))) - .withEnableDiagnosticsSupport(false) - .withLogging(new NginxLogging().withStorageAccount( - new NginxStorageAccount().withAccountName("xujwbhqwalmuzyo").withContainerName("epdkzja"))) - .withScalingProperties(new NginxDeploymentScalingProperties().withCapacity(1987726952) - .withProfiles(Arrays.asList( - new ScaleProfile().withName("d") - .withCapacity(new ScaleProfileCapacity().withMin(1400002261).withMax(1879785159)), - new ScaleProfile().withName("v") - .withCapacity(new ScaleProfileCapacity().withMin(1605187994).withMax(1767161087)), - new ScaleProfile().withName("iwdjswztsdbpgn") - .withCapacity(new ScaleProfileCapacity().withMin(1127167490).withMax(862771413)), - new ScaleProfile().withName("x") - .withCapacity(new ScaleProfileCapacity().withMin(1275335894).withMax(999605731))))) - .withAutoUpgradeProfile(new AutoUpgradeProfile().withUpgradeChannel("bzpfzab")) - .withUserProfile(new NginxDeploymentUserProfile().withPreferredEmail("uhxwtctyqiklbbov")) - .withNginxAppProtect(new NginxDeploymentPropertiesNginxAppProtect().withWebApplicationFirewallSettings( - new WebApplicationFirewallSettings().withActivationState(ActivationState.DISABLED))); - model = BinaryData.fromObject(model).toObject(NginxDeploymentProperties.class); - Assertions.assertEquals("yxczfclh", - model.networkProfile().frontEndIpConfiguration().publicIpAddresses().get(0).id()); - Assertions.assertEquals("tsthsucocm", - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.DYNAMIC, - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("zt", - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).subnetId()); - Assertions.assertEquals("wwrq", model.networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals(false, model.enableDiagnosticsSupport()); - Assertions.assertEquals("xujwbhqwalmuzyo", model.logging().storageAccount().accountName()); - Assertions.assertEquals("epdkzja", model.logging().storageAccount().containerName()); - Assertions.assertEquals(1987726952, model.scalingProperties().capacity()); - Assertions.assertEquals("d", model.scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(1400002261, model.scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(1879785159, model.scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("bzpfzab", model.autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals("uhxwtctyqiklbbov", model.userProfile().preferredEmail()); - Assertions.assertEquals(ActivationState.DISABLED, - model.nginxAppProtect().webApplicationFirewallSettings().activationState()); - } -} 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 6977563c3868..000000000000 --- 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\":\"mehhseyvjusrtsl\",\"capacity\":{\"min\":1593935423,\"max\":1948338560}},{\"name\":\"kdeemaofmxagkvtm\",\"capacity\":{\"min\":696697077,\"max\":2048736715}}]}") - .toObject(NginxDeploymentScalingPropertiesAutoScaleSettings.class); - Assertions.assertEquals("mehhseyvjusrtsl", model.profiles().get(0).name()); - Assertions.assertEquals(1593935423, model.profiles().get(0).capacity().min()); - Assertions.assertEquals(1948338560, 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("mehhseyvjusrtsl") - .withCapacity(new ScaleProfileCapacity().withMin(1593935423).withMax(1948338560)), - new ScaleProfile().withName("kdeemaofmxagkvtm") - .withCapacity(new ScaleProfileCapacity().withMin(696697077).withMax(2048736715)))); - model = BinaryData.fromObject(model).toObject(NginxDeploymentScalingPropertiesAutoScaleSettings.class); - Assertions.assertEquals("mehhseyvjusrtsl", model.profiles().get(0).name()); - Assertions.assertEquals(1593935423, model.profiles().get(0).capacity().min()); - Assertions.assertEquals(1948338560, 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 789b48564943..000000000000 --- 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\":1613065996,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"oyrxvwfudwpzntxh\",\"capacity\":{\"min\":1710146471,\"max\":328563559}},{\"name\":\"lrqjbhckfr\",\"capacity\":{\"min\":1523615779,\"max\":2044526914}},{\"name\":\"xsbkyvpyca\",\"capacity\":{\"min\":427278595,\"max\":106855620}},{\"name\":\"bpzkafkuwbc\",\"capacity\":{\"min\":1514524475,\"max\":946722582}}]}}") - .toObject(NginxDeploymentScalingProperties.class); - Assertions.assertEquals(1613065996, model.capacity()); - Assertions.assertEquals("oyrxvwfudwpzntxh", model.profiles().get(0).name()); - Assertions.assertEquals(1710146471, model.profiles().get(0).capacity().min()); - Assertions.assertEquals(328563559, model.profiles().get(0).capacity().max()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentScalingProperties model = new NginxDeploymentScalingProperties().withCapacity(1613065996) - .withProfiles(Arrays.asList( - new ScaleProfile().withName("oyrxvwfudwpzntxh") - .withCapacity(new ScaleProfileCapacity().withMin(1710146471).withMax(328563559)), - new ScaleProfile().withName("lrqjbhckfr") - .withCapacity(new ScaleProfileCapacity().withMin(1523615779).withMax(2044526914)), - new ScaleProfile().withName("xsbkyvpyca") - .withCapacity(new ScaleProfileCapacity().withMin(427278595).withMax(106855620)), - new ScaleProfile().withName("bpzkafkuwbc") - .withCapacity(new ScaleProfileCapacity().withMin(1514524475).withMax(946722582)))); - model = BinaryData.fromObject(model).toObject(NginxDeploymentScalingProperties.class); - Assertions.assertEquals(1613065996, model.capacity()); - Assertions.assertEquals("oyrxvwfudwpzntxh", model.profiles().get(0).name()); - Assertions.assertEquals(1710146471, model.profiles().get(0).capacity().min()); - Assertions.assertEquals(328563559, 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 b673488d24cd..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentUpdateParametersTests.java +++ /dev/null @@ -1,174 +0,0 @@ -// 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.ActivationState; -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.NginxDeploymentUpdatePropertiesNginxAppProtect; -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 com.azure.resourcemanager.nginx.models.WebApplicationFirewallSettings; -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\":\"btdhxujznbm\",\"tenantId\":\"wuwprzqlv\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"iplrbpbewtghfgb\":{\"principalId\":\"j\",\"clientId\":\"hfxobbcswsrtj\"}}},\"tags\":{\"gibtnm\":\"wxzvlvqhjkb\"},\"sku\":{\"name\":\"ebwwaloayqc\"},\"location\":\"rtzju\",\"properties\":{\"enableDiagnosticsSupport\":false,\"logging\":{\"storageAccount\":{\"accountName\":\"txon\",\"containerName\":\"ts\"}},\"scalingProperties\":{\"capacity\":1151721891,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"wxqpsrknftguvri\",\"capacity\":{\"min\":2067966148,\"max\":346256186}},{\"name\":\"rwmdyvxqtay\",\"capacity\":{\"min\":1285325454,\"max\":357638492}}]}},\"userProfile\":{\"preferredEmail\":\"oyq\"},\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{\"id\":\"qibycnojvknm\"},{\"id\":\"qsgzvahapj\"},{\"id\":\"hpvgqz\"}],\"privateIPAddresses\":[{\"privateIPAddress\":\"xdjzlmwlxk\",\"privateIPAllocationMethod\":\"Dynamic\",\"subnetId\":\"hzovawjvzunlut\"},{\"privateIPAddress\":\"n\",\"privateIPAllocationMethod\":\"Static\",\"subnetId\":\"i\"},{\"privateIPAddress\":\"ilpjzuaejxdult\",\"privateIPAllocationMethod\":\"Dynamic\",\"subnetId\":\"btdzumveekg\"}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"zuhkfpbsjyof\"}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"luu\"},\"nginxAppProtect\":{\"webApplicationFirewallSettings\":{\"activationState\":\"Disabled\"}}}}") - .toObject(NginxDeploymentUpdateParameters.class); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("wxzvlvqhjkb", model.tags().get("gibtnm")); - Assertions.assertEquals("ebwwaloayqc", model.sku().name()); - Assertions.assertEquals("rtzju", model.location()); - Assertions.assertEquals(false, model.properties().enableDiagnosticsSupport()); - Assertions.assertEquals("txon", model.properties().logging().storageAccount().accountName()); - Assertions.assertEquals("ts", model.properties().logging().storageAccount().containerName()); - Assertions.assertEquals(1151721891, model.properties().scalingProperties().capacity()); - Assertions.assertEquals("wxqpsrknftguvri", model.properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(2067966148, model.properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(346256186, model.properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("oyq", model.properties().userProfile().preferredEmail()); - Assertions.assertEquals("qibycnojvknm", - model.properties().networkProfile().frontEndIpConfiguration().publicIpAddresses().get(0).id()); - Assertions.assertEquals("xdjzlmwlxk", - model.properties() - .networkProfile() - .frontEndIpConfiguration() - .privateIpAddresses() - .get(0) - .privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.DYNAMIC, - model.properties() - .networkProfile() - .frontEndIpConfiguration() - .privateIpAddresses() - .get(0) - .privateIpAllocationMethod()); - Assertions.assertEquals("hzovawjvzunlut", - model.properties().networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).subnetId()); - Assertions.assertEquals("zuhkfpbsjyof", - model.properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals("luu", model.properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals(ActivationState.DISABLED, - model.properties().nginxAppProtect().webApplicationFirewallSettings().activationState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentUpdateParameters model - = new NginxDeploymentUpdateParameters() - .withIdentity(new IdentityProperties().withType(IdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("iplrbpbewtghfgb", new UserIdentityProperties()))) - .withTags(mapOf("gibtnm", "wxzvlvqhjkb")) - .withSku(new ResourceSku().withName("ebwwaloayqc")) - .withLocation("rtzju") - .withProperties( - new NginxDeploymentUpdateProperties().withEnableDiagnosticsSupport(false) - .withLogging(new NginxLogging().withStorageAccount( - new NginxStorageAccount().withAccountName("txon").withContainerName("ts"))) - .withScalingProperties(new NginxDeploymentScalingProperties().withCapacity(1151721891) - .withProfiles(Arrays.asList(new ScaleProfile().withName("wxqpsrknftguvri") - .withCapacity(new ScaleProfileCapacity().withMin(2067966148).withMax(346256186)), - new ScaleProfile().withName("rwmdyvxqtay") - .withCapacity(new ScaleProfileCapacity().withMin(1285325454).withMax(357638492))))) - .withUserProfile(new NginxDeploymentUserProfile().withPreferredEmail("oyq")) - .withNetworkProfile( - new NginxNetworkProfile() - .withFrontEndIpConfiguration( - new NginxFrontendIpConfiguration() - .withPublicIpAddresses( - Arrays.asList(new NginxPublicIpAddress().withId("qibycnojvknm"), - new NginxPublicIpAddress().withId("qsgzvahapj"), - new NginxPublicIpAddress().withId("hpvgqz"))) - .withPrivateIpAddresses( - Arrays.asList( - new NginxPrivateIpAddress().withPrivateIpAddress("xdjzlmwlxk") - .withPrivateIpAllocationMethod( - NginxPrivateIpAllocationMethod.DYNAMIC) - .withSubnetId("hzovawjvzunlut"), - new NginxPrivateIpAddress().withPrivateIpAddress("n") - .withPrivateIpAllocationMethod( - NginxPrivateIpAllocationMethod.STATIC) - .withSubnetId("i"), - new NginxPrivateIpAddress().withPrivateIpAddress("ilpjzuaejxdult") - .withPrivateIpAllocationMethod( - NginxPrivateIpAllocationMethod.DYNAMIC) - .withSubnetId("btdzumveekg")))) - .withNetworkInterfaceConfiguration( - new NginxNetworkInterfaceConfiguration().withSubnetId("zuhkfpbsjyof"))) - .withAutoUpgradeProfile(new AutoUpgradeProfile().withUpgradeChannel("luu")) - .withNginxAppProtect( - new NginxDeploymentUpdatePropertiesNginxAppProtect().withWebApplicationFirewallSettings( - new WebApplicationFirewallSettings().withActivationState(ActivationState.DISABLED)))); - model = BinaryData.fromObject(model).toObject(NginxDeploymentUpdateParameters.class); - Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("wxzvlvqhjkb", model.tags().get("gibtnm")); - Assertions.assertEquals("ebwwaloayqc", model.sku().name()); - Assertions.assertEquals("rtzju", model.location()); - Assertions.assertEquals(false, model.properties().enableDiagnosticsSupport()); - Assertions.assertEquals("txon", model.properties().logging().storageAccount().accountName()); - Assertions.assertEquals("ts", model.properties().logging().storageAccount().containerName()); - Assertions.assertEquals(1151721891, model.properties().scalingProperties().capacity()); - Assertions.assertEquals("wxqpsrknftguvri", model.properties().scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(2067966148, model.properties().scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(346256186, model.properties().scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("oyq", model.properties().userProfile().preferredEmail()); - Assertions.assertEquals("qibycnojvknm", - model.properties().networkProfile().frontEndIpConfiguration().publicIpAddresses().get(0).id()); - Assertions.assertEquals("xdjzlmwlxk", - model.properties() - .networkProfile() - .frontEndIpConfiguration() - .privateIpAddresses() - .get(0) - .privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.DYNAMIC, - model.properties() - .networkProfile() - .frontEndIpConfiguration() - .privateIpAddresses() - .get(0) - .privateIpAllocationMethod()); - Assertions.assertEquals("hzovawjvzunlut", - model.properties().networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).subnetId()); - Assertions.assertEquals("zuhkfpbsjyof", - model.properties().networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals("luu", model.properties().autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals(ActivationState.DISABLED, - model.properties().nginxAppProtect().webApplicationFirewallSettings().activationState()); - } - - // 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/NginxDeploymentUpdatePropertiesNginxAppProtectTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentUpdatePropertiesNginxAppProtectTests.java deleted file mode 100644 index 6455f03af4ab..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentUpdatePropertiesNginxAppProtectTests.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.ActivationState; -import com.azure.resourcemanager.nginx.models.NginxDeploymentUpdatePropertiesNginxAppProtect; -import com.azure.resourcemanager.nginx.models.WebApplicationFirewallSettings; -import org.junit.jupiter.api.Assertions; - -public final class NginxDeploymentUpdatePropertiesNginxAppProtectTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NginxDeploymentUpdatePropertiesNginxAppProtect model - = BinaryData.fromString("{\"webApplicationFirewallSettings\":{\"activationState\":\"Enabled\"}}") - .toObject(NginxDeploymentUpdatePropertiesNginxAppProtect.class); - Assertions.assertEquals(ActivationState.ENABLED, model.webApplicationFirewallSettings().activationState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentUpdatePropertiesNginxAppProtect model - = new NginxDeploymentUpdatePropertiesNginxAppProtect().withWebApplicationFirewallSettings( - new WebApplicationFirewallSettings().withActivationState(ActivationState.ENABLED)); - model = BinaryData.fromObject(model).toObject(NginxDeploymentUpdatePropertiesNginxAppProtect.class); - Assertions.assertEquals(ActivationState.ENABLED, model.webApplicationFirewallSettings().activationState()); - } -} 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 bf7f3522b999..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxDeploymentUpdatePropertiesTests.java +++ /dev/null @@ -1,107 +0,0 @@ -// 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.ActivationState; -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.NginxDeploymentUpdatePropertiesNginxAppProtect; -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 com.azure.resourcemanager.nginx.models.WebApplicationFirewallSettings; -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\":\"ekqvkeln\",\"containerName\":\"vbxwyjsflhh\"}},\"scalingProperties\":{\"capacity\":290339428,\"autoScaleSettings\":{\"profiles\":[{\"name\":\"ixisxyawjoy\",\"capacity\":{\"min\":628335164,\"max\":1772436776}},{\"name\":\"slyjpkiid\",\"capacity\":{\"min\":983085062,\"max\":787836165}},{\"name\":\"xznelixhnrztf\",\"capacity\":{\"min\":1975568377,\"max\":434458515}},{\"name\":\"bnxknalaulppg\",\"capacity\":{\"min\":1784168921,\"max\":1987785731}}]}},\"userProfile\":{\"preferredEmail\":\"apnyiropuhpig\"},\"networkProfile\":{\"frontEndIPConfiguration\":{\"publicIPAddresses\":[{\"id\":\"qgitxmed\"}],\"privateIPAddresses\":[{\"privateIPAddress\":\"lynqwwncwzzh\",\"privateIPAllocationMethod\":\"Dynamic\",\"subnetId\":\"rmgucnap\"}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"oellwp\"}},\"autoUpgradeProfile\":{\"upgradeChannel\":\"d\"},\"nginxAppProtect\":{\"webApplicationFirewallSettings\":{\"activationState\":\"Disabled\"}}}") - .toObject(NginxDeploymentUpdateProperties.class); - Assertions.assertEquals(false, model.enableDiagnosticsSupport()); - Assertions.assertEquals("ekqvkeln", model.logging().storageAccount().accountName()); - Assertions.assertEquals("vbxwyjsflhh", model.logging().storageAccount().containerName()); - Assertions.assertEquals(290339428, model.scalingProperties().capacity()); - Assertions.assertEquals("ixisxyawjoy", model.scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(628335164, model.scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(1772436776, model.scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("apnyiropuhpig", model.userProfile().preferredEmail()); - Assertions.assertEquals("qgitxmed", - model.networkProfile().frontEndIpConfiguration().publicIpAddresses().get(0).id()); - Assertions.assertEquals("lynqwwncwzzh", - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.DYNAMIC, - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("rmgucnap", - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).subnetId()); - Assertions.assertEquals("oellwp", model.networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals("d", model.autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals(ActivationState.DISABLED, - model.nginxAppProtect().webApplicationFirewallSettings().activationState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentUpdateProperties model - = new NginxDeploymentUpdateProperties().withEnableDiagnosticsSupport(false) - .withLogging(new NginxLogging().withStorageAccount( - new NginxStorageAccount().withAccountName("ekqvkeln").withContainerName("vbxwyjsflhh"))) - .withScalingProperties(new NginxDeploymentScalingProperties().withCapacity(290339428) - .withProfiles(Arrays.asList( - new ScaleProfile().withName("ixisxyawjoy") - .withCapacity(new ScaleProfileCapacity().withMin(628335164).withMax(1772436776)), - new ScaleProfile().withName("slyjpkiid") - .withCapacity(new ScaleProfileCapacity().withMin(983085062).withMax(787836165)), - new ScaleProfile().withName("xznelixhnrztf") - .withCapacity(new ScaleProfileCapacity().withMin(1975568377).withMax(434458515)), - new ScaleProfile().withName("bnxknalaulppg") - .withCapacity(new ScaleProfileCapacity().withMin(1784168921).withMax(1987785731))))) - .withUserProfile(new NginxDeploymentUserProfile().withPreferredEmail("apnyiropuhpig")) - .withNetworkProfile(new NginxNetworkProfile() - .withFrontEndIpConfiguration(new NginxFrontendIpConfiguration() - .withPublicIpAddresses(Arrays.asList(new NginxPublicIpAddress().withId("qgitxmed"))) - .withPrivateIpAddresses( - Arrays.asList(new NginxPrivateIpAddress().withPrivateIpAddress("lynqwwncwzzh") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.DYNAMIC) - .withSubnetId("rmgucnap")))) - .withNetworkInterfaceConfiguration(new NginxNetworkInterfaceConfiguration().withSubnetId("oellwp"))) - .withAutoUpgradeProfile(new AutoUpgradeProfile().withUpgradeChannel("d")) - .withNginxAppProtect( - new NginxDeploymentUpdatePropertiesNginxAppProtect().withWebApplicationFirewallSettings( - new WebApplicationFirewallSettings().withActivationState(ActivationState.DISABLED))); - model = BinaryData.fromObject(model).toObject(NginxDeploymentUpdateProperties.class); - Assertions.assertEquals(false, model.enableDiagnosticsSupport()); - Assertions.assertEquals("ekqvkeln", model.logging().storageAccount().accountName()); - Assertions.assertEquals("vbxwyjsflhh", model.logging().storageAccount().containerName()); - Assertions.assertEquals(290339428, model.scalingProperties().capacity()); - Assertions.assertEquals("ixisxyawjoy", model.scalingProperties().profiles().get(0).name()); - Assertions.assertEquals(628335164, model.scalingProperties().profiles().get(0).capacity().min()); - Assertions.assertEquals(1772436776, model.scalingProperties().profiles().get(0).capacity().max()); - Assertions.assertEquals("apnyiropuhpig", model.userProfile().preferredEmail()); - Assertions.assertEquals("qgitxmed", - model.networkProfile().frontEndIpConfiguration().publicIpAddresses().get(0).id()); - Assertions.assertEquals("lynqwwncwzzh", - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.DYNAMIC, - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("rmgucnap", - model.networkProfile().frontEndIpConfiguration().privateIpAddresses().get(0).subnetId()); - Assertions.assertEquals("oellwp", model.networkProfile().networkInterfaceConfiguration().subnetId()); - Assertions.assertEquals("d", model.autoUpgradeProfile().upgradeChannel()); - Assertions.assertEquals(ActivationState.DISABLED, - model.nginxAppProtect().webApplicationFirewallSettings().activationState()); - } -} 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 0cc2e6e23492..000000000000 --- 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\":\"mdua\"}").toObject(NginxDeploymentUserProfile.class); - Assertions.assertEquals("mdua", model.preferredEmail()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxDeploymentUserProfile model = new NginxDeploymentUserProfile().withPreferredEmail("mdua"); - model = BinaryData.fromObject(model).toObject(NginxDeploymentUserProfile.class); - Assertions.assertEquals("mdua", 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 416241c88f85..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxFrontendIpConfigurationTests.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.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\":\"lo\"}],\"privateIPAddresses\":[{\"privateIPAddress\":\"yfjfcnjbkcn\",\"privateIPAllocationMethod\":\"Dynamic\",\"subnetId\":\"ttkphywpnvjtoqne\"}]}") - .toObject(NginxFrontendIpConfiguration.class); - Assertions.assertEquals("lo", model.publicIpAddresses().get(0).id()); - Assertions.assertEquals("yfjfcnjbkcn", model.privateIpAddresses().get(0).privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.DYNAMIC, - model.privateIpAddresses().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("ttkphywpnvjtoqne", 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("lo"))) - .withPrivateIpAddresses(Arrays.asList(new NginxPrivateIpAddress().withPrivateIpAddress("yfjfcnjbkcn") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.DYNAMIC) - .withSubnetId("ttkphywpnvjtoqne"))); - model = BinaryData.fromObject(model).toObject(NginxFrontendIpConfiguration.class); - Assertions.assertEquals("lo", model.publicIpAddresses().get(0).id()); - Assertions.assertEquals("yfjfcnjbkcn", model.privateIpAddresses().get(0).privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.DYNAMIC, - model.privateIpAddresses().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("ttkphywpnvjtoqne", 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 9ddf45bba3c8..000000000000 --- 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\":\"ywpmueefjzwfqkq\",\"containerName\":\"ids\"}}") - .toObject(NginxLogging.class); - Assertions.assertEquals("ywpmueefjzwfqkq", model.storageAccount().accountName()); - Assertions.assertEquals("ids", model.storageAccount().containerName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxLogging model = new NginxLogging() - .withStorageAccount(new NginxStorageAccount().withAccountName("ywpmueefjzwfqkq").withContainerName("ids")); - model = BinaryData.fromObject(model).toObject(NginxLogging.class); - Assertions.assertEquals("ywpmueefjzwfqkq", model.storageAccount().accountName()); - Assertions.assertEquals("ids", 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 037c0e63912f..000000000000 --- 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\":\"zq\"}").toObject(NginxNetworkInterfaceConfiguration.class); - Assertions.assertEquals("zq", model.subnetId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxNetworkInterfaceConfiguration model = new NginxNetworkInterfaceConfiguration().withSubnetId("zq"); - model = BinaryData.fromObject(model).toObject(NginxNetworkInterfaceConfiguration.class); - Assertions.assertEquals("zq", 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 aeffee86d390..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxNetworkProfileTests.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.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\":\"baumnyqupedeoj\"}],\"privateIPAddresses\":[{\"privateIPAddress\":\"khsmtxpsiebt\",\"privateIPAllocationMethod\":\"Dynamic\",\"subnetId\":\"esap\"},{\"privateIPAddress\":\"rdqmhjjdhtldwkyz\",\"privateIPAllocationMethod\":\"Static\",\"subnetId\":\"kn\"},{\"privateIPAddress\":\"scwsv\",\"privateIPAllocationMethod\":\"Dynamic\",\"subnetId\":\"ogtwrupqsxvnmi\"}]},\"networkInterfaceConfiguration\":{\"subnetId\":\"vce\"}}") - .toObject(NginxNetworkProfile.class); - Assertions.assertEquals("baumnyqupedeoj", model.frontEndIpConfiguration().publicIpAddresses().get(0).id()); - Assertions.assertEquals("khsmtxpsiebt", - model.frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.DYNAMIC, - model.frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("esap", model.frontEndIpConfiguration().privateIpAddresses().get(0).subnetId()); - Assertions.assertEquals("vce", 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("baumnyqupedeoj"))) - .withPrivateIpAddresses(Arrays.asList( - new NginxPrivateIpAddress().withPrivateIpAddress("khsmtxpsiebt") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.DYNAMIC) - .withSubnetId("esap"), - new NginxPrivateIpAddress().withPrivateIpAddress("rdqmhjjdhtldwkyz") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.STATIC) - .withSubnetId("kn"), - new NginxPrivateIpAddress().withPrivateIpAddress("scwsv") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.DYNAMIC) - .withSubnetId("ogtwrupqsxvnmi")))) - .withNetworkInterfaceConfiguration(new NginxNetworkInterfaceConfiguration().withSubnetId("vce")); - model = BinaryData.fromObject(model).toObject(NginxNetworkProfile.class); - Assertions.assertEquals("baumnyqupedeoj", model.frontEndIpConfiguration().publicIpAddresses().get(0).id()); - Assertions.assertEquals("khsmtxpsiebt", - model.frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.DYNAMIC, - model.frontEndIpConfiguration().privateIpAddresses().get(0).privateIpAllocationMethod()); - Assertions.assertEquals("esap", model.frontEndIpConfiguration().privateIpAddresses().get(0).subnetId()); - Assertions.assertEquals("vce", 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 0eab114b6199..000000000000 --- 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\":\"hoxus\",\"privateIPAllocationMethod\":\"Static\",\"subnetId\":\"bgyepsbj\"}") - .toObject(NginxPrivateIpAddress.class); - Assertions.assertEquals("hoxus", model.privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.STATIC, model.privateIpAllocationMethod()); - Assertions.assertEquals("bgyepsbj", model.subnetId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxPrivateIpAddress model = new NginxPrivateIpAddress().withPrivateIpAddress("hoxus") - .withPrivateIpAllocationMethod(NginxPrivateIpAllocationMethod.STATIC) - .withSubnetId("bgyepsbj"); - model = BinaryData.fromObject(model).toObject(NginxPrivateIpAddress.class); - Assertions.assertEquals("hoxus", model.privateIpAddress()); - Assertions.assertEquals(NginxPrivateIpAllocationMethod.STATIC, model.privateIpAllocationMethod()); - Assertions.assertEquals("bgyepsbj", 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 b6170375f169..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxPublicIpAddressTests.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.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\":\"clfp\"}").toObject(NginxPublicIpAddress.class); - Assertions.assertEquals("clfp", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxPublicIpAddress model = new NginxPublicIpAddress().withId("clfp"); - model = BinaryData.fromObject(model).toObject(NginxPublicIpAddress.class); - Assertions.assertEquals("clfp", 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 f5484edbdb6b..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/NginxStorageAccountTests.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.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\":\"onobglaocqx\",\"containerName\":\"cmgyud\"}") - .toObject(NginxStorageAccount.class); - Assertions.assertEquals("onobglaocqx", model.accountName()); - Assertions.assertEquals("cmgyud", model.containerName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NginxStorageAccount model - = new NginxStorageAccount().withAccountName("onobglaocqx").withContainerName("cmgyud"); - model = BinaryData.fromObject(model).toObject(NginxStorageAccount.class); - Assertions.assertEquals("onobglaocqx", model.accountName()); - Assertions.assertEquals("cmgyud", 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 f44f68e27222..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/OperationDisplayTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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\":\"baaa\",\"resource\":\"yvayffimrzr\",\"operation\":\"zqogse\",\"description\":\"evfdnwnwm\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("baaa", model.provider()); - Assertions.assertEquals("yvayffimrzr", model.resource()); - Assertions.assertEquals("zqogse", model.operation()); - Assertions.assertEquals("evfdnwnwm", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("baaa") - .withResource("yvayffimrzr") - .withOperation("zqogse") - .withDescription("evfdnwnwm"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("baaa", model.provider()); - Assertions.assertEquals("yvayffimrzr", model.resource()); - Assertions.assertEquals("zqogse", model.operation()); - Assertions.assertEquals("evfdnwnwm", 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 1a346e8a48ab..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/OperationListResultTests.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.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\":\"kkfoqr\",\"display\":{\"provider\":\"kzikfjawneaivxwc\",\"resource\":\"lpcirelsf\",\"operation\":\"enwabfatk\",\"description\":\"dxbjhwuaanozj\"},\"isDataAction\":false},{\"name\":\"youlp\",\"display\":{\"provider\":\"xagl\",\"resource\":\"imjwosyt\",\"operation\":\"tcs\",\"description\":\"cktqumiekkezzi\"},\"isDataAction\":false},{\"name\":\"fjhdg\",\"display\":{\"provider\":\"ebdunyg\",\"resource\":\"qidbqfatpxllrxcy\",\"operation\":\"oadsuvar\",\"description\":\"wdmjsjqbjhhyx\"},\"isDataAction\":true}],\"nextLink\":\"yc\"}") - .toObject(OperationListResult.class); - Assertions.assertEquals("kkfoqr", model.value().get(0).name()); - Assertions.assertEquals("kzikfjawneaivxwc", model.value().get(0).display().provider()); - Assertions.assertEquals("lpcirelsf", model.value().get(0).display().resource()); - Assertions.assertEquals("enwabfatk", model.value().get(0).display().operation()); - Assertions.assertEquals("dxbjhwuaanozj", model.value().get(0).display().description()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("yc", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult().withValue(Arrays.asList( - new OperationResultInner().withName("kkfoqr") - .withDisplay(new OperationDisplay().withProvider("kzikfjawneaivxwc") - .withResource("lpcirelsf") - .withOperation("enwabfatk") - .withDescription("dxbjhwuaanozj")) - .withIsDataAction(false), - new OperationResultInner().withName("youlp") - .withDisplay(new OperationDisplay().withProvider("xagl") - .withResource("imjwosyt") - .withOperation("tcs") - .withDescription("cktqumiekkezzi")) - .withIsDataAction(false), - new OperationResultInner().withName("fjhdg") - .withDisplay(new OperationDisplay().withProvider("ebdunyg") - .withResource("qidbqfatpxllrxcy") - .withOperation("oadsuvar") - .withDescription("wdmjsjqbjhhyx")) - .withIsDataAction(true))) - .withNextLink("yc"); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - Assertions.assertEquals("kkfoqr", model.value().get(0).name()); - Assertions.assertEquals("kzikfjawneaivxwc", model.value().get(0).display().provider()); - Assertions.assertEquals("lpcirelsf", model.value().get(0).display().resource()); - Assertions.assertEquals("enwabfatk", model.value().get(0).display().operation()); - Assertions.assertEquals("dxbjhwuaanozj", model.value().get(0).display().description()); - Assertions.assertEquals(false, model.value().get(0).isDataAction()); - Assertions.assertEquals("yc", 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 e0e5946049b8..000000000000 --- 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\":\"uhpkxkgymar\",\"display\":{\"provider\":\"ajxq\",\"resource\":\"jhkycub\",\"operation\":\"dgssofwqmzqal\",\"description\":\"mnjijpxacqqudf\"},\"isDataAction\":true}") - .toObject(OperationResultInner.class); - Assertions.assertEquals("uhpkxkgymar", model.name()); - Assertions.assertEquals("ajxq", model.display().provider()); - Assertions.assertEquals("jhkycub", model.display().resource()); - Assertions.assertEquals("dgssofwqmzqal", model.display().operation()); - Assertions.assertEquals("mnjijpxacqqudf", model.display().description()); - Assertions.assertEquals(true, model.isDataAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationResultInner model = new OperationResultInner().withName("uhpkxkgymar") - .withDisplay(new OperationDisplay().withProvider("ajxq") - .withResource("jhkycub") - .withOperation("dgssofwqmzqal") - .withDescription("mnjijpxacqqudf")) - .withIsDataAction(true); - model = BinaryData.fromObject(model).toObject(OperationResultInner.class); - Assertions.assertEquals("uhpkxkgymar", model.name()); - Assertions.assertEquals("ajxq", model.display().provider()); - Assertions.assertEquals("jhkycub", model.display().resource()); - Assertions.assertEquals("dgssofwqmzqal", model.display().operation()); - Assertions.assertEquals("mnjijpxacqqudf", 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 5ab6459243d2..000000000000 --- 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.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -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\":\"cjdx\",\"display\":{\"provider\":\"zoggculapz\",\"resource\":\"rpgogtqxep\",\"operation\":\"lbfu\",\"description\":\"lyjt\"},\"isDataAction\":false}]}"; - - 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("cjdx", response.iterator().next().name()); - Assertions.assertEquals("zoggculapz", response.iterator().next().display().provider()); - Assertions.assertEquals("rpgogtqxep", response.iterator().next().display().resource()); - Assertions.assertEquals("lbfu", response.iterator().next().display().operation()); - Assertions.assertEquals("lyjt", response.iterator().next().display().description()); - Assertions.assertEquals(false, 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 9f31ae165a0a..000000000000 --- 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\":\"jdauwhvy\"}").toObject(ResourceSku.class); - Assertions.assertEquals("jdauwhvy", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceSku model = new ResourceSku().withName("jdauwhvy"); - model = BinaryData.fromObject(model).toObject(ResourceSku.class); - Assertions.assertEquals("jdauwhvy", 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 12bedc8b1b30..000000000000 --- 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\":1520620796,\"max\":14767496}").toObject(ScaleProfileCapacity.class); - Assertions.assertEquals(1520620796, model.min()); - Assertions.assertEquals(14767496, model.max()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScaleProfileCapacity model = new ScaleProfileCapacity().withMin(1520620796).withMax(14767496); - model = BinaryData.fromObject(model).toObject(ScaleProfileCapacity.class); - Assertions.assertEquals(1520620796, model.min()); - Assertions.assertEquals(14767496, 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 3d21800efb3e..000000000000 --- 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\":\"qkrhahvljua\",\"capacity\":{\"min\":1935710102,\"max\":836090349}}") - .toObject(ScaleProfile.class); - Assertions.assertEquals("qkrhahvljua", model.name()); - Assertions.assertEquals(1935710102, model.capacity().min()); - Assertions.assertEquals(836090349, model.capacity().max()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScaleProfile model = new ScaleProfile().withName("qkrhahvljua") - .withCapacity(new ScaleProfileCapacity().withMin(1935710102).withMax(836090349)); - model = BinaryData.fromObject(model).toObject(ScaleProfile.class); - Assertions.assertEquals("qkrhahvljua", model.name()); - Assertions.assertEquals(1935710102, model.capacity().min()); - Assertions.assertEquals(836090349, 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 c64eba4aab03..000000000000 --- 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\":\"rbnlankxmyskp\",\"clientId\":\"enbtkcxywny\"}") - .toObject(UserIdentityProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserIdentityProperties model = new UserIdentityProperties(); - model = BinaryData.fromObject(model).toObject(UserIdentityProperties.class); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/WebApplicationFirewallComponentVersionsTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/WebApplicationFirewallComponentVersionsTests.java deleted file mode 100644 index bf0c8a0df2f0..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/WebApplicationFirewallComponentVersionsTests.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.WebApplicationFirewallComponentVersions; -import org.junit.jupiter.api.Assertions; - -public final class WebApplicationFirewallComponentVersionsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WebApplicationFirewallComponentVersions model - = BinaryData.fromString("{\"wafEngineVersion\":\"ni\",\"wafNginxVersion\":\"kxfbkpycgklwndn\"}") - .toObject(WebApplicationFirewallComponentVersions.class); - Assertions.assertEquals("ni", model.wafEngineVersion()); - Assertions.assertEquals("kxfbkpycgklwndn", model.wafNginxVersion()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WebApplicationFirewallComponentVersions model - = new WebApplicationFirewallComponentVersions().withWafEngineVersion("ni") - .withWafNginxVersion("kxfbkpycgklwndn"); - model = BinaryData.fromObject(model).toObject(WebApplicationFirewallComponentVersions.class); - Assertions.assertEquals("ni", model.wafEngineVersion()); - Assertions.assertEquals("kxfbkpycgklwndn", model.wafNginxVersion()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/WebApplicationFirewallPackageTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/WebApplicationFirewallPackageTests.java deleted file mode 100644 index b7f2bbec8eda..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/WebApplicationFirewallPackageTests.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.WebApplicationFirewallPackage; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class WebApplicationFirewallPackageTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WebApplicationFirewallPackage model - = BinaryData.fromString("{\"version\":\"nrjawgqwg\",\"revisionDatetime\":\"2021-10-10T15:46:25Z\"}") - .toObject(WebApplicationFirewallPackage.class); - Assertions.assertEquals("nrjawgqwg", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-10T15:46:25Z"), model.revisionDatetime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WebApplicationFirewallPackage model = new WebApplicationFirewallPackage().withVersion("nrjawgqwg") - .withRevisionDatetime(OffsetDateTime.parse("2021-10-10T15:46:25Z")); - model = BinaryData.fromObject(model).toObject(WebApplicationFirewallPackage.class); - Assertions.assertEquals("nrjawgqwg", model.version()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-10T15:46:25Z"), model.revisionDatetime()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/WebApplicationFirewallSettingsTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/WebApplicationFirewallSettingsTests.java deleted file mode 100644 index 57b830c17692..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/WebApplicationFirewallSettingsTests.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.ActivationState; -import com.azure.resourcemanager.nginx.models.WebApplicationFirewallSettings; -import org.junit.jupiter.api.Assertions; - -public final class WebApplicationFirewallSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WebApplicationFirewallSettings model - = BinaryData.fromString("{\"activationState\":\"Enabled\"}").toObject(WebApplicationFirewallSettings.class); - Assertions.assertEquals(ActivationState.ENABLED, model.activationState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WebApplicationFirewallSettings model - = new WebApplicationFirewallSettings().withActivationState(ActivationState.ENABLED); - model = BinaryData.fromObject(model).toObject(WebApplicationFirewallSettings.class); - Assertions.assertEquals(ActivationState.ENABLED, model.activationState()); - } -} diff --git a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/WebApplicationFirewallStatusTests.java b/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/WebApplicationFirewallStatusTests.java deleted file mode 100644 index 291c374286cf..000000000000 --- a/sdk/nginx/azure-resourcemanager-nginx/src/test/java/com/azure/resourcemanager/nginx/generated/WebApplicationFirewallStatusTests.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.WebApplicationFirewallStatus; - -public final class WebApplicationFirewallStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WebApplicationFirewallStatus model = BinaryData.fromString( - "{\"attackSignaturesPackage\":{\"version\":\"z\",\"revisionDatetime\":\"2021-06-30T00:10:41Z\"},\"botSignaturesPackage\":{\"version\":\"gicjooxdjeb\",\"revisionDatetime\":\"2021-10-10T15:28:34Z\"},\"threatCampaignsPackage\":{\"version\":\"cwwfvovbvme\",\"revisionDatetime\":\"2021-06-02T22:02:30Z\"},\"componentVersions\":{\"wafEngineVersion\":\"ivyhzceuojgjrwju\",\"wafNginxVersion\":\"iotwmcdytdxwit\"}}") - .toObject(WebApplicationFirewallStatus.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WebApplicationFirewallStatus model = new WebApplicationFirewallStatus(); - model = BinaryData.fromObject(model).toObject(WebApplicationFirewallStatus.class); - } -}