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

/**
 * Connection state snapshot.
 *
 */
class ConnectionStateSnapshot {
  /**
   * Create a ConnectionStateSnapshot.
   * @property {string} [connectionState] The connection state. Possible values
   * include: 'Reachable', 'Unreachable', 'Unknown'
   * @property {date} [startTime] The start time of the connection snapshot.
   * @property {date} [endTime] The end time of the connection snapshot.
   * @property {string} [evaluationState] Connectivity analysis evaluation
   * state. Possible values include: 'NotStarted', 'InProgress', 'Completed'
   * @property {number} [avgLatencyInMs] Average latency in ms.
   * @property {number} [minLatencyInMs] Minimum latency in ms.
   * @property {number} [maxLatencyInMs] Maximum latency in ms.
   * @property {number} [probesSent] The number of sent probes.
   * @property {number} [probesFailed] The number of failed probes.
   * @property {array} [hops] List of hops between the source and the
   * destination.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ConnectionStateSnapshot
   *
   * @returns {object} metadata of ConnectionStateSnapshot
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ConnectionStateSnapshot',
      type: {
        name: 'Composite',
        className: 'ConnectionStateSnapshot',
        modelProperties: {
          connectionState: {
            required: false,
            serializedName: 'connectionState',
            type: {
              name: 'String'
            }
          },
          startTime: {
            required: false,
            serializedName: 'startTime',
            type: {
              name: 'DateTime'
            }
          },
          endTime: {
            required: false,
            serializedName: 'endTime',
            type: {
              name: 'DateTime'
            }
          },
          evaluationState: {
            required: false,
            serializedName: 'evaluationState',
            type: {
              name: 'String'
            }
          },
          avgLatencyInMs: {
            required: false,
            serializedName: 'avgLatencyInMs',
            type: {
              name: 'Number'
            }
          },
          minLatencyInMs: {
            required: false,
            serializedName: 'minLatencyInMs',
            type: {
              name: 'Number'
            }
          },
          maxLatencyInMs: {
            required: false,
            serializedName: 'maxLatencyInMs',
            type: {
              name: 'Number'
            }
          },
          probesSent: {
            required: false,
            serializedName: 'probesSent',
            type: {
              name: 'Number'
            }
          },
          probesFailed: {
            required: false,
            serializedName: 'probesFailed',
            type: {
              name: 'Number'
            }
          },
          hops: {
            required: false,
            readOnly: true,
            serializedName: 'hops',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ConnectivityHopElementType',
                  type: {
                    name: 'Composite',
                    className: 'ConnectivityHop'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = ConnectionStateSnapshot;
