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

from msrest.serialization import Model


class UpsertAggregateMeterRequest(Model):
    """UpsertAggregateMeterRequest.

    All required parameters must be populated in order to send to Azure.

    :param aggregate_meter_id: Aggregation Meter Identifier
     If AggregateMeterId is null: a new aggregate meter and version is always
     created
     If AggregateMeterId is not null: it must exist and only associated with 1
     account otherwise error
     If AggregateMeterId exists: we will always update the Aggregate's
     MeterInfo and AccountInfo
     If AggregateMeterId exists and no version exists on the same account and
     meter with the specified billing period: a new version is created
     If AggregateMeterId exists and a version exists on the same account and
     meter with the specified billing period: the version is updated <span
     class='property-internal'>Required (defined)</span>
    :type aggregate_meter_id: int
    :param begin_period: Required. Begin period for the version in the format
     YYYYMM <span class='property-internal'>Required</span>
    :type begin_period: int
    :param source_meter_ids: Required. Meters to aggregate
     All meters must match the commodity of the aggregate meter
     All meters must be on the place the aggregate is created
     All meters should be hidden <span
     class='property-internal'>Required</span> <span
     class='property-internal'>Cannot be Empty</span>
    :type source_meter_ids: list[int]
    :param commodity_id: Required. The identifier for the aggregate meter's
     commodity <span class='property-internal'>Required</span>
    :type commodity_id: int
    :param aggregate_meter_info: Required. The aggregate meter info <span
     class='property-internal'>Required</span> <span
     class='property-internal'>Must be between 0 and 50 characters</span>
    :type aggregate_meter_info: str
    """

    _validation = {
        'begin_period': {'required': True},
        'source_meter_ids': {'required': True},
        'commodity_id': {'required': True},
        'aggregate_meter_info': {'required': True, 'max_length': 50, 'min_length': 0},
    }

    _attribute_map = {
        'aggregate_meter_id': {'key': 'aggregateMeterId', 'type': 'int'},
        'begin_period': {'key': 'beginPeriod', 'type': 'int'},
        'source_meter_ids': {'key': 'sourceMeterIds', 'type': '[int]'},
        'commodity_id': {'key': 'commodityId', 'type': 'int'},
        'aggregate_meter_info': {'key': 'aggregateMeterInfo', 'type': 'str'},
    }

    def __init__(self, **kwargs):
        super(UpsertAggregateMeterRequest, self).__init__(**kwargs)
        self.aggregate_meter_id = kwargs.get('aggregate_meter_id', None)
        self.begin_period = kwargs.get('begin_period', None)
        self.source_meter_ids = kwargs.get('source_meter_ids', None)
        self.commodity_id = kwargs.get('commodity_id', None)
        self.aggregate_meter_info = kwargs.get('aggregate_meter_info', None)
