# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::Consumption::Mgmt::V2017_04_24_preview
  module Models
    #
    # An usage detail resource.
    #
    class UsageDetail < Resource

      include MsRestAzure

      # @return [String] The id of the billing period resource that the usage
      # belongs to.
      attr_accessor :billing_period_id

      # @return [String] The id of the invoice resource that the usage belongs
      # to.
      attr_accessor :invoice_id

      # @return [DateTime] The start of the date time range covered by the
      # usage detail.
      attr_accessor :usage_start

      # @return [DateTime] The end of the date time range covered by the usage
      # detail.
      attr_accessor :usage_end

      # @return [String] The name of the resource instance that the usage is
      # about.
      attr_accessor :instance_name

      # @return [String] The uri of the resource instance that the usage is
      # about.
      attr_accessor :instance_id

      # @return [String] The location of the resource instance that the usage
      # is about.
      attr_accessor :instance_location

      # @return [String] The ISO currency in which the meter is charged, for
      # example, USD.
      attr_accessor :currency

      # @return The quantity of usage.
      attr_accessor :usage_quantity

      # @return The billable usage quantity.
      attr_accessor :billable_quantity

      # @return The amount of cost before tax.
      attr_accessor :pretax_cost

      # @return [Boolean] The estimated usage is subject to change.
      attr_accessor :is_estimated

      # @return [String] The meter id.
      attr_accessor :meter_id

      # @return [MeterDetails] The details about the meter. By default this is
      # not populated, unless it's specified in $expand.
      attr_accessor :meter_details

      # @return [Hash{String => String}] The list of key/value pairs for the
      # additional properties, in the format 'key':'value' where key = the
      # field name, and value = the field value. By default this is not
      # populated, unless it's specified in $expand.
      attr_accessor :additional_properties


      #
      # Mapper for UsageDetail class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'UsageDetail',
          type: {
            name: 'Composite',
            class_name: 'UsageDetail',
            model_properties: {
              id: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'id',
                type: {
                  name: 'String'
                }
              },
              name: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'name',
                type: {
                  name: 'String'
                }
              },
              type: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'type',
                type: {
                  name: 'String'
                }
              },
              tags: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'tags',
                type: {
                  name: 'Dictionary',
                  value: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'StringElementType',
                      type: {
                        name: 'String'
                      }
                  }
                }
              },
              billing_period_id: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.billingPeriodId',
                type: {
                  name: 'String'
                }
              },
              invoice_id: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.invoiceId',
                type: {
                  name: 'String'
                }
              },
              usage_start: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.usageStart',
                type: {
                  name: 'DateTime'
                }
              },
              usage_end: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.usageEnd',
                type: {
                  name: 'DateTime'
                }
              },
              instance_name: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.instanceName',
                type: {
                  name: 'String'
                }
              },
              instance_id: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.instanceId',
                type: {
                  name: 'String'
                }
              },
              instance_location: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.instanceLocation',
                type: {
                  name: 'String'
                }
              },
              currency: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.currency',
                type: {
                  name: 'String'
                }
              },
              usage_quantity: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.usageQuantity',
                type: {
                  name: 'Number'
                }
              },
              billable_quantity: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.billableQuantity',
                type: {
                  name: 'Number'
                }
              },
              pretax_cost: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.pretaxCost',
                type: {
                  name: 'Number'
                }
              },
              is_estimated: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.isEstimated',
                type: {
                  name: 'Boolean'
                }
              },
              meter_id: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.meterId',
                type: {
                  name: 'String'
                }
              },
              meter_details: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.meterDetails',
                type: {
                  name: 'Composite',
                  class_name: 'MeterDetails'
                }
              },
              additional_properties: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.additionalProperties',
                type: {
                  name: 'Dictionary',
                  value: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'StringElementType',
                      type: {
                        name: 'String'
                      }
                  }
                }
              }
            }
          }
        }
      end
    end
  end
end
