/*
 * 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 backend pool is a collection of backends that can be routed to.
 *
 * @extends models['SubResource']
 */
class BackendPool extends models['SubResource'] {
  /**
   * Create a BackendPool.
   * @member {array} [backends] The set of backends for this pool
   * @member {object} [loadBalancingSettings] Load balancing settings for a
   * backend pool
   * @member {string} [loadBalancingSettings.id] Resource ID.
   * @member {object} [healthProbeSettings] L7 health probe settings for a
   * backend pool
   * @member {string} [healthProbeSettings.id] Resource ID.
   * @member {string} [resourceState] Resource status. Possible values include:
   * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting'
   * @member {string} [name] Resource name.
   * @member {string} [type] Resource type.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of BackendPool
   *
   * @returns {object} metadata of BackendPool
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'BackendPool',
      type: {
        name: 'Composite',
        className: 'BackendPool',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          backends: {
            required: false,
            serializedName: 'properties.backends',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'BackendElementType',
                  type: {
                    name: 'Composite',
                    className: 'Backend'
                  }
              }
            }
          },
          loadBalancingSettings: {
            required: false,
            serializedName: 'properties.loadBalancingSettings',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          healthProbeSettings: {
            required: false,
            serializedName: 'properties.healthProbeSettings',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          resourceState: {
            required: false,
            serializedName: 'properties.resourceState',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = BackendPool;
