diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/CHANGELOG.md b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/CHANGELOG.md index ed7455771113..da6f3c0d5b8e 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/CHANGELOG.md +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/CHANGELOG.md @@ -1,14 +1,49 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.2.0-beta.1 (2025-03-06) + +- Azure Resource Manager Traffic Controller client library for Java. This package contains Microsoft Azure SDK for Traffic Controller Management SDK. Traffic Controller Provider management API. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added -### Breaking Changes +* `models.IpAccessRule` was added + +* `models.FrontendUpdateProperties` was added + +* `models.IpAccessRuleAction` was added + +* `models.IpAccessRulesPolicy` was added + +* `models.IpAccessRulesSecurityPolicy` was added + +#### `models.Frontend$Update` was modified + +* `withProperties(models.FrontendUpdateProperties)` was added + +#### `models.SecurityPolicyProperties` was modified + +* `ipAccessRulesPolicy()` was added +* `withIpAccessRulesPolicy(models.IpAccessRulesPolicy)` was added -### Bugs Fixed +#### `models.SecurityPolicyConfigurations` was modified -### Other Changes +* `withIpAccessRulesSecurityPolicy(models.IpAccessRulesSecurityPolicy)` was added +* `ipAccessRulesSecurityPolicy()` was added + +#### `models.FrontendUpdate` was modified + +* `properties()` was added +* `withProperties(models.FrontendUpdateProperties)` was added + +#### `models.SecurityPolicyUpdateProperties` was modified + +* `withIpAccessRulesPolicy(models.IpAccessRulesPolicy)` was added +* `ipAccessRulesPolicy()` was added + +#### `models.FrontendProperties` was modified + +* `securityPolicyConfigurations()` was added +* `withSecurityPolicyConfigurations(models.SecurityPolicyConfigurations)` was added ## 1.1.0 (2025-02-06) diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/README.md b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/README.md index 6f344d4365db..a0ff70704689 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/README.md +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/README.md @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ TrafficControllerManager manager = TrafficControllerManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -107,5 +107,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/SAMPLE.md b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/SAMPLE.md index 21eaf2ca2f36..6a0f5be2d594 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/SAMPLE.md +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/SAMPLE.md @@ -49,7 +49,7 @@ import com.azure.resourcemanager.servicenetworking.models.AssociationType; */ public final class AssociationsInterfaceCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-01-01/AssociationPut.json + * x-ms-original-file: 2025-03-01-preview/AssociationPut.json */ /** * Sample code: Put Association. @@ -77,7 +77,7 @@ public final class AssociationsInterfaceCreateOrUpdateSamples { */ public final class AssociationsInterfaceDeleteSamples { /* - * x-ms-original-file: 2025-01-01/AssociationDelete.json + * x-ms-original-file: 2025-03-01-preview/AssociationDelete.json */ /** * Sample code: Delete Association. @@ -98,7 +98,7 @@ public final class AssociationsInterfaceDeleteSamples { */ public final class AssociationsInterfaceGetSamples { /* - * x-ms-original-file: 2025-01-01/AssociationGet.json + * x-ms-original-file: 2025-03-01-preview/AssociationGet.json */ /** * Sample code: Get Association. @@ -119,7 +119,7 @@ public final class AssociationsInterfaceGetSamples { */ public final class AssociationsInterfaceListByTrafficControllerSamples { /* - * x-ms-original-file: 2025-01-01/AssociationsGet.json + * x-ms-original-file: 2025-03-01-preview/AssociationsGet.json */ /** * Sample code: Get Associations. @@ -145,7 +145,7 @@ import com.azure.resourcemanager.servicenetworking.models.AssociationUpdatePrope */ public final class AssociationsInterfaceUpdateSamples { /* - * x-ms-original-file: 2025-01-01/AssociationPatch.json + * x-ms-original-file: 2025-03-01-preview/AssociationPatch.json */ /** * Sample code: Update Association. @@ -175,7 +175,7 @@ import com.azure.resourcemanager.servicenetworking.models.FrontendProperties; */ public final class FrontendsInterfaceCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-01-01/FrontendPut.json + * x-ms-original-file: 2025-03-01-preview/FrontendPut.json */ /** * Sample code: Put Frontend. @@ -201,7 +201,7 @@ public final class FrontendsInterfaceCreateOrUpdateSamples { */ public final class FrontendsInterfaceDeleteSamples { /* - * x-ms-original-file: 2025-01-01/FrontendDelete.json + * x-ms-original-file: 2025-03-01-preview/FrontendDelete.json */ /** * Sample code: Delete Frontend. @@ -222,7 +222,7 @@ public final class FrontendsInterfaceDeleteSamples { */ public final class FrontendsInterfaceGetSamples { /* - * x-ms-original-file: 2025-01-01/FrontendGet.json + * x-ms-original-file: 2025-03-01-preview/FrontendGet.json */ /** * Sample code: Get Frontend. @@ -243,7 +243,7 @@ public final class FrontendsInterfaceGetSamples { */ public final class FrontendsInterfaceListByTrafficControllerSamples { /* - * x-ms-original-file: 2025-01-01/FrontendsGet.json + * x-ms-original-file: 2025-03-01-preview/FrontendsGet.json */ /** * Sample code: Get Frontends. @@ -266,7 +266,7 @@ import com.azure.resourcemanager.servicenetworking.models.Frontend; */ public final class FrontendsInterfaceUpdateSamples { /* - * x-ms-original-file: 2025-01-01/FrontendPatch.json + * x-ms-original-file: 2025-03-01-preview/FrontendPatch.json */ /** * Sample code: Update Frontend. @@ -290,7 +290,7 @@ public final class FrontendsInterfaceUpdateSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: 2025-01-01/OperationsList.json + * x-ms-original-file: 2025-03-01-preview/OperationsList.json */ /** * Sample code: Get Operations List. @@ -306,22 +306,44 @@ public final class OperationsListSamples { ### SecurityPoliciesInterface_CreateOrUpdate ```java +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyProperties; import com.azure.resourcemanager.servicenetworking.models.WafPolicy; +import java.util.Arrays; /** * Samples for SecurityPoliciesInterface CreateOrUpdate. */ public final class SecurityPoliciesInterfaceCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-01-01/SecurityPolicyPut.json + * x-ms-original-file: 2025-03-01-preview/IpAccessRulesSecurityPolicyPut.json */ /** - * Sample code: Put SecurityPolicy. + * Sample code: Put IpAccessRules SecurityPolicy. * * @param manager Entry point to TrafficControllerManager. */ - public static void putSecurityPolicy(com.azure.resourcemanager.servicenetworking.TrafficControllerManager manager) { + public static void + putIpAccessRulesSecurityPolicy(com.azure.resourcemanager.servicenetworking.TrafficControllerManager manager) { + manager.securityPoliciesInterfaces() + .define("sp1") + .withRegion("NorthCentralUS") + .withExistingTrafficController("rg1", "tc1") + .withProperties(new SecurityPolicyProperties() + .withIpAccessRulesPolicy(new IpAccessRulesPolicy().withRules(Arrays.asList()))) + .create(); + } + + /* + * x-ms-original-file: 2025-03-01-preview/WafSecurityPolicyPut.json + */ + /** + * Sample code: Put WAF SecurityPolicy. + * + * @param manager Entry point to TrafficControllerManager. + */ + public static void + putWAFSecurityPolicy(com.azure.resourcemanager.servicenetworking.TrafficControllerManager manager) { manager.securityPoliciesInterfaces() .define("sp1") .withRegion("NorthCentralUS") @@ -341,7 +363,7 @@ public final class SecurityPoliciesInterfaceCreateOrUpdateSamples { */ public final class SecurityPoliciesInterfaceDeleteSamples { /* - * x-ms-original-file: 2025-01-01/SecurityPolicyDelete.json + * x-ms-original-file: 2025-03-01-preview/SecurityPolicyDelete.json */ /** * Sample code: Delete SecurityPolicy. @@ -363,7 +385,7 @@ public final class SecurityPoliciesInterfaceDeleteSamples { */ public final class SecurityPoliciesInterfaceGetSamples { /* - * x-ms-original-file: 2025-01-01/SecurityPolicyGet.json + * x-ms-original-file: 2025-03-01-preview/SecurityPolicyGet.json */ /** * Sample code: Get SecurityPolicy. @@ -384,7 +406,7 @@ public final class SecurityPoliciesInterfaceGetSamples { */ public final class SecurityPoliciesInterfaceListByTrafficControllerSamples { /* - * x-ms-original-file: 2025-01-01/SecurityPoliciesGetList.json + * x-ms-original-file: 2025-03-01-preview/SecurityPoliciesGetList.json */ /** * Sample code: Get SecurityPolicies. @@ -401,24 +423,45 @@ public final class SecurityPoliciesInterfaceListByTrafficControllerSamples { ### SecurityPoliciesInterface_Update ```java +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyUpdateProperties; import com.azure.resourcemanager.servicenetworking.models.WafPolicy; +import java.util.Arrays; /** * Samples for SecurityPoliciesInterface Update. */ public final class SecurityPoliciesInterfaceUpdateSamples { /* - * x-ms-original-file: 2025-01-01/SecurityPolicyPatch.json + * x-ms-original-file: 2025-03-01-preview/IpAccessRulesSecurityPolicyPatch.json + */ + /** + * Sample code: Update IpAccessRules SecurityPolicy. + * + * @param manager Entry point to TrafficControllerManager. + */ + public static void updateIpAccessRulesSecurityPolicy( + com.azure.resourcemanager.servicenetworking.TrafficControllerManager manager) { + SecurityPolicy resource = manager.securityPoliciesInterfaces() + .getWithResponse("rg1", "tc1", "sp1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new SecurityPolicyUpdateProperties() + .withIpAccessRulesPolicy(new IpAccessRulesPolicy().withRules(Arrays.asList()))) + .apply(); + } + + /* + * x-ms-original-file: 2025-03-01-preview/WafSecurityPolicyPatch.json */ /** - * Sample code: Update SecurityPolicy. + * Sample code: Update WAF SecurityPolicy. * * @param manager Entry point to TrafficControllerManager. */ public static void - updateSecurityPolicy(com.azure.resourcemanager.servicenetworking.TrafficControllerManager manager) { + updateWAFSecurityPolicy(com.azure.resourcemanager.servicenetworking.TrafficControllerManager manager) { SecurityPolicy resource = manager.securityPoliciesInterfaces() .getWithResponse("rg1", "tc1", "sp1", com.azure.core.util.Context.NONE) .getValue(); @@ -441,7 +484,7 @@ import java.util.Map; */ public final class TrafficControllerInterfaceCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-01-01/TrafficControllerPut.json + * x-ms-original-file: 2025-03-01-preview/TrafficControllerPut.json */ /** * Sample code: Put Traffic Controller. @@ -480,7 +523,7 @@ public final class TrafficControllerInterfaceCreateOrUpdateSamples { */ public final class TrafficControllerInterfaceDeleteSamples { /* - * x-ms-original-file: 2025-01-01/TrafficControllerDelete.json + * x-ms-original-file: 2025-03-01-preview/TrafficControllerDelete.json */ /** * Sample code: Delete Traffic Controller. @@ -502,7 +545,7 @@ public final class TrafficControllerInterfaceDeleteSamples { */ public final class TrafficControllerInterfaceGetByResourceGroupSamples { /* - * x-ms-original-file: 2025-01-01/TrafficControllerGet.json + * x-ms-original-file: 2025-03-01-preview/TrafficControllerGet.json */ /** * Sample code: Get Traffic Controller. @@ -525,7 +568,7 @@ public final class TrafficControllerInterfaceGetByResourceGroupSamples { */ public final class TrafficControllerInterfaceListSamples { /* - * x-ms-original-file: 2025-01-01/TrafficControllersGetList.json + * x-ms-original-file: 2025-03-01-preview/TrafficControllersGetList.json */ /** * Sample code: Get Traffic Controllers List. @@ -547,7 +590,7 @@ public final class TrafficControllerInterfaceListSamples { */ public final class TrafficControllerInterfaceListByResourceGroupSamples { /* - * x-ms-original-file: 2025-01-01/TrafficControllersGet.json + * x-ms-original-file: 2025-03-01-preview/TrafficControllersGet.json */ /** * Sample code: Get Traffic Controllers. @@ -573,7 +616,7 @@ import java.util.Map; */ public final class TrafficControllerInterfaceUpdateSamples { /* - * x-ms-original-file: 2025-01-01/TrafficControllerPatch.json + * x-ms-original-file: 2025-03-01-preview/TrafficControllerPatch.json */ /** * Sample code: Patch Traffic Controller. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/pom.xml b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/pom.xml index 297abfe73263..6888aa4d8dab 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/pom.xml +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/pom.xml @@ -45,7 +45,6 @@ UTF-8 0 0 - false true diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/implementation/FrontendImpl.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/implementation/FrontendImpl.java index 20ab5205611d..da5223d0c9a6 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/implementation/FrontendImpl.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/implementation/FrontendImpl.java @@ -11,6 +11,7 @@ import com.azure.resourcemanager.servicenetworking.models.Frontend; import com.azure.resourcemanager.servicenetworking.models.FrontendProperties; import com.azure.resourcemanager.servicenetworking.models.FrontendUpdate; +import com.azure.resourcemanager.servicenetworking.models.FrontendUpdateProperties; import java.util.Collections; import java.util.Map; @@ -177,6 +178,11 @@ public FrontendImpl withProperties(FrontendProperties properties) { return this; } + public FrontendImpl withProperties(FrontendUpdateProperties properties) { + this.updateProperties.withProperties(properties); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/implementation/TrafficControllerManagementClientImpl.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/implementation/TrafficControllerManagementClientImpl.java index c7b1eb5665a0..4bce0f8839e1 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/implementation/TrafficControllerManagementClientImpl.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/implementation/TrafficControllerManagementClientImpl.java @@ -214,7 +214,7 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; this.subscriptionId = subscriptionId; - this.apiVersion = "2025-01-01"; + this.apiVersion = "2025-03-01-preview"; this.associationsInterfaces = new AssociationsInterfacesClientImpl(this); this.frontendsInterfaces = new FrontendsInterfacesClientImpl(this); this.securityPoliciesInterfaces = new SecurityPoliciesInterfacesClientImpl(this); diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/AssociationSubnetUpdate.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/AssociationSubnetUpdate.java index e34090491db5..f58a027a4b5b 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/AssociationSubnetUpdate.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/AssociationSubnetUpdate.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.servicenetworking.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -54,14 +53,8 @@ public AssociationSubnetUpdate withId(String id) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (id() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property id in model AssociationSubnetUpdate")); - } } - private static final ClientLogger LOGGER = new ClientLogger(AssociationSubnetUpdate.class); - /** * {@inheritDoc} */ @@ -78,7 +71,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of AssociationSubnetUpdate 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 AssociationSubnetUpdate. */ public static AssociationSubnetUpdate fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/Frontend.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/Frontend.java index 47c97e09248e..16773e14ec4f 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/Frontend.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/Frontend.java @@ -201,7 +201,7 @@ interface WithProperties { /** * The template for Frontend update. */ - interface Update extends UpdateStages.WithTags { + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { /** * Executes the update request. * @@ -234,6 +234,19 @@ interface WithTags { */ Update withTags(Map tags); } + + /** + * The stage of the Frontend update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(FrontendUpdateProperties properties); + } } /** diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/FrontendProperties.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/FrontendProperties.java index 85e68237ba59..c73db2b1b704 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/FrontendProperties.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/FrontendProperties.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.servicenetworking.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,13 +14,18 @@ /** * Frontend Properties. */ -@Immutable +@Fluent public final class FrontendProperties implements JsonSerializable { /* * The Fully Qualified Domain Name of the DNS record associated to a Traffic Controller frontend. */ private String fqdn; + /* + * Frontend Security Policy Configuration + */ + private SecurityPolicyConfigurations securityPolicyConfigurations; + /* * Provisioning State of Traffic Controller Frontend Resource */ @@ -42,6 +47,27 @@ public String fqdn() { return this.fqdn; } + /** + * Get the securityPolicyConfigurations property: Frontend Security Policy Configuration. + * + * @return the securityPolicyConfigurations value. + */ + public SecurityPolicyConfigurations securityPolicyConfigurations() { + return this.securityPolicyConfigurations; + } + + /** + * Set the securityPolicyConfigurations property: Frontend Security Policy Configuration. + * + * @param securityPolicyConfigurations the securityPolicyConfigurations value to set. + * @return the FrontendProperties object itself. + */ + public FrontendProperties + withSecurityPolicyConfigurations(SecurityPolicyConfigurations securityPolicyConfigurations) { + this.securityPolicyConfigurations = securityPolicyConfigurations; + return this; + } + /** * Get the provisioningState property: Provisioning State of Traffic Controller Frontend Resource. * @@ -57,6 +83,9 @@ public ProvisioningState provisioningState() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (securityPolicyConfigurations() != null) { + securityPolicyConfigurations().validate(); + } } /** @@ -65,6 +94,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("securityPolicyConfigurations", this.securityPolicyConfigurations); return jsonWriter.writeEndObject(); } @@ -85,6 +115,9 @@ public static FrontendProperties fromJson(JsonReader jsonReader) throws IOExcept if ("fqdn".equals(fieldName)) { deserializedFrontendProperties.fqdn = reader.getString(); + } else if ("securityPolicyConfigurations".equals(fieldName)) { + deserializedFrontendProperties.securityPolicyConfigurations + = SecurityPolicyConfigurations.fromJson(reader); } else if ("provisioningState".equals(fieldName)) { deserializedFrontendProperties.provisioningState = ProvisioningState.fromString(reader.getString()); } else { diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/FrontendUpdate.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/FrontendUpdate.java index b4c269700317..6cf95c7f92a0 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/FrontendUpdate.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/FrontendUpdate.java @@ -22,6 +22,11 @@ public final class FrontendUpdate implements JsonSerializable { */ private Map tags; + /* + * The resource-specific properties for this resource. + */ + private FrontendUpdateProperties properties; + /** * Creates an instance of FrontendUpdate class. */ @@ -48,12 +53,35 @@ public FrontendUpdate withTags(Map tags) { return this; } + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public FrontendUpdateProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the FrontendUpdate object itself. + */ + public FrontendUpdate withProperties(FrontendUpdateProperties properties) { + this.properties = properties; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (properties() != null) { + properties().validate(); + } } /** @@ -63,6 +91,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -84,6 +113,8 @@ public static FrontendUpdate fromJson(JsonReader jsonReader) throws IOException if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedFrontendUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedFrontendUpdate.properties = FrontendUpdateProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/FrontendUpdateProperties.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/FrontendUpdateProperties.java new file mode 100644 index 000000000000..e6d75b2b84c1 --- /dev/null +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/FrontendUpdateProperties.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicenetworking.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The updatable properties of the Frontend. + */ +@Fluent +public final class FrontendUpdateProperties implements JsonSerializable { + /* + * Frontend Security Policy Configuration + */ + private SecurityPolicyConfigurations securityPolicyConfigurations; + + /** + * Creates an instance of FrontendUpdateProperties class. + */ + public FrontendUpdateProperties() { + } + + /** + * Get the securityPolicyConfigurations property: Frontend Security Policy Configuration. + * + * @return the securityPolicyConfigurations value. + */ + public SecurityPolicyConfigurations securityPolicyConfigurations() { + return this.securityPolicyConfigurations; + } + + /** + * Set the securityPolicyConfigurations property: Frontend Security Policy Configuration. + * + * @param securityPolicyConfigurations the securityPolicyConfigurations value to set. + * @return the FrontendUpdateProperties object itself. + */ + public FrontendUpdateProperties + withSecurityPolicyConfigurations(SecurityPolicyConfigurations securityPolicyConfigurations) { + this.securityPolicyConfigurations = securityPolicyConfigurations; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (securityPolicyConfigurations() != null) { + securityPolicyConfigurations().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("securityPolicyConfigurations", this.securityPolicyConfigurations); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FrontendUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FrontendUpdateProperties 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 FrontendUpdateProperties. + */ + public static FrontendUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FrontendUpdateProperties deserializedFrontendUpdateProperties = new FrontendUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("securityPolicyConfigurations".equals(fieldName)) { + deserializedFrontendUpdateProperties.securityPolicyConfigurations + = SecurityPolicyConfigurations.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFrontendUpdateProperties; + }); + } +} diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/IpAccessRule.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/IpAccessRule.java new file mode 100644 index 000000000000..bf9c4f56eab9 --- /dev/null +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/IpAccessRule.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicenetworking.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Ip Access Policy Rules. + */ +@Fluent +public final class IpAccessRule implements JsonSerializable { + /* + * Name of the Ip Access Rule + */ + private String name; + + /* + * The priority of the rule. The value can be between 1 and 500. The priority number must be unique for each rule in + * the collection. The lower the priority number, the higher the priority of the rule. + */ + private int priority; + + /* + * Source Address Prefixed Applied by the Rule. Asterisk '*' can also be used to match all source IPs. + */ + private List sourceAddressPrefixes; + + /* + * Action of the Rule + */ + private IpAccessRuleAction action; + + /** + * Creates an instance of IpAccessRule class. + */ + public IpAccessRule() { + } + + /** + * Get the name property: Name of the Ip Access Rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the Ip Access Rule. + * + * @param name the name value to set. + * @return the IpAccessRule object itself. + */ + public IpAccessRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the priority property: The priority of the rule. The value can be between 1 and 500. The priority number must + * be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. + * + * @return the priority value. + */ + public int priority() { + return this.priority; + } + + /** + * Set the priority property: The priority of the rule. The value can be between 1 and 500. The priority number must + * be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. + * + * @param priority the priority value to set. + * @return the IpAccessRule object itself. + */ + public IpAccessRule withPriority(int priority) { + this.priority = priority; + return this; + } + + /** + * Get the sourceAddressPrefixes property: Source Address Prefixed Applied by the Rule. Asterisk '*' can also be + * used to match all source IPs. + * + * @return the sourceAddressPrefixes value. + */ + public List sourceAddressPrefixes() { + return this.sourceAddressPrefixes; + } + + /** + * Set the sourceAddressPrefixes property: Source Address Prefixed Applied by the Rule. Asterisk '*' can also be + * used to match all source IPs. + * + * @param sourceAddressPrefixes the sourceAddressPrefixes value to set. + * @return the IpAccessRule object itself. + */ + public IpAccessRule withSourceAddressPrefixes(List sourceAddressPrefixes) { + this.sourceAddressPrefixes = sourceAddressPrefixes; + return this; + } + + /** + * Get the action property: Action of the Rule. + * + * @return the action value. + */ + public IpAccessRuleAction action() { + return this.action; + } + + /** + * Set the action property: Action of the Rule. + * + * @param action the action value to set. + * @return the IpAccessRule object itself. + */ + public IpAccessRule withAction(IpAccessRuleAction action) { + this.action = action; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model IpAccessRule")); + } + if (sourceAddressPrefixes() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourceAddressPrefixes in model IpAccessRule")); + } + if (action() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property action in model IpAccessRule")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpAccessRule.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeIntField("priority", this.priority); + jsonWriter.writeArrayField("sourceAddressPrefixes", this.sourceAddressPrefixes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpAccessRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpAccessRule 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 IpAccessRule. + */ + public static IpAccessRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpAccessRule deserializedIpAccessRule = new IpAccessRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedIpAccessRule.name = reader.getString(); + } else if ("priority".equals(fieldName)) { + deserializedIpAccessRule.priority = reader.getInt(); + } else if ("sourceAddressPrefixes".equals(fieldName)) { + List sourceAddressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedIpAccessRule.sourceAddressPrefixes = sourceAddressPrefixes; + } else if ("action".equals(fieldName)) { + deserializedIpAccessRule.action = IpAccessRuleAction.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedIpAccessRule; + }); + } +} diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/IpAccessRuleAction.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/IpAccessRuleAction.java new file mode 100644 index 000000000000..ef31279f387f --- /dev/null +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/IpAccessRuleAction.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicenetworking.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Action of Ip Access Rule. + */ +public final class IpAccessRuleAction extends ExpandableStringEnum { + /** + * Allow Source Ip Prefixes. + */ + public static final IpAccessRuleAction ALLOW = fromString("allow"); + + /** + * Deny Source Ip Prefixes. + */ + public static final IpAccessRuleAction DENY = fromString("deny"); + + /** + * Creates a new instance of IpAccessRuleAction value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IpAccessRuleAction() { + } + + /** + * Creates or finds a IpAccessRuleAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding IpAccessRuleAction. + */ + public static IpAccessRuleAction fromString(String name) { + return fromString(name, IpAccessRuleAction.class); + } + + /** + * Gets known IpAccessRuleAction values. + * + * @return known IpAccessRuleAction values. + */ + public static Collection values() { + return values(IpAccessRuleAction.class); + } +} diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/IpAccessRulesPolicy.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/IpAccessRulesPolicy.java new file mode 100644 index 000000000000..dcc31eca529b --- /dev/null +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/IpAccessRulesPolicy.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicenetworking.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Ip Access Policy. + */ +@Fluent +public final class IpAccessRulesPolicy implements JsonSerializable { + /* + * Ip Access Policy Rules List + */ + private List rules; + + /** + * Creates an instance of IpAccessRulesPolicy class. + */ + public IpAccessRulesPolicy() { + } + + /** + * Get the rules property: Ip Access Policy Rules List. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: Ip Access Policy Rules List. + * + * @param rules the rules value to set. + * @return the IpAccessRulesPolicy object itself. + */ + public IpAccessRulesPolicy withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("rules", this.rules, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpAccessRulesPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpAccessRulesPolicy 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 IpAccessRulesPolicy. + */ + public static IpAccessRulesPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpAccessRulesPolicy deserializedIpAccessRulesPolicy = new IpAccessRulesPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rules".equals(fieldName)) { + List rules = reader.readArray(reader1 -> IpAccessRule.fromJson(reader1)); + deserializedIpAccessRulesPolicy.rules = rules; + } else { + reader.skipChildren(); + } + } + + return deserializedIpAccessRulesPolicy; + }); + } +} diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/IpAccessRulesSecurityPolicy.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/IpAccessRulesSecurityPolicy.java new file mode 100644 index 000000000000..11806ec561a9 --- /dev/null +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/IpAccessRulesSecurityPolicy.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicenetworking.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * IpAccessRules Security Policy. + */ +@Fluent +public final class IpAccessRulesSecurityPolicy implements JsonSerializable { + /* + * Resource ID of the Ip Access Rules Security Policy + */ + private String id; + + /** + * Creates an instance of IpAccessRulesSecurityPolicy class. + */ + public IpAccessRulesSecurityPolicy() { + } + + /** + * Get the id property: Resource ID of the Ip Access Rules Security Policy. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Resource ID of the Ip Access Rules Security Policy. + * + * @param id the id value to set. + * @return the IpAccessRulesSecurityPolicy object itself. + */ + public IpAccessRulesSecurityPolicy withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model IpAccessRulesSecurityPolicy")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(IpAccessRulesSecurityPolicy.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpAccessRulesSecurityPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpAccessRulesSecurityPolicy 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 IpAccessRulesSecurityPolicy. + */ + public static IpAccessRulesSecurityPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpAccessRulesSecurityPolicy deserializedIpAccessRulesSecurityPolicy = new IpAccessRulesSecurityPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedIpAccessRulesSecurityPolicy.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedIpAccessRulesSecurityPolicy; + }); + } +} diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/PolicyType.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/PolicyType.java index 1eb6df9b9b01..266a7c3b24c0 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/PolicyType.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/PolicyType.java @@ -16,6 +16,11 @@ public final class PolicyType extends ExpandableStringEnum { */ public static final PolicyType WAF = fromString("waf"); + /** + * Policy of Type IpAccessRules. + */ + public static final PolicyType IP_ACCESS_RULES = fromString("ipAccessRules"); + /** * Creates a new instance of PolicyType value. * diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/SecurityPolicyConfigurations.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/SecurityPolicyConfigurations.java index 7cb469dcf8ce..4ed9d16ff5ba 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/SecurityPolicyConfigurations.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/SecurityPolicyConfigurations.java @@ -17,10 +17,15 @@ @Fluent public final class SecurityPolicyConfigurations implements JsonSerializable { /* - * Contains reference to a WAF-type security policy that is applied at the Traffic Controller level. + * Contains reference to a WAF-type security policy. */ private WafSecurityPolicy wafSecurityPolicy; + /* + * Contains reference to a IpAccessRules-type security policy. + */ + private IpAccessRulesSecurityPolicy ipAccessRulesSecurityPolicy; + /** * Creates an instance of SecurityPolicyConfigurations class. */ @@ -28,8 +33,7 @@ public SecurityPolicyConfigurations() { } /** - * Get the wafSecurityPolicy property: Contains reference to a WAF-type security policy that is applied at the - * Traffic Controller level. + * Get the wafSecurityPolicy property: Contains reference to a WAF-type security policy. * * @return the wafSecurityPolicy value. */ @@ -38,8 +42,7 @@ public WafSecurityPolicy wafSecurityPolicy() { } /** - * Set the wafSecurityPolicy property: Contains reference to a WAF-type security policy that is applied at the - * Traffic Controller level. + * Set the wafSecurityPolicy property: Contains reference to a WAF-type security policy. * * @param wafSecurityPolicy the wafSecurityPolicy value to set. * @return the SecurityPolicyConfigurations object itself. @@ -49,6 +52,27 @@ public SecurityPolicyConfigurations withWafSecurityPolicy(WafSecurityPolicy wafS return this; } + /** + * Get the ipAccessRulesSecurityPolicy property: Contains reference to a IpAccessRules-type security policy. + * + * @return the ipAccessRulesSecurityPolicy value. + */ + public IpAccessRulesSecurityPolicy ipAccessRulesSecurityPolicy() { + return this.ipAccessRulesSecurityPolicy; + } + + /** + * Set the ipAccessRulesSecurityPolicy property: Contains reference to a IpAccessRules-type security policy. + * + * @param ipAccessRulesSecurityPolicy the ipAccessRulesSecurityPolicy value to set. + * @return the SecurityPolicyConfigurations object itself. + */ + public SecurityPolicyConfigurations + withIpAccessRulesSecurityPolicy(IpAccessRulesSecurityPolicy ipAccessRulesSecurityPolicy) { + this.ipAccessRulesSecurityPolicy = ipAccessRulesSecurityPolicy; + return this; + } + /** * Validates the instance. * @@ -58,6 +82,9 @@ public void validate() { if (wafSecurityPolicy() != null) { wafSecurityPolicy().validate(); } + if (ipAccessRulesSecurityPolicy() != null) { + ipAccessRulesSecurityPolicy().validate(); + } } /** @@ -67,6 +94,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("wafSecurityPolicy", this.wafSecurityPolicy); + jsonWriter.writeJsonField("ipAccessRulesSecurityPolicy", this.ipAccessRulesSecurityPolicy); return jsonWriter.writeEndObject(); } @@ -87,6 +115,9 @@ public static SecurityPolicyConfigurations fromJson(JsonReader jsonReader) throw if ("wafSecurityPolicy".equals(fieldName)) { deserializedSecurityPolicyConfigurations.wafSecurityPolicy = WafSecurityPolicy.fromJson(reader); + } else if ("ipAccessRulesSecurityPolicy".equals(fieldName)) { + deserializedSecurityPolicyConfigurations.ipAccessRulesSecurityPolicy + = IpAccessRulesSecurityPolicy.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/SecurityPolicyProperties.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/SecurityPolicyProperties.java index 62b542d40410..edc063a4e0b0 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/SecurityPolicyProperties.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/main/java/com/azure/resourcemanager/servicenetworking/models/SecurityPolicyProperties.java @@ -22,10 +22,17 @@ public final class SecurityPolicyProperties implements JsonSerializable { /* - * Web Application Firewall Policy of the Traffic Controller Security Policy + * Web Application Firewall Policy of the Traffic Controller Security Policy. Single Security Policy can have only + * one policy type set. */ private WafPolicy wafPolicy; + /* + * Ip Access Policy of the Traffic Controller Security Policy. Single Security Policy can have only one policy type + * set. + */ + private IpAccessRulesPolicy ipAccessRulesPolicy; + /** * Creates an instance of SecurityPolicyUpdateProperties class. */ @@ -28,7 +35,8 @@ public SecurityPolicyUpdateProperties() { } /** - * Get the wafPolicy property: Web Application Firewall Policy of the Traffic Controller Security Policy. + * Get the wafPolicy property: Web Application Firewall Policy of the Traffic Controller Security Policy. Single + * Security Policy can have only one policy type set. * * @return the wafPolicy value. */ @@ -37,7 +45,8 @@ public WafPolicy wafPolicy() { } /** - * Set the wafPolicy property: Web Application Firewall Policy of the Traffic Controller Security Policy. + * Set the wafPolicy property: Web Application Firewall Policy of the Traffic Controller Security Policy. Single + * Security Policy can have only one policy type set. * * @param wafPolicy the wafPolicy value to set. * @return the SecurityPolicyUpdateProperties object itself. @@ -47,6 +56,28 @@ public SecurityPolicyUpdateProperties withWafPolicy(WafPolicy wafPolicy) { return this; } + /** + * Get the ipAccessRulesPolicy property: Ip Access Policy of the Traffic Controller Security Policy. Single Security + * Policy can have only one policy type set. + * + * @return the ipAccessRulesPolicy value. + */ + public IpAccessRulesPolicy ipAccessRulesPolicy() { + return this.ipAccessRulesPolicy; + } + + /** + * Set the ipAccessRulesPolicy property: Ip Access Policy of the Traffic Controller Security Policy. Single Security + * Policy can have only one policy type set. + * + * @param ipAccessRulesPolicy the ipAccessRulesPolicy value to set. + * @return the SecurityPolicyUpdateProperties object itself. + */ + public SecurityPolicyUpdateProperties withIpAccessRulesPolicy(IpAccessRulesPolicy ipAccessRulesPolicy) { + this.ipAccessRulesPolicy = ipAccessRulesPolicy; + return this; + } + /** * Validates the instance. * @@ -56,6 +87,9 @@ public void validate() { if (wafPolicy() != null) { wafPolicy().validate(); } + if (ipAccessRulesPolicy() != null) { + ipAccessRulesPolicy().validate(); + } } /** @@ -65,6 +99,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("wafPolicy", this.wafPolicy); + jsonWriter.writeJsonField("ipAccessRulesPolicy", this.ipAccessRulesPolicy); return jsonWriter.writeEndObject(); } @@ -86,6 +121,9 @@ public static SecurityPolicyUpdateProperties fromJson(JsonReader jsonReader) thr if ("wafPolicy".equals(fieldName)) { deserializedSecurityPolicyUpdateProperties.wafPolicy = WafPolicy.fromJson(reader); + } else if ("ipAccessRulesPolicy".equals(fieldName)) { + deserializedSecurityPolicyUpdateProperties.ipAccessRulesPolicy + = IpAccessRulesPolicy.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceCreateOrUpdateSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceCreateOrUpdateSamples.java index ab944c91693e..22516039e568 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceCreateOrUpdateSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceCreateOrUpdateSamples.java @@ -13,7 +13,7 @@ */ public final class AssociationsInterfaceCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-01-01/AssociationPut.json + * x-ms-original-file: 2025-03-01-preview/AssociationPut.json */ /** * Sample code: Put Association. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceDeleteSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceDeleteSamples.java index 46eb3a96f1fc..b10a17325708 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceDeleteSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class AssociationsInterfaceDeleteSamples { /* - * x-ms-original-file: 2025-01-01/AssociationDelete.json + * x-ms-original-file: 2025-03-01-preview/AssociationDelete.json */ /** * Sample code: Delete Association. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceGetSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceGetSamples.java index 6b7a83b4c8da..99c718ddca34 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceGetSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceGetSamples.java @@ -9,7 +9,7 @@ */ public final class AssociationsInterfaceGetSamples { /* - * x-ms-original-file: 2025-01-01/AssociationGet.json + * x-ms-original-file: 2025-03-01-preview/AssociationGet.json */ /** * Sample code: Get Association. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceListByTrafficControllerSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceListByTrafficControllerSamples.java index a11af15c14ee..8debb39ebb20 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceListByTrafficControllerSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceListByTrafficControllerSamples.java @@ -9,7 +9,7 @@ */ public final class AssociationsInterfaceListByTrafficControllerSamples { /* - * x-ms-original-file: 2025-01-01/AssociationsGet.json + * x-ms-original-file: 2025-03-01-preview/AssociationsGet.json */ /** * Sample code: Get Associations. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceUpdateSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceUpdateSamples.java index be32fc4fad81..3fbd36cbad1c 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceUpdateSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfaceUpdateSamples.java @@ -14,7 +14,7 @@ */ public final class AssociationsInterfaceUpdateSamples { /* - * x-ms-original-file: 2025-01-01/AssociationPatch.json + * x-ms-original-file: 2025-03-01-preview/AssociationPatch.json */ /** * Sample code: Update Association. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceCreateOrUpdateSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceCreateOrUpdateSamples.java index 868ed14117a8..25bd15dfcbb2 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceCreateOrUpdateSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceCreateOrUpdateSamples.java @@ -11,7 +11,7 @@ */ public final class FrontendsInterfaceCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-01-01/FrontendPut.json + * x-ms-original-file: 2025-03-01-preview/FrontendPut.json */ /** * Sample code: Put Frontend. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceDeleteSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceDeleteSamples.java index aa1e87e3c9ed..e805f55d260c 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceDeleteSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class FrontendsInterfaceDeleteSamples { /* - * x-ms-original-file: 2025-01-01/FrontendDelete.json + * x-ms-original-file: 2025-03-01-preview/FrontendDelete.json */ /** * Sample code: Delete Frontend. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceGetSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceGetSamples.java index b41195ed666f..530110fb5a7c 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceGetSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceGetSamples.java @@ -9,7 +9,7 @@ */ public final class FrontendsInterfaceGetSamples { /* - * x-ms-original-file: 2025-01-01/FrontendGet.json + * x-ms-original-file: 2025-03-01-preview/FrontendGet.json */ /** * Sample code: Get Frontend. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceListByTrafficControllerSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceListByTrafficControllerSamples.java index 14253752f46c..2b70371c26d1 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceListByTrafficControllerSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceListByTrafficControllerSamples.java @@ -9,7 +9,7 @@ */ public final class FrontendsInterfaceListByTrafficControllerSamples { /* - * x-ms-original-file: 2025-01-01/FrontendsGet.json + * x-ms-original-file: 2025-03-01-preview/FrontendsGet.json */ /** * Sample code: Get Frontends. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceUpdateSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceUpdateSamples.java index 4f0c3068c5b6..98661c0cce5c 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceUpdateSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfaceUpdateSamples.java @@ -11,7 +11,7 @@ */ public final class FrontendsInterfaceUpdateSamples { /* - * x-ms-original-file: 2025-01-01/FrontendPatch.json + * x-ms-original-file: 2025-03-01-preview/FrontendPatch.json */ /** * Sample code: Update Frontend. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/OperationsListSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/OperationsListSamples.java index 1861b77c5a0d..fbdedc7fa093 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/OperationsListSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/OperationsListSamples.java @@ -9,7 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: 2025-01-01/OperationsList.json + * x-ms-original-file: 2025-03-01-preview/OperationsList.json */ /** * Sample code: Get Operations List. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceCreateOrUpdateSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceCreateOrUpdateSamples.java index 2b5741f872a7..6bcfe90061ac 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceCreateOrUpdateSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceCreateOrUpdateSamples.java @@ -4,22 +4,44 @@ package com.azure.resourcemanager.servicenetworking.generated; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyProperties; import com.azure.resourcemanager.servicenetworking.models.WafPolicy; +import java.util.Arrays; /** * Samples for SecurityPoliciesInterface CreateOrUpdate. */ public final class SecurityPoliciesInterfaceCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-01-01/SecurityPolicyPut.json + * x-ms-original-file: 2025-03-01-preview/IpAccessRulesSecurityPolicyPut.json */ /** - * Sample code: Put SecurityPolicy. + * Sample code: Put IpAccessRules SecurityPolicy. * * @param manager Entry point to TrafficControllerManager. */ - public static void putSecurityPolicy(com.azure.resourcemanager.servicenetworking.TrafficControllerManager manager) { + public static void + putIpAccessRulesSecurityPolicy(com.azure.resourcemanager.servicenetworking.TrafficControllerManager manager) { + manager.securityPoliciesInterfaces() + .define("sp1") + .withRegion("NorthCentralUS") + .withExistingTrafficController("rg1", "tc1") + .withProperties(new SecurityPolicyProperties() + .withIpAccessRulesPolicy(new IpAccessRulesPolicy().withRules(Arrays.asList()))) + .create(); + } + + /* + * x-ms-original-file: 2025-03-01-preview/WafSecurityPolicyPut.json + */ + /** + * Sample code: Put WAF SecurityPolicy. + * + * @param manager Entry point to TrafficControllerManager. + */ + public static void + putWAFSecurityPolicy(com.azure.resourcemanager.servicenetworking.TrafficControllerManager manager) { manager.securityPoliciesInterfaces() .define("sp1") .withRegion("NorthCentralUS") diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceDeleteSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceDeleteSamples.java index f2374819aab3..9a10a2259a0a 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceDeleteSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class SecurityPoliciesInterfaceDeleteSamples { /* - * x-ms-original-file: 2025-01-01/SecurityPolicyDelete.json + * x-ms-original-file: 2025-03-01-preview/SecurityPolicyDelete.json */ /** * Sample code: Delete SecurityPolicy. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceGetSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceGetSamples.java index 7c2ea512e0b1..b4cb398fbe6e 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceGetSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceGetSamples.java @@ -9,7 +9,7 @@ */ public final class SecurityPoliciesInterfaceGetSamples { /* - * x-ms-original-file: 2025-01-01/SecurityPolicyGet.json + * x-ms-original-file: 2025-03-01-preview/SecurityPolicyGet.json */ /** * Sample code: Get SecurityPolicy. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceListByTrafficControllerSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceListByTrafficControllerSamples.java index 29ea5a62bc34..eef4c35aa412 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceListByTrafficControllerSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceListByTrafficControllerSamples.java @@ -9,7 +9,7 @@ */ public final class SecurityPoliciesInterfaceListByTrafficControllerSamples { /* - * x-ms-original-file: 2025-01-01/SecurityPoliciesGetList.json + * x-ms-original-file: 2025-03-01-preview/SecurityPoliciesGetList.json */ /** * Sample code: Get SecurityPolicies. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceUpdateSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceUpdateSamples.java index 5d1ef468fcb4..1eebbe761c45 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceUpdateSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfaceUpdateSamples.java @@ -4,24 +4,45 @@ package com.azure.resourcemanager.servicenetworking.generated; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyUpdateProperties; import com.azure.resourcemanager.servicenetworking.models.WafPolicy; +import java.util.Arrays; /** * Samples for SecurityPoliciesInterface Update. */ public final class SecurityPoliciesInterfaceUpdateSamples { /* - * x-ms-original-file: 2025-01-01/SecurityPolicyPatch.json + * x-ms-original-file: 2025-03-01-preview/IpAccessRulesSecurityPolicyPatch.json */ /** - * Sample code: Update SecurityPolicy. + * Sample code: Update IpAccessRules SecurityPolicy. + * + * @param manager Entry point to TrafficControllerManager. + */ + public static void updateIpAccessRulesSecurityPolicy( + com.azure.resourcemanager.servicenetworking.TrafficControllerManager manager) { + SecurityPolicy resource = manager.securityPoliciesInterfaces() + .getWithResponse("rg1", "tc1", "sp1", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new SecurityPolicyUpdateProperties() + .withIpAccessRulesPolicy(new IpAccessRulesPolicy().withRules(Arrays.asList()))) + .apply(); + } + + /* + * x-ms-original-file: 2025-03-01-preview/WafSecurityPolicyPatch.json + */ + /** + * Sample code: Update WAF SecurityPolicy. * * @param manager Entry point to TrafficControllerManager. */ public static void - updateSecurityPolicy(com.azure.resourcemanager.servicenetworking.TrafficControllerManager manager) { + updateWAFSecurityPolicy(com.azure.resourcemanager.servicenetworking.TrafficControllerManager manager) { SecurityPolicy resource = manager.securityPoliciesInterfaces() .getWithResponse("rg1", "tc1", "sp1", com.azure.core.util.Context.NONE) .getValue(); diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceCreateOrUpdateSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceCreateOrUpdateSamples.java index f1281458a915..2a7f87985705 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceCreateOrUpdateSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceCreateOrUpdateSamples.java @@ -12,7 +12,7 @@ */ public final class TrafficControllerInterfaceCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-01-01/TrafficControllerPut.json + * x-ms-original-file: 2025-03-01-preview/TrafficControllerPut.json */ /** * Sample code: Put Traffic Controller. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceDeleteSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceDeleteSamples.java index 38eaaa20b15e..d06112db37d3 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceDeleteSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class TrafficControllerInterfaceDeleteSamples { /* - * x-ms-original-file: 2025-01-01/TrafficControllerDelete.json + * x-ms-original-file: 2025-03-01-preview/TrafficControllerDelete.json */ /** * Sample code: Delete Traffic Controller. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceGetByResourceGroupSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceGetByResourceGroupSamples.java index d88be41a0bc4..de43e8ac262d 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceGetByResourceGroupSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class TrafficControllerInterfaceGetByResourceGroupSamples { /* - * x-ms-original-file: 2025-01-01/TrafficControllerGet.json + * x-ms-original-file: 2025-03-01-preview/TrafficControllerGet.json */ /** * Sample code: Get Traffic Controller. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceListByResourceGroupSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceListByResourceGroupSamples.java index 752e0454eb2e..28d0e24e9c7e 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceListByResourceGroupSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceListByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class TrafficControllerInterfaceListByResourceGroupSamples { /* - * x-ms-original-file: 2025-01-01/TrafficControllersGet.json + * x-ms-original-file: 2025-03-01-preview/TrafficControllersGet.json */ /** * Sample code: Get Traffic Controllers. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceListSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceListSamples.java index 3f696918d191..c3d885fb63e2 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceListSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceListSamples.java @@ -9,7 +9,7 @@ */ public final class TrafficControllerInterfaceListSamples { /* - * x-ms-original-file: 2025-01-01/TrafficControllersGetList.json + * x-ms-original-file: 2025-03-01-preview/TrafficControllersGetList.json */ /** * Sample code: Get Traffic Controllers List. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceUpdateSamples.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceUpdateSamples.java index bf73e4f3d9b4..8568d3dcb660 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceUpdateSamples.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/samples/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfaceUpdateSamples.java @@ -13,7 +13,7 @@ */ public final class TrafficControllerInterfaceUpdateSamples { /* - * x-ms-original-file: 2025-01-01/TrafficControllerPatch.json + * x-ms-original-file: 2025-03-01-preview/TrafficControllerPatch.json */ /** * Sample code: Patch Traffic Controller. diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationListResultTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationListResultTests.java index 0f67d464cfae..9116316b7db4 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationListResultTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationListResultTests.java @@ -13,12 +13,12 @@ public final class AssociationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AssociationListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"associationType\":\"subnets\",\"subnet\":{\"id\":\"esaagdfm\"},\"provisioningState\":\"Provisioning\"},\"location\":\"hjxri\",\"tags\":{\"pa\":\"mrvktsizntoc\",\"poyfdkfogkn\":\"uajpsquc\",\"eqsrdeupewnwreit\":\"gjofjd\",\"usarhmofc\":\"zyf\"},\"id\":\"hs\",\"name\":\"yurkdtmlxhekuksj\",\"type\":\"xukcdmpar\"},{\"properties\":{\"associationType\":\"subnets\",\"subnet\":{\"id\":\"anzwuxzdxta\"},\"provisioningState\":\"Accepted\"},\"location\":\"m\",\"tags\":{\"u\":\"pmrqobm\"},\"id\":\"knryrtihfxtij\",\"name\":\"pzvgnwzsymglzufc\",\"type\":\"zk\"},{\"properties\":{\"associationType\":\"subnets\",\"subnet\":{\"id\":\"ihanuf\"},\"provisioningState\":\"Canceled\"},\"location\":\"jysagith\",\"tags\":{\"npqxuh\":\"abifpikxwczbys\"},\"id\":\"vyq\",\"name\":\"iwbybrkxvdumjg\",\"type\":\"tfwvukxgaudc\"},{\"properties\":{\"associationType\":\"subnets\",\"subnet\":{\"id\":\"s\"},\"provisioningState\":\"Updating\"},\"location\":\"ejhkry\",\"tags\":{\"lokjyemkk\":\"apcz\",\"joxzjnchgejspodm\":\"ni\",\"h\":\"ilzyd\"},\"id\":\"jwyahuxinpmqnja\",\"name\":\"wixjsprozvcp\",\"type\":\"tegjvwmf\"}],\"nextLink\":\"t\"}") + "{\"value\":[{\"properties\":{\"associationType\":\"subnets\",\"subnet\":{\"id\":\"j\"},\"provisioningState\":\"Accepted\"},\"location\":\"kwm\",\"tags\":{\"psqucmpoyf\":\"tsizntocipaoua\",\"knygjofjddeq\":\"kfo\",\"upewnwreitjzy\":\"rd\",\"ofcqhsm\":\"lusarh\"},\"id\":\"urkdtmlx\",\"name\":\"ekuksjtx\",\"type\":\"kc\"}],\"nextLink\":\"parcry\"}") .toObject(AssociationListResult.class); - Assertions.assertEquals("hjxri", model.value().get(0).location()); - Assertions.assertEquals("mrvktsizntoc", model.value().get(0).tags().get("pa")); + Assertions.assertEquals("kwm", model.value().get(0).location()); + Assertions.assertEquals("tsizntocipaoua", model.value().get(0).tags().get("psqucmpoyf")); Assertions.assertEquals(AssociationType.SUBNETS, model.value().get(0).properties().associationType()); - Assertions.assertEquals("esaagdfm", model.value().get(0).properties().subnet().id()); - Assertions.assertEquals("t", model.nextLink()); + Assertions.assertEquals("j", model.value().get(0).properties().subnet().id()); + Assertions.assertEquals("parcry", model.nextLink()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationSubnetUpdateTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationSubnetUpdateTests.java index ace6cb2fe0c5..280144d138ff 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationSubnetUpdateTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationSubnetUpdateTests.java @@ -12,14 +12,14 @@ public final class AssociationSubnetUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AssociationSubnetUpdate model - = BinaryData.fromString("{\"id\":\"lhqgnufooojy\"}").toObject(AssociationSubnetUpdate.class); - Assertions.assertEquals("lhqgnufooojy", model.id()); + = BinaryData.fromString("{\"id\":\"esaagdfm\"}").toObject(AssociationSubnetUpdate.class); + Assertions.assertEquals("esaagdfm", model.id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - AssociationSubnetUpdate model = new AssociationSubnetUpdate().withId("lhqgnufooojy"); + AssociationSubnetUpdate model = new AssociationSubnetUpdate().withId("esaagdfm"); model = BinaryData.fromObject(model).toObject(AssociationSubnetUpdate.class); - Assertions.assertEquals("lhqgnufooojy", model.id()); + Assertions.assertEquals("esaagdfm", model.id()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationUpdatePropertiesTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationUpdatePropertiesTests.java index 800cda8e6b30..3b9299a1280d 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationUpdatePropertiesTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationUpdatePropertiesTests.java @@ -14,19 +14,19 @@ public final class AssociationUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AssociationUpdateProperties model - = BinaryData.fromString("{\"associationType\":\"subnets\",\"subnet\":{\"id\":\"nq\"}}") + = BinaryData.fromString("{\"associationType\":\"subnets\",\"subnet\":{\"id\":\"jywif\"}}") .toObject(AssociationUpdateProperties.class); Assertions.assertEquals(AssociationType.SUBNETS, model.associationType()); - Assertions.assertEquals("nq", model.subnet().id()); + Assertions.assertEquals("jywif", model.subnet().id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { AssociationUpdateProperties model = new AssociationUpdateProperties().withAssociationType(AssociationType.SUBNETS) - .withSubnet(new AssociationSubnetUpdate().withId("nq")); + .withSubnet(new AssociationSubnetUpdate().withId("jywif")); model = BinaryData.fromObject(model).toObject(AssociationUpdateProperties.class); Assertions.assertEquals(AssociationType.SUBNETS, model.associationType()); - Assertions.assertEquals("nq", model.subnet().id()); + Assertions.assertEquals("jywif", model.subnet().id()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationUpdateTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationUpdateTests.java index c86fe9e2353e..1edaf422898d 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationUpdateTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationUpdateTests.java @@ -16,24 +16,23 @@ public final class AssociationUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AssociationUpdate model = BinaryData - .fromString( - "{\"tags\":{\"fp\":\"c\"},\"properties\":{\"associationType\":\"subnets\",\"subnet\":{\"id\":\"t\"}}}") + AssociationUpdate model = BinaryData.fromString( + "{\"tags\":{\"fp\":\"c\"},\"properties\":{\"associationType\":\"subnets\",\"subnet\":{\"id\":\"cqqjnqglhqgn\"}}}") .toObject(AssociationUpdate.class); Assertions.assertEquals("c", model.tags().get("fp")); Assertions.assertEquals(AssociationType.SUBNETS, model.properties().associationType()); - Assertions.assertEquals("t", model.properties().subnet().id()); + Assertions.assertEquals("cqqjnqglhqgn", model.properties().subnet().id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { AssociationUpdate model = new AssociationUpdate().withTags(mapOf("fp", "c")) .withProperties(new AssociationUpdateProperties().withAssociationType(AssociationType.SUBNETS) - .withSubnet(new AssociationSubnetUpdate().withId("t"))); + .withSubnet(new AssociationSubnetUpdate().withId("cqqjnqglhqgn"))); model = BinaryData.fromObject(model).toObject(AssociationUpdate.class); Assertions.assertEquals("c", model.tags().get("fp")); Assertions.assertEquals(AssociationType.SUBNETS, model.properties().associationType()); - Assertions.assertEquals("t", model.properties().subnet().id()); + Assertions.assertEquals("cqqjnqglhqgn", model.properties().subnet().id()); } // Use "Map.of" if available diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfacesCreateOrUpdateMockTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfacesCreateOrUpdateMockTests.java index d0b29e7d9e7f..5a9d707b763e 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfacesCreateOrUpdateMockTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfacesCreateOrUpdateMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicenetworking.TrafficControllerManager; import com.azure.resourcemanager.servicenetworking.models.Association; @@ -26,29 +26,28 @@ public final class AssociationsInterfacesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"associationType\":\"subnets\",\"subnet\":{\"id\":\"kt\"},\"provisioningState\":\"Succeeded\"},\"location\":\"nhwlrsffrzpwvl\",\"tags\":{\"kt\":\"gbiqylihkaet\"},\"id\":\"fcivfsnkym\",\"name\":\"ctq\",\"type\":\"jf\"}"; + = "{\"properties\":{\"associationType\":\"subnets\",\"subnet\":{\"id\":\"wd\"},\"provisioningState\":\"Succeeded\"},\"location\":\"tsdbpgn\",\"tags\":{\"pzxbz\":\"x\"},\"id\":\"fzab\",\"name\":\"lcuhxwtctyqiklb\",\"type\":\"ovplw\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); TrafficControllerManager manager = TrafficControllerManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Association response = manager.associationsInterfaces() - .define("jdeyeamdpha") - .withRegion("ow") - .withExistingTrafficController("sjttgzfbish", "bkh") - .withTags(mapOf("tmryw", "hwankixzbinjepu", "yqzrnkcqvyxlw", "uzoqft", "oqqnwvlryav", "zlsico", "konocu", - "hheunmmqhgyx")) + .define("lhaaxdbabp") + .withRegion("mnyyazt") + .withExistingTrafficController("nrs", "nlqidybyxczf") + .withTags(mapOf("uedck", "wwrq", "bxu", "ywbiexzfeyueax")) .withProperties(new AssociationProperties().withAssociationType(AssociationType.SUBNETS) - .withSubnet(new AssociationSubnet().withId("buxwgip"))) + .withSubnet(new AssociationSubnet().withId("qlfktsths"))) .create(); - Assertions.assertEquals("nhwlrsffrzpwvl", response.location()); - Assertions.assertEquals("gbiqylihkaet", response.tags().get("kt")); + Assertions.assertEquals("tsdbpgn", response.location()); + Assertions.assertEquals("x", response.tags().get("pzxbz")); Assertions.assertEquals(AssociationType.SUBNETS, response.properties().associationType()); - Assertions.assertEquals("kt", response.properties().subnet().id()); + Assertions.assertEquals("wd", response.properties().subnet().id()); } // Use "Map.of" if available diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfacesGetWithResponseMockTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfacesGetWithResponseMockTests.java index fd38c926fd88..ae0b3822d557 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfacesGetWithResponseMockTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfacesGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicenetworking.TrafficControllerManager; import com.azure.resourcemanager.servicenetworking.models.Association; @@ -22,22 +22,22 @@ public final class AssociationsInterfacesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"associationType\":\"subnets\",\"subnet\":{\"id\":\"ruwiqzbqjvsov\"},\"provisioningState\":\"Provisioning\"},\"location\":\"acspkwl\",\"tags\":{\"hrk\":\"obpxjmflbvvn\",\"ajiwkuo\":\"ciwwzjuqkhr\",\"sauuimj\":\"oskg\",\"rfbyaosvexcso\":\"vxieduugidyj\"},\"id\":\"pclhocohslk\",\"name\":\"vleggzfbuhfmvfax\",\"type\":\"ffeii\"}"; + = "{\"properties\":{\"associationType\":\"subnets\",\"subnet\":{\"id\":\"ihkaetcktvfc\"},\"provisioningState\":\"Deleting\"},\"location\":\"nkymuctqhjfbebrj\",\"tags\":{\"xfvjrbirp\":\"rfuwutt\",\"jky\":\"xepcyvahfn\",\"ljyoxgvcltb\":\"xjvuujqgidokg\"},\"id\":\"sncghkjeszz\",\"name\":\"bijhtxfvgxbf\",\"type\":\"mxnehmp\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); TrafficControllerManager manager = TrafficControllerManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Association response = manager.associationsInterfaces() - .getWithResponse("oczvy", "fqrvkdvjsllrmvvd", "watkpnpulexxb", com.azure.core.util.Context.NONE) + .getWithResponse("wrmjmwvvjektc", "senhwlrs", "frzpwvlqdqgb", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("acspkwl", response.location()); - Assertions.assertEquals("obpxjmflbvvn", response.tags().get("hrk")); + Assertions.assertEquals("nkymuctqhjfbebrj", response.location()); + Assertions.assertEquals("rfuwutt", response.tags().get("xfvjrbirp")); Assertions.assertEquals(AssociationType.SUBNETS, response.properties().associationType()); - Assertions.assertEquals("ruwiqzbqjvsov", response.properties().subnet().id()); + Assertions.assertEquals("ihkaetcktvfc", response.properties().subnet().id()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfacesListByTrafficControllerMockTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfacesListByTrafficControllerMockTests.java index 5af9ec400cc5..efde7e063918 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfacesListByTrafficControllerMockTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/AssociationsInterfacesListByTrafficControllerMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicenetworking.TrafficControllerManager; import com.azure.resourcemanager.servicenetworking.models.Association; @@ -23,21 +23,21 @@ public final class AssociationsInterfacesListByTrafficControllerMockTests { @Test public void testListByTrafficController() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"associationType\":\"subnets\",\"subnet\":{\"id\":\"shxmzsbbzoggigrx\"},\"provisioningState\":\"Updating\"},\"location\":\"vjxxjnsp\",\"tags\":{\"nkoukn\":\"tko\",\"ngkpocipazy\":\"udwtiukbl\",\"gukgjnpiucgygevq\":\"o\"},\"id\":\"ntypmrbpizcdrqj\",\"name\":\"dpydn\",\"type\":\"yhxdeoejzicwi\"}]}"; + = "{\"value\":[{\"properties\":{\"associationType\":\"subnets\",\"subnet\":{\"id\":\"wflzlfbxzpuzy\"},\"provisioningState\":\"Canceled\"},\"location\":\"nqzahmgkbrpyyd\",\"tags\":{\"agnb\":\"nuqqkpikadrgvt\",\"fsiarbutr\":\"ynhijggme\",\"jrunmpxtt\":\"vpnazzm\"},\"id\":\"bh\",\"name\":\"bnlankxmyskpb\",\"type\":\"enbtkcxywny\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); TrafficControllerManager manager = TrafficControllerManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response - = manager.associationsInterfaces().listByTrafficController("hl", "m", com.azure.core.util.Context.NONE); + PagedIterable response = manager.associationsInterfaces() + .listByTrafficController("ec", "godebfqkkrbmpu", com.azure.core.util.Context.NONE); - Assertions.assertEquals("vjxxjnsp", response.iterator().next().location()); - Assertions.assertEquals("tko", response.iterator().next().tags().get("nkoukn")); + Assertions.assertEquals("nqzahmgkbrpyyd", response.iterator().next().location()); + Assertions.assertEquals("nuqqkpikadrgvt", response.iterator().next().tags().get("agnb")); Assertions.assertEquals(AssociationType.SUBNETS, response.iterator().next().properties().associationType()); - Assertions.assertEquals("shxmzsbbzoggigrx", response.iterator().next().properties().subnet().id()); + Assertions.assertEquals("wflzlfbxzpuzy", response.iterator().next().properties().subnet().id()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendInnerTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendInnerTests.java index db5da72de430..42251ab0b327 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendInnerTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendInnerTests.java @@ -7,6 +7,9 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.servicenetworking.fluent.models.FrontendInner; import com.azure.resourcemanager.servicenetworking.models.FrontendProperties; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesSecurityPolicy; +import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyConfigurations; +import com.azure.resourcemanager.servicenetworking.models.WafSecurityPolicy; import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Assertions; @@ -15,20 +18,30 @@ public final class FrontendInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FrontendInner model = BinaryData.fromString( - "{\"properties\":{\"fqdn\":\"dvpjhulsuuvmk\",\"provisioningState\":\"Provisioning\"},\"location\":\"rwfndiod\",\"tags\":{\"ryo\":\"lwejdpv\",\"hbcryffdfdosyge\":\"psoacctazakljl\",\"rzevdphlxaol\":\"paojakhmsbzjh\"},\"id\":\"hqtrgqjbpf\",\"name\":\"fsinzgvfcjrwzoxx\",\"type\":\"tfell\"}") + "{\"properties\":{\"fqdn\":\"zwuxzd\",\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"yrlhmwhfpmrqobm\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"kknryrtihf\"}},\"provisioningState\":\"Deleting\"},\"location\":\"bpzvgn\",\"tags\":{\"ohdbihanufh\":\"ymglzufcyz\",\"a\":\"cbjy\",\"xwczbyscnp\":\"ithxqhabifpi\"},\"id\":\"x\",\"name\":\"hiv\",\"type\":\"qniwbybrkxvdumj\"}") .toObject(FrontendInner.class); - Assertions.assertEquals("rwfndiod", model.location()); - Assertions.assertEquals("lwejdpv", model.tags().get("ryo")); + Assertions.assertEquals("bpzvgn", model.location()); + Assertions.assertEquals("ymglzufcyz", model.tags().get("ohdbihanufh")); + Assertions.assertEquals("yrlhmwhfpmrqobm", + model.properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("kknryrtihf", + model.properties().securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FrontendInner model = new FrontendInner().withLocation("rwfndiod") - .withTags(mapOf("ryo", "lwejdpv", "hbcryffdfdosyge", "psoacctazakljl", "rzevdphlxaol", "paojakhmsbzjh")) - .withProperties(new FrontendProperties()); + FrontendInner model = new FrontendInner().withLocation("bpzvgn") + .withTags(mapOf("ohdbihanufh", "ymglzufcyz", "a", "cbjy", "xwczbyscnp", "ithxqhabifpi")) + .withProperties(new FrontendProperties().withSecurityPolicyConfigurations(new SecurityPolicyConfigurations() + .withWafSecurityPolicy(new WafSecurityPolicy().withId("yrlhmwhfpmrqobm")) + .withIpAccessRulesSecurityPolicy(new IpAccessRulesSecurityPolicy().withId("kknryrtihf")))); model = BinaryData.fromObject(model).toObject(FrontendInner.class); - Assertions.assertEquals("rwfndiod", model.location()); - Assertions.assertEquals("lwejdpv", model.tags().get("ryo")); + Assertions.assertEquals("bpzvgn", model.location()); + Assertions.assertEquals("ymglzufcyz", model.tags().get("ohdbihanufh")); + Assertions.assertEquals("yrlhmwhfpmrqobm", + model.properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("kknryrtihf", + model.properties().securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } // Use "Map.of" if available diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendListResultTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendListResultTests.java index bd572a83e736..24aeffc3eb80 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendListResultTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendListResultTests.java @@ -12,10 +12,14 @@ public final class FrontendListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FrontendListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"fqdn\":\"v\",\"provisioningState\":\"Deleting\"},\"location\":\"ihnhun\",\"tags\":{\"gxg\":\"jzrnf\",\"fublj\":\"spemvtzfk\",\"aeqjhqjbasvms\":\"fxqeof\",\"gsntnbybkzgcwr\":\"jqul\"},\"id\":\"clxxwrljdo\",\"name\":\"skcqvkocrcjd\",\"type\":\"wtnhxbnjbiksqr\"},{\"properties\":{\"fqdn\":\"sainqpjwnzl\",\"provisioningState\":\"Deleting\"},\"location\":\"ppeebvmgxsab\",\"tags\":{\"c\":\"duuji\",\"dhkrwpdappdsbdk\":\"czdzev\",\"nhutjeltmrldhugj\":\"wrwjfeu\",\"ablgphuticndvk\":\"zdatqxhocdg\"},\"id\":\"ozwyiftyhxhuro\",\"name\":\"ftyxolniw\",\"type\":\"wcukjfkgiawxk\"},{\"properties\":{\"fqdn\":\"plwckbas\",\"provisioningState\":\"Deleting\"},\"location\":\"ddhsgcbacphe\",\"tags\":{\"ndlik\":\"tynqgoul\"},\"id\":\"yqkgfg\",\"name\":\"bmadgak\",\"type\":\"qsrxybzqqed\"}],\"nextLink\":\"tbciqfouflmm\"}") + "{\"value\":[{\"properties\":{\"fqdn\":\"dfdosygexp\",\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"akhmsbzjhcrz\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"dphlxaolt\"}},\"provisioningState\":\"Deleting\"},\"location\":\"gqjbpfzfsin\",\"tags\":{\"jrwzox\":\"f\"},\"id\":\"j\",\"name\":\"felluwfzitonpe\",\"type\":\"fpjkjlxofp\"},{\"properties\":{\"fqdn\":\"pfxxy\",\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"i\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"ayhuy\"}},\"provisioningState\":\"Deleting\"},\"location\":\"odepoogin\",\"tags\":{\"gnarxzxtheo\":\"mihe\",\"cciqihnhungbwjz\":\"usivye\",\"kufubljo\":\"nfygxgispemvtz\"},\"id\":\"xqeofjaeqjhqjba\",\"name\":\"v\",\"type\":\"smjqulngsntnbyb\"}],\"nextLink\":\"gc\"}") .toObject(FrontendListResult.class); - Assertions.assertEquals("ihnhun", model.value().get(0).location()); - Assertions.assertEquals("jzrnf", model.value().get(0).tags().get("gxg")); - Assertions.assertEquals("tbciqfouflmm", model.nextLink()); + Assertions.assertEquals("gqjbpfzfsin", model.value().get(0).location()); + Assertions.assertEquals("f", model.value().get(0).tags().get("jrwzox")); + Assertions.assertEquals("akhmsbzjhcrz", + model.value().get(0).properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("dphlxaolt", + model.value().get(0).properties().securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); + Assertions.assertEquals("gc", model.nextLink()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendPropertiesTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendPropertiesTests.java index 68194b508821..ec40854395eb 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendPropertiesTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendPropertiesTests.java @@ -6,17 +6,30 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.servicenetworking.models.FrontendProperties; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesSecurityPolicy; +import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyConfigurations; +import com.azure.resourcemanager.servicenetworking.models.WafSecurityPolicy; +import org.junit.jupiter.api.Assertions; public final class FrontendPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - FrontendProperties model = BinaryData.fromString("{\"fqdn\":\"fziton\",\"provisioningState\":\"Updating\"}") + FrontendProperties model = BinaryData.fromString( + "{\"fqdn\":\"tfwvukxgaudc\",\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"h\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"cnyejhkryhtnapcz\"}},\"provisioningState\":\"Updating\"}") .toObject(FrontendProperties.class); + Assertions.assertEquals("h", model.securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("cnyejhkryhtnapcz", + model.securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FrontendProperties model = new FrontendProperties(); + FrontendProperties model = new FrontendProperties().withSecurityPolicyConfigurations( + new SecurityPolicyConfigurations().withWafSecurityPolicy(new WafSecurityPolicy().withId("h")) + .withIpAccessRulesSecurityPolicy(new IpAccessRulesSecurityPolicy().withId("cnyejhkryhtnapcz"))); model = BinaryData.fromObject(model).toObject(FrontendProperties.class); + Assertions.assertEquals("h", model.securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("cnyejhkryhtnapcz", + model.securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendUpdatePropertiesTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendUpdatePropertiesTests.java new file mode 100644 index 000000000000..a3ebf3108cea --- /dev/null +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendUpdatePropertiesTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicenetworking.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicenetworking.models.FrontendUpdateProperties; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesSecurityPolicy; +import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyConfigurations; +import com.azure.resourcemanager.servicenetworking.models.WafSecurityPolicy; +import org.junit.jupiter.api.Assertions; + +public final class FrontendUpdatePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + FrontendUpdateProperties model = BinaryData.fromString( + "{\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"akl\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"ahbc\"}}}") + .toObject(FrontendUpdateProperties.class); + Assertions.assertEquals("akl", model.securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("ahbc", model.securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + FrontendUpdateProperties model = new FrontendUpdateProperties().withSecurityPolicyConfigurations( + new SecurityPolicyConfigurations().withWafSecurityPolicy(new WafSecurityPolicy().withId("akl")) + .withIpAccessRulesSecurityPolicy(new IpAccessRulesSecurityPolicy().withId("ahbc"))); + model = BinaryData.fromObject(model).toObject(FrontendUpdateProperties.class); + Assertions.assertEquals("akl", model.securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("ahbc", model.securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); + } +} diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendUpdateTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendUpdateTests.java index 42e38eeff20a..ae8fbc29a23a 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendUpdateTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendUpdateTests.java @@ -6,6 +6,10 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.servicenetworking.models.FrontendUpdate; +import com.azure.resourcemanager.servicenetworking.models.FrontendUpdateProperties; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesSecurityPolicy; +import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyConfigurations; +import com.azure.resourcemanager.servicenetworking.models.WafSecurityPolicy; import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Assertions; @@ -13,19 +17,27 @@ public final class FrontendUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - FrontendUpdate model = BinaryData - .fromString( - "{\"tags\":{\"ypininm\":\"jkjlxofpdvhpfx\",\"po\":\"yhuybbkpod\",\"ognarxzxtheotus\":\"ginuvamih\"}}") + FrontendUpdate model = BinaryData.fromString( + "{\"tags\":{\"ixjsprozvcputeg\":\"xinpmqnjaq\",\"atscmd\":\"vwmf\",\"zkrwfn\":\"pjhulsuuvmkj\"},\"properties\":{\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"jpslwejd\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"wryoqpsoacc\"}}}}") .toObject(FrontendUpdate.class); - Assertions.assertEquals("jkjlxofpdvhpfx", model.tags().get("ypininm")); + Assertions.assertEquals("xinpmqnjaq", model.tags().get("ixjsprozvcputeg")); + Assertions.assertEquals("jpslwejd", model.properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("wryoqpsoacc", + model.properties().securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { FrontendUpdate model = new FrontendUpdate() - .withTags(mapOf("ypininm", "jkjlxofpdvhpfx", "po", "yhuybbkpod", "ognarxzxtheotus", "ginuvamih")); + .withTags(mapOf("ixjsprozvcputeg", "xinpmqnjaq", "atscmd", "vwmf", "zkrwfn", "pjhulsuuvmkj")) + .withProperties(new FrontendUpdateProperties().withSecurityPolicyConfigurations( + new SecurityPolicyConfigurations().withWafSecurityPolicy(new WafSecurityPolicy().withId("jpslwejd")) + .withIpAccessRulesSecurityPolicy(new IpAccessRulesSecurityPolicy().withId("wryoqpsoacc")))); model = BinaryData.fromObject(model).toObject(FrontendUpdate.class); - Assertions.assertEquals("jkjlxofpdvhpfx", model.tags().get("ypininm")); + Assertions.assertEquals("xinpmqnjaq", model.tags().get("ixjsprozvcputeg")); + Assertions.assertEquals("jpslwejd", model.properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("wryoqpsoacc", + model.properties().securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } // Use "Map.of" if available diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfacesCreateOrUpdateMockTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfacesCreateOrUpdateMockTests.java index d0417343ed76..ac3d3859c773 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfacesCreateOrUpdateMockTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfacesCreateOrUpdateMockTests.java @@ -6,12 +6,15 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicenetworking.TrafficControllerManager; import com.azure.resourcemanager.servicenetworking.models.Frontend; import com.azure.resourcemanager.servicenetworking.models.FrontendProperties; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesSecurityPolicy; +import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyConfigurations; +import com.azure.resourcemanager.servicenetworking.models.WafSecurityPolicy; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.HashMap; @@ -24,25 +27,30 @@ public final class FrontendsInterfacesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"fqdn\":\"iwdjswztsdbpgn\",\"provisioningState\":\"Succeeded\"},\"location\":\"hpzxbzpfzab\",\"tags\":{\"lwzbhvgyugu\":\"uhxwtctyqiklbbov\"},\"id\":\"svmkfssxquk\",\"name\":\"fpl\",\"type\":\"mg\"}"; + = "{\"properties\":{\"fqdn\":\"alaexqpvfadmwsrc\",\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"xpvgo\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"lf\"}},\"provisioningState\":\"Succeeded\"},\"location\":\"wbnb\",\"tags\":{\"urqhaka\":\"dawkzbali\",\"xcug\":\"hashsfwxosow\",\"ovbvmeueciv\":\"cjooxdjebwpucwwf\",\"otwmcdyt\":\"hzceuojgjrwjue\"},\"id\":\"x\",\"name\":\"it\",\"type\":\"nrjawgqwg\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); TrafficControllerManager manager = TrafficControllerManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Frontend response = manager.frontendsInterfaces() - .define("axdbabph") - .withRegion("mnyyazt") - .withExistingTrafficController("xywnytnrsynlqidy", "yxczfclh") - .withTags(mapOf("uedck", "wwrq", "bxu", "ywbiexzfeyueax")) - .withProperties(new FrontendProperties()) + .define("qj") + .withRegion("afkuwb") + .withExistingTrafficController("udxytlmoyrx", "wfudwpzntxhdzhl") + .withTags(mapOf("hseyvju", "wbme", "hspkdeemao", "rts")) + .withProperties(new FrontendProperties().withSecurityPolicyConfigurations( + new SecurityPolicyConfigurations().withWafSecurityPolicy(new WafSecurityPolicy().withId("ca")) + .withIpAccessRulesSecurityPolicy(new IpAccessRulesSecurityPolicy().withId("z")))) .create(); - Assertions.assertEquals("hpzxbzpfzab", response.location()); - Assertions.assertEquals("uhxwtctyqiklbbov", response.tags().get("lwzbhvgyugu")); + Assertions.assertEquals("wbnb", response.location()); + Assertions.assertEquals("dawkzbali", response.tags().get("urqhaka")); + Assertions.assertEquals("xpvgo", response.properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("lf", + response.properties().securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } // Use "Map.of" if available diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfacesGetWithResponseMockTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfacesGetWithResponseMockTests.java index d7ee7f472e60..f2e9baf27d53 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfacesGetWithResponseMockTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfacesGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicenetworking.TrafficControllerManager; import com.azure.resourcemanager.servicenetworking.models.Frontend; @@ -21,20 +21,24 @@ public final class FrontendsInterfacesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"fqdn\":\"nljky\",\"provisioningState\":\"Failed\"},\"location\":\"uujqgidokgjljyo\",\"tags\":{\"hbijhtxfvgxb\":\"cltbgsncghkjesz\",\"eh\":\"smx\",\"qkkrb\":\"pvecxgodeb\"},\"id\":\"pukgriwflzlfb\",\"name\":\"zpuzycisp\",\"type\":\"qzahmgkbrp\"}"; + = "{\"properties\":{\"fqdn\":\"l\",\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"sxnkjzkdeslpvlo\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"i\"}},\"provisioningState\":\"Accepted\"},\"location\":\"xpkd\",\"tags\":{\"edeojnabc\":\"aiuebbaumnyqu\",\"sapskr\":\"hsmtxpsiebtfhvp\",\"kyzxuutk\":\"qmhjjdhtld\"},\"id\":\"cwscwsvlx\",\"name\":\"togt\",\"type\":\"rupqsxvnmicy\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); TrafficControllerManager manager = TrafficControllerManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Frontend response = manager.frontendsInterfaces() - .getWithResponse("ebrjcxe", "fuwutttxf", "jrbirphxepcyv", com.azure.core.util.Context.NONE) + .getWithResponse("bhvgy", "gu", "svmkfssxquk", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("uujqgidokgjljyo", response.location()); - Assertions.assertEquals("cltbgsncghkjesz", response.tags().get("hbijhtxfvgxb")); + Assertions.assertEquals("xpkd", response.location()); + Assertions.assertEquals("aiuebbaumnyqu", response.tags().get("edeojnabc")); + Assertions.assertEquals("sxnkjzkdeslpvlo", + response.properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("i", + response.properties().securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfacesListByTrafficControllerMockTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfacesListByTrafficControllerMockTests.java index 01d683f1922e..122afc05f5c5 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfacesListByTrafficControllerMockTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/FrontendsInterfacesListByTrafficControllerMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicenetworking.TrafficControllerManager; import com.azure.resourcemanager.servicenetworking.models.Frontend; @@ -22,19 +22,23 @@ public final class FrontendsInterfacesListByTrafficControllerMockTests { @Test public void testListByTrafficController() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"fqdn\":\"vtq\",\"provisioningState\":\"Deleting\"},\"location\":\"uynhijg\",\"tags\":{\"arbu\":\"bfs\"},\"id\":\"rcvpnazzmhjrunmp\",\"name\":\"ttdbhrbnl\",\"type\":\"nkxmyskpbhenbtk\"}]}"; + = "{\"value\":[{\"properties\":{\"fqdn\":\"notyfjfcnjbkcn\",\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"bttk\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"ywpnvjt\"}},\"provisioningState\":\"Updating\"},\"location\":\"rmclfplphoxu\",\"tags\":{\"jta\":\"pabgyeps\",\"kqujidsuyono\":\"qugxywpmueefjzwf\"},\"id\":\"glaocq\",\"name\":\"tcc\",\"type\":\"g\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); TrafficControllerManager manager = TrafficControllerManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.frontendsInterfaces() - .listByTrafficController("y", "hibnuqqkpika", com.azure.core.util.Context.NONE); + PagedIterable response + = manager.frontendsInterfaces().listByTrafficController("vce", "vei", com.azure.core.util.Context.NONE); - Assertions.assertEquals("uynhijg", response.iterator().next().location()); - Assertions.assertEquals("bfs", response.iterator().next().tags().get("arbu")); + Assertions.assertEquals("rmclfplphoxu", response.iterator().next().location()); + Assertions.assertEquals("pabgyeps", response.iterator().next().tags().get("jta")); + Assertions.assertEquals("bttk", + response.iterator().next().properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("ywpnvjt", + response.iterator().next().properties().securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/IpAccessRuleTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/IpAccessRuleTests.java new file mode 100644 index 000000000000..d2b1e8e97da4 --- /dev/null +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/IpAccessRuleTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicenetworking.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRule; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRuleAction; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class IpAccessRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IpAccessRule model = BinaryData.fromString( + "{\"name\":\"wdzuhtymwisd\",\"priority\":1072165585,\"sourceAddressPrefixes\":[\"hwxmnteiwa\",\"pvkmijcmmxdcuf\",\"fsrpymzidnse\",\"cxtbzsg\"],\"action\":\"allow\"}") + .toObject(IpAccessRule.class); + Assertions.assertEquals("wdzuhtymwisd", model.name()); + Assertions.assertEquals(1072165585, model.priority()); + Assertions.assertEquals("hwxmnteiwa", model.sourceAddressPrefixes().get(0)); + Assertions.assertEquals(IpAccessRuleAction.ALLOW, model.action()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IpAccessRule model = new IpAccessRule().withName("wdzuhtymwisd") + .withPriority(1072165585) + .withSourceAddressPrefixes(Arrays.asList("hwxmnteiwa", "pvkmijcmmxdcuf", "fsrpymzidnse", "cxtbzsg")) + .withAction(IpAccessRuleAction.ALLOW); + model = BinaryData.fromObject(model).toObject(IpAccessRule.class); + Assertions.assertEquals("wdzuhtymwisd", model.name()); + Assertions.assertEquals(1072165585, model.priority()); + Assertions.assertEquals("hwxmnteiwa", model.sourceAddressPrefixes().get(0)); + Assertions.assertEquals(IpAccessRuleAction.ALLOW, model.action()); + } +} diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/IpAccessRulesPolicyTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/IpAccessRulesPolicyTests.java new file mode 100644 index 000000000000..f05465087fc5 --- /dev/null +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/IpAccessRulesPolicyTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicenetworking.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRule; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRuleAction; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesPolicy; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class IpAccessRulesPolicyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IpAccessRulesPolicy model = BinaryData.fromString( + "{\"rules\":[{\"name\":\"uizga\",\"priority\":101465987,\"sourceAddressPrefixes\":[\"fizuckyf\",\"hr\",\"idf\"],\"action\":\"allow\"}]}") + .toObject(IpAccessRulesPolicy.class); + Assertions.assertEquals("uizga", model.rules().get(0).name()); + Assertions.assertEquals(101465987, model.rules().get(0).priority()); + Assertions.assertEquals("fizuckyf", model.rules().get(0).sourceAddressPrefixes().get(0)); + Assertions.assertEquals(IpAccessRuleAction.ALLOW, model.rules().get(0).action()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IpAccessRulesPolicy model + = new IpAccessRulesPolicy().withRules(Arrays.asList(new IpAccessRule().withName("uizga") + .withPriority(101465987) + .withSourceAddressPrefixes(Arrays.asList("fizuckyf", "hr", "idf")) + .withAction(IpAccessRuleAction.ALLOW))); + model = BinaryData.fromObject(model).toObject(IpAccessRulesPolicy.class); + Assertions.assertEquals("uizga", model.rules().get(0).name()); + Assertions.assertEquals(101465987, model.rules().get(0).priority()); + Assertions.assertEquals("fizuckyf", model.rules().get(0).sourceAddressPrefixes().get(0)); + Assertions.assertEquals(IpAccessRuleAction.ALLOW, model.rules().get(0).action()); + } +} diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/IpAccessRulesSecurityPolicyTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/IpAccessRulesSecurityPolicyTests.java new file mode 100644 index 000000000000..69ae42f45130 --- /dev/null +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/IpAccessRulesSecurityPolicyTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.servicenetworking.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesSecurityPolicy; +import org.junit.jupiter.api.Assertions; + +public final class IpAccessRulesSecurityPolicyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IpAccessRulesSecurityPolicy model + = BinaryData.fromString("{\"id\":\"podmailzydehojwy\"}").toObject(IpAccessRulesSecurityPolicy.class); + Assertions.assertEquals("podmailzydehojwy", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IpAccessRulesSecurityPolicy model = new IpAccessRulesSecurityPolicy().withId("podmailzydehojwy"); + model = BinaryData.fromObject(model).toObject(IpAccessRulesSecurityPolicy.class); + Assertions.assertEquals("podmailzydehojwy", model.id()); + } +} diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/OperationDisplayTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/OperationDisplayTests.java index 64e6e67c1d9e..9b030dbd03a0 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/OperationDisplayTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/OperationDisplayTests.java @@ -10,8 +10,9 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"dxwzywqsmbsurexi\",\"resource\":\"ryocfsfksymdd\",\"operation\":\"tki\",\"description\":\"xhqyudxorrqnb\"}") + OperationDisplay model = BinaryData + .fromString( + "{\"provider\":\"xzko\",\"resource\":\"cukoklyaxuconu\",\"operation\":\"zf\",\"description\":\"eyp\"}") .toObject(OperationDisplay.class); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/OperationInnerTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/OperationInnerTests.java index 3344658f554d..a6b2dded1bf6 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/OperationInnerTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/OperationInnerTests.java @@ -11,7 +11,7 @@ public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"name\":\"ltrpmopj\",\"isDataAction\":false,\"display\":{\"provider\":\"u\",\"resource\":\"thfuiuaodsfcpkvx\",\"operation\":\"puozmyzydag\",\"description\":\"axbezyiuo\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") + "{\"name\":\"iyqzrnk\",\"isDataAction\":true,\"display\":{\"provider\":\"lwh\",\"resource\":\"sicohoqqnwvlry\",\"operation\":\"w\",\"description\":\"eun\"},\"origin\":\"system\",\"actionType\":\"Internal\"}") .toObject(OperationInner.class); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/OperationListResultTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/OperationListResultTests.java index 3f299064b461..6bb4bbd87028 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/OperationListResultTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/OperationListResultTests.java @@ -12,8 +12,8 @@ public final class OperationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"xhbkuofq\",\"isDataAction\":false,\"display\":{\"provider\":\"menevfyexfwh\",\"resource\":\"cibvyvdcsitynn\",\"operation\":\"mdectehfiqscjey\",\"description\":\"hezrkgq\"},\"origin\":\"user\",\"actionType\":\"Internal\"},{\"name\":\"o\",\"isDataAction\":true,\"display\":{\"provider\":\"sle\",\"resource\":\"vxyqjpkcattpngjc\",\"operation\":\"czsqpjhvm\",\"description\":\"jvnysounqe\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upfh\"}") + "{\"value\":[{\"name\":\"ifsjttgzfbishcb\",\"isDataAction\":true,\"display\":{\"provider\":\"eyeam\",\"resource\":\"hagalpbuxwgipwh\",\"operation\":\"ow\",\"description\":\"shwankixzbinje\"},\"origin\":\"user\",\"actionType\":\"Internal\"}],\"nextLink\":\"ywnuzoq\"}") .toObject(OperationListResult.class); - Assertions.assertEquals("upfh", model.nextLink()); + Assertions.assertEquals("ywnuzoq", model.nextLink()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/OperationsListMockTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/OperationsListMockTests.java index 4d1c0ae9c4a0..35fc6e333a40 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/OperationsListMockTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/OperationsListMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicenetworking.TrafficControllerManager; import com.azure.resourcemanager.servicenetworking.models.Operation; @@ -21,14 +21,14 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"mwabnetshhszhedp\",\"isDataAction\":false,\"display\":{\"provider\":\"ubmwmbesld\",\"resource\":\"wwtppj\",\"operation\":\"cxogaokonzm\",\"description\":\"ikvmkqzeqqk\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; + = "{\"value\":[{\"name\":\"ulpjr\",\"isDataAction\":false,\"display\":{\"provider\":\"rvimjwosytxitcsk\",\"resource\":\"k\",\"operation\":\"umiekkezzi\",\"description\":\"ly\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); TrafficControllerManager manager = TrafficControllerManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/ResourceIdTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/ResourceIdTests.java index 524dbb6f65e5..c19cea26aaf4 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/ResourceIdTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/ResourceIdTests.java @@ -11,7 +11,7 @@ public final class ResourceIdTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ResourceId model = BinaryData.fromString("{\"id\":\"eojnxqbzvddn\"}").toObject(ResourceId.class); - Assertions.assertEquals("eojnxqbzvddn", model.id()); + ResourceId model = BinaryData.fromString("{\"id\":\"rvkdvjsllrm\"}").toObject(ResourceId.class); + Assertions.assertEquals("rvkdvjsllrm", model.id()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfacesCreateOrUpdateMockTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfacesCreateOrUpdateMockTests.java index 4c15edcae551..8c3c07b91c47 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfacesCreateOrUpdateMockTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfacesCreateOrUpdateMockTests.java @@ -6,15 +6,19 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicenetworking.TrafficControllerManager; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRule; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRuleAction; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyProperties; import com.azure.resourcemanager.servicenetworking.models.WafPolicy; 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; @@ -25,27 +29,37 @@ public final class SecurityPoliciesInterfacesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"policyType\":\"waf\",\"wafPolicy\":{\"id\":\"e\"},\"provisioningState\":\"Succeeded\"},\"location\":\"k\",\"tags\":{\"uhashsfwx\":\"liourqhak\"},\"id\":\"sowzxcugi\",\"name\":\"jooxdjebw\",\"type\":\"ucww\"}"; + = "{\"properties\":{\"policyType\":\"waf\",\"wafPolicy\":{\"id\":\"tpvjzbexilzznfqq\"},\"ipAccessRulesPolicy\":{\"rules\":[{\"name\":\"mqtaruoujmkcjh\",\"priority\":1589023977,\"sourceAddressPrefixes\":[\"tjrybnwjewgdr\",\"ervnaenqpehi\",\"doy\",\"mifthnzdnd\"],\"action\":\"allow\"},{\"name\":\"gnayqigynduh\",\"priority\":924939472,\"sourceAddressPrefixes\":[\"qlkth\",\"maqolbgycduie\",\"tgccymvaolpss\"],\"action\":\"deny\"}]},\"provisioningState\":\"Succeeded\"},\"location\":\"mdnbbglzpswiy\",\"tags\":{\"sadbz\":\"wyhzdx\",\"dvxzbncblylpst\":\"nvdfznuda\",\"rsc\":\"bhhxsrzdzuc\"},\"id\":\"ntnev\",\"name\":\"iwjmygtdssls\",\"type\":\"tmweriofzpyq\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); TrafficControllerManager manager = TrafficControllerManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SecurityPolicy response = manager.securityPoliciesInterfaces() - .define("qj") - .withRegion("pycanuzbpz") - .withExistingTrafficController("udxytlmoyrx", "wfudwpzntxhdzhl") - .withTags(mapOf("ehhseyvjusrts", "kuwbcrnwb", "mx", "hspkdeemao", "ljuahaquhcdh", "gkvtmelmqkrhah", - "xqpvfadmw", "duala")) - .withProperties(new SecurityPolicyProperties().withWafPolicy(new WafPolicy().withId("rlhrxs"))) + .define("qzvszjf") + .withRegion("wwfbkrvrnsvshq") + .withExistingTrafficController("xjyngudivk", "tswb") + .withTags(mapOf("sbfov", "xc")) + .withProperties(new SecurityPolicyProperties().withWafPolicy(new WafPolicy().withId("dxxiv")) + .withIpAccessRulesPolicy( + new IpAccessRulesPolicy().withRules(Arrays.asList(new IpAccessRule().withName("cqaqtdoqmcbx") + .withPriority(1486848471) + .withSourceAddressPrefixes(Arrays.asList("xyslqbh", "fxoblytkb")) + .withAction(IpAccessRuleAction.ALLOW))))) .create(); - Assertions.assertEquals("k", response.location()); - Assertions.assertEquals("liourqhak", response.tags().get("uhashsfwx")); - Assertions.assertEquals("e", response.properties().wafPolicy().id()); + Assertions.assertEquals("mdnbbglzpswiy", response.location()); + Assertions.assertEquals("wyhzdx", response.tags().get("sadbz")); + Assertions.assertEquals("tpvjzbexilzznfqq", response.properties().wafPolicy().id()); + Assertions.assertEquals("mqtaruoujmkcjh", response.properties().ipAccessRulesPolicy().rules().get(0).name()); + Assertions.assertEquals(1589023977, response.properties().ipAccessRulesPolicy().rules().get(0).priority()); + Assertions.assertEquals("tjrybnwjewgdr", + response.properties().ipAccessRulesPolicy().rules().get(0).sourceAddressPrefixes().get(0)); + Assertions.assertEquals(IpAccessRuleAction.ALLOW, + response.properties().ipAccessRulesPolicy().rules().get(0).action()); } // Use "Map.of" if available diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfacesGetWithResponseMockTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfacesGetWithResponseMockTests.java index fbeef5ac5528..d978c5379ff8 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfacesGetWithResponseMockTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfacesGetWithResponseMockTests.java @@ -6,10 +6,11 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicenetworking.TrafficControllerManager; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRuleAction; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicy; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; @@ -21,21 +22,27 @@ public final class SecurityPoliciesInterfacesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"policyType\":\"waf\",\"wafPolicy\":{\"id\":\"eojnabc\"},\"provisioningState\":\"Canceled\"},\"location\":\"txp\",\"tags\":{\"rdqmhjjdhtldwkyz\":\"btfhvpesaps\",\"cwsvlxotog\":\"uutkncw\",\"o\":\"wrupqsxvnmicykvc\"},\"id\":\"eil\",\"name\":\"vnotyfjfcnj\",\"type\":\"k\"}"; + = "{\"properties\":{\"policyType\":\"ipAccessRules\",\"wafPolicy\":{\"id\":\"h\"},\"ipAccessRulesPolicy\":{\"rules\":[{\"name\":\"nbmpowuwprzq\",\"priority\":1300670095,\"sourceAddressPrefixes\":[\"ualupjmkh\",\"xobbcswsrt\",\"riplrbpbewtg\"],\"action\":\"allow\"},{\"name\":\"gblcgwxzvlvq\",\"priority\":2103137599,\"sourceAddressPrefixes\":[\"begibtnmxiebwwa\",\"oayqc\"],\"action\":\"allow\"},{\"name\":\"rtzju\",\"priority\":1115460475,\"sourceAddressPrefixes\":[\"yzm\",\"txon\",\"mtsavjcbpwxqp\"],\"action\":\"deny\"},{\"name\":\"knftguvriuh\",\"priority\":773993487,\"sourceAddressPrefixes\":[\"mdyvxqtayriw\",\"ro\",\"qbex\"],\"action\":\"deny\"}]},\"provisioningState\":\"Canceled\"},\"location\":\"bycnojvkn\",\"tags\":{\"zhpvgqzcjrvxd\":\"qsgzvahapj\",\"vawjvzunlu\":\"zlmwlxkvugfhz\",\"xipeilpjzuaejx\":\"hnnpr\"},\"id\":\"ultskzbbtdz\",\"name\":\"mv\",\"type\":\"ekg\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); TrafficControllerManager manager = TrafficControllerManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SecurityPolicy response = manager.securityPoliciesInterfaces() - .getWithResponse("xnkjzkdesl", "vlopwiyighx", "kdwzbaiuebbaumny", com.azure.core.util.Context.NONE) + .getWithResponse("hniskxfbkpyc", "klwndnhjdauwhv", "l", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("txp", response.location()); - Assertions.assertEquals("btfhvpesaps", response.tags().get("rdqmhjjdhtldwkyz")); - Assertions.assertEquals("eojnabc", response.properties().wafPolicy().id()); + Assertions.assertEquals("bycnojvkn", response.location()); + Assertions.assertEquals("qsgzvahapj", response.tags().get("zhpvgqzcjrvxd")); + Assertions.assertEquals("h", response.properties().wafPolicy().id()); + Assertions.assertEquals("nbmpowuwprzq", response.properties().ipAccessRulesPolicy().rules().get(0).name()); + Assertions.assertEquals(1300670095, response.properties().ipAccessRulesPolicy().rules().get(0).priority()); + Assertions.assertEquals("ualupjmkh", + response.properties().ipAccessRulesPolicy().rules().get(0).sourceAddressPrefixes().get(0)); + Assertions.assertEquals(IpAccessRuleAction.ALLOW, + response.properties().ipAccessRulesPolicy().rules().get(0).action()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfacesListByTrafficControllerMockTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfacesListByTrafficControllerMockTests.java index 02c505ca0200..416b6ce1cdd5 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfacesListByTrafficControllerMockTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPoliciesInterfacesListByTrafficControllerMockTests.java @@ -7,10 +7,11 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicenetworking.TrafficControllerManager; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRuleAction; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicy; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; @@ -22,20 +23,35 @@ public final class SecurityPoliciesInterfacesListByTrafficControllerMockTests { @Test public void testListByTrafficController() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"policyType\":\"waf\",\"wafPolicy\":{\"id\":\"clfp\"},\"provisioningState\":\"Deleting\"},\"location\":\"xus\",\"tags\":{\"psbjta\":\"abgy\",\"kqujidsuyono\":\"qugxywpmueefjzwf\"},\"id\":\"glaocq\",\"name\":\"tcc\",\"type\":\"g\"}]}"; + = "{\"value\":[{\"properties\":{\"policyType\":\"waf\",\"wafPolicy\":{\"id\":\"ttouwaboekqvkel\"},\"ipAccessRulesPolicy\":{\"rules\":[{\"name\":\"bxwyjsflhhcaa\",\"priority\":131354519,\"sourceAddressPrefixes\":[\"ixisxyawjoy\",\"qcslyjpkiid\",\"yexz\",\"eli\"],\"action\":\"allow\"},{\"name\":\"nr\",\"priority\":2120108327,\"sourceAddressPrefixes\":[\"o\",\"hb\",\"xknalaulppg\"],\"action\":\"deny\"},{\"name\":\"tpnapnyiropuhpig\",\"priority\":1156367150,\"sourceAddressPrefixes\":[\"ylgqgitxmedjvcsl\",\"n\",\"wwncwzzhxgk\",\"rmgucnap\"],\"action\":\"allow\"}]},\"provisioningState\":\"Updating\"},\"location\":\"llwptfdy\",\"tags\":{\"huaoppp\":\"qbuaceopzfqr\",\"z\":\"qeqxo\",\"moizpos\":\"ahzxctobgbk\"},\"id\":\"mgrcfbu\",\"name\":\"rmfqjhhkxbpvj\",\"type\":\"mjh\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); TrafficControllerManager manager = TrafficControllerManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.securityPoliciesInterfaces() - .listByTrafficController("nxdhbt", "kphywpnvjto", com.azure.core.util.Context.NONE); + .listByTrafficController("wozuhkf", "bsjyofdx", com.azure.core.util.Context.NONE); - Assertions.assertEquals("xus", response.iterator().next().location()); - Assertions.assertEquals("abgy", response.iterator().next().tags().get("psbjta")); - Assertions.assertEquals("clfp", response.iterator().next().properties().wafPolicy().id()); + Assertions.assertEquals("llwptfdy", response.iterator().next().location()); + Assertions.assertEquals("qbuaceopzfqr", response.iterator().next().tags().get("huaoppp")); + Assertions.assertEquals("ttouwaboekqvkel", response.iterator().next().properties().wafPolicy().id()); + Assertions.assertEquals("bxwyjsflhhcaa", + response.iterator().next().properties().ipAccessRulesPolicy().rules().get(0).name()); + Assertions.assertEquals(131354519, + response.iterator().next().properties().ipAccessRulesPolicy().rules().get(0).priority()); + Assertions.assertEquals("ixisxyawjoy", + response.iterator() + .next() + .properties() + .ipAccessRulesPolicy() + .rules() + .get(0) + .sourceAddressPrefixes() + .get(0)); + Assertions.assertEquals(IpAccessRuleAction.ALLOW, + response.iterator().next().properties().ipAccessRulesPolicy().rules().get(0).action()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyConfigurationsTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyConfigurationsTests.java index 32de163920e4..2f07f4f42fd0 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyConfigurationsTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyConfigurationsTests.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.servicenetworking.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesSecurityPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyConfigurations; import com.azure.resourcemanager.servicenetworking.models.WafSecurityPolicy; import org.junit.jupiter.api.Assertions; @@ -12,16 +13,21 @@ public final class SecurityPolicyConfigurationsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SecurityPolicyConfigurations model = BinaryData.fromString("{\"wafSecurityPolicy\":{\"id\":\"ndei\"}}") + SecurityPolicyConfigurations model = BinaryData + .fromString( + "{\"wafSecurityPolicy\":{\"id\":\"jye\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"kvnipjoxz\"}}") .toObject(SecurityPolicyConfigurations.class); - Assertions.assertEquals("ndei", model.wafSecurityPolicy().id()); + Assertions.assertEquals("jye", model.wafSecurityPolicy().id()); + Assertions.assertEquals("kvnipjoxz", model.ipAccessRulesSecurityPolicy().id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SecurityPolicyConfigurations model - = new SecurityPolicyConfigurations().withWafSecurityPolicy(new WafSecurityPolicy().withId("ndei")); + = new SecurityPolicyConfigurations().withWafSecurityPolicy(new WafSecurityPolicy().withId("jye")) + .withIpAccessRulesSecurityPolicy(new IpAccessRulesSecurityPolicy().withId("kvnipjoxz")); model = BinaryData.fromObject(model).toObject(SecurityPolicyConfigurations.class); - Assertions.assertEquals("ndei", model.wafSecurityPolicy().id()); + Assertions.assertEquals("jye", model.wafSecurityPolicy().id()); + Assertions.assertEquals("kvnipjoxz", model.ipAccessRulesSecurityPolicy().id()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyInnerTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyInnerTests.java index bae627430252..608da7fa27cd 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyInnerTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyInnerTests.java @@ -6,8 +6,12 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.servicenetworking.fluent.models.SecurityPolicyInner; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRule; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRuleAction; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyProperties; import com.azure.resourcemanager.servicenetworking.models.WafPolicy; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Assertions; @@ -16,22 +20,53 @@ public final class SecurityPolicyInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SecurityPolicyInner model = BinaryData.fromString( - "{\"properties\":{\"policyType\":\"waf\",\"wafPolicy\":{\"id\":\"odmgl\"},\"provisioningState\":\"Canceled\"},\"location\":\"b\",\"tags\":{\"wgcu\":\"mutduqktaps\"},\"id\":\"rtumkdosvq\",\"name\":\"hbmdgbbjfdd\",\"type\":\"mbmbexppbh\"}") + "{\"properties\":{\"policyType\":\"ipAccessRules\",\"wafPolicy\":{\"id\":\"xxwr\"},\"ipAccessRulesPolicy\":{\"rules\":[{\"name\":\"uskcqvkocrcj\",\"priority\":747491790,\"sourceAddressPrefixes\":[\"tnhxbn\",\"biksq\",\"gls\",\"ainqpjwnzlljfm\"],\"action\":\"allow\"},{\"name\":\"eebvmgxsab\",\"priority\":2117273621,\"sourceAddressPrefixes\":[\"duuji\",\"c\",\"czdzev\",\"dhkrwpdappdsbdk\"],\"action\":\"allow\"},{\"name\":\"rwjfe\",\"priority\":905142721,\"sourceAddressPrefixes\":[\"hutje\",\"tmrldhugjzzdatq\",\"hocdgeab\",\"gphuticndvka\"],\"action\":\"deny\"}]},\"provisioningState\":\"Succeeded\"},\"location\":\"ftyhxhurokf\",\"tags\":{\"giawx\":\"olniwpwcukjf\",\"nddhsgcbacph\":\"lryplwckbasyy\",\"nqgoulzndli\":\"jkot\",\"dgak\":\"wyqkgfgibm\"},\"id\":\"qsrxybzqqed\",\"name\":\"ytb\",\"type\":\"iqfouflmmnkz\"}") .toObject(SecurityPolicyInner.class); - Assertions.assertEquals("b", model.location()); - Assertions.assertEquals("mutduqktaps", model.tags().get("wgcu")); - Assertions.assertEquals("odmgl", model.properties().wafPolicy().id()); + Assertions.assertEquals("ftyhxhurokf", model.location()); + Assertions.assertEquals("olniwpwcukjf", model.tags().get("giawx")); + Assertions.assertEquals("xxwr", model.properties().wafPolicy().id()); + Assertions.assertEquals("uskcqvkocrcj", model.properties().ipAccessRulesPolicy().rules().get(0).name()); + Assertions.assertEquals(747491790, model.properties().ipAccessRulesPolicy().rules().get(0).priority()); + Assertions.assertEquals("tnhxbn", + model.properties().ipAccessRulesPolicy().rules().get(0).sourceAddressPrefixes().get(0)); + Assertions.assertEquals(IpAccessRuleAction.ALLOW, + model.properties().ipAccessRulesPolicy().rules().get(0).action()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SecurityPolicyInner model = new SecurityPolicyInner().withLocation("b") - .withTags(mapOf("wgcu", "mutduqktaps")) - .withProperties(new SecurityPolicyProperties().withWafPolicy(new WafPolicy().withId("odmgl"))); + SecurityPolicyInner model + = new SecurityPolicyInner().withLocation("ftyhxhurokf") + .withTags(mapOf("giawx", "olniwpwcukjf", "nddhsgcbacph", "lryplwckbasyy", "nqgoulzndli", "jkot", "dgak", + "wyqkgfgibm")) + .withProperties( + new SecurityPolicyProperties().withWafPolicy(new WafPolicy().withId("xxwr")) + .withIpAccessRulesPolicy( + new IpAccessRulesPolicy().withRules(Arrays.asList( + new IpAccessRule().withName("uskcqvkocrcj") + .withPriority(747491790) + .withSourceAddressPrefixes( + Arrays.asList("tnhxbn", "biksq", "gls", "ainqpjwnzlljfm")) + .withAction(IpAccessRuleAction.ALLOW), + new IpAccessRule().withName("eebvmgxsab") + .withPriority(2117273621) + .withSourceAddressPrefixes(Arrays.asList("duuji", "c", "czdzev", "dhkrwpdappdsbdk")) + .withAction(IpAccessRuleAction.ALLOW), + new IpAccessRule().withName("rwjfe") + .withPriority(905142721) + .withSourceAddressPrefixes( + Arrays.asList("hutje", "tmrldhugjzzdatq", "hocdgeab", "gphuticndvka")) + .withAction(IpAccessRuleAction.DENY))))); model = BinaryData.fromObject(model).toObject(SecurityPolicyInner.class); - Assertions.assertEquals("b", model.location()); - Assertions.assertEquals("mutduqktaps", model.tags().get("wgcu")); - Assertions.assertEquals("odmgl", model.properties().wafPolicy().id()); + Assertions.assertEquals("ftyhxhurokf", model.location()); + Assertions.assertEquals("olniwpwcukjf", model.tags().get("giawx")); + Assertions.assertEquals("xxwr", model.properties().wafPolicy().id()); + Assertions.assertEquals("uskcqvkocrcj", model.properties().ipAccessRulesPolicy().rules().get(0).name()); + Assertions.assertEquals(747491790, model.properties().ipAccessRulesPolicy().rules().get(0).priority()); + Assertions.assertEquals("tnhxbn", + model.properties().ipAccessRulesPolicy().rules().get(0).sourceAddressPrefixes().get(0)); + Assertions.assertEquals(IpAccessRuleAction.ALLOW, + model.properties().ipAccessRulesPolicy().rules().get(0).action()); } // Use "Map.of" if available diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyListResultTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyListResultTests.java index d84727976a27..fde381c850f0 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyListResultTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyListResultTests.java @@ -6,17 +6,24 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.servicenetworking.implementation.models.SecurityPolicyListResult; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRuleAction; import org.junit.jupiter.api.Assertions; public final class SecurityPolicyListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SecurityPolicyListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"policyType\":\"waf\",\"wafPolicy\":{\"id\":\"wbxgjvt\"},\"provisioningState\":\"Provisioning\"},\"location\":\"sszdnru\",\"tags\":{\"uitnwuiz\":\"uhmuouqfprwzwbn\",\"x\":\"a\",\"hr\":\"fizuckyf\"},\"id\":\"idf\",\"name\":\"zwdzuh\",\"type\":\"ymwisdkft\"}],\"nextLink\":\"xmnteiwaop\"}") + "{\"value\":[{\"properties\":{\"policyType\":\"ipAccessRules\",\"wafPolicy\":{\"id\":\"yeicxmqciwqvhk\"},\"ipAccessRulesPolicy\":{\"rules\":[{\"name\":\"igdtopbob\",\"priority\":319956486,\"sourceAddressPrefixes\":[],\"action\":\"allow\"},{\"name\":\"hm\",\"priority\":20476621,\"sourceAddressPrefixes\":[],\"action\":\"allow\"},{\"name\":\"a\",\"priority\":248377661,\"sourceAddressPrefixes\":[],\"action\":\"deny\"},{\"name\":\"hrzayvvtpgvdf\",\"priority\":723087340,\"sourceAddressPrefixes\":[],\"action\":\"deny\"}]},\"provisioningState\":\"Failed\"},\"location\":\"tutqxlngxlefgug\",\"tags\":{\"i\":\"rxdq\"},\"id\":\"tthzrvqd\",\"name\":\"abhjybi\",\"type\":\"ehoqfbowskan\"},{\"properties\":{\"policyType\":\"ipAccessRules\",\"wafPolicy\":{\"id\":\"cuiywgqyw\"},\"ipAccessRulesPolicy\":{\"rules\":[{\"name\":\"vynhzgpphrcg\",\"priority\":485990541,\"sourceAddressPrefixes\":[],\"action\":\"deny\"},{\"name\":\"ocpecfvmmco\",\"priority\":1597553677,\"sourceAddressPrefixes\":[],\"action\":\"deny\"},{\"name\":\"xlzevgbmqjqabcy\",\"priority\":591177451,\"sourceAddressPrefixes\":[],\"action\":\"deny\"}]},\"provisioningState\":\"Provisioning\"},\"location\":\"lzu\",\"tags\":{\"cfionl\":\"fwnfnb\"},\"id\":\"bxetqgtzxdpn\",\"name\":\"bqqwxrj\",\"type\":\"eallnwsubisnj\"},{\"properties\":{\"policyType\":\"ipAccessRules\",\"wafPolicy\":{\"id\":\"gnzscxaqwo\"},\"ipAccessRulesPolicy\":{\"rules\":[{\"name\":\"bonqvpkvlrxnjeas\",\"priority\":1797788548,\"sourceAddressPrefixes\":[],\"action\":\"deny\"},{\"name\":\"heoflokeyyienjbd\",\"priority\":375227162,\"sourceAddressPrefixes\":[],\"action\":\"deny\"}]},\"provisioningState\":\"Failed\"},\"location\":\"pdjpjumasxazjp\",\"tags\":{\"b\":\"gual\"},\"id\":\"xhejjzzvdud\",\"name\":\"wdslfhotwmcy\",\"type\":\"pwlbjnpg\"}],\"nextLink\":\"ftadehxnltyfs\"}") .toObject(SecurityPolicyListResult.class); - Assertions.assertEquals("sszdnru", model.value().get(0).location()); - Assertions.assertEquals("uhmuouqfprwzwbn", model.value().get(0).tags().get("uitnwuiz")); - Assertions.assertEquals("wbxgjvt", model.value().get(0).properties().wafPolicy().id()); - Assertions.assertEquals("xmnteiwaop", model.nextLink()); + Assertions.assertEquals("tutqxlngxlefgug", model.value().get(0).location()); + Assertions.assertEquals("rxdq", model.value().get(0).tags().get("i")); + Assertions.assertEquals("yeicxmqciwqvhk", model.value().get(0).properties().wafPolicy().id()); + Assertions.assertEquals("igdtopbob", + model.value().get(0).properties().ipAccessRulesPolicy().rules().get(0).name()); + Assertions.assertEquals(319956486, + model.value().get(0).properties().ipAccessRulesPolicy().rules().get(0).priority()); + Assertions.assertEquals(IpAccessRuleAction.ALLOW, + model.value().get(0).properties().ipAccessRulesPolicy().rules().get(0).action()); + Assertions.assertEquals("ftadehxnltyfs", model.nextLink()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyPropertiesTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyPropertiesTests.java index 2f730c8f050e..0f6cbe1443b7 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyPropertiesTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyPropertiesTests.java @@ -5,23 +5,53 @@ package com.azure.resourcemanager.servicenetworking.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRule; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRuleAction; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyProperties; import com.azure.resourcemanager.servicenetworking.models.WafPolicy; +import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class SecurityPolicyPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SecurityPolicyProperties model = BinaryData - .fromString("{\"policyType\":\"waf\",\"wafPolicy\":{\"id\":\"ol\"},\"provisioningState\":\"Failed\"}") + SecurityPolicyProperties model = BinaryData.fromString( + "{\"policyType\":\"waf\",\"wafPolicy\":{\"id\":\"mglougpbkw\"},\"ipAccessRulesPolicy\":{\"rules\":[{\"name\":\"duqkt\",\"priority\":675008389,\"sourceAddressPrefixes\":[\"pwgcuertu\",\"kdosvqw\",\"bmdg\",\"bjf\"],\"action\":\"allow\"},{\"name\":\"gmbmbexppbh\",\"priority\":211326115,\"sourceAddressPrefixes\":[\"rolfpfp\",\"algbquxigjyjg\"],\"action\":\"deny\"},{\"name\":\"aoyfhrtxilnerkuj\",\"priority\":43446932,\"sourceAddressPrefixes\":[\"l\",\"juvf\",\"awrlyx\"],\"action\":\"allow\"},{\"name\":\"kcprbnw\",\"priority\":1695010462,\"sourceAddressPrefixes\":[\"jvtbvpyss\",\"dnrujqguhmuouqfp\"],\"action\":\"deny\"}]},\"provisioningState\":\"Canceled\"}") .toObject(SecurityPolicyProperties.class); - Assertions.assertEquals("ol", model.wafPolicy().id()); + Assertions.assertEquals("mglougpbkw", model.wafPolicy().id()); + Assertions.assertEquals("duqkt", model.ipAccessRulesPolicy().rules().get(0).name()); + Assertions.assertEquals(675008389, model.ipAccessRulesPolicy().rules().get(0).priority()); + Assertions.assertEquals("pwgcuertu", model.ipAccessRulesPolicy().rules().get(0).sourceAddressPrefixes().get(0)); + Assertions.assertEquals(IpAccessRuleAction.ALLOW, model.ipAccessRulesPolicy().rules().get(0).action()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SecurityPolicyProperties model = new SecurityPolicyProperties().withWafPolicy(new WafPolicy().withId("ol")); + SecurityPolicyProperties model + = new SecurityPolicyProperties().withWafPolicy(new WafPolicy().withId("mglougpbkw")) + .withIpAccessRulesPolicy(new IpAccessRulesPolicy().withRules(Arrays.asList( + new IpAccessRule().withName("duqkt") + .withPriority(675008389) + .withSourceAddressPrefixes(Arrays.asList("pwgcuertu", "kdosvqw", "bmdg", "bjf")) + .withAction(IpAccessRuleAction.ALLOW), + new IpAccessRule().withName("gmbmbexppbh") + .withPriority(211326115) + .withSourceAddressPrefixes(Arrays.asList("rolfpfp", "algbquxigjyjg")) + .withAction(IpAccessRuleAction.DENY), + new IpAccessRule().withName("aoyfhrtxilnerkuj") + .withPriority(43446932) + .withSourceAddressPrefixes(Arrays.asList("l", "juvf", "awrlyx")) + .withAction(IpAccessRuleAction.ALLOW), + new IpAccessRule().withName("kcprbnw") + .withPriority(1695010462) + .withSourceAddressPrefixes(Arrays.asList("jvtbvpyss", "dnrujqguhmuouqfp")) + .withAction(IpAccessRuleAction.DENY)))); model = BinaryData.fromObject(model).toObject(SecurityPolicyProperties.class); - Assertions.assertEquals("ol", model.wafPolicy().id()); + Assertions.assertEquals("mglougpbkw", model.wafPolicy().id()); + Assertions.assertEquals("duqkt", model.ipAccessRulesPolicy().rules().get(0).name()); + Assertions.assertEquals(675008389, model.ipAccessRulesPolicy().rules().get(0).priority()); + Assertions.assertEquals("pwgcuertu", model.ipAccessRulesPolicy().rules().get(0).sourceAddressPrefixes().get(0)); + Assertions.assertEquals(IpAccessRuleAction.ALLOW, model.ipAccessRulesPolicy().rules().get(0).action()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyUpdatePropertiesTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyUpdatePropertiesTests.java index 5065edee186c..73ea9fab095a 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyUpdatePropertiesTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyUpdatePropertiesTests.java @@ -5,23 +5,55 @@ package com.azure.resourcemanager.servicenetworking.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRule; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRuleAction; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyUpdateProperties; import com.azure.resourcemanager.servicenetworking.models.WafPolicy; +import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class SecurityPolicyUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SecurityPolicyUpdateProperties model = BinaryData.fromString("{\"wafPolicy\":{\"id\":\"qawrlyxwj\"}}") + SecurityPolicyUpdateProperties model = BinaryData.fromString( + "{\"wafPolicy\":{\"id\":\"bdxkqpxokaj\"},\"ipAccessRulesPolicy\":{\"rules\":[{\"name\":\"imexgstxgcpodgma\",\"priority\":600216788,\"sourceAddressPrefixes\":[\"mvdjwzrlovmc\"],\"action\":\"deny\"},{\"name\":\"hijco\",\"priority\":1526151596,\"sourceAddressPrefixes\":[\"tbzaqsqsycbkbfk\",\"ukdkexxppofmxa\"],\"action\":\"allow\"},{\"name\":\"fjpgddtocjjxhvp\",\"priority\":70113912,\"sourceAddressPrefixes\":[\"exhd\",\"xibqeojnx\"],\"action\":\"allow\"},{\"name\":\"zvddntwndeicbtwn\",\"priority\":537336258,\"sourceAddressPrefixes\":[\"oqvuhr\",\"cffcyddglmj\"],\"action\":\"allow\"}]}}") .toObject(SecurityPolicyUpdateProperties.class); - Assertions.assertEquals("qawrlyxwj", model.wafPolicy().id()); + Assertions.assertEquals("bdxkqpxokaj", model.wafPolicy().id()); + Assertions.assertEquals("imexgstxgcpodgma", model.ipAccessRulesPolicy().rules().get(0).name()); + Assertions.assertEquals(600216788, model.ipAccessRulesPolicy().rules().get(0).priority()); + Assertions.assertEquals("mvdjwzrlovmc", + model.ipAccessRulesPolicy().rules().get(0).sourceAddressPrefixes().get(0)); + Assertions.assertEquals(IpAccessRuleAction.DENY, model.ipAccessRulesPolicy().rules().get(0).action()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SecurityPolicyUpdateProperties model - = new SecurityPolicyUpdateProperties().withWafPolicy(new WafPolicy().withId("qawrlyxwj")); + = new SecurityPolicyUpdateProperties().withWafPolicy(new WafPolicy().withId("bdxkqpxokaj")) + .withIpAccessRulesPolicy(new IpAccessRulesPolicy().withRules(Arrays.asList( + new IpAccessRule().withName("imexgstxgcpodgma") + .withPriority(600216788) + .withSourceAddressPrefixes(Arrays.asList("mvdjwzrlovmc")) + .withAction(IpAccessRuleAction.DENY), + new IpAccessRule().withName("hijco") + .withPriority(1526151596) + .withSourceAddressPrefixes(Arrays.asList("tbzaqsqsycbkbfk", "ukdkexxppofmxa")) + .withAction(IpAccessRuleAction.ALLOW), + new IpAccessRule().withName("fjpgddtocjjxhvp") + .withPriority(70113912) + .withSourceAddressPrefixes(Arrays.asList("exhd", "xibqeojnx")) + .withAction(IpAccessRuleAction.ALLOW), + new IpAccessRule().withName("zvddntwndeicbtwn") + .withPriority(537336258) + .withSourceAddressPrefixes(Arrays.asList("oqvuhr", "cffcyddglmj")) + .withAction(IpAccessRuleAction.ALLOW)))); model = BinaryData.fromObject(model).toObject(SecurityPolicyUpdateProperties.class); - Assertions.assertEquals("qawrlyxwj", model.wafPolicy().id()); + Assertions.assertEquals("bdxkqpxokaj", model.wafPolicy().id()); + Assertions.assertEquals("imexgstxgcpodgma", model.ipAccessRulesPolicy().rules().get(0).name()); + Assertions.assertEquals(600216788, model.ipAccessRulesPolicy().rules().get(0).priority()); + Assertions.assertEquals("mvdjwzrlovmc", + model.ipAccessRulesPolicy().rules().get(0).sourceAddressPrefixes().get(0)); + Assertions.assertEquals(IpAccessRuleAction.DENY, model.ipAccessRulesPolicy().rules().get(0).action()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyUpdateTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyUpdateTests.java index 456762aa7b16..ea9a92ae07a9 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyUpdateTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/SecurityPolicyUpdateTests.java @@ -5,9 +5,13 @@ package com.azure.resourcemanager.servicenetworking.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRule; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRuleAction; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyUpdate; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyUpdateProperties; import com.azure.resourcemanager.servicenetworking.models.WafPolicy; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; import org.junit.jupiter.api.Assertions; @@ -15,20 +19,49 @@ public final class SecurityPolicyUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SecurityPolicyUpdate model = BinaryData - .fromString("{\"tags\":{\"rkujy\":\"yjgzjaoyfhrtxiln\"},\"properties\":{\"wafPolicy\":{\"id\":\"eju\"}}}") + SecurityPolicyUpdate model = BinaryData.fromString( + "{\"tags\":{\"mdwzjeiachboo\":\"sne\"},\"properties\":{\"wafPolicy\":{\"id\":\"nrosfqpte\"},\"ipAccessRulesPolicy\":{\"rules\":[{\"name\":\"vypyqrimzinpv\",\"priority\":990570448,\"sourceAddressPrefixes\":[\"dkirsoodqxhcr\",\"nohjt\",\"kwh\"],\"action\":\"deny\"},{\"name\":\"oifiyipjxsqwpgr\",\"priority\":1124714443,\"sourceAddressPrefixes\":[\"norcjxvsnbyxqab\",\"mocpc\"],\"action\":\"deny\"},{\"name\":\"hurzafblj\",\"priority\":844718571,\"sourceAddressPrefixes\":[\"btoqcjmkljavbqid\",\"qajzyulpkudjkr\",\"khbzhfepgzg\"],\"action\":\"allow\"},{\"name\":\"xzlocxscp\",\"priority\":1853852705,\"sourceAddressPrefixes\":[\"rhhbcs\",\"l\",\"mmajtjaodx\"],\"action\":\"deny\"}]}}}") .toObject(SecurityPolicyUpdate.class); - Assertions.assertEquals("yjgzjaoyfhrtxiln", model.tags().get("rkujy")); - Assertions.assertEquals("eju", model.properties().wafPolicy().id()); + Assertions.assertEquals("sne", model.tags().get("mdwzjeiachboo")); + Assertions.assertEquals("nrosfqpte", model.properties().wafPolicy().id()); + Assertions.assertEquals("vypyqrimzinpv", model.properties().ipAccessRulesPolicy().rules().get(0).name()); + Assertions.assertEquals(990570448, model.properties().ipAccessRulesPolicy().rules().get(0).priority()); + Assertions.assertEquals("dkirsoodqxhcr", + model.properties().ipAccessRulesPolicy().rules().get(0).sourceAddressPrefixes().get(0)); + Assertions.assertEquals(IpAccessRuleAction.DENY, + model.properties().ipAccessRulesPolicy().rules().get(0).action()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SecurityPolicyUpdate model = new SecurityPolicyUpdate().withTags(mapOf("rkujy", "yjgzjaoyfhrtxiln")) - .withProperties(new SecurityPolicyUpdateProperties().withWafPolicy(new WafPolicy().withId("eju"))); + SecurityPolicyUpdate model = new SecurityPolicyUpdate().withTags(mapOf("mdwzjeiachboo", "sne")) + .withProperties(new SecurityPolicyUpdateProperties().withWafPolicy(new WafPolicy().withId("nrosfqpte")) + .withIpAccessRulesPolicy(new IpAccessRulesPolicy().withRules(Arrays.asList( + new IpAccessRule().withName("vypyqrimzinpv") + .withPriority(990570448) + .withSourceAddressPrefixes(Arrays.asList("dkirsoodqxhcr", "nohjt", "kwh")) + .withAction(IpAccessRuleAction.DENY), + new IpAccessRule().withName("oifiyipjxsqwpgr") + .withPriority(1124714443) + .withSourceAddressPrefixes(Arrays.asList("norcjxvsnbyxqab", "mocpc")) + .withAction(IpAccessRuleAction.DENY), + new IpAccessRule().withName("hurzafblj") + .withPriority(844718571) + .withSourceAddressPrefixes(Arrays.asList("btoqcjmkljavbqid", "qajzyulpkudjkr", "khbzhfepgzg")) + .withAction(IpAccessRuleAction.ALLOW), + new IpAccessRule().withName("xzlocxscp") + .withPriority(1853852705) + .withSourceAddressPrefixes(Arrays.asList("rhhbcs", "l", "mmajtjaodx")) + .withAction(IpAccessRuleAction.DENY))))); model = BinaryData.fromObject(model).toObject(SecurityPolicyUpdate.class); - Assertions.assertEquals("yjgzjaoyfhrtxiln", model.tags().get("rkujy")); - Assertions.assertEquals("eju", model.properties().wafPolicy().id()); + Assertions.assertEquals("sne", model.tags().get("mdwzjeiachboo")); + Assertions.assertEquals("nrosfqpte", model.properties().wafPolicy().id()); + Assertions.assertEquals("vypyqrimzinpv", model.properties().ipAccessRulesPolicy().rules().get(0).name()); + Assertions.assertEquals(990570448, model.properties().ipAccessRulesPolicy().rules().get(0).priority()); + Assertions.assertEquals("dkirsoodqxhcr", + model.properties().ipAccessRulesPolicy().rules().get(0).sourceAddressPrefixes().get(0)); + Assertions.assertEquals(IpAccessRuleAction.DENY, + model.properties().ipAccessRulesPolicy().rules().get(0).action()); } // Use "Map.of" if available diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInnerTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInnerTests.java index 204fc560fa9a..aef0fef37e3e 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInnerTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInnerTests.java @@ -6,6 +6,7 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.servicenetworking.fluent.models.TrafficControllerInner; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesSecurityPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyConfigurations; import com.azure.resourcemanager.servicenetworking.models.TrafficControllerProperties; import com.azure.resourcemanager.servicenetworking.models.WafSecurityPolicy; @@ -17,24 +18,30 @@ public final class TrafficControllerInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TrafficControllerInner model = BinaryData.fromString( - "{\"properties\":{\"configurationEndpoints\":[\"jcmmxdcufufsrp\",\"mzidnsezcxtb\"],\"frontends\":[{\"id\":\"fycc\"},{\"id\":\"newmdwzjeiachbo\"}],\"associations\":[{\"id\":\"lnrosfqp\"},{\"id\":\"eeh\"},{\"id\":\"zvypyqrimzinp\"},{\"id\":\"swjdkirso\"}],\"securityPolicies\":[{\"id\":\"xhcr\"},{\"id\":\"nohjt\"}],\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"h\"}},\"provisioningState\":\"Succeeded\"},\"location\":\"fiyipjxsqwpgrj\",\"tags\":{\"qabnmoc\":\"orcjxvsnby\",\"toqcjmklja\":\"cyshurzafbljjgp\",\"yulpkudjkr\":\"bqidtqaj\",\"e\":\"khbzhfepgzg\"},\"id\":\"zloc\",\"name\":\"scpai\",\"type\":\"rhhbcs\"}") + "{\"properties\":{\"configurationEndpoints\":[\"suesnzw\"],\"frontends\":[{\"id\":\"bavo\"},{\"id\":\"xzdmohctb\"},{\"id\":\"vudwx\"}],\"associations\":[{\"id\":\"nvowgujju\"},{\"id\":\"wdkcglhsl\"}],\"securityPolicies\":[{\"id\":\"dyggdtjixhbku\"},{\"id\":\"fqweykhmene\"},{\"id\":\"fyexfwhy\"}],\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"bvyvdcsity\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"aamdect\"}},\"provisioningState\":\"Canceled\"},\"location\":\"qsc\",\"tags\":{\"kgqhcjrefovg\":\"pvhez\",\"jpkcattpng\":\"kqsleyyvxy\",\"czsqpjhvm\":\"cr\"},\"id\":\"ajvnysounqe\",\"name\":\"a\",\"type\":\"oaeupfhyhltrpmo\"}") .toObject(TrafficControllerInner.class); - Assertions.assertEquals("fiyipjxsqwpgrj", model.location()); - Assertions.assertEquals("orcjxvsnby", model.tags().get("qabnmoc")); - Assertions.assertEquals("h", model.properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("qsc", model.location()); + Assertions.assertEquals("pvhez", model.tags().get("kgqhcjrefovg")); + Assertions.assertEquals("bvyvdcsity", + model.properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("aamdect", + model.properties().securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TrafficControllerInner model = new TrafficControllerInner().withLocation("fiyipjxsqwpgrj") - .withTags(mapOf("qabnmoc", "orcjxvsnby", "toqcjmklja", "cyshurzafbljjgp", "yulpkudjkr", "bqidtqaj", "e", - "khbzhfepgzg")) + TrafficControllerInner model = new TrafficControllerInner().withLocation("qsc") + .withTags(mapOf("kgqhcjrefovg", "pvhez", "jpkcattpng", "kqsleyyvxy", "czsqpjhvm", "cr")) .withProperties(new TrafficControllerProperties().withSecurityPolicyConfigurations( - new SecurityPolicyConfigurations().withWafSecurityPolicy(new WafSecurityPolicy().withId("h")))); + new SecurityPolicyConfigurations().withWafSecurityPolicy(new WafSecurityPolicy().withId("bvyvdcsity")) + .withIpAccessRulesSecurityPolicy(new IpAccessRulesSecurityPolicy().withId("aamdect")))); model = BinaryData.fromObject(model).toObject(TrafficControllerInner.class); - Assertions.assertEquals("fiyipjxsqwpgrj", model.location()); - Assertions.assertEquals("orcjxvsnby", model.tags().get("qabnmoc")); - Assertions.assertEquals("h", model.properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("qsc", model.location()); + Assertions.assertEquals("pvhez", model.tags().get("kgqhcjrefovg")); + Assertions.assertEquals("bvyvdcsity", + model.properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("aamdect", + model.properties().securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } // Use "Map.of" if available diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfacesCreateOrUpdateMockTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfacesCreateOrUpdateMockTests.java index 7bd3246c45c2..a2d2664d317f 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfacesCreateOrUpdateMockTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfacesCreateOrUpdateMockTests.java @@ -6,10 +6,11 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicenetworking.TrafficControllerManager; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesSecurityPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyConfigurations; import com.azure.resourcemanager.servicenetworking.models.TrafficController; import com.azure.resourcemanager.servicenetworking.models.TrafficControllerProperties; @@ -26,28 +27,31 @@ public final class TrafficControllerInterfacesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"configurationEndpoints\":[\"nayqi\",\"ynduha\",\"hqlkthumaqo\"],\"frontends\":[{\"id\":\"ycduier\"},{\"id\":\"gccymvaolpssl\"}],\"associations\":[{\"id\":\"mmdnbbglzps\"},{\"id\":\"iydmcwyhzdxs\"}],\"securityPolicies\":[{\"id\":\"bzmnvdfznud\"}],\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"vxzbncb\"}},\"provisioningState\":\"Succeeded\"},\"location\":\"stdbhhxsrzdzu\",\"tags\":{\"wjmy\":\"scdntnevf\"},\"id\":\"tdss\",\"name\":\"s\",\"type\":\"tmweriofzpyq\"}"; + = "{\"properties\":{\"configurationEndpoints\":[\"p\"],\"frontends\":[{\"id\":\"gxqquezik\"},{\"id\":\"wggxkallat\"},{\"id\":\"elwuipi\"}],\"associations\":[{\"id\":\"zkzivgvvcnay\"},{\"id\":\"hyrnxxmu\"}],\"securityPolicies\":[{\"id\":\"ndrdvstkwq\"},{\"id\":\"tchealmf\"},{\"id\":\"tdaaygdvwvg\"},{\"id\":\"iohgwxrtfud\"}],\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"xg\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"agvrvmnpkuk\"}},\"provisioningState\":\"Succeeded\"},\"location\":\"dblx\",\"tags\":{\"j\":\"mfnjh\",\"oqreyfkzikfjawn\":\"wmszkk\",\"vxwc\":\"a\"},\"id\":\"elpcirelsfeaenwa\",\"name\":\"fatkld\",\"type\":\"xbjhwuaanozjosph\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); TrafficControllerManager manager = TrafficControllerManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); TrafficController response = manager.trafficControllerInterfaces() - .define("tswb") - .withRegion("ftpvjzbexil") - .withExistingResourceGroup("xjyngudivk") - .withTags(mapOf("jmkcjhwqytj", "fqqnvwpmqtaruo", "jewgdrjerv", "ybn")) - .withProperties(new TrafficControllerProperties().withSecurityPolicyConfigurations( - new SecurityPolicyConfigurations().withWafSecurityPolicy(new WafSecurityPolicy().withId("w")))) + .define("jfqka") + .withRegion("yynpcdpumnzgmwz") + .withExistingResourceGroup("uu") + .withTags(mapOf("lwwrl", "biknsorgjhxbld", "ok", "dmtnc")) + .withProperties( + new TrafficControllerProperties().withSecurityPolicyConfigurations(new SecurityPolicyConfigurations() + .withWafSecurityPolicy(new WafSecurityPolicy().withId("nkedyatrwyhqmib")) + .withIpAccessRulesSecurityPolicy(new IpAccessRulesSecurityPolicy().withId("hwit")))) .create(); - Assertions.assertEquals("stdbhhxsrzdzu", response.location()); - Assertions.assertEquals("scdntnevf", response.tags().get("wjmy")); - Assertions.assertEquals("vxzbncb", - response.properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("dblx", response.location()); + Assertions.assertEquals("mfnjh", response.tags().get("j")); + Assertions.assertEquals("xg", response.properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("agvrvmnpkuk", + response.properties().securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } // Use "Map.of" if available diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfacesGetByResourceGroupWithResponseMockTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfacesGetByResourceGroupWithResponseMockTests.java index fd9b365f9018..ef87c1dd7f57 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfacesGetByResourceGroupWithResponseMockTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfacesGetByResourceGroupWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicenetworking.TrafficControllerManager; import com.azure.resourcemanager.servicenetworking.models.TrafficController; @@ -21,22 +21,23 @@ public final class TrafficControllerInterfacesGetByResourceGroupWithResponseMock @Test public void testGetByResourceGroupWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"configurationEndpoints\":[\"uojgj\",\"wjue\",\"otwmcdyt\"],\"frontends\":[{\"id\":\"it\"}],\"associations\":[{\"id\":\"jawgqwg\"}],\"securityPolicies\":[{\"id\":\"isk\"}],\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"kpycgklwndnhjd\"}},\"provisioningState\":\"Deleting\"},\"location\":\"vylwzbtdhxuj\",\"tags\":{\"qlveualupjmkh\":\"mpowuwpr\"},\"id\":\"xobbcswsrt\",\"name\":\"riplrbpbewtg\",\"type\":\"fgb\"}"; + = "{\"properties\":{\"configurationEndpoints\":[\"vwiwubmwmbesld\",\"k\",\"wtppjflcxogaoko\",\"z\"],\"frontends\":[{\"id\":\"ikvmkqzeqqk\"},{\"id\":\"l\"},{\"id\":\"fzxmhhvhgureodkw\"},{\"id\":\"bdagxt\"}],\"associations\":[{\"id\":\"dxbx\"},{\"id\":\"akbogqxndlkzgxh\"}],\"securityPolicies\":[{\"id\":\"plbpodxun\"},{\"id\":\"bebxmubyyntwl\"},{\"id\":\"bqtkoievseotgqr\"},{\"id\":\"ltmuwlauwzizx\"}],\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"gcj\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"u\"}},\"provisioningState\":\"Canceled\"},\"location\":\"pbttdum\",\"tags\":{\"hjpglkf\":\"pxebmnzbt\"},\"id\":\"ohdneuel\",\"name\":\"phsdyhto\",\"type\":\"fikdowwqu\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); TrafficControllerManager manager = TrafficControllerManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); TrafficController response = manager.trafficControllerInterfaces() - .getByResourceGroupWithResponse("vo", "bvmeuecivy", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("emwabnet", "hhszh", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("vylwzbtdhxuj", response.location()); - Assertions.assertEquals("mpowuwpr", response.tags().get("qlveualupjmkh")); - Assertions.assertEquals("kpycgklwndnhjd", - response.properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("pbttdum", response.location()); + Assertions.assertEquals("pxebmnzbt", response.tags().get("hjpglkf")); + Assertions.assertEquals("gcj", response.properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("u", + response.properties().securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfacesListByResourceGroupMockTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfacesListByResourceGroupMockTests.java index c298588bab5d..897d392a52f8 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfacesListByResourceGroupMockTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfacesListByResourceGroupMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicenetworking.TrafficControllerManager; import com.azure.resourcemanager.servicenetworking.models.TrafficController; @@ -22,21 +22,23 @@ public final class TrafficControllerInterfacesListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"configurationEndpoints\":[\"vlvqhjkbegi\",\"t\",\"mxiebw\",\"aloayqcgwrtzju\"],\"frontends\":[{\"id\":\"yzm\"},{\"id\":\"txon\"},{\"id\":\"mtsavjcbpwxqp\"}],\"associations\":[{\"id\":\"nftguvriuhpr\"},{\"id\":\"mdyvxqtayriw\"},{\"id\":\"ro\"}],\"securityPolicies\":[{\"id\":\"exrmcqibycnojvk\"},{\"id\":\"mefqsgzvahapjyzh\"}],\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"qzcjrvxdj\"}},\"provisioningState\":\"Updating\"},\"location\":\"lxkvu\",\"tags\":{\"nluthnnp\":\"zovawjvz\",\"jzuaejxdultskzbb\":\"nxipeil\",\"wozuhkf\":\"dzumveekg\",\"uusdttouwa\":\"bsjyofdx\"},\"id\":\"oekqvk\",\"name\":\"lns\",\"type\":\"vbxwyjsflhh\"}]}"; + = "{\"value\":[{\"properties\":{\"configurationEndpoints\":[\"lvithhqzonosgg\",\"hcohfwdsjnk\"],\"frontends\":[{\"id\":\"utiiswacf\"},{\"id\":\"gdkz\"},{\"id\":\"ewkfvhqcrai\"}],\"associations\":[{\"id\":\"n\"},{\"id\":\"pfuflrw\"}],\"securityPolicies\":[{\"id\":\"dlxyjrxs\"},{\"id\":\"gafcnihgwqapnedg\"},{\"id\":\"bcvkcvqvpkeq\"},{\"id\":\"cvdrhvoodsot\"}],\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"zdopcjwvnhd\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"wmgxcxrsl\"}},\"provisioningState\":\"Deleting\"},\"location\":\"wuoegrpk\",\"tags\":{\"pdggkzzlvm\":\"niyqslui\",\"fvmwy\":\"mpaxmodfvuefywsb\",\"yzvqt\":\"rfouyftaakcpw\"},\"id\":\"nubexk\",\"name\":\"zksmondj\",\"type\":\"quxvypomgkop\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); TrafficControllerManager manager = TrafficControllerManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.trafficControllerInterfaces().listByResourceGroup("c", com.azure.core.util.Context.NONE); + = manager.trafficControllerInterfaces().listByResourceGroup("v", com.azure.core.util.Context.NONE); - Assertions.assertEquals("lxkvu", response.iterator().next().location()); - Assertions.assertEquals("zovawjvz", response.iterator().next().tags().get("nluthnnp")); - Assertions.assertEquals("qzcjrvxdj", + Assertions.assertEquals("wuoegrpk", response.iterator().next().location()); + Assertions.assertEquals("niyqslui", response.iterator().next().tags().get("pdggkzzlvm")); + Assertions.assertEquals("zdopcjwvnhd", response.iterator().next().properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("wmgxcxrsl", + response.iterator().next().properties().securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfacesListMockTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfacesListMockTests.java index 5c4de0445747..d18f9b0d208e 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfacesListMockTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerInterfacesListMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.servicenetworking.TrafficControllerManager; import com.azure.resourcemanager.servicenetworking.models.TrafficController; @@ -22,21 +22,23 @@ public final class TrafficControllerInterfacesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"configurationEndpoints\":[\"n\",\"ixisxyawjoy\",\"qcslyjpkiid\"],\"frontends\":[{\"id\":\"xznelixhnrztf\"},{\"id\":\"lhbnxkna\"},{\"id\":\"aulppggd\"}],\"associations\":[{\"id\":\"apnyiropuhpig\"},{\"id\":\"pgylg\"},{\"id\":\"git\"},{\"id\":\"medjvcslynqwwncw\"}],\"securityPolicies\":[{\"id\":\"xgk\"}],\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"gucnapkte\"}},\"provisioningState\":\"Succeeded\"},\"location\":\"wptfdy\",\"tags\":{\"huaoppp\":\"qbuaceopzfqr\",\"z\":\"qeqxo\",\"moizpos\":\"ahzxctobgbk\"},\"id\":\"mgrcfbu\",\"name\":\"rmfqjhhkxbpvj\",\"type\":\"mjh\"}]}"; + = "{\"value\":[{\"properties\":{\"configurationEndpoints\":[\"jvp\",\"jqg\"],\"frontends\":[{\"id\":\"mocmbqfqvmk\"},{\"id\":\"xozap\"}],\"associations\":[{\"id\":\"lxprglyatddckcbc\"},{\"id\":\"ejrjxgciqibrho\"},{\"id\":\"xsdqrhzoymibmrqy\"},{\"id\":\"bahwfl\"}],\"securityPolicies\":[{\"id\":\"dtmhrkwofyyvoqa\"},{\"id\":\"piexpbtgiw\"},{\"id\":\"wo\"}],\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"ashrt\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"kcnqxwbpo\"}},\"provisioningState\":\"Updating\"},\"location\":\"iujwa\",\"tags\":{\"pqlpq\":\"pqiiobyuqe\",\"fbtkuwhhmhyk\":\"cciuqgbdbutau\",\"hkoymkcdyhbp\":\"joxafnndlpi\",\"reqnovvqfov\":\"kpw\"},\"id\":\"jxywsuws\",\"name\":\"rsndsytgadgvra\",\"type\":\"aeneqnzarrwl\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); TrafficControllerManager manager = TrafficControllerManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.trafficControllerInterfaces().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("wptfdy", response.iterator().next().location()); - Assertions.assertEquals("qbuaceopzfqr", response.iterator().next().tags().get("huaoppp")); - Assertions.assertEquals("gucnapkte", + Assertions.assertEquals("iujwa", response.iterator().next().location()); + Assertions.assertEquals("pqiiobyuqe", response.iterator().next().tags().get("pqlpq")); + Assertions.assertEquals("ashrt", response.iterator().next().properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("kcnqxwbpo", + response.iterator().next().properties().securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerListResultTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerListResultTests.java index 41dae233b0e3..83d37d627b7e 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerListResultTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerListResultTests.java @@ -12,12 +12,14 @@ public final class TrafficControllerListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TrafficControllerListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"configurationEndpoints\":[\"w\"],\"frontends\":[{\"id\":\"a\"}],\"associations\":[{\"id\":\"z\"},{\"id\":\"yvvtpgvdfgio\"}],\"securityPolicies\":[{\"id\":\"tutqxlngxlefgug\"},{\"id\":\"xkrxdqmi\"},{\"id\":\"tthzrvqd\"},{\"id\":\"abhjybi\"}],\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"oqfbowskanyk\"}},\"provisioningState\":\"Provisioning\"},\"location\":\"u\",\"tags\":{\"nhzgpphrcgyn\":\"gqywgndrv\",\"fsxlzevgbmqjqa\":\"ocpecfvmmco\"},\"id\":\"c\",\"name\":\"pmivkwlzu\",\"type\":\"ccfwnfnbacfion\"},{\"properties\":{\"configurationEndpoints\":[\"etqgtzxdpnq\"],\"frontends\":[{\"id\":\"wxrjfeallnwsub\"},{\"id\":\"snjampmng\"},{\"id\":\"zscxaqwo\"}],\"associations\":[{\"id\":\"cbonqvpk\"},{\"id\":\"lrxnjeaseiphe\"},{\"id\":\"f\"}],\"securityPolicies\":[{\"id\":\"eyy\"},{\"id\":\"enjbdlwtgrhp\"}],\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"jumasx\"}},\"provisioningState\":\"Succeeded\"},\"location\":\"qyeg\",\"tags\":{\"xhejjzzvdud\":\"hb\",\"pwlbjnpg\":\"wdslfhotwmcy\",\"nltyfsoppusuesnz\":\"cftadeh\",\"xzdmohctb\":\"dejbavo\"},\"id\":\"vudwx\",\"name\":\"ndnvo\",\"type\":\"gujjugwdkcglh\"}],\"nextLink\":\"azjdyggd\"}") + "{\"value\":[{\"properties\":{\"configurationEndpoints\":[\"ciwwzjuqkhr\"],\"frontends\":[{\"id\":\"iwkuofos\"},{\"id\":\"ghsauuimjmvxied\"},{\"id\":\"ugidyjrr\"},{\"id\":\"byao\"}],\"associations\":[{\"id\":\"xc\"}],\"securityPolicies\":[{\"id\":\"pclhocohslk\"}],\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"eggzfb\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"fmvfaxkffeiit\"}},\"provisioningState\":\"Accepted\"},\"location\":\"ez\",\"tags\":{\"xwburvjxxjns\":\"hxmzsbbzoggig\",\"ou\":\"ydptkoen\",\"dng\":\"nvudwtiukb\",\"g\":\"pocipazyxoegu\"},\"id\":\"npiucgygevqznty\",\"name\":\"mrbpizcdrqj\",\"type\":\"dpydn\"}],\"nextLink\":\"hxdeoejz\"}") .toObject(TrafficControllerListResult.class); - Assertions.assertEquals("u", model.value().get(0).location()); - Assertions.assertEquals("gqywgndrv", model.value().get(0).tags().get("nhzgpphrcgyn")); - Assertions.assertEquals("oqfbowskanyk", + Assertions.assertEquals("ez", model.value().get(0).location()); + Assertions.assertEquals("hxmzsbbzoggig", model.value().get(0).tags().get("xwburvjxxjns")); + Assertions.assertEquals("eggzfb", model.value().get(0).properties().securityPolicyConfigurations().wafSecurityPolicy().id()); - Assertions.assertEquals("azjdyggd", model.nextLink()); + Assertions.assertEquals("fmvfaxkffeiit", + model.value().get(0).properties().securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); + Assertions.assertEquals("hxdeoejz", model.nextLink()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerPropertiesTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerPropertiesTests.java index 5b57e9021c77..ce249a6227f8 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerPropertiesTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerPropertiesTests.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.servicenetworking.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesSecurityPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyConfigurations; import com.azure.resourcemanager.servicenetworking.models.TrafficControllerProperties; import com.azure.resourcemanager.servicenetworking.models.WafSecurityPolicy; @@ -14,16 +15,19 @@ public final class TrafficControllerPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TrafficControllerProperties model = BinaryData.fromString( - "{\"configurationEndpoints\":[\"mmajtjaodx\",\"bnbdxkqpxokajion\",\"imexgstxgcpodgma\"],\"frontends\":[{\"id\":\"mvdjwzrlovmc\"}],\"associations\":[{\"id\":\"ijcoejctb\"},{\"id\":\"aqsqsycbkbfk\"}],\"securityPolicies\":[{\"id\":\"dkexxppofm\"},{\"id\":\"axcfjpgddtocjjx\"}],\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"mouexhdzx\"}},\"provisioningState\":\"Succeeded\"}") + "{\"configurationEndpoints\":[\"cma\",\"u\",\"kthfui\",\"aodsfcpkv\"],\"frontends\":[{\"id\":\"puozmyzydag\"},{\"id\":\"uaxbezyiuokkt\"}],\"associations\":[{\"id\":\"dxwzywqsmbsurexi\"},{\"id\":\"o\"},{\"id\":\"yocf\"}],\"securityPolicies\":[{\"id\":\"s\"},{\"id\":\"mddystkiiux\"}],\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"udxorrqn\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"oczvy\"}},\"provisioningState\":\"Deleting\"}") .toObject(TrafficControllerProperties.class); - Assertions.assertEquals("mouexhdzx", model.securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("udxorrqn", model.securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("oczvy", model.securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { TrafficControllerProperties model = new TrafficControllerProperties().withSecurityPolicyConfigurations( - new SecurityPolicyConfigurations().withWafSecurityPolicy(new WafSecurityPolicy().withId("mouexhdzx"))); + new SecurityPolicyConfigurations().withWafSecurityPolicy(new WafSecurityPolicy().withId("udxorrqn")) + .withIpAccessRulesSecurityPolicy(new IpAccessRulesSecurityPolicy().withId("oczvy"))); model = BinaryData.fromObject(model).toObject(TrafficControllerProperties.class); - Assertions.assertEquals("mouexhdzx", model.securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("udxorrqn", model.securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("oczvy", model.securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerUpdatePropertiesTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerUpdatePropertiesTests.java index a8a5a8c0e2c4..35da14fe811e 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerUpdatePropertiesTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerUpdatePropertiesTests.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.servicenetworking.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesSecurityPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyConfigurations; import com.azure.resourcemanager.servicenetworking.models.TrafficControllerUpdateProperties; import com.azure.resourcemanager.servicenetworking.models.WafSecurityPolicy; @@ -13,18 +14,23 @@ public final class TrafficControllerUpdatePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - TrafficControllerUpdateProperties model = BinaryData - .fromString("{\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"xuigdtopbobj\"}}}") + TrafficControllerUpdateProperties model = BinaryData.fromString( + "{\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"vmyokacspkwl\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"dobpxjmflbvvn\"}}}") .toObject(TrafficControllerUpdateProperties.class); - Assertions.assertEquals("xuigdtopbobj", model.securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("vmyokacspkwl", model.securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("dobpxjmflbvvn", + model.securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TrafficControllerUpdateProperties model = new TrafficControllerUpdateProperties() - .withSecurityPolicyConfigurations(new SecurityPolicyConfigurations() - .withWafSecurityPolicy(new WafSecurityPolicy().withId("xuigdtopbobj"))); + TrafficControllerUpdateProperties model + = new TrafficControllerUpdateProperties().withSecurityPolicyConfigurations( + new SecurityPolicyConfigurations().withWafSecurityPolicy(new WafSecurityPolicy().withId("vmyokacspkwl")) + .withIpAccessRulesSecurityPolicy(new IpAccessRulesSecurityPolicy().withId("dobpxjmflbvvn"))); model = BinaryData.fromObject(model).toObject(TrafficControllerUpdateProperties.class); - Assertions.assertEquals("xuigdtopbobj", model.securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("vmyokacspkwl", model.securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("dobpxjmflbvvn", + model.securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerUpdateTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerUpdateTests.java index 17341013dacd..e0417eaff986 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerUpdateTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/TrafficControllerUpdateTests.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.servicenetworking.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.servicenetworking.models.IpAccessRulesSecurityPolicy; import com.azure.resourcemanager.servicenetworking.models.SecurityPolicyConfigurations; import com.azure.resourcemanager.servicenetworking.models.TrafficControllerUpdate; import com.azure.resourcemanager.servicenetworking.models.TrafficControllerUpdateProperties; @@ -17,23 +18,27 @@ public final class TrafficControllerUpdateTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TrafficControllerUpdate model = BinaryData.fromString( - "{\"tags\":{\"t\":\"ddglm\"},\"properties\":{\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"wpyeicxmqciwqvh\"}}}}") + "{\"tags\":{\"atkpnp\":\"f\"},\"properties\":{\"securityPolicyConfigurations\":{\"wafSecurityPolicy\":{\"id\":\"xbczwtruwiqz\"},\"ipAccessRulesSecurityPolicy\":{\"id\":\"j\"}}}}") .toObject(TrafficControllerUpdate.class); - Assertions.assertEquals("ddglm", model.tags().get("t")); - Assertions.assertEquals("wpyeicxmqciwqvh", + Assertions.assertEquals("f", model.tags().get("atkpnp")); + Assertions.assertEquals("xbczwtruwiqz", model.properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("j", + model.properties().securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TrafficControllerUpdate model = new TrafficControllerUpdate().withTags(mapOf("t", "ddglm")) - .withProperties(new TrafficControllerUpdateProperties() - .withSecurityPolicyConfigurations(new SecurityPolicyConfigurations() - .withWafSecurityPolicy(new WafSecurityPolicy().withId("wpyeicxmqciwqvh")))); + TrafficControllerUpdate model = new TrafficControllerUpdate().withTags(mapOf("atkpnp", "f")) + .withProperties(new TrafficControllerUpdateProperties().withSecurityPolicyConfigurations( + new SecurityPolicyConfigurations().withWafSecurityPolicy(new WafSecurityPolicy().withId("xbczwtruwiqz")) + .withIpAccessRulesSecurityPolicy(new IpAccessRulesSecurityPolicy().withId("j")))); model = BinaryData.fromObject(model).toObject(TrafficControllerUpdate.class); - Assertions.assertEquals("ddglm", model.tags().get("t")); - Assertions.assertEquals("wpyeicxmqciwqvh", + Assertions.assertEquals("f", model.tags().get("atkpnp")); + Assertions.assertEquals("xbczwtruwiqz", model.properties().securityPolicyConfigurations().wafSecurityPolicy().id()); + Assertions.assertEquals("j", + model.properties().securityPolicyConfigurations().ipAccessRulesSecurityPolicy().id()); } // Use "Map.of" if available diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/WafPolicyTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/WafPolicyTests.java index b80c16f825d0..8929d0dff3a5 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/WafPolicyTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/WafPolicyTests.java @@ -11,14 +11,14 @@ public final class WafPolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - WafPolicy model = BinaryData.fromString("{\"id\":\"psalgbqux\"}").toObject(WafPolicy.class); - Assertions.assertEquals("psalgbqux", model.id()); + WafPolicy model = BinaryData.fromString("{\"id\":\"bngui\"}").toObject(WafPolicy.class); + Assertions.assertEquals("bngui", model.id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WafPolicy model = new WafPolicy().withId("psalgbqux"); + WafPolicy model = new WafPolicy().withId("bngui"); model = BinaryData.fromObject(model).toObject(WafPolicy.class); - Assertions.assertEquals("psalgbqux", model.id()); + Assertions.assertEquals("bngui", model.id()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/WafSecurityPolicyTests.java b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/WafSecurityPolicyTests.java index 7d5bc149385d..5bfa2d05d1dd 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/WafSecurityPolicyTests.java +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/src/test/java/com/azure/resourcemanager/servicenetworking/generated/WafSecurityPolicyTests.java @@ -11,15 +11,14 @@ public final class WafSecurityPolicyTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - WafSecurityPolicy model - = BinaryData.fromString("{\"id\":\"btwnpzaoqvuhrhcf\"}").toObject(WafSecurityPolicy.class); - Assertions.assertEquals("btwnpzaoqvuhrhcf", model.id()); + WafSecurityPolicy model = BinaryData.fromString("{\"id\":\"nchgej\"}").toObject(WafSecurityPolicy.class); + Assertions.assertEquals("nchgej", model.id()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WafSecurityPolicy model = new WafSecurityPolicy().withId("btwnpzaoqvuhrhcf"); + WafSecurityPolicy model = new WafSecurityPolicy().withId("nchgej"); model = BinaryData.fromObject(model).toObject(WafSecurityPolicy.class); - Assertions.assertEquals("btwnpzaoqvuhrhcf", model.id()); + Assertions.assertEquals("nchgej", model.id()); } } diff --git a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/tsp-location.yaml b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/tsp-location.yaml index 3e38b59b745b..71ed656b0be1 100644 --- a/sdk/servicenetworking/azure-resourcemanager-servicenetworking/tsp-location.yaml +++ b/sdk/servicenetworking/azure-resourcemanager-servicenetworking/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/servicenetworking/ServiceNetworking.Management -commit: 05b150757bd72ad78bd27216e5e662beaa49bd6c +commit: fa15260dd392beb7b08250e07626f4f0072b37f2 repo: Azure/azure-rest-api-specs additionalDirectories: