/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

'use strict';

const models = require('./index');

/**
 * Virtual Network resource.
 *
 * @extends models['Resource']
 */
class VirtualNetwork extends models['Resource'] {
  /**
   * Create a VirtualNetwork.
   * @property {object} [addressSpace] The AddressSpace that contains an array
   * of IP address ranges that can be used by subnets.
   * @property {array} [addressSpace.addressPrefixes] A list of address blocks
   * reserved for this virtual network in CIDR notation.
   * @property {object} [dhcpOptions] The dhcpOptions that contains an array of
   * DNS servers available to VMs deployed in the virtual network.
   * @property {array} [dhcpOptions.dnsServers] The list of DNS servers IP
   * addresses.
   * @property {array} [subnets] A list of subnets in a Virtual Network.
   * @property {array} [virtualNetworkPeerings] A list of peerings in a Virtual
   * Network.
   * @property {string} [resourceGuid] The resourceGuid property of the Virtual
   * Network resource.
   * @property {string} [provisioningState] The provisioning state of the
   * PublicIP resource. Possible values are: 'Updating', 'Deleting', and
   * 'Failed'.
   * @property {boolean} [enableDdosProtection] Indicates if DDoS protection is
   * enabled for all the protected resources in the virtual network. It
   * requires a DDoS protection plan associated with the resource. Default
   * value: false .
   * @property {boolean} [enableVmProtection] Indicates if VM protection is
   * enabled for all the subnets in the virtual network. Default value: false .
   * @property {object} [ddosProtectionPlan] The DDoS protection plan
   * associated with the virtual network.
   * @property {string} [ddosProtectionPlan.id] Resource ID.
   * @property {string} [etag] Gets a unique read-only string that changes
   * whenever the resource is updated.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of VirtualNetwork
   *
   * @returns {object} metadata of VirtualNetwork
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'VirtualNetwork',
      type: {
        name: 'Composite',
        className: 'VirtualNetwork',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          location: {
            required: false,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          addressSpace: {
            required: false,
            serializedName: 'properties.addressSpace',
            type: {
              name: 'Composite',
              className: 'AddressSpace'
            }
          },
          dhcpOptions: {
            required: false,
            serializedName: 'properties.dhcpOptions',
            type: {
              name: 'Composite',
              className: 'DhcpOptions'
            }
          },
          subnets: {
            required: false,
            serializedName: 'properties.subnets',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'SubnetElementType',
                  type: {
                    name: 'Composite',
                    className: 'Subnet'
                  }
              }
            }
          },
          virtualNetworkPeerings: {
            required: false,
            serializedName: 'properties.virtualNetworkPeerings',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'VirtualNetworkPeeringElementType',
                  type: {
                    name: 'Composite',
                    className: 'VirtualNetworkPeering'
                  }
              }
            }
          },
          resourceGuid: {
            required: false,
            serializedName: 'properties.resourceGuid',
            type: {
              name: 'String'
            }
          },
          provisioningState: {
            required: false,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          enableDdosProtection: {
            required: false,
            serializedName: 'properties.enableDdosProtection',
            defaultValue: false,
            type: {
              name: 'Boolean'
            }
          },
          enableVmProtection: {
            required: false,
            serializedName: 'properties.enableVmProtection',
            defaultValue: false,
            type: {
              name: 'Boolean'
            }
          },
          ddosProtectionPlan: {
            required: false,
            serializedName: 'properties.ddosProtectionPlan',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          etag: {
            required: false,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = VirtualNetwork;
