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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Virtual network model. */
@Fluent
public final class VirtualNetworkInner {
    /*
     * can be used in vm creation/deletion
     */
    @JsonProperty(value = "assignable", access = JsonProperty.Access.WRITE_ONLY)
    private Boolean assignable;

    /*
     * virtual network id (privateCloudId:vsphereId)
     */
    @JsonProperty(value = "id", required = true)
    private String id;

    /*
     * Azure region
     */
    @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY)
    private String location;

    /*
     * {VirtualNetworkName}
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /*
     * Virtual Network properties
     */
    @JsonProperty(value = "properties")
    private VirtualNetworkProperties innerProperties;

    /*
     * {resourceProviderNamespace}/{resourceType}
     */
    @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY)
    private String type;

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

    /**
     * Get the assignable property: can be used in vm creation/deletion.
     *
     * @return the assignable value.
     */
    public Boolean assignable() {
        return this.assignable;
    }

    /**
     * Get the id property: virtual network id (privateCloudId:vsphereId).
     *
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Set the id property: virtual network id (privateCloudId:vsphereId).
     *
     * @param id the id value to set.
     * @return the VirtualNetworkInner object itself.
     */
    public VirtualNetworkInner withId(String id) {
        this.id = id;
        return this;
    }

    /**
     * Get the location property: Azure region.
     *
     * @return the location value.
     */
    public String location() {
        return this.location;
    }

    /**
     * Get the name property: {VirtualNetworkName}.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

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

    /**
     * Get the type property: {resourceProviderNamespace}/{resourceType}.
     *
     * @return the type value.
     */
    public String type() {
        return this.type;
    }

    /**
     * Get the privateCloudId property: The Private Cloud id.
     *
     * @return the privateCloudId value.
     */
    public String privateCloudId() {
        return this.innerProperties() == null ? null : this.innerProperties().privateCloudId();
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (id() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property id in model VirtualNetworkInner"));
        }
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(VirtualNetworkInner.class);
}
