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

/**
 * A metric segment
 *
 */
class MetricsSegmentInfo {
  /**
   * Create a MetricsSegmentInfo.
   * @member {date} [start] Start time of the metric segment (only when an
   * interval was specified).
   * @member {date} [end] Start time of the metric segment (only when an
   * interval was specified).
   * @member {array} [segments] Segmented metric data (if further segmented).
   */
  constructor() {
  }

  /**
   * Defines the metadata of MetricsSegmentInfo
   *
   * @returns {object} metadata of MetricsSegmentInfo
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'metricsSegmentInfo',
      type: {
        name: 'Composite',
        additionalProperties: {
          type: {
            name: 'Dictionary',
            value: {
                required: false,
                serializedName: 'ObjectElementType',
                type: {
                  name: 'Object'
                }
            }
          }
        },
        className: 'MetricsSegmentInfo',
        modelProperties: {
          start: {
            required: false,
            serializedName: 'start',
            type: {
              name: 'DateTime'
            }
          },
          end: {
            required: false,
            serializedName: 'end',
            type: {
              name: 'DateTime'
            }
          },
          segments: {
            required: false,
            serializedName: 'segments',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'MetricsSegmentInfoElementType',
                  type: {
                    name: 'Composite',
                    additionalProperties: {
                      type: {
                        name: 'Dictionary',
                        value: {
                            required: false,
                            serializedName: 'ObjectElementType',
                            type: {
                              name: 'Object'
                            }
                        }
                      }
                    },
                    className: 'MetricsSegmentInfo'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = MetricsSegmentInfo;
