from __future__ import annotations
import datetime
from collections.abc import Callable
from dataclasses import dataclass, field
from kiota_abstractions.serialization import Parsable, ParseNode, SerializationWriter
from typing import Any, Optional, TYPE_CHECKING, Union
from uuid import UUID

if TYPE_CHECKING:
    from .payment_items_get_response_results_association_type import PaymentItemsGetResponse_results_associationType

@dataclass
class PaymentItemsGetResponse_results(Parsable):
    # The advance amount of the work completed in this period.
    advance_amount: Optional[float] = None
    # The advance percent of the work completed in this period.
    advance_percent: Optional[float] = None
    # The aggregate type to budget Payment application.Possible values: ``workCompleted``, ``workCompletedPercentage``
    aggregate_by: Optional[str] = None
    # The amount of the work completed in this period.
    amount: Optional[float] = None
    # The ID of the object that the payment item is generated from.
    association_id: Optional[UUID] = None
    # The object type of the payment item is generated from.Possible values: ``SCO``, ``OCO``, ``SOV``, ``CostItem``, ``SubCostItem``, ``MaterialsOnSite``
    association_type: Optional[PaymentItemsGetResponse_results_associationType] = None
    # The budget code for the payment item (unformatted string).
    budget_code: Optional[str] = None
    # The budget code for the payment item (formatted with separators).
    budget_formatted_code: Optional[str] = None
    # The ID of the Budget to which the payment item belongs.
    budget_id: Optional[UUID] = None
    # Not relevant
    budget_transfers: Optional[float] = None
    # Not relevant
    budget_transfers_quantity: Optional[float] = None
    # Not relevant
    budget_transfers_unit_price: Optional[float] = None
    # Indicate if this payment item can be deleted.
    can_delete: Optional[bool] = None
    # The user who made the change.
    changed_by: Optional[str] = None
    # The claimed amount of the work completed in this period.
    claimed_amount: Optional[float] = None
    # The claimed quantity of the work completed in this period.
    claimed_quantity: Optional[float] = None
    # The claimed unit price of the work completed in this period.
    claimed_unit_price: Optional[float] = None
    # The retained amount of total work completed released in this period.
    completed_work_released: Optional[float] = None
    # Not relevant
    completed_work_retained: Optional[float] = None
    # Not relevant
    completed_work_retained_percent: Optional[float] = None
    # The amount of total work completed retained (pre-release) in this application. This parameter will be deprecated.
    completed_work_retention: Optional[float] = None
    # The percentage of total work completed retained in this application.
    completed_work_retention_percent: Optional[float] = None
    # The date and time that the item was created, in ISO 8601 format.
    created_at: Optional[datetime.datetime] = None
    # The user who created the payment item. This is the ID of a user managed by BIM 360 Admin.
    creator_id: Optional[str] = None
    # Not relevant
    current_completed_work_retention: Optional[float] = None
    # Not relevant
    current_completed_work_retention_foreign_currency: Optional[float] = None
    # Not relevant
    current_completed_work_retention_percent: Optional[float] = None
    # Not relevant
    current_materials_retention: Optional[float] = None
    # Not relevant
    current_materials_retention_foreign_currency: Optional[float] = None
    # Not relevant
    current_materials_retention_percent: Optional[float] = None
    # Not relevant
    current_released: Optional[float] = None
    # Not relevant
    current_retention: Optional[float] = None
    # A description of the payment item.
    description: Optional[str] = None
    # Exchange rate. Default value is ``1``. If multi-currency is not enabled, it will also be ``1``.
    exchange_rate: Optional[float] = None
    # The identifier assigned to an item in its original external ERP system. Use this ID to track and look up data within the integrated system. Note that this value comes from the item's ID in the external system.Max length: 255
    external_id: Optional[str] = None
    # A message generated by the external ERP system that explains the sync status of the integration. For example, common values include ``success`` or ``fail`` to indicate the result of the integration operation.Max length: 255
    external_message: Optional[str] = None
    # The name of the external ERP system integrated with Cost Management. Use this name to identify and search for data within the integrated system.Max length: 255
    external_system: Optional[str] = None
    # Indicate if this payment item has comment.
    has_comment: Optional[bool] = None
    # Unique identifier of the payment.
    id: Optional[UUID] = None
    # The state of the item during the integration with the external ERP system (such as SignNow). An item can be a ``budget``, ``contract``, ``main contract``, ``main contract item``, ``cost item``, ``expense``, ``expense item``, ``change order``, or ``schedule of value``. For more details, see `Integrate with External System </en/docs/acc/v1/tutorials/cost/integrate-with-external-system/>`_ tutorial.Possible values:``locked``: the item is currently locked within the ERP system, preventing modifications until unlocked. To unlock and modify the item, use the relevant PATCH endpoint to set ``integrationState`` to ``null``. For example, for a budget, call `PATCH budgets <en/docs/bim360/v1/reference/http/cost-budgets-budgetId-PATCH/>`_. For a contract, call `PATCH contracts <en/docs/bim360/v1/reference/http/cost-contracts-contractId-PATCH/>`_. For more details, see the `Help documentation <https://help.autodesk.com/view/BUILD/ENU/?guid=Integrated_and_Locked>`_.``integrated``: the item has been successfully added to the ERP system.``failed``: the item encountered an error during the integration process and was not successfully added to the ERP system. For example, if a user tries to integrate ``contracts`` from an ERP system and the updates fail, the ``integrationState`` can be set to ``failed``. Retry the sync process or analyze the issue if it continues to fail.``null``: The item has not been integrated with the ERP system. This is default value.For more information regarding integrations within the Cost Management system, see `Integrations in Cost Management <https://help.autodesk.com/view/BUILD/ENU/?guid=Cost_Integrations>`_.
    integration_state: Optional[str] = None
    # The date and time that the item's integration status was last changed.
    integration_state_changed_at: Optional[str] = None
    # The user who last changed the integration status. This is the ID of a user managed by the BIM 360/ACC Admin.
    integration_state_changed_by: Optional[str] = None
    # Indicate if this payment item should be exposed to owner. This is only for budget payment.
    is_private: Optional[bool] = None
    # The last user who made the review.
    last_reviewed_by: Optional[str] = None
    # The date and time when the item was last synchronized with the external ERP system. This value is updated by the external system and is in ISO 8601 format.
    last_sync_time: Optional[datetime.datetime] = None
    # Not relevant
    materials: Optional[float] = None
    # The amount of the materials billed in this period.
    materials_billed: Optional[float] = None
    # The quantity of the materials billed in this period.
    materials_billed_quantity: Optional[float] = None
    # The unit of the materials billed in this period.
    materials_billed_unit: Optional[str] = None
    # The unit price of the materials billed in this period.
    materials_billed_unit_price: Optional[float] = None
    # The amount of the materials stored in this application.
    materials_on_store: Optional[float] = None
    # The quantity of the materials stored in this application.
    materials_on_store_quantity: Optional[float] = None
    # The retained amount of the materials (stored or billed) released in this period. This parameter is deprecated, use materialsReleased.
    materials_on_store_released: Optional[float] = None
    # The percentage of the materials retained. This parameter is deprecated, use materialsRetainedPercent.
    materials_on_store_retention_percent: Optional[float] = None
    # The unit of the materials stored in this application.
    materials_on_store_unit: Optional[str] = None
    # The unit price of the materials stored in this application.
    materials_on_store_unit_price: Optional[float] = None
    # The retained amount of the materials (stored or billed) released in this period.
    materials_released: Optional[float] = None
    # The amount of the materials (stored or billed) retained in this application.
    materials_retained: Optional[float] = None
    # Not relevant
    materials_retained_percent: Optional[float] = None
    # The amount of the materials (stored or billed) retained (pre-release) in this application. This parameter will be deprecated, use materialsRetained.
    materials_retention: Optional[float] = None
    # The percentage of the materials (stored or billed) retained (pre-release) in this application. This parameter will be deprecated, use materialsRetainedPercent.
    materials_retention_percent: Optional[float] = None
    # The name of the payment item.Max length: 1024
    name: Optional[str] = None
    # The net amount to be paid in this period, including work completed, materials stored or billed, retention and release.
    net_amount: Optional[float] = None
    # The net amount to be paid in this period, in foreign currency.
    net_amount_foreign_currency: Optional[float] = None
    # The original amount of the payment item. Derived from the associated SOV or the main contract item.
    original_amount: Optional[float] = None
    # If this payment item came from Schedule of Value, the value is equal to Schedule of Value exchange rate; If this payment item came from SCO, the value is equal to SCO exchange rate. Default value is ``1``. If multi-currency is not enabled, it will also be ``1``.
    original_exchange_rate: Optional[float] = None
    # The original quantity of the payment item. Derived from the associated SOV or the main contract item.
    original_quantity: Optional[float] = None
    # The original unit price of the payment item. Derived from the associated SOV or the main contract item.
    original_unit_price: Optional[float] = None
    # The ID of the parent item for sub items.
    parent_id: Optional[UUID] = None
    # The ID of the payment the items belong to.
    payment_id: Optional[UUID] = None
    # The position of the payment item in the payment item siblings.
    position: Optional[int] = None
    # The advance amount of total work completed prior to this period.
    previous_advance_amount: Optional[float] = None
    # The advance amount of total work completed prior to this period, in foreign currency.
    previous_advance_amount_foreign_currency: Optional[float] = None
    # The amount of total work completed prior to this period.
    previous_amount: Optional[float] = None
    # The amount of total work completed prior to this period, in foreign currency.
    previous_amount_foreign_currency: Optional[float] = None
    # The claimed amount of the work completed prior to this period.
    previous_claimed_amount: Optional[float] = None
    # The claimed amount of the work completed prior to this period, in foreign currency.
    previous_claimed_amount_foreign_currency: Optional[float] = None
    # The claimed quantity of total work completed prior to this period.
    previous_claimed_quantity: Optional[float] = None
    # The claimed unit price of the work completed prior to this period.
    previous_claimed_unit_price: Optional[float] = None
    # Not relevant
    previous_completed_work_retained: Optional[float] = None
    # Not relevant
    previous_completed_work_retained_foreign_currency: Optional[float] = None
    # Exchange rate from previous payment application. Default value is ``1``, if multi-currency is not enabled, it will also be ``1``.
    previous_exchange_rate: Optional[float] = None
    # Not relevant
    previous_materials: Optional[float] = None
    # The amount of total materials billed prior to this period.
    previous_materials_billed: Optional[float] = None
    # The amount of total materials billed prior to this period, in foreign currency.
    previous_materials_billed_foreign_currency: Optional[float] = None
    # The quantity of total materials billed prior to this period.
    previous_materials_billed_quantity: Optional[float] = None
    # The unit of total materials billed prior to this period.
    previous_materials_billed_unit: Optional[str] = None
    # The unit price of total materials billed prior to this period.
    previous_materials_billed_unit_price: Optional[float] = None
    # The amount of total materials stored prior to this period.
    previous_materials_on_store: Optional[float] = None
    # Not relevant
    previous_materials_retained: Optional[float] = None
    # Not relevant
    previous_materials_retained_foreign_currency: Optional[float] = None
    # Not relevant
    previous_net_amount: Optional[float] = None
    # The quantity of total work completed prior to this period.
    previous_quantity: Optional[float] = None
    # The recoupment amount of the work completed prior to this period.
    previous_recoupment_amount: Optional[float] = None
    # The recoupment amount of the work completed prior to this period, in foreign currency.
    previous_recoupment_amount_foreign_currency: Optional[float] = None
    # Not relevant
    previous_retained: Optional[float] = None
    # The unit price of total work completed prior to this period.
    previous_unit_price: Optional[float] = None
    # The quantity of the work completed in this period.
    quantity: Optional[float] = None
    # netAmountForeignCurrency / originalExchangeRate - netAmount
    realized_gain_or_loss: Optional[float] = None
    # The recoupment amount of the work completed in this period.
    recoupment_amount: Optional[float] = None
    # The recoupment percentage of the work completed in this period.
    recoupment_percent_of_completed_work: Optional[float] = None
    # Not relevant
    retainage: Optional[float] = None
    # The review status the payment item.Possible values: ``accepted``, ``rejected``, ``semi-rejected``, ``null``
    status: Optional[str] = None
    # Not relevant
    total_retained: Optional[float] = None
    # Not relevant
    total_retained_percent: Optional[float] = None
    # The percentage of total work completed and materials retained (pre-release).
    total_retention_percent: Optional[float] = None
    # The unit of the work completed in this period.
    unit: Optional[str] = None
    # The unit price of the work completed in this period.
    unit_price: Optional[float] = None
    # The date and time that the item was last updated, in ISO 8601 format.
    updated_at: Optional[datetime.datetime] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> PaymentItemsGetResponse_results:
        """
        Creates a new instance of the appropriate class based on discriminator value
        param parse_node: The parse node to use to read the discriminator value and create the object
        Returns: PaymentItemsGetResponse_results
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return PaymentItemsGetResponse_results()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .payment_items_get_response_results_association_type import PaymentItemsGetResponse_results_associationType

        from .payment_items_get_response_results_association_type import PaymentItemsGetResponse_results_associationType

        fields: dict[str, Callable[[Any], None]] = {
            "advanceAmount": lambda n : setattr(self, 'advance_amount', n.get_float_value()),
            "advancePercent": lambda n : setattr(self, 'advance_percent', n.get_float_value()),
            "aggregateBy": lambda n : setattr(self, 'aggregate_by', n.get_str_value()),
            "amount": lambda n : setattr(self, 'amount', n.get_float_value()),
            "associationId": lambda n : setattr(self, 'association_id', n.get_uuid_value()),
            "associationType": lambda n : setattr(self, 'association_type', n.get_enum_value(PaymentItemsGetResponse_results_associationType)),
            "budgetCode": lambda n : setattr(self, 'budget_code', n.get_str_value()),
            "budgetFormattedCode": lambda n : setattr(self, 'budget_formatted_code', n.get_str_value()),
            "budgetId": lambda n : setattr(self, 'budget_id', n.get_uuid_value()),
            "budgetTransfers": lambda n : setattr(self, 'budget_transfers', n.get_float_value()),
            "budgetTransfersQuantity": lambda n : setattr(self, 'budget_transfers_quantity', n.get_float_value()),
            "budgetTransfersUnitPrice": lambda n : setattr(self, 'budget_transfers_unit_price', n.get_float_value()),
            "canDelete": lambda n : setattr(self, 'can_delete', n.get_bool_value()),
            "changedBy": lambda n : setattr(self, 'changed_by', n.get_str_value()),
            "claimedAmount": lambda n : setattr(self, 'claimed_amount', n.get_float_value()),
            "claimedQuantity": lambda n : setattr(self, 'claimed_quantity', n.get_float_value()),
            "claimedUnitPrice": lambda n : setattr(self, 'claimed_unit_price', n.get_float_value()),
            "completedWorkReleased": lambda n : setattr(self, 'completed_work_released', n.get_float_value()),
            "completedWorkRetained": lambda n : setattr(self, 'completed_work_retained', n.get_float_value()),
            "completedWorkRetainedPercent": lambda n : setattr(self, 'completed_work_retained_percent', n.get_float_value()),
            "completedWorkRetention": lambda n : setattr(self, 'completed_work_retention', n.get_float_value()),
            "completedWorkRetentionPercent": lambda n : setattr(self, 'completed_work_retention_percent', n.get_float_value()),
            "createdAt": lambda n : setattr(self, 'created_at', n.get_datetime_value()),
            "creatorId": lambda n : setattr(self, 'creator_id', n.get_str_value()),
            "currentCompletedWorkRetention": lambda n : setattr(self, 'current_completed_work_retention', n.get_float_value()),
            "currentCompletedWorkRetentionForeignCurrency": lambda n : setattr(self, 'current_completed_work_retention_foreign_currency', n.get_float_value()),
            "currentCompletedWorkRetentionPercent": lambda n : setattr(self, 'current_completed_work_retention_percent', n.get_float_value()),
            "currentMaterialsRetention": lambda n : setattr(self, 'current_materials_retention', n.get_float_value()),
            "currentMaterialsRetentionForeignCurrency": lambda n : setattr(self, 'current_materials_retention_foreign_currency', n.get_float_value()),
            "currentMaterialsRetentionPercent": lambda n : setattr(self, 'current_materials_retention_percent', n.get_float_value()),
            "currentReleased": lambda n : setattr(self, 'current_released', n.get_float_value()),
            "currentRetention": lambda n : setattr(self, 'current_retention', n.get_float_value()),
            "description": lambda n : setattr(self, 'description', n.get_str_value()),
            "exchangeRate": lambda n : setattr(self, 'exchange_rate', n.get_float_value()),
            "externalId": lambda n : setattr(self, 'external_id', n.get_str_value()),
            "externalMessage": lambda n : setattr(self, 'external_message', n.get_str_value()),
            "externalSystem": lambda n : setattr(self, 'external_system', n.get_str_value()),
            "hasComment": lambda n : setattr(self, 'has_comment', n.get_bool_value()),
            "id": lambda n : setattr(self, 'id', n.get_uuid_value()),
            "integrationState": lambda n : setattr(self, 'integration_state', n.get_str_value()),
            "integrationStateChangedAt": lambda n : setattr(self, 'integration_state_changed_at', n.get_str_value()),
            "integrationStateChangedBy": lambda n : setattr(self, 'integration_state_changed_by', n.get_str_value()),
            "isPrivate": lambda n : setattr(self, 'is_private', n.get_bool_value()),
            "lastReviewedBy": lambda n : setattr(self, 'last_reviewed_by', n.get_str_value()),
            "lastSyncTime": lambda n : setattr(self, 'last_sync_time', n.get_datetime_value()),
            "materials": lambda n : setattr(self, 'materials', n.get_float_value()),
            "materialsBilled": lambda n : setattr(self, 'materials_billed', n.get_float_value()),
            "materialsBilledQuantity": lambda n : setattr(self, 'materials_billed_quantity', n.get_float_value()),
            "materialsBilledUnit": lambda n : setattr(self, 'materials_billed_unit', n.get_str_value()),
            "materialsBilledUnitPrice": lambda n : setattr(self, 'materials_billed_unit_price', n.get_float_value()),
            "materialsOnStore": lambda n : setattr(self, 'materials_on_store', n.get_float_value()),
            "materialsOnStoreQuantity": lambda n : setattr(self, 'materials_on_store_quantity', n.get_float_value()),
            "materialsOnStoreReleased": lambda n : setattr(self, 'materials_on_store_released', n.get_float_value()),
            "materialsOnStoreRetentionPercent": lambda n : setattr(self, 'materials_on_store_retention_percent', n.get_float_value()),
            "materialsOnStoreUnit": lambda n : setattr(self, 'materials_on_store_unit', n.get_str_value()),
            "materialsOnStoreUnitPrice": lambda n : setattr(self, 'materials_on_store_unit_price', n.get_float_value()),
            "materialsReleased": lambda n : setattr(self, 'materials_released', n.get_float_value()),
            "materialsRetained": lambda n : setattr(self, 'materials_retained', n.get_float_value()),
            "materialsRetainedPercent": lambda n : setattr(self, 'materials_retained_percent', n.get_float_value()),
            "materialsRetention": lambda n : setattr(self, 'materials_retention', n.get_float_value()),
            "materialsRetentionPercent": lambda n : setattr(self, 'materials_retention_percent', n.get_float_value()),
            "name": lambda n : setattr(self, 'name', n.get_str_value()),
            "netAmount": lambda n : setattr(self, 'net_amount', n.get_float_value()),
            "netAmountForeignCurrency": lambda n : setattr(self, 'net_amount_foreign_currency', n.get_float_value()),
            "originalAmount": lambda n : setattr(self, 'original_amount', n.get_float_value()),
            "originalExchangeRate": lambda n : setattr(self, 'original_exchange_rate', n.get_float_value()),
            "originalQuantity": lambda n : setattr(self, 'original_quantity', n.get_float_value()),
            "originalUnitPrice": lambda n : setattr(self, 'original_unit_price', n.get_float_value()),
            "parentId": lambda n : setattr(self, 'parent_id', n.get_uuid_value()),
            "paymentId": lambda n : setattr(self, 'payment_id', n.get_uuid_value()),
            "position": lambda n : setattr(self, 'position', n.get_int_value()),
            "previousAdvanceAmount": lambda n : setattr(self, 'previous_advance_amount', n.get_float_value()),
            "previousAdvanceAmountForeignCurrency": lambda n : setattr(self, 'previous_advance_amount_foreign_currency', n.get_float_value()),
            "previousAmount": lambda n : setattr(self, 'previous_amount', n.get_float_value()),
            "previousAmountForeignCurrency": lambda n : setattr(self, 'previous_amount_foreign_currency', n.get_float_value()),
            "previousClaimedAmount": lambda n : setattr(self, 'previous_claimed_amount', n.get_float_value()),
            "previousClaimedAmountForeignCurrency": lambda n : setattr(self, 'previous_claimed_amount_foreign_currency', n.get_float_value()),
            "previousClaimedQuantity": lambda n : setattr(self, 'previous_claimed_quantity', n.get_float_value()),
            "previousClaimedUnitPrice": lambda n : setattr(self, 'previous_claimed_unit_price', n.get_float_value()),
            "previousCompletedWorkRetained": lambda n : setattr(self, 'previous_completed_work_retained', n.get_float_value()),
            "previousCompletedWorkRetainedForeignCurrency": lambda n : setattr(self, 'previous_completed_work_retained_foreign_currency', n.get_float_value()),
            "previousExchangeRate": lambda n : setattr(self, 'previous_exchange_rate', n.get_float_value()),
            "previousMaterials": lambda n : setattr(self, 'previous_materials', n.get_float_value()),
            "previousMaterialsBilled": lambda n : setattr(self, 'previous_materials_billed', n.get_float_value()),
            "previousMaterialsBilledForeignCurrency": lambda n : setattr(self, 'previous_materials_billed_foreign_currency', n.get_float_value()),
            "previousMaterialsBilledQuantity": lambda n : setattr(self, 'previous_materials_billed_quantity', n.get_float_value()),
            "previousMaterialsBilledUnit": lambda n : setattr(self, 'previous_materials_billed_unit', n.get_str_value()),
            "previousMaterialsBilledUnitPrice": lambda n : setattr(self, 'previous_materials_billed_unit_price', n.get_float_value()),
            "previousMaterialsOnStore": lambda n : setattr(self, 'previous_materials_on_store', n.get_float_value()),
            "previousMaterialsRetained": lambda n : setattr(self, 'previous_materials_retained', n.get_float_value()),
            "previousMaterialsRetainedForeignCurrency": lambda n : setattr(self, 'previous_materials_retained_foreign_currency', n.get_float_value()),
            "previousNetAmount": lambda n : setattr(self, 'previous_net_amount', n.get_float_value()),
            "previousQuantity": lambda n : setattr(self, 'previous_quantity', n.get_float_value()),
            "previousRecoupmentAmount": lambda n : setattr(self, 'previous_recoupment_amount', n.get_float_value()),
            "previousRecoupmentAmountForeignCurrency": lambda n : setattr(self, 'previous_recoupment_amount_foreign_currency', n.get_float_value()),
            "previousRetained": lambda n : setattr(self, 'previous_retained', n.get_float_value()),
            "previousUnitPrice": lambda n : setattr(self, 'previous_unit_price', n.get_float_value()),
            "quantity": lambda n : setattr(self, 'quantity', n.get_float_value()),
            "realizedGainOrLoss": lambda n : setattr(self, 'realized_gain_or_loss', n.get_float_value()),
            "recoupmentAmount": lambda n : setattr(self, 'recoupment_amount', n.get_float_value()),
            "recoupmentPercentOfCompletedWork": lambda n : setattr(self, 'recoupment_percent_of_completed_work', n.get_float_value()),
            "retainage": lambda n : setattr(self, 'retainage', n.get_float_value()),
            "status": lambda n : setattr(self, 'status', n.get_str_value()),
            "totalRetained": lambda n : setattr(self, 'total_retained', n.get_float_value()),
            "totalRetainedPercent": lambda n : setattr(self, 'total_retained_percent', n.get_float_value()),
            "totalRetentionPercent": lambda n : setattr(self, 'total_retention_percent', n.get_float_value()),
            "unit": lambda n : setattr(self, 'unit', n.get_str_value()),
            "unitPrice": lambda n : setattr(self, 'unit_price', n.get_float_value()),
            "updatedAt": lambda n : setattr(self, 'updated_at', n.get_datetime_value()),
        }
        return fields
    
    def serialize(self,writer: SerializationWriter) -> None:
        """
        Serializes information the current object
        param writer: Serialization writer to use to serialize this model
        Returns: None
        """
        if writer is None:
            raise TypeError("writer cannot be null.")
        writer.write_float_value("advanceAmount", self.advance_amount)
        writer.write_float_value("advancePercent", self.advance_percent)
        writer.write_str_value("aggregateBy", self.aggregate_by)
        writer.write_float_value("amount", self.amount)
        writer.write_uuid_value("associationId", self.association_id)
        writer.write_enum_value("associationType", self.association_type)
        writer.write_str_value("budgetCode", self.budget_code)
        writer.write_str_value("budgetFormattedCode", self.budget_formatted_code)
        writer.write_uuid_value("budgetId", self.budget_id)
        writer.write_float_value("budgetTransfers", self.budget_transfers)
        writer.write_float_value("budgetTransfersQuantity", self.budget_transfers_quantity)
        writer.write_float_value("budgetTransfersUnitPrice", self.budget_transfers_unit_price)
        writer.write_bool_value("canDelete", self.can_delete)
        writer.write_str_value("changedBy", self.changed_by)
        writer.write_float_value("claimedAmount", self.claimed_amount)
        writer.write_float_value("claimedQuantity", self.claimed_quantity)
        writer.write_float_value("claimedUnitPrice", self.claimed_unit_price)
        writer.write_float_value("completedWorkReleased", self.completed_work_released)
        writer.write_float_value("completedWorkRetained", self.completed_work_retained)
        writer.write_float_value("completedWorkRetainedPercent", self.completed_work_retained_percent)
        writer.write_float_value("completedWorkRetention", self.completed_work_retention)
        writer.write_float_value("completedWorkRetentionPercent", self.completed_work_retention_percent)
        writer.write_datetime_value("createdAt", self.created_at)
        writer.write_str_value("creatorId", self.creator_id)
        writer.write_float_value("currentCompletedWorkRetention", self.current_completed_work_retention)
        writer.write_float_value("currentCompletedWorkRetentionForeignCurrency", self.current_completed_work_retention_foreign_currency)
        writer.write_float_value("currentCompletedWorkRetentionPercent", self.current_completed_work_retention_percent)
        writer.write_float_value("currentMaterialsRetention", self.current_materials_retention)
        writer.write_float_value("currentMaterialsRetentionForeignCurrency", self.current_materials_retention_foreign_currency)
        writer.write_float_value("currentMaterialsRetentionPercent", self.current_materials_retention_percent)
        writer.write_float_value("currentReleased", self.current_released)
        writer.write_float_value("currentRetention", self.current_retention)
        writer.write_str_value("description", self.description)
        writer.write_float_value("exchangeRate", self.exchange_rate)
        writer.write_str_value("externalId", self.external_id)
        writer.write_str_value("externalMessage", self.external_message)
        writer.write_str_value("externalSystem", self.external_system)
        writer.write_bool_value("hasComment", self.has_comment)
        writer.write_uuid_value("id", self.id)
        writer.write_str_value("integrationState", self.integration_state)
        writer.write_str_value("integrationStateChangedAt", self.integration_state_changed_at)
        writer.write_str_value("integrationStateChangedBy", self.integration_state_changed_by)
        writer.write_bool_value("isPrivate", self.is_private)
        writer.write_str_value("lastReviewedBy", self.last_reviewed_by)
        writer.write_datetime_value("lastSyncTime", self.last_sync_time)
        writer.write_float_value("materials", self.materials)
        writer.write_float_value("materialsBilled", self.materials_billed)
        writer.write_float_value("materialsBilledQuantity", self.materials_billed_quantity)
        writer.write_str_value("materialsBilledUnit", self.materials_billed_unit)
        writer.write_float_value("materialsBilledUnitPrice", self.materials_billed_unit_price)
        writer.write_float_value("materialsOnStore", self.materials_on_store)
        writer.write_float_value("materialsOnStoreQuantity", self.materials_on_store_quantity)
        writer.write_float_value("materialsOnStoreReleased", self.materials_on_store_released)
        writer.write_float_value("materialsOnStoreRetentionPercent", self.materials_on_store_retention_percent)
        writer.write_str_value("materialsOnStoreUnit", self.materials_on_store_unit)
        writer.write_float_value("materialsOnStoreUnitPrice", self.materials_on_store_unit_price)
        writer.write_float_value("materialsReleased", self.materials_released)
        writer.write_float_value("materialsRetained", self.materials_retained)
        writer.write_float_value("materialsRetainedPercent", self.materials_retained_percent)
        writer.write_float_value("materialsRetention", self.materials_retention)
        writer.write_float_value("materialsRetentionPercent", self.materials_retention_percent)
        writer.write_str_value("name", self.name)
        writer.write_float_value("netAmount", self.net_amount)
        writer.write_float_value("netAmountForeignCurrency", self.net_amount_foreign_currency)
        writer.write_float_value("originalAmount", self.original_amount)
        writer.write_float_value("originalExchangeRate", self.original_exchange_rate)
        writer.write_float_value("originalQuantity", self.original_quantity)
        writer.write_float_value("originalUnitPrice", self.original_unit_price)
        writer.write_uuid_value("parentId", self.parent_id)
        writer.write_uuid_value("paymentId", self.payment_id)
        writer.write_int_value("position", self.position)
        writer.write_float_value("previousAdvanceAmount", self.previous_advance_amount)
        writer.write_float_value("previousAdvanceAmountForeignCurrency", self.previous_advance_amount_foreign_currency)
        writer.write_float_value("previousAmount", self.previous_amount)
        writer.write_float_value("previousAmountForeignCurrency", self.previous_amount_foreign_currency)
        writer.write_float_value("previousClaimedAmount", self.previous_claimed_amount)
        writer.write_float_value("previousClaimedAmountForeignCurrency", self.previous_claimed_amount_foreign_currency)
        writer.write_float_value("previousClaimedQuantity", self.previous_claimed_quantity)
        writer.write_float_value("previousClaimedUnitPrice", self.previous_claimed_unit_price)
        writer.write_float_value("previousCompletedWorkRetained", self.previous_completed_work_retained)
        writer.write_float_value("previousCompletedWorkRetainedForeignCurrency", self.previous_completed_work_retained_foreign_currency)
        writer.write_float_value("previousExchangeRate", self.previous_exchange_rate)
        writer.write_float_value("previousMaterials", self.previous_materials)
        writer.write_float_value("previousMaterialsBilled", self.previous_materials_billed)
        writer.write_float_value("previousMaterialsBilledForeignCurrency", self.previous_materials_billed_foreign_currency)
        writer.write_float_value("previousMaterialsBilledQuantity", self.previous_materials_billed_quantity)
        writer.write_str_value("previousMaterialsBilledUnit", self.previous_materials_billed_unit)
        writer.write_float_value("previousMaterialsBilledUnitPrice", self.previous_materials_billed_unit_price)
        writer.write_float_value("previousMaterialsOnStore", self.previous_materials_on_store)
        writer.write_float_value("previousMaterialsRetained", self.previous_materials_retained)
        writer.write_float_value("previousMaterialsRetainedForeignCurrency", self.previous_materials_retained_foreign_currency)
        writer.write_float_value("previousNetAmount", self.previous_net_amount)
        writer.write_float_value("previousQuantity", self.previous_quantity)
        writer.write_float_value("previousRecoupmentAmount", self.previous_recoupment_amount)
        writer.write_float_value("previousRecoupmentAmountForeignCurrency", self.previous_recoupment_amount_foreign_currency)
        writer.write_float_value("previousRetained", self.previous_retained)
        writer.write_float_value("previousUnitPrice", self.previous_unit_price)
        writer.write_float_value("quantity", self.quantity)
        writer.write_float_value("realizedGainOrLoss", self.realized_gain_or_loss)
        writer.write_float_value("recoupmentAmount", self.recoupment_amount)
        writer.write_float_value("recoupmentPercentOfCompletedWork", self.recoupment_percent_of_completed_work)
        writer.write_float_value("retainage", self.retainage)
        writer.write_str_value("status", self.status)
        writer.write_float_value("totalRetained", self.total_retained)
        writer.write_float_value("totalRetainedPercent", self.total_retained_percent)
        writer.write_float_value("totalRetentionPercent", self.total_retention_percent)
        writer.write_str_value("unit", self.unit)
        writer.write_float_value("unitPrice", self.unit_price)
        writer.write_datetime_value("updatedAt", self.updated_at)
    

