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

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

    :param emission_source_id: Required. The Emission Source this record will
     be assigned to <span class='property-internal'>Required</span>
    :type emission_source_id: int
    :param begin_date: Required. The begin date for this record <span
     class='property-internal'>Required</span>
    :type begin_date: datetime
    :param end_date: Required. The end date for this record <span
     class='property-internal'>Required</span>
    :type end_date: datetime
    :param vendor_id: The supplier for this record <span
     class='property-internal'>Required (defined)</span>
    :type vendor_id: int
    :param record_type_id: Required. The type of this record. Valid values
     are:
     1 - Use
     2 - Cost
     3 - Direct/Offset <span class='property-internal'>Required</span> <span
     class='property-internal'>One of 1, 2, 3 </span>
    :type record_type_id: int
    :param scope_category_id: Required. The scope category for this record
     <span class='property-internal'>Required</span>
    :type scope_category_id: int
    :param factor_id: Required. The factor for this record <span
     class='property-internal'>Required</span>
    :type factor_id: int
    :param quantity: The use that is being tracked by this record.
     This value is required if RecordTypeId is set to 1 (Use) or 3
     (Direct/Offset),
     but must be left null if RecordTypeId is set to 2 (Cost). <span
     class='property-internal'>Required when RecordTypeId is set to 1, or
     3</span>
    :type quantity: float
    :param quantity_unit_id: The unit for the use being tracked by this
     record.
     This value is required if RecordTypeId is set to 1 (Use) or 3
     (Direct/Offset),
     but must be left null if RecordTypeId is set to 2 (Cost). <span
     class='property-internal'>Required when RecordTypeId is set to 1, or
     3</span>
    :type quantity_unit_id: int
    :param cost: The cost for this record
     Required if RecordTypeId is set to 2 (Cost), otherwise it is optional.
     <span class='property-internal'>Required when RecordTypeId is set to
     2</span>
    :type cost: float
    :param cost_unit_id: The unit for this record's cost.
     Required if RecordTypeId is set to 2 (Cost), otherwise it is optional.
     <span class='property-internal'>Required when RecordTypeId is set to
     2</span>
    :type cost_unit_id: int
    :param note: The note for this record <span class='property-internal'>Must
     be between 0 and 255 characters</span> <span
     class='property-internal'>Required (defined)</span>
    :type note: str
    :param attachment: The attachment for this record <span
     class='property-internal'>Must be between 0 and 260 characters</span>
     <span class='property-internal'>Required (defined)</span>
    :type attachment: str
    """

    _validation = {
        'emission_source_id': {'required': True},
        'begin_date': {'required': True},
        'end_date': {'required': True},
        'record_type_id': {'required': True},
        'scope_category_id': {'required': True},
        'factor_id': {'required': True},
        'note': {'max_length': 255, 'min_length': 0},
        'attachment': {'max_length': 260, 'min_length': 0},
    }

    _attribute_map = {
        'emission_source_id': {'key': 'emissionSourceId', 'type': 'int'},
        'begin_date': {'key': 'beginDate', 'type': 'iso-8601'},
        'end_date': {'key': 'endDate', 'type': 'iso-8601'},
        'vendor_id': {'key': 'vendorId', 'type': 'int'},
        'record_type_id': {'key': 'recordTypeId', 'type': 'int'},
        'scope_category_id': {'key': 'scopeCategoryId', 'type': 'int'},
        'factor_id': {'key': 'factorId', 'type': 'int'},
        'quantity': {'key': 'quantity', 'type': 'float'},
        'quantity_unit_id': {'key': 'quantityUnitId', 'type': 'int'},
        'cost': {'key': 'cost', 'type': 'float'},
        'cost_unit_id': {'key': 'costUnitId', 'type': 'int'},
        'note': {'key': 'note', 'type': 'str'},
        'attachment': {'key': 'attachment', 'type': 'str'},
    }

    def __init__(self, *, emission_source_id: int, begin_date, end_date, record_type_id: int, scope_category_id: int, factor_id: int, vendor_id: int=None, quantity: float=None, quantity_unit_id: int=None, cost: float=None, cost_unit_id: int=None, note: str=None, attachment: str=None, **kwargs) -> None:
        super(EmissionRecordRequest, self).__init__(**kwargs)
        self.emission_source_id = emission_source_id
        self.begin_date = begin_date
        self.end_date = end_date
        self.vendor_id = vendor_id
        self.record_type_id = record_type_id
        self.scope_category_id = scope_category_id
        self.factor_id = factor_id
        self.quantity = quantity
        self.quantity_unit_id = quantity_unit_id
        self.cost = cost
        self.cost_unit_id = cost_unit_id
        self.note = note
        self.attachment = attachment
