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

package com.azure.resourcemanager.resourcemover.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/** Defines the virtual network resource settings. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resourceType")
@JsonTypeName("Microsoft.Network/virtualNetworks")
@Fluent
public final class VirtualNetworkResourceSettings extends ResourceSettings {
    /*
     * Gets or sets a value indicating whether gets or sets whether the
     * DDOS protection should be switched on.
     */
    @JsonProperty(value = "enableDdosProtection")
    private Boolean enableDdosProtection;

    /*
     * Gets or sets the address prefixes for the virtual network.
     */
    @JsonProperty(value = "addressSpace")
    private List<String> addressSpace;

    /*
     * Gets or sets DHCPOptions that contains an array of DNS servers available to VMs
     * deployed in the virtual network.
     */
    @JsonProperty(value = "dnsServers")
    private List<String> dnsServers;

    /*
     * Gets or sets List of subnets in a VirtualNetwork.
     */
    @JsonProperty(value = "subnets")
    private List<SubnetResourceSettings> subnets;

    /** Creates an instance of VirtualNetworkResourceSettings class. */
    public VirtualNetworkResourceSettings() {
    }

    /**
     * Get the enableDdosProtection property: Gets or sets a value indicating whether gets or sets whether the DDOS
     * protection should be switched on.
     *
     * @return the enableDdosProtection value.
     */
    public Boolean enableDdosProtection() {
        return this.enableDdosProtection;
    }

    /**
     * Set the enableDdosProtection property: Gets or sets a value indicating whether gets or sets whether the DDOS
     * protection should be switched on.
     *
     * @param enableDdosProtection the enableDdosProtection value to set.
     * @return the VirtualNetworkResourceSettings object itself.
     */
    public VirtualNetworkResourceSettings withEnableDdosProtection(Boolean enableDdosProtection) {
        this.enableDdosProtection = enableDdosProtection;
        return this;
    }

    /**
     * Get the addressSpace property: Gets or sets the address prefixes for the virtual network.
     *
     * @return the addressSpace value.
     */
    public List<String> addressSpace() {
        return this.addressSpace;
    }

    /**
     * Set the addressSpace property: Gets or sets the address prefixes for the virtual network.
     *
     * @param addressSpace the addressSpace value to set.
     * @return the VirtualNetworkResourceSettings object itself.
     */
    public VirtualNetworkResourceSettings withAddressSpace(List<String> addressSpace) {
        this.addressSpace = addressSpace;
        return this;
    }

    /**
     * Get the dnsServers property: Gets or sets DHCPOptions that contains an array of DNS servers available to VMs
     * deployed in the virtual network.
     *
     * @return the dnsServers value.
     */
    public List<String> dnsServers() {
        return this.dnsServers;
    }

    /**
     * Set the dnsServers property: Gets or sets DHCPOptions that contains an array of DNS servers available to VMs
     * deployed in the virtual network.
     *
     * @param dnsServers the dnsServers value to set.
     * @return the VirtualNetworkResourceSettings object itself.
     */
    public VirtualNetworkResourceSettings withDnsServers(List<String> dnsServers) {
        this.dnsServers = dnsServers;
        return this;
    }

    /**
     * Get the subnets property: Gets or sets List of subnets in a VirtualNetwork.
     *
     * @return the subnets value.
     */
    public List<SubnetResourceSettings> subnets() {
        return this.subnets;
    }

    /**
     * Set the subnets property: Gets or sets List of subnets in a VirtualNetwork.
     *
     * @param subnets the subnets value to set.
     * @return the VirtualNetworkResourceSettings object itself.
     */
    public VirtualNetworkResourceSettings withSubnets(List<SubnetResourceSettings> subnets) {
        this.subnets = subnets;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public VirtualNetworkResourceSettings withTargetResourceName(String targetResourceName) {
        super.withTargetResourceName(targetResourceName);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (subnets() != null) {
            subnets().forEach(e -> e.validate());
        }
    }
}
