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

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

    :param effective_date: Required. Effective date for the version <span
     class='property-internal'>Required</span> <span
     class='property-internal'>Must be between 12/31/1899 and 1/1/3000</span>
    :type effective_date: datetime
    :param note: Note for the version <span class='property-internal'>Must be
     between 0 and 255 characters</span> <span
     class='property-internal'>Required (defined)</span>
    :type note: str
    :param use_unit_cost: Unit cost for the use <span
     class='property-info'>Max scale of 8</span> <span
     class='property-info'>NULL Valid</span> <span
     class='property-internal'>Required (defined)</span>
    :type use_unit_cost: float
    :param use_unit_id: Use unit ID <span class='property-internal'>Required
     (defined)</span>
    :type use_unit_id: int
    :param demand_unit_cost: Unit cost for the demand <span
     class='property-info'>Max scale of 8</span> <span
     class='property-info'>NULL Valid</span> <span
     class='property-internal'>Required (defined)</span>
    :type demand_unit_cost: float
    :param demand_unit_id: Demand unit ID <span
     class='property-internal'>Required (defined)</span>
    :type demand_unit_id: int
    :param account_line_items: Cost bodylines for the account <span
     class='property-internal'>Required (defined)</span>
    :type account_line_items:
     list[~energycap.sdk.models.GenericBodylineRequest]
    :param meter_line_items: Cost bodylines for the meter <span
     class='property-internal'>Required (defined)</span>
    :type meter_line_items: list[~energycap.sdk.models.GenericBodylineRequest]
    :param udfs: List of user defined/custom fields and values for this
     version
     If the Udfs list is null or empty no values are assigned
     If a udf is omitted no value is assigned to that udf
     To remove a value from an existing Udf, pass in the UdfId and set the
     Value to null <span class='property-internal'>Required (defined)</span>
    :type udfs: list[~energycap.sdk.models.UDFValue]
    """

    _validation = {
        'effective_date': {'required': True},
        'note': {'max_length': 255, 'min_length': 0},
    }

    _attribute_map = {
        'effective_date': {'key': 'effectiveDate', 'type': 'iso-8601'},
        'note': {'key': 'note', 'type': 'str'},
        'use_unit_cost': {'key': 'useUnitCost', 'type': 'float'},
        'use_unit_id': {'key': 'useUnitId', 'type': 'int'},
        'demand_unit_cost': {'key': 'demandUnitCost', 'type': 'float'},
        'demand_unit_id': {'key': 'demandUnitId', 'type': 'int'},
        'account_line_items': {'key': 'accountLineItems', 'type': '[GenericBodylineRequest]'},
        'meter_line_items': {'key': 'meterLineItems', 'type': '[GenericBodylineRequest]'},
        'udfs': {'key': 'udfs', 'type': '[UDFValue]'},
    }

    def __init__(self, **kwargs):
        super(RateVersionRequest, self).__init__(**kwargs)
        self.effective_date = kwargs.get('effective_date', None)
        self.note = kwargs.get('note', None)
        self.use_unit_cost = kwargs.get('use_unit_cost', None)
        self.use_unit_id = kwargs.get('use_unit_id', None)
        self.demand_unit_cost = kwargs.get('demand_unit_cost', None)
        self.demand_unit_id = kwargs.get('demand_unit_id', None)
        self.account_line_items = kwargs.get('account_line_items', None)
        self.meter_line_items = kwargs.get('meter_line_items', None)
        self.udfs = kwargs.get('udfs', None)
