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

/**
 * The response to a metrics query.
 *
 */
class Response {
  /**
   * Create a Response.
   * @property {number} [cost] The integer value representing the cost of the
   * query, for data case.
   * @property {string} timespan The timespan for which the data was retrieved.
   * Its value consists of two datetimes concatenated, separated by '/'.  This
   * may be adjusted in the future and returned back from what was originally
   * requested.
   * @property {moment.duration} [interval] The interval (window size) for
   * which the metric data was returned in.  This may be adjusted in the future
   * and returned back from what was originally requested.  This is not present
   * if a metadata request was made.
   * @property {string} [namespace] The namespace of the metrics been queried
   * @property {string} [resourceregion] The region of the resource been
   * queried for metrics.
   * @property {array} value the value of the collection.
   */
  constructor() {
  }

  /**
   * Defines the metadata of Response
   *
   * @returns {object} metadata of Response
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Response',
      type: {
        name: 'Composite',
        className: 'Response',
        modelProperties: {
          cost: {
            required: false,
            serializedName: 'cost',
            constraints: {
              InclusiveMinimum: 0
            },
            type: {
              name: 'Number'
            }
          },
          timespan: {
            required: true,
            serializedName: 'timespan',
            type: {
              name: 'String'
            }
          },
          interval: {
            required: false,
            serializedName: 'interval',
            type: {
              name: 'TimeSpan'
            }
          },
          namespace: {
            required: false,
            serializedName: 'namespace',
            type: {
              name: 'String'
            }
          },
          resourceregion: {
            required: false,
            serializedName: 'resourceregion',
            type: {
              name: 'String'
            }
          },
          value: {
            required: true,
            serializedName: 'value',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'MetricElementType',
                  type: {
                    name: 'Composite',
                    className: 'Metric'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = Response;
