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

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

    :param account_id: Required. The bill's account <span
     class='property-internal'>Required</span>
    :type account_id: int
    :param begin_date: Required. The bill's begin date <span
     class='property-internal'>Required</span> <span
     class='property-internal'>Must be between 12/31/1899 and 1/1/3000</span>
    :type begin_date: datetime
    :param end_date: Required. The bill's end date <span
     class='property-internal'>Required</span> <span
     class='property-internal'>Must be between 12/31/1899 and 1/1/3000</span>
    :type end_date: datetime
    :param billing_period: Required. The bill's billing period <span
     class='property-internal'>Required</span> <span
     class='property-internal'>Must be between 190001 and 209912</span>
    :type billing_period: int
    :param account_period: The bill's accounting period
     Depending on your settings you can have up to 13 accounting periods <span
     class='property-internal'>Must be between 190001 and 209913</span> <span
     class='property-internal'>Required (defined)</span>
    :type account_period: int
    :param estimated: Indicates if the bill is estimated <span
     class='property-internal'>Required (defined)</span>
    :type estimated: bool
    :param statement_date: The date and time of the bill statement <span
     class='property-internal'>Must be between 12/31/1899 and 1/1/3000</span>
     <span class='property-internal'>Required (defined)</span>
    :type statement_date: datetime
    :param due_date: The date and time the bill is due <span
     class='property-internal'>Must be between 12/31/1899 and 1/1/3000</span>
     <span class='property-internal'>Required (defined)</span>
    :type due_date: datetime
    :param next_reading: The date and time the next reading <span
     class='property-internal'>Must be between 12/31/1899 and 1/1/3000</span>
     <span class='property-internal'>Required (defined)</span>
    :type next_reading: datetime
    :param control_code: The bill's control code <span
     class='property-internal'>Must be between 0 and 255 characters</span>
     <span class='property-internal'>Required (defined)</span>
    :type control_code: str
    :param invoice_number: The bill's invoice number <span
     class='property-internal'>Must be between 0 and 32 characters</span> <span
     class='property-internal'>Required (defined)</span>
    :type invoice_number: str
    :param set_to_unapproved: The bill's "approval change flag".
     If a bill is approved and the approval system is turned on:
     true = unapprove bill, false = don't change bill's approval status.
     If the approval system is not turned on:
     the bill's approval status will not be changed regardless of this setting.
     <span class='property-internal'>Required (defined)</span>
    :type set_to_unapproved: bool
    :param note: The bill note <span class='property-internal'>Required
     (defined)</span>
    :type note: str
    :param meters: The meters with line items <span
     class='property-internal'>Required (defined)</span>
    :type meters: list[~energycap.sdk.models.BillMeterEdit]
    :param account_body_lines: The account line items <span
     class='property-internal'>Required (defined)</span>
    :type account_body_lines:
     list[~energycap.sdk.models.BillAccountBodyLineEdit]
    """

    _validation = {
        'account_id': {'required': True},
        'begin_date': {'required': True},
        'end_date': {'required': True},
        'billing_period': {'required': True, 'maximum': 209912, 'minimum': 190001},
        'account_period': {'maximum': 209913, 'minimum': 190001},
        'control_code': {'max_length': 255, 'min_length': 0},
        'invoice_number': {'max_length': 32, 'min_length': 0},
    }

    _attribute_map = {
        'account_id': {'key': 'accountId', 'type': 'int'},
        'begin_date': {'key': 'beginDate', 'type': 'iso-8601'},
        'end_date': {'key': 'endDate', 'type': 'iso-8601'},
        'billing_period': {'key': 'billingPeriod', 'type': 'int'},
        'account_period': {'key': 'accountPeriod', 'type': 'int'},
        'estimated': {'key': 'estimated', 'type': 'bool'},
        'statement_date': {'key': 'statementDate', 'type': 'iso-8601'},
        'due_date': {'key': 'dueDate', 'type': 'iso-8601'},
        'next_reading': {'key': 'nextReading', 'type': 'iso-8601'},
        'control_code': {'key': 'controlCode', 'type': 'str'},
        'invoice_number': {'key': 'invoiceNumber', 'type': 'str'},
        'set_to_unapproved': {'key': 'setToUnapproved', 'type': 'bool'},
        'note': {'key': 'note', 'type': 'str'},
        'meters': {'key': 'meters', 'type': '[BillMeterEdit]'},
        'account_body_lines': {'key': 'accountBodyLines', 'type': '[BillAccountBodyLineEdit]'},
    }

    def __init__(self, **kwargs):
        super(BillEdit, self).__init__(**kwargs)
        self.account_id = kwargs.get('account_id', None)
        self.begin_date = kwargs.get('begin_date', None)
        self.end_date = kwargs.get('end_date', None)
        self.billing_period = kwargs.get('billing_period', None)
        self.account_period = kwargs.get('account_period', None)
        self.estimated = kwargs.get('estimated', None)
        self.statement_date = kwargs.get('statement_date', None)
        self.due_date = kwargs.get('due_date', None)
        self.next_reading = kwargs.get('next_reading', None)
        self.control_code = kwargs.get('control_code', None)
        self.invoice_number = kwargs.get('invoice_number', None)
        self.set_to_unapproved = kwargs.get('set_to_unapproved', None)
        self.note = kwargs.get('note', None)
        self.meters = kwargs.get('meters', None)
        self.account_body_lines = kwargs.get('account_body_lines', None)
