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

/**
 * Pool of backend IP addresses.
 *
 * @extends models['SubResource']
 */
class BackendAddressPool extends models['SubResource'] {
  /**
   * Create a BackendAddressPool.
   * @property {array} [backendIPConfigurations] Gets collection of references
   * to IP addresses defined in network interfaces.
   * @property {array} [loadBalancingRules] Gets load balancing rules that use
   * this backend address pool.
   * @property {object} [outboundRule] Gets outbound rules that use this
   * backend address pool.
   * @property {string} [outboundRule.id] Resource ID.
   * @property {string} [provisioningState] Get provisioning state of the
   * public IP resource. Possible values are: 'Updating', 'Deleting', and
   * 'Failed'.
   * @property {string} [name] Gets name of the resource that is unique within
   * a resource group. This name can be used to access the resource.
   * @property {string} [etag] A unique read-only string that changes whenever
   * the resource is updated.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of BackendAddressPool
   *
   * @returns {object} metadata of BackendAddressPool
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'BackendAddressPool',
      type: {
        name: 'Composite',
        className: 'BackendAddressPool',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          backendIPConfigurations: {
            required: false,
            readOnly: true,
            serializedName: 'properties.backendIPConfigurations',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'NetworkInterfaceIPConfigurationElementType',
                  type: {
                    name: 'Composite',
                    className: 'NetworkInterfaceIPConfiguration'
                  }
              }
            }
          },
          loadBalancingRules: {
            required: false,
            readOnly: true,
            serializedName: 'properties.loadBalancingRules',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'SubResourceElementType',
                  type: {
                    name: 'Composite',
                    className: 'SubResource'
                  }
              }
            }
          },
          outboundRule: {
            required: false,
            readOnly: true,
            serializedName: 'properties.outboundRule',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          provisioningState: {
            required: false,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          etag: {
            required: false,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = BackendAddressPool;
