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

/**
 * @class
 * Initializes a new instance of the FirewallRule class.
 * @constructor
 * Represents a server firewall rule.
 *
 * @member {string} [kind] Kind of server that contains this firewall rule.
 *
 * @member {string} [location] Location of the server that contains this
 * firewall rule.
 *
 * @member {string} [type] Type of resource this is.
 *
 * @member {string} startIpAddress The start IP address of the firewall rule.
 * Must be IPv4 format. Use value '0.0.0.0' to represent all Azure-internal IP
 * addresses.
 *
 * @member {string} endIpAddress The end IP address of the firewall rule. Must
 * be IPv4 format. Must be greater than or equal to startIpAddress. Use value
 * '0.0.0.0' to represent all Azure-internal IP addresses.
 *
 */
class FirewallRule extends models['SubResource'] {
  constructor() {
    super();
  }

  /**
   * Defines the metadata of FirewallRule
   *
   * @returns {object} metadata of FirewallRule
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'FirewallRule',
      type: {
        name: 'Composite',
        className: 'FirewallRule',
        modelProperties: {
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          kind: {
            required: false,
            readOnly: true,
            serializedName: 'kind',
            type: {
              name: 'String'
            }
          },
          location: {
            required: false,
            readOnly: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          startIpAddress: {
            required: true,
            serializedName: 'properties.startIpAddress',
            type: {
              name: 'String'
            }
          },
          endIpAddress: {
            required: true,
            serializedName: 'properties.endIpAddress',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = FirewallRule;
