/*
 * 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');

/**
 * A virtual network rule.
 *
 * @extends models['ProxyResource']
 */
class VirtualNetworkRule extends models['ProxyResource'] {
  /**
   * Create a VirtualNetworkRule.
   * @property {string} virtualNetworkSubnetId The ARM resource id of the
   * virtual network subnet.
   * @property {boolean} [ignoreMissingVnetServiceEndpoint] Create firewall
   * rule before the virtual network has vnet service endpoint enabled.
   * @property {string} [state] Virtual Network Rule State. Possible values
   * include: 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown'
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of VirtualNetworkRule
   *
   * @returns {object} metadata of VirtualNetworkRule
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'VirtualNetworkRule',
      type: {
        name: 'Composite',
        className: 'VirtualNetworkRule',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            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'
            }
          },
          virtualNetworkSubnetId: {
            required: true,
            serializedName: 'properties.virtualNetworkSubnetId',
            type: {
              name: 'String'
            }
          },
          ignoreMissingVnetServiceEndpoint: {
            required: false,
            serializedName: 'properties.ignoreMissingVnetServiceEndpoint',
            type: {
              name: 'Boolean'
            }
          },
          state: {
            required: false,
            readOnly: true,
            serializedName: 'properties.state',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = VirtualNetworkRule;
