# 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.

    :param meter_code: 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: 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: 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: 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: The identifier for the meter's time zone. <span
     class='property-internal'>Required</span>
    :type meter_time_zone_id: int
    :param active: 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 set to -1 or null, then no change will be made.
     Please see DemandUnitId summary as well <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 this property does not exist, then no change will be made.
     If this property exists and its value is -1, then no change will be made.
     If this property exists and its value is null AND useUnitId is null then
     no change will be made.
     If this property is sent in as null AND useUnitId is NOT null, then the
     meter's demand unit ID will be set to null.
     Please see UseUnitID summary as well <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, meter_code, meter_info, place_id, commodity_id, meter_time_zone_id, active, address=None, bill_entry_note=None, include_in_energy_star=None, primary_use_id=None, properties=None, use_unit_id=None, demand_unit_id=None, meter_description="Æ"):
        super(MeterEdit, self).__init__()
        self.meter_code = meter_code
        self.meter_info = meter_info
        self.place_id = place_id
        self.commodity_id = commodity_id
        self.address = address
        self.bill_entry_note = bill_entry_note
        self.include_in_energy_star = include_in_energy_star
        self.primary_use_id = primary_use_id
        self.meter_time_zone_id = meter_time_zone_id
        self.active = active
        self.properties = properties
        self.use_unit_id = use_unit_id
        self.demand_unit_id = demand_unit_id
        self.meter_description = meter_description
