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

package com.azure.resourcemanager.devtestlabs.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.resourcemanager.devtestlabs.models.ExternalSubnet;
import com.azure.resourcemanager.devtestlabs.models.Subnet;
import com.azure.resourcemanager.devtestlabs.models.SubnetOverride;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

/** A virtual network. */
@Fluent
public final class VirtualNetworkInner extends Resource {
    /*
     * The properties of the resource.
     */
    @JsonProperty(value = "properties")
    private VirtualNetworkProperties innerProperties;

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

    /**
     * Get the innerProperties property: The properties of the resource.
     *
     * @return the innerProperties value.
     */
    private VirtualNetworkProperties innerProperties() {
        return this.innerProperties;
    }

    /** {@inheritDoc} */
    @Override
    public VirtualNetworkInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public VirtualNetworkInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the allowedSubnets property: The allowed subnets of the virtual network.
     *
     * @return the allowedSubnets value.
     */
    public List<Subnet> allowedSubnets() {
        return this.innerProperties() == null ? null : this.innerProperties().allowedSubnets();
    }

    /**
     * Set the allowedSubnets property: The allowed subnets of the virtual network.
     *
     * @param allowedSubnets the allowedSubnets value to set.
     * @return the VirtualNetworkInner object itself.
     */
    public VirtualNetworkInner withAllowedSubnets(List<Subnet> allowedSubnets) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualNetworkProperties();
        }
        this.innerProperties().withAllowedSubnets(allowedSubnets);
        return this;
    }

    /**
     * Get the description property: The description of the virtual network.
     *
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Set the description property: The description of the virtual network.
     *
     * @param description the description value to set.
     * @return the VirtualNetworkInner object itself.
     */
    public VirtualNetworkInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualNetworkProperties();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the externalProviderResourceId property: The Microsoft.Network resource identifier of the virtual network.
     *
     * @return the externalProviderResourceId value.
     */
    public String externalProviderResourceId() {
        return this.innerProperties() == null ? null : this.innerProperties().externalProviderResourceId();
    }

    /**
     * Set the externalProviderResourceId property: The Microsoft.Network resource identifier of the virtual network.
     *
     * @param externalProviderResourceId the externalProviderResourceId value to set.
     * @return the VirtualNetworkInner object itself.
     */
    public VirtualNetworkInner withExternalProviderResourceId(String externalProviderResourceId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualNetworkProperties();
        }
        this.innerProperties().withExternalProviderResourceId(externalProviderResourceId);
        return this;
    }

    /**
     * Get the externalSubnets property: The external subnet properties.
     *
     * @return the externalSubnets value.
     */
    public List<ExternalSubnet> externalSubnets() {
        return this.innerProperties() == null ? null : this.innerProperties().externalSubnets();
    }

    /**
     * Get the subnetOverrides property: The subnet overrides of the virtual network.
     *
     * @return the subnetOverrides value.
     */
    public List<SubnetOverride> subnetOverrides() {
        return this.innerProperties() == null ? null : this.innerProperties().subnetOverrides();
    }

    /**
     * Set the subnetOverrides property: The subnet overrides of the virtual network.
     *
     * @param subnetOverrides the subnetOverrides value to set.
     * @return the VirtualNetworkInner object itself.
     */
    public VirtualNetworkInner withSubnetOverrides(List<SubnetOverride> subnetOverrides) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualNetworkProperties();
        }
        this.innerProperties().withSubnetOverrides(subnetOverrides);
        return this;
    }

    /**
     * Get the createdDate property: The creation date of the virtual network.
     *
     * @return the createdDate value.
     */
    public OffsetDateTime createdDate() {
        return this.innerProperties() == null ? null : this.innerProperties().createdDate();
    }

    /**
     * Get the provisioningState property: The provisioning status of the resource.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).
     *
     * @return the uniqueIdentifier value.
     */
    public String uniqueIdentifier() {
        return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier();
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}
