// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.managednetworkfabric.generated;

import com.azure.resourcemanager.managednetworkfabric.models.AggregateRoute;
import com.azure.resourcemanager.managednetworkfabric.models.AggregateRouteConfiguration;
import com.azure.resourcemanager.managednetworkfabric.models.L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy;
import com.azure.resourcemanager.managednetworkfabric.models.RedistributeConnectedSubnets;
import com.azure.resourcemanager.managednetworkfabric.models.RedistributeStaticRoutes;
import java.util.Arrays;

/** Samples for L3IsolationDomains Create. */
public final class L3IsolationDomainsCreateSamples {
    /*
     * x-ms-original-file: specification/managednetworkfabric/resource-manager/Microsoft.ManagedNetworkFabric/preview/2023-02-01-preview/examples/L3IsolationDomains_Create_MaximumSet_Gen.json
     */
    /**
     * Sample code: L3IsolationDomains_Create_MaximumSet_Gen.
     *
     * @param manager Entry point to ManagedNetworkFabricManager.
     */
    public static void l3IsolationDomainsCreateMaximumSetGen(
        com.azure.resourcemanager.managednetworkfabric.ManagedNetworkFabricManager manager) {
        manager
            .l3IsolationDomains()
            .define("example-l3domain")
            .withRegion("eastus")
            .withExistingResourceGroup("resourceGroupName")
            .withNetworkFabricId(
                "/subscriptions/xxxxxx/resourceGroups/resourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/FabricName")
            .withRedistributeConnectedSubnets(RedistributeConnectedSubnets.TRUE)
            .withRedistributeStaticRoutes(RedistributeStaticRoutes.FALSE)
            .withAggregateRouteConfiguration(
                new AggregateRouteConfiguration()
                    .withIpv4Routes(Arrays.asList(new AggregateRoute().withPrefix("10.0.0.0/24")))
                    .withIpv6Routes(Arrays.asList(new AggregateRoute().withPrefix("10.0.0.1"))))
            .withDescription("creating L3 isolation domain")
            .withConnectedSubnetRoutePolicy(
                new L3IsolationDomainPatchPropertiesConnectedSubnetRoutePolicy()
                    .withExportRoutePolicyId(
                        "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/routePolicies/routePolicyName2"))
            .create();
    }
}
