/*
 * 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 0.16.0.0
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

'use strict';

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

var util = require('util');

/**
 * @class
 * Initializes a new instance of the Probe class.
 * @constructor
 * Load balancer Probe
 * @member {array} [loadBalancingRules] Gets Load balancer rules that use this
 * probe
 * 
 * @member {string} protocol Gets or sets the protocol of the end point.
 * Possible values are http pr Tcp. If Tcp is specified, a received ACK is
 * required for the probe to be successful. If http is specified,a 200 OK
 * response from the specifies URI is required for the probe to be
 * successful. Possible values include: 'Http', 'Tcp'
 * 
 * @member {number} port Gets or sets Port for communicating the probe.
 * Possible values range from 1 to 65535, inclusive.
 * 
 * @member {number} [intervalInSeconds] Gets or sets the interval, in seconds,
 * for how frequently to probe the endpoint for health status. Typically, the
 * interval is slightly less than half the allocated timeout period (in
 * seconds) which allows two full probes before taking the instance out of
 * rotation. The default value is 15, the minimum value is 5
 * 
 * @member {number} [numberOfProbes] Gets or sets the number of probes where
 * if no response, will result in stopping further traffic from being
 * delivered to the endpoint. This values allows endponints to be taken out
 * of rotation faster or slower than the typical times used in Azure.
 * 
 * @member {string} [requestPath] Gets or sets the URI used for requesting
 * health status from the VM. Path is required if a protocol is set to http.
 * Otherwise, it is not allowed. There is no default value
 * 
 * @member {string} [provisioningState] Gets or sets Provisioning state of the
 * PublicIP resource Updating/Deleting/Failed
 * 
 * @member {string} [name] Gets name of the resource that is unique within a
 * resource group. This name can be used to access the resource
 * 
 * @member {string} [etag] A unique read-only string that changes whenever the
 * resource is updated
 * 
 */
function Probe() {
  Probe['super_'].call(this);
}

util.inherits(Probe, models['SubResource']);

/**
 * Defines the metadata of Probe
 *
 * @returns {object} metadata of Probe
 *
 */
Probe.prototype.mapper = function () {
  return {
    required: false,
    serializedName: 'Probe',
    type: {
      name: 'Composite',
      className: 'Probe',
      modelProperties: {
        id: {
          required: false,
          serializedName: 'id',
          type: {
            name: 'String'
          }
        },
        loadBalancingRules: {
          required: false,
          serializedName: 'properties.loadBalancingRules',
          type: {
            name: 'Sequence',
            element: {
                required: false,
                serializedName: 'SubResourceElementType',
                type: {
                  name: 'Composite',
                  className: 'SubResource'
                }
            }
          }
        },
        protocol: {
          required: true,
          serializedName: 'properties.protocol',
          type: {
            name: 'String'
          }
        },
        port: {
          required: true,
          serializedName: 'properties.port',
          type: {
            name: 'Number'
          }
        },
        intervalInSeconds: {
          required: false,
          serializedName: 'properties.intervalInSeconds',
          type: {
            name: 'Number'
          }
        },
        numberOfProbes: {
          required: false,
          serializedName: 'properties.numberOfProbes',
          type: {
            name: 'Number'
          }
        },
        requestPath: {
          required: false,
          serializedName: 'properties.requestPath',
          type: {
            name: 'String'
          }
        },
        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 = Probe;
