/*
 * The version of the OpenAPI document: v3
 * Contact: developer-experience@adyen.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit this class manually.
 */

import { Amount } from './amount';
import { CounterpartyV3 } from './counterpartyV3';

export class Transaction {
    /**
    * Unique identifier of the account holder.
    */
    'accountHolderId': string;
    'amount': Amount;
    /**
    * Unique identifier of the balance account.
    */
    'balanceAccountId': string;
    /**
    * Unique identifier of the balance platform.
    */
    'balancePlatform': string;
    /**
    * The date the transaction was booked to the balance account.
    */
    'bookingDate': Date;
    /**
    * The category of the transaction indicating the type of activity.   Possible values:  * **platformPayment**: The transaction is a payment or payment modification made with an Adyen merchant account.  * **internal**: The transaction resulted from an internal adjustment such as a deposit correction or invoice deduction.  * **bank**: The transaction is a bank-related activity, such as sending a payout or receiving funds.  * **issuedCard**: The transaction is a card-related activity, such as using an Adyen-issued card to pay online.  
    */
    'category'?: Transaction.CategoryEnum;
    'counterparty': CounterpartyV3;
    /**
    * The date the transaction was created.
    */
    'createdAt': Date;
    /**
    * The `description` from the `/transfers` request.
    */
    'description'?: string;
    /**
    * Unique identifier of the transaction.
    */
    'id': string;
    'instructedAmount'?: Amount;
    /**
    * Unique identifier of the payment instrument that was used for the transaction.
    */
    'paymentInstrumentId'?: string;
    /**
    * The [`reference`](https://docs.adyen.com/api-explorer/#/transfers/latest/post/transfers__reqParam_reference) from the `/transfers` request. If you haven\'t provided any, Adyen generates a unique reference.
    */
    'reference': string;
    /**
    * The reference sent to or received from the counterparty.  * For outgoing funds, this is the [`referenceForBeneficiary`](https://docs.adyen.com/api-explorer/#/transfers/latest/post/transfers__resParam_referenceForBeneficiary) from the  [`/transfers`](https://docs.adyen.com/api-explorer/#/transfers/latest/post/transfers__reqParam_referenceForBeneficiary) request.   * For incoming funds, this is the reference from the sender.
    */
    'referenceForBeneficiary'?: string;
    /**
    * The status of the transaction.   Possible values:  * **pending**: The transaction is still pending.  * **booked**: The transaction has been booked to the balance account.  
    */
    'status': Transaction.StatusEnum;
    /**
    * Unique identifier of the related transfer.
    */
    'transferId'?: string;
    /**
    * The type of the transaction.   Possible values: **payment**, **capture**, **captureReversal**, **refund** **refundReversal**, **chargeback**, **chargebackReversal**, **secondChargeback**, **atmWithdrawal**, **atmWithdrawalReversal**, **internalTransfer**, **manualCorrection**, **invoiceDeduction**, **depositCorrection**, **bankTransfer**, **miscCost**, **paymentCost**, **fee**
    */
    'type'?: Transaction.TypeEnum;
    /**
    * The date the transfer amount becomes available in the balance account.
    */
    'valueDate': Date;

    static discriminator: string | undefined = undefined;

    static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
        {
            "name": "accountHolderId",
            "baseName": "accountHolderId",
            "type": "string"
        },
        {
            "name": "amount",
            "baseName": "amount",
            "type": "Amount"
        },
        {
            "name": "balanceAccountId",
            "baseName": "balanceAccountId",
            "type": "string"
        },
        {
            "name": "balancePlatform",
            "baseName": "balancePlatform",
            "type": "string"
        },
        {
            "name": "bookingDate",
            "baseName": "bookingDate",
            "type": "Date"
        },
        {
            "name": "category",
            "baseName": "category",
            "type": "Transaction.CategoryEnum"
        },
        {
            "name": "counterparty",
            "baseName": "counterparty",
            "type": "CounterpartyV3"
        },
        {
            "name": "createdAt",
            "baseName": "createdAt",
            "type": "Date"
        },
        {
            "name": "description",
            "baseName": "description",
            "type": "string"
        },
        {
            "name": "id",
            "baseName": "id",
            "type": "string"
        },
        {
            "name": "instructedAmount",
            "baseName": "instructedAmount",
            "type": "Amount"
        },
        {
            "name": "paymentInstrumentId",
            "baseName": "paymentInstrumentId",
            "type": "string"
        },
        {
            "name": "reference",
            "baseName": "reference",
            "type": "string"
        },
        {
            "name": "referenceForBeneficiary",
            "baseName": "referenceForBeneficiary",
            "type": "string"
        },
        {
            "name": "status",
            "baseName": "status",
            "type": "Transaction.StatusEnum"
        },
        {
            "name": "transferId",
            "baseName": "transferId",
            "type": "string"
        },
        {
            "name": "type",
            "baseName": "type",
            "type": "Transaction.TypeEnum"
        },
        {
            "name": "valueDate",
            "baseName": "valueDate",
            "type": "Date"
        }    ];

    static getAttributeTypeMap() {
        return Transaction.attributeTypeMap;
    }
}

export namespace Transaction {
    export enum CategoryEnum {
        Bank = <any> 'bank',
        Grants = <any> 'grants',
        Internal = <any> 'internal',
        IssuedCard = <any> 'issuedCard',
        PlatformPayment = <any> 'platformPayment'
    }
    export enum StatusEnum {
        Booked = <any> 'booked',
        Pending = <any> 'pending'
    }
    export enum TypeEnum {
        AtmWithdrawal = <any> 'atmWithdrawal',
        AtmWithdrawalReversal = <any> 'atmWithdrawalReversal',
        BalanceAdjustment = <any> 'balanceAdjustment',
        BankTransfer = <any> 'bankTransfer',
        Capture = <any> 'capture',
        CaptureReversal = <any> 'captureReversal',
        Chargeback = <any> 'chargeback',
        ChargebackReversal = <any> 'chargebackReversal',
        DepositCorrection = <any> 'depositCorrection',
        Fee = <any> 'fee',
        Grant = <any> 'grant',
        Installment = <any> 'installment',
        InstallmentReversal = <any> 'installmentReversal',
        InternalTransfer = <any> 'internalTransfer',
        InvoiceDeduction = <any> 'invoiceDeduction',
        Leftover = <any> 'leftover',
        ManualCorrection = <any> 'manualCorrection',
        MiscCost = <any> 'miscCost',
        Payment = <any> 'payment',
        PaymentCost = <any> 'paymentCost',
        Refund = <any> 'refund',
        RefundReversal = <any> 'refundReversal',
        Repayment = <any> 'repayment',
        ReserveAdjustment = <any> 'reserveAdjustment',
        SecondChargeback = <any> 'secondChargeback'
    }
}
