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 .payments_get_response_additional_collaborators import PaymentsGetResponse_additionalCollaborators
    from .payments_get_response_association_type import PaymentsGetResponse_associationType
    from .payments_get_response_recipients import PaymentsGetResponse_recipients
    from .payments_get_response_status import PaymentsGetResponse_status

@dataclass
class PaymentsGetResponse(Parsable):
    # The additional collaborator company and contacts.
    additional_collaborators: Optional[list[PaymentsGetResponse_additionalCollaborators]] = None
    # 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
    # Not relevant
    aggregate_by: Optional[str] = None
    # The amount of the work completed in this period.
    amount: Optional[float] = None
    # The date and time that the item was approved, in ISO 8601 format.
    approved_at: Optional[str] = None
    # Not relevant
    approved_budget_transfers: Optional[float] = None
    # Not relevant
    approved_budget_transfers_foreign_currency: Optional[float] = None
    # The amount of total approved change orders in this payment.
    approved_change_orders: Optional[float] = None
    # The amount of total approved change orders in this payment, in foreign currency.
    approved_change_orders_foreign_currency: Optional[float] = None
    # The BIM360/ACC ID of the architecture firm. The detailed company information can be retrieved from `GET projects/:project_id/companies <en/docs/bim360/v1/reference/http/projects-:project_id-companies-GET/>`_ endpoint by searching the `member_group_id` in the response.
    architect_company_id: Optional[str] = None
    # The unique ID of the architecture firm. The detailed company information can be retrieved by this uuid from `GET companies/:company_id <en/docs/bim360/v1/reference/http/companies-:company_id-GET/>` in the response
    architect_company_uid: Optional[str] = None
    # The BIM360/ACC ID of the primary contact at the architecture firm.
    architect_contact_id: Optional[str] = None
    # The ID of the contract or main contract that the payment is associated with.
    association_id: Optional[UUID] = None
    # The type of contract associated with this payment.Possible values: ``Contract``, ``MainContract``.
    association_type: Optional[PaymentsGetResponse_associationType] = None
    # Not relevant
    billing_period_id: Optional[UUID] = None
    # The ID of the budget payment associated with this cost payment. This field is valid only for cost payments.
    budget_payment_id: Optional[str] = None
    # Not relevant
    budget_transfer_ids: Optional[list[str]] = None
    # The date and time that the item was calculated, in ISO 8601 format.
    calculated_at: Optional[str] = None
    # The ID of the user who calculated the payment.
    calculated_by: Optional[str] = None
    # Not relevant
    can_release_retention: Optional[bool] = None
    # The claimed amount of total work completed in this period.
    claimed_amount: Optional[float] = None
    # The ID of a company managed by a BIM 360 Admin. Detailed company information can be retrieved by calling `GET projects/:project_id/companies <en/docs/bim360/v1/reference/http/projects-:project_id-companies-GET/>`_ and locating the `member_group_id` in the response.
    company_id: Optional[str] = None
    # The unique ID (UUID) of the company in this account. Detailed company information can be retrieved using this UUID by calling `GET companies/:company_id <en/docs/bim360/v1/reference/http/companies-:company_id-GET/>`_ in the response.
    company_uid: Optional[str] = None
    # The percentage of the gross retention amount of the payment for work completed. (released value is not removed)
    completed_work_gross_retention_percent: 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 in this application.
    completed_work_retention: Optional[float] = None
    # The amount of total work completed retained (pre-release), in foreign currency.
    completed_work_retention_foreign_currency: Optional[float] = None
    # The ID of a contact managed by a BIM 360 Admin.
    contact_id: Optional[str] = None
    # The original contract amount of the payment.
    contract_amount: Optional[float] = None
    # The original contract amount of the payment, in foreign currency.
    contract_amount_foreign_currency: 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. This is the ID of a user managed by BIM 360 Admin.
    creator_id: Optional[str] = None
    # Not relevant
    current_completed_work_retention_percent: Optional[float] = None
    # Not relevant
    current_materials_retention_percent: Optional[float] = None
    # A detailed description of this payment.
    description: Optional[str] = None
    # The due date of this payment.
    due_date: Optional[str] = None
    # The end date of this payment.
    end_date: 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
    # The date and time determine which distribution period this payment belongs to, after the status of ``status`` is set to ``approved`` or ``paid``.
    forecast_distribution_at: Optional[str] = None
    # Indicate if this payment has item rejected. This parameter is deprecated.
    has_item_rejected: Optional[bool] = None
    # Indicate if this payment has item reviewed. This parameter is deprecated.
    has_item_reviewed: Optional[bool] = None
    # The 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
    # Not relevant
    internal_id: Optional[str] = None
    # Not relevant
    internal_system: 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
    # The ID of the main contract associated with this payment.
    main_contract_id: Optional[UUID] = None
    # The amount of the materials billed in this period.
    materials_billed: Optional[float] = None
    # The percentage of the gross retention of the payment for material (released value is not removed).
    materials_gross_retention_percent: Optional[float] = None
    # The amount of the materials stored in this application.
    materials_on_store: Optional[float] = None
    # The amount of the materials stored retained in this application. This parameter is deprecated.
    materials_on_store_retention: 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 in this application.
    materials_retention: Optional[float] = None
    # The amount of the materials (stored or billed) retained in this application, in foreign currency.
    materials_retention_foreign_currency: Optional[float] = None
    # The name of this payment.Max length: 1024
    name: Optional[str] = None
    # The net amount that should be paid in this period, including work completed, advance amount, materials stored or billed, retention and release.
    net_amount: Optional[float] = None
    # The net amount that should be paid in this period, including work completed, advance amount, materials stored or billed, retention and release, in foreign currency.
    net_amount_foreign_currency: Optional[float] = None
    # The net materials stored in this period, which equals to (`materialsOnStore` - `previousMaterialsOnStore`).
    net_materials_on_store: Optional[float] = None
    # The net retention in this period, which equals to (`completedWorkRetention` + `materialsOnStoreRetention` - `previousRetention`).
    net_retention: Optional[float] = None
    # The note attached to the payment, if returned. The note consists of Tiptap formatted rich text. For more information, see `https://tiptap.dev <https://tiptap.dev/introduction/>`_.
    note: Optional[str] = None
    # The number of this payment.Max length: 255
    number: Optional[str] = None
    # The original payment amount, including the main contract amount, change orders, and internal budget transfers that affect the schedule of values defined in project settings.
    original_amount: Optional[float] = None
    # The original payment amount in foreign currency, including the main contract amount, change orders, and internal budget transfers that affect the schedule of values defined in project settings.
    original_amount_foreign_currency: Optional[float] = None
    # The date and time when the expense is paid.
    paid_at: Optional[str] = None
    # Not relevant
    payment_stage: Optional[str] = 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
    # Not relevant
    previous_approved_budget_transfers: Optional[float] = None
    # Not relevant
    previous_approved_budget_transfers_foreign_currency: Optional[float] = None
    # The amount of total approved change orders prior to this period.
    previous_approved_change_orders: Optional[float] = None
    # The amount of total approved change orders prior to this period, in foreign currency.
    previous_approved_change_orders_foreign_currency: Optional[float] = None
    # The claimed amount of total work completed prior to this period.
    previous_claimed_amount: Optional[float] = None
    # The claimed amount of total work completed prior to this period, in foreign currency.
    previous_claimed_amount_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
    # 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 amount of total materials stored prior to this period.
    previous_materials_on_store: Optional[float] = None
    # The unique identifier of the previous payment for this payment.
    previous_payment_id: Optional[UUID] = None
    # The recoupment amount of total work completed prior to this period.
    previous_recoupment_amount: Optional[float] = None
    # The recoupment amount of total work completed prior to this period, in foreign currency.
    previous_recoupment_amount_foreign_currency: Optional[float] = None
    # The retained amount of total work completed and materials (stored or billed) prior to this period.
    previous_retention: Optional[float] = None
    # The retained amount of total work completed and materials (stored or billed) prior to this period, in foreign currency.
    previous_retention_foreign_currency: Optional[float] = None
    # Persons that the generated documents will be sent to.
    recipients: Optional[list[PaymentsGetResponse_recipients]] = 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
    # The start date of this payment.
    start_date: Optional[str] = None
    # The status of this payment. For details about the possible values of this field, see `Payment Application Statuses <https://help.autodesk.com/view/BUILD/ENU/?guid=Cost_Payment_Application_Statuses>`_.Possible values: ``draft``, ``pendingInput``, ``submitted``, ``revise``, ``accepted``, ``approved``, ``paid``.
    status: Optional[PaymentsGetResponse_status] = None
    # The date and time when the payment is submitted.
    submitted_at: Optional[str] = None
    # The percentage of the gross retention of the payment for work completed and material. (released value is not removed)
    total_gross_retention_percent: Optional[float] = None
    # Not relevant
    total_retained: Optional[float] = None
    # Not relevant
    total_retained_percent: 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) -> PaymentsGetResponse:
        """
        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: PaymentsGetResponse
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return PaymentsGetResponse()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        from .payments_get_response_additional_collaborators import PaymentsGetResponse_additionalCollaborators
        from .payments_get_response_association_type import PaymentsGetResponse_associationType
        from .payments_get_response_recipients import PaymentsGetResponse_recipients
        from .payments_get_response_status import PaymentsGetResponse_status

        from .payments_get_response_additional_collaborators import PaymentsGetResponse_additionalCollaborators
        from .payments_get_response_association_type import PaymentsGetResponse_associationType
        from .payments_get_response_recipients import PaymentsGetResponse_recipients
        from .payments_get_response_status import PaymentsGetResponse_status

        fields: dict[str, Callable[[Any], None]] = {
            "additionalCollaborators": lambda n : setattr(self, 'additional_collaborators', n.get_collection_of_object_values(PaymentsGetResponse_additionalCollaborators)),
            "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()),
            "approvedAt": lambda n : setattr(self, 'approved_at', n.get_str_value()),
            "approvedBudgetTransfers": lambda n : setattr(self, 'approved_budget_transfers', n.get_float_value()),
            "approvedBudgetTransfersForeignCurrency": lambda n : setattr(self, 'approved_budget_transfers_foreign_currency', n.get_float_value()),
            "approvedChangeOrders": lambda n : setattr(self, 'approved_change_orders', n.get_float_value()),
            "approvedChangeOrdersForeignCurrency": lambda n : setattr(self, 'approved_change_orders_foreign_currency', n.get_float_value()),
            "architectCompanyId": lambda n : setattr(self, 'architect_company_id', n.get_str_value()),
            "architectCompanyUid": lambda n : setattr(self, 'architect_company_uid', n.get_str_value()),
            "architectContactId": lambda n : setattr(self, 'architect_contact_id', n.get_str_value()),
            "associationId": lambda n : setattr(self, 'association_id', n.get_uuid_value()),
            "associationType": lambda n : setattr(self, 'association_type', n.get_enum_value(PaymentsGetResponse_associationType)),
            "billingPeriodId": lambda n : setattr(self, 'billing_period_id', n.get_uuid_value()),
            "budgetPaymentId": lambda n : setattr(self, 'budget_payment_id', n.get_str_value()),
            "budgetTransferIds": lambda n : setattr(self, 'budget_transfer_ids', n.get_collection_of_primitive_values(str)),
            "calculatedAt": lambda n : setattr(self, 'calculated_at', n.get_str_value()),
            "calculatedBy": lambda n : setattr(self, 'calculated_by', n.get_str_value()),
            "canReleaseRetention": lambda n : setattr(self, 'can_release_retention', n.get_bool_value()),
            "claimedAmount": lambda n : setattr(self, 'claimed_amount', n.get_float_value()),
            "companyId": lambda n : setattr(self, 'company_id', n.get_str_value()),
            "companyUid": lambda n : setattr(self, 'company_uid', n.get_str_value()),
            "completedWorkGrossRetentionPercent": lambda n : setattr(self, 'completed_work_gross_retention_percent', 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()),
            "completedWorkRetentionForeignCurrency": lambda n : setattr(self, 'completed_work_retention_foreign_currency', n.get_float_value()),
            "contactId": lambda n : setattr(self, 'contact_id', n.get_str_value()),
            "contractAmount": lambda n : setattr(self, 'contract_amount', n.get_float_value()),
            "contractAmountForeignCurrency": lambda n : setattr(self, 'contract_amount_foreign_currency', 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()),
            "currentCompletedWorkRetentionPercent": lambda n : setattr(self, 'current_completed_work_retention_percent', n.get_float_value()),
            "currentMaterialsRetentionPercent": lambda n : setattr(self, 'current_materials_retention_percent', n.get_float_value()),
            "description": lambda n : setattr(self, 'description', n.get_str_value()),
            "dueDate": lambda n : setattr(self, 'due_date', n.get_str_value()),
            "endDate": lambda n : setattr(self, 'end_date', 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()),
            "forecastDistributionAt": lambda n : setattr(self, 'forecast_distribution_at', n.get_str_value()),
            "hasItemRejected": lambda n : setattr(self, 'has_item_rejected', n.get_bool_value()),
            "hasItemReviewed": lambda n : setattr(self, 'has_item_reviewed', 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()),
            "internalId": lambda n : setattr(self, 'internal_id', n.get_str_value()),
            "internalSystem": lambda n : setattr(self, 'internal_system', n.get_str_value()),
            "lastSyncTime": lambda n : setattr(self, 'last_sync_time', n.get_datetime_value()),
            "mainContractId": lambda n : setattr(self, 'main_contract_id', n.get_uuid_value()),
            "materialsBilled": lambda n : setattr(self, 'materials_billed', n.get_float_value()),
            "materialsGrossRetentionPercent": lambda n : setattr(self, 'materials_gross_retention_percent', n.get_float_value()),
            "materialsOnStore": lambda n : setattr(self, 'materials_on_store', n.get_float_value()),
            "materialsOnStoreRetention": lambda n : setattr(self, 'materials_on_store_retention', 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()),
            "materialsRetentionForeignCurrency": lambda n : setattr(self, 'materials_retention_foreign_currency', 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()),
            "netMaterialsOnStore": lambda n : setattr(self, 'net_materials_on_store', n.get_float_value()),
            "netRetention": lambda n : setattr(self, 'net_retention', n.get_float_value()),
            "note": lambda n : setattr(self, 'note', n.get_str_value()),
            "number": lambda n : setattr(self, 'number', n.get_str_value()),
            "originalAmount": lambda n : setattr(self, 'original_amount', n.get_float_value()),
            "originalAmountForeignCurrency": lambda n : setattr(self, 'original_amount_foreign_currency', n.get_float_value()),
            "paidAt": lambda n : setattr(self, 'paid_at', n.get_str_value()),
            "paymentStage": lambda n : setattr(self, 'payment_stage', n.get_str_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()),
            "previousApprovedBudgetTransfers": lambda n : setattr(self, 'previous_approved_budget_transfers', n.get_float_value()),
            "previousApprovedBudgetTransfersForeignCurrency": lambda n : setattr(self, 'previous_approved_budget_transfers_foreign_currency', n.get_float_value()),
            "previousApprovedChangeOrders": lambda n : setattr(self, 'previous_approved_change_orders', n.get_float_value()),
            "previousApprovedChangeOrdersForeignCurrency": lambda n : setattr(self, 'previous_approved_change_orders_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()),
            "previousExchangeRate": lambda n : setattr(self, 'previous_exchange_rate', 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()),
            "previousMaterialsOnStore": lambda n : setattr(self, 'previous_materials_on_store', n.get_float_value()),
            "previousPaymentId": lambda n : setattr(self, 'previous_payment_id', n.get_uuid_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()),
            "previousRetention": lambda n : setattr(self, 'previous_retention', n.get_float_value()),
            "previousRetentionForeignCurrency": lambda n : setattr(self, 'previous_retention_foreign_currency', n.get_float_value()),
            "recipients": lambda n : setattr(self, 'recipients', n.get_collection_of_object_values(PaymentsGetResponse_recipients)),
            "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()),
            "startDate": lambda n : setattr(self, 'start_date', n.get_str_value()),
            "status": lambda n : setattr(self, 'status', n.get_enum_value(PaymentsGetResponse_status)),
            "submittedAt": lambda n : setattr(self, 'submitted_at', n.get_str_value()),
            "totalGrossRetentionPercent": lambda n : setattr(self, 'total_gross_retention_percent', n.get_float_value()),
            "totalRetained": lambda n : setattr(self, 'total_retained', n.get_float_value()),
            "totalRetainedPercent": lambda n : setattr(self, 'total_retained_percent', 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_collection_of_object_values("additionalCollaborators", self.additional_collaborators)
        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_str_value("approvedAt", self.approved_at)
        writer.write_float_value("approvedBudgetTransfers", self.approved_budget_transfers)
        writer.write_float_value("approvedBudgetTransfersForeignCurrency", self.approved_budget_transfers_foreign_currency)
        writer.write_float_value("approvedChangeOrders", self.approved_change_orders)
        writer.write_float_value("approvedChangeOrdersForeignCurrency", self.approved_change_orders_foreign_currency)
        writer.write_str_value("architectCompanyId", self.architect_company_id)
        writer.write_str_value("architectCompanyUid", self.architect_company_uid)
        writer.write_str_value("architectContactId", self.architect_contact_id)
        writer.write_uuid_value("associationId", self.association_id)
        writer.write_enum_value("associationType", self.association_type)
        writer.write_uuid_value("billingPeriodId", self.billing_period_id)
        writer.write_str_value("budgetPaymentId", self.budget_payment_id)
        writer.write_collection_of_primitive_values("budgetTransferIds", self.budget_transfer_ids)
        writer.write_str_value("calculatedAt", self.calculated_at)
        writer.write_str_value("calculatedBy", self.calculated_by)
        writer.write_bool_value("canReleaseRetention", self.can_release_retention)
        writer.write_float_value("claimedAmount", self.claimed_amount)
        writer.write_str_value("companyId", self.company_id)
        writer.write_str_value("companyUid", self.company_uid)
        writer.write_float_value("completedWorkGrossRetentionPercent", self.completed_work_gross_retention_percent)
        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("completedWorkRetentionForeignCurrency", self.completed_work_retention_foreign_currency)
        writer.write_str_value("contactId", self.contact_id)
        writer.write_float_value("contractAmount", self.contract_amount)
        writer.write_float_value("contractAmountForeignCurrency", self.contract_amount_foreign_currency)
        writer.write_datetime_value("createdAt", self.created_at)
        writer.write_str_value("creatorId", self.creator_id)
        writer.write_float_value("currentCompletedWorkRetentionPercent", self.current_completed_work_retention_percent)
        writer.write_float_value("currentMaterialsRetentionPercent", self.current_materials_retention_percent)
        writer.write_str_value("description", self.description)
        writer.write_str_value("dueDate", self.due_date)
        writer.write_str_value("endDate", self.end_date)
        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_str_value("forecastDistributionAt", self.forecast_distribution_at)
        writer.write_bool_value("hasItemRejected", self.has_item_rejected)
        writer.write_bool_value("hasItemReviewed", self.has_item_reviewed)
        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_str_value("internalId", self.internal_id)
        writer.write_str_value("internalSystem", self.internal_system)
        writer.write_datetime_value("lastSyncTime", self.last_sync_time)
        writer.write_uuid_value("mainContractId", self.main_contract_id)
        writer.write_float_value("materialsBilled", self.materials_billed)
        writer.write_float_value("materialsGrossRetentionPercent", self.materials_gross_retention_percent)
        writer.write_float_value("materialsOnStore", self.materials_on_store)
        writer.write_float_value("materialsOnStoreRetention", self.materials_on_store_retention)
        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("materialsRetentionForeignCurrency", self.materials_retention_foreign_currency)
        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("netMaterialsOnStore", self.net_materials_on_store)
        writer.write_float_value("netRetention", self.net_retention)
        writer.write_str_value("note", self.note)
        writer.write_str_value("number", self.number)
        writer.write_float_value("originalAmount", self.original_amount)
        writer.write_float_value("originalAmountForeignCurrency", self.original_amount_foreign_currency)
        writer.write_str_value("paidAt", self.paid_at)
        writer.write_str_value("paymentStage", self.payment_stage)
        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("previousApprovedBudgetTransfers", self.previous_approved_budget_transfers)
        writer.write_float_value("previousApprovedBudgetTransfersForeignCurrency", self.previous_approved_budget_transfers_foreign_currency)
        writer.write_float_value("previousApprovedChangeOrders", self.previous_approved_change_orders)
        writer.write_float_value("previousApprovedChangeOrdersForeignCurrency", self.previous_approved_change_orders_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("previousExchangeRate", self.previous_exchange_rate)
        writer.write_float_value("previousMaterialsBilled", self.previous_materials_billed)
        writer.write_float_value("previousMaterialsBilledForeignCurrency", self.previous_materials_billed_foreign_currency)
        writer.write_float_value("previousMaterialsOnStore", self.previous_materials_on_store)
        writer.write_uuid_value("previousPaymentId", self.previous_payment_id)
        writer.write_float_value("previousRecoupmentAmount", self.previous_recoupment_amount)
        writer.write_float_value("previousRecoupmentAmountForeignCurrency", self.previous_recoupment_amount_foreign_currency)
        writer.write_float_value("previousRetention", self.previous_retention)
        writer.write_float_value("previousRetentionForeignCurrency", self.previous_retention_foreign_currency)
        writer.write_collection_of_object_values("recipients", self.recipients)
        writer.write_float_value("recoupmentAmount", self.recoupment_amount)
        writer.write_float_value("recoupmentPercentOfCompletedWork", self.recoupment_percent_of_completed_work)
        writer.write_str_value("startDate", self.start_date)
        writer.write_enum_value("status", self.status)
        writer.write_str_value("submittedAt", self.submitted_at)
        writer.write_float_value("totalGrossRetentionPercent", self.total_gross_retention_percent)
        writer.write_float_value("totalRetained", self.total_retained)
        writer.write_float_value("totalRetainedPercent", self.total_retained_percent)
        writer.write_datetime_value("updatedAt", self.updated_at)
    

