# 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 MeterEdit(Model):
    """MeterEdit.

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

    :param meter_code: Required. The meter code <span
     class='property-internal'>Required</span> <span
     class='property-internal'>Must be between 0 and 32 characters</span>
    :type meter_code: str
    :param meter_info: Required. The meter info <span
     class='property-internal'>Required</span> <span
     class='property-internal'>Must be between 0 and 50 characters</span>
    :type meter_info: str
    :param place_id: Required. The identifier for the place the meter is
     assigned to <span class='property-internal'>Topmost (Place)</span> <span
     class='property-internal'>Required</span>
    :type place_id: int
    :param commodity_id: Required. The commodity identifier that the meter is
     assigned to.
     If different from original commodity id, then a commodity change will be
     attempted. <span class='property-internal'>Required</span>
    :type commodity_id: int
    :param address:
    :type address: ~energycap.sdk.models.AddressChild
    :param bill_entry_note: The bill entry note <span
     class='property-internal'>Must be between 0 and 64 characters</span> <span
     class='property-internal'>Required (defined)</span>
    :type bill_entry_note: str
    :param include_in_energy_star: DEPRECATED
     To be included in ENERGY STAR a meter needs to be linked to a meter in
     Portfolio Manager
     This can be done with the PUT place/{placeId}/energyStar/link or the
     ENERGY STAR: Mappings Setup Sheet <span class='property-internal'>Required
     (defined)</span>
    :type include_in_energy_star: bool
    :param primary_use_id: The identifier for the meter's primary use <span
     class='property-internal'>Required (defined)</span>
    :type primary_use_id: int
    :param meter_time_zone_id: Required. The identifier for the meter's time
     zone. <span class='property-internal'>Required</span>
    :type meter_time_zone_id: int
    :param active: Required. Is this meter active? <span
     class='property-internal'>Required</span>
    :type active: bool
    :param properties: An array of meter properties <span
     class='property-internal'>Required (defined)</span>
    :type properties: dict[str, str]
    :param use_unit_id: The use unit ID is the reporting unit for use for this
     meter.
     If it is null the use unit will be removed <span
     class='property-internal'>Required (defined)</span>
    :type use_unit_id: int
    :param demand_unit_id: The demand unit ID is the reporting unit for demand
     for this meter.
     If it is null the demand unit will be removed <span
     class='property-internal'>Required (defined)</span>
    :type demand_unit_id: int
    :param meter_description: A description of the meter <span
     class='property-internal'>Must be between 0 and 4000 characters</span>
     <span class='property-internal'>Required (defined)</span>. Default value:
     "Æ" .
    :type meter_description: str
    """

    _validation = {
        'meter_code': {'required': True, 'max_length': 32, 'min_length': 0},
        'meter_info': {'required': True, 'max_length': 50, 'min_length': 0},
        'place_id': {'required': True},
        'commodity_id': {'required': True},
        'bill_entry_note': {'max_length': 64, 'min_length': 0},
        'meter_time_zone_id': {'required': True},
        'active': {'required': True},
        'meter_description': {'max_length': 4000, 'min_length': 0},
    }

    _attribute_map = {
        'meter_code': {'key': 'meterCode', 'type': 'str'},
        'meter_info': {'key': 'meterInfo', 'type': 'str'},
        'place_id': {'key': 'placeId', 'type': 'int'},
        'commodity_id': {'key': 'commodityId', 'type': 'int'},
        'address': {'key': 'address', 'type': 'AddressChild'},
        'bill_entry_note': {'key': 'billEntryNote', 'type': 'str'},
        'include_in_energy_star': {'key': 'includeInEnergyStar', 'type': 'bool'},
        'primary_use_id': {'key': 'primaryUseId', 'type': 'int'},
        'meter_time_zone_id': {'key': 'meterTimeZoneId', 'type': 'int'},
        'active': {'key': 'active', 'type': 'bool'},
        'properties': {'key': 'properties', 'type': '{str}'},
        'use_unit_id': {'key': 'useUnitId', 'type': 'int'},
        'demand_unit_id': {'key': 'demandUnitId', 'type': 'int'},
        'meter_description': {'key': 'meterDescription', 'type': 'str'},
    }

    def __init__(self, **kwargs):
        super(MeterEdit, self).__init__(**kwargs)
        self.meter_code = kwargs.get('meter_code', None)
        self.meter_info = kwargs.get('meter_info', None)
        self.place_id = kwargs.get('place_id', None)
        self.commodity_id = kwargs.get('commodity_id', None)
        self.address = kwargs.get('address', None)
        self.bill_entry_note = kwargs.get('bill_entry_note', None)
        self.include_in_energy_star = kwargs.get('include_in_energy_star', None)
        self.primary_use_id = kwargs.get('primary_use_id', None)
        self.meter_time_zone_id = kwargs.get('meter_time_zone_id', None)
        self.active = kwargs.get('active', None)
        self.properties = kwargs.get('properties', None)
        self.use_unit_id = kwargs.get('use_unit_id', None)
        self.demand_unit_id = kwargs.get('demand_unit_id', None)
        self.meter_description = kwargs.get('meter_description', "Æ")
