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

/**
 * Describes the usageAggregation.
 *
 */
class UsageAggregation {
  /**
   * Create a UsageAggregation.
   * @member {string} [id] Unique Id for the usage aggregate.
   * @member {string} [name] Name of the usage aggregate.
   * @member {string} [type] Type of the resource being returned.
   * @member {uuid} [subscriptionId] The subscription identifier for the Azure
   * user.
   * @member {string} [meterId] Unique ID for the resource that was consumed
   * (aka ResourceID).
   * @member {date} [usageStartTime] UTC start time for the usage bucket to
   * which this usage aggregate belongs.
   * @member {date} [usageEndTime] UTC end time for the usage bucket to which
   * this usage aggregate belongs.
   * @member {number} [quantity] The amount of the resource consumption that
   * occurred in this time frame.
   * @member {string} [unit] The unit in which the usage for this resource is
   * being counted, e.g. Hours, GB.
   * @member {string} [meterName] Friendly name of the resource being consumed.
   * @member {string} [meterCategory] Category of the consumed resource.
   * @member {string} [meterSubCategory] Sub-category of the consumed resource.
   * @member {string} [meterRegion] Region of the meterId used for billing
   * purposes
   * @member {object} [infoFields] Key-value pairs of instance details (legacy
   * format).
   * @member {string} [infoFields.project] Identifies the name of the instance
   * provisioned by the user.
   * @member {string} [instanceData] Key-value pairs of instance details
   * represented as a string.
   */
  constructor() {
  }

  /**
   * Defines the metadata of UsageAggregation
   *
   * @returns {object} metadata of UsageAggregation
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'UsageAggregation',
      type: {
        name: 'Composite',
        className: 'UsageAggregation',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          subscriptionId: {
            required: false,
            serializedName: 'properties.subscriptionId',
            type: {
              name: 'String'
            }
          },
          meterId: {
            required: false,
            serializedName: 'properties.meterId',
            type: {
              name: 'String'
            }
          },
          usageStartTime: {
            required: false,
            serializedName: 'properties.usageStartTime',
            type: {
              name: 'DateTime'
            }
          },
          usageEndTime: {
            required: false,
            serializedName: 'properties.usageEndTime',
            type: {
              name: 'DateTime'
            }
          },
          quantity: {
            required: false,
            serializedName: 'properties.quantity',
            type: {
              name: 'Number'
            }
          },
          unit: {
            required: false,
            serializedName: 'properties.unit',
            type: {
              name: 'String'
            }
          },
          meterName: {
            required: false,
            serializedName: 'properties.meterName',
            type: {
              name: 'String'
            }
          },
          meterCategory: {
            required: false,
            serializedName: 'properties.meterCategory',
            type: {
              name: 'String'
            }
          },
          meterSubCategory: {
            required: false,
            serializedName: 'properties.meterSubCategory',
            type: {
              name: 'String'
            }
          },
          meterRegion: {
            required: false,
            serializedName: 'properties.meterRegion',
            type: {
              name: 'String'
            }
          },
          infoFields: {
            required: false,
            serializedName: 'properties.infoFields',
            type: {
              name: 'Composite',
              className: 'InfoField'
            }
          },
          instanceData: {
            required: false,
            serializedName: 'properties.instanceData',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = UsageAggregation;
