"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

from __future__ import annotations
import dataclasses
import dateutil.parser
from ..shared import affectedblock as shared_affectedblock
from ..shared import customerminified as shared_customerminified
from dataclasses_json import Undefined, dataclass_json
from datetime import datetime
from enum import Enum
from orb import utils
from typing import Optional, Union



@dataclasses.dataclass
class VoidInitiatedLedgerEntryAmount:
    pass



@dataclasses.dataclass
class VoidInitiatedLedgerEntryEndingBalance:
    pass

class VoidInitiatedLedgerEntryEntryStatus(str, Enum):
    COMMITTED = 'committed'
    PENDING = 'pending'

class VoidInitiatedLedgerEntryEntryType(str, Enum):
    VOID_INITIATED = 'void_initiated'



@dataclasses.dataclass
class VoidInitiatedLedgerEntryStartingBalance:
    pass



@dataclasses.dataclass
class VoidInitiatedLedgerEntryVoidAmount:
    pass


@dataclass_json(undefined=Undefined.EXCLUDE)

@dataclasses.dataclass
class VoidInitiatedLedgerEntry:
    r"""The [Credit Ledger Entry resource](/guides/product-catalog/prepurchase) models prepaid credits within Orb."""
    amount: Union[float, str] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amount') }})
    created_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('created_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse }})
    credit_block: shared_affectedblock.AffectedBlock = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('credit_block') }})
    customer: shared_customerminified.CustomerMinified = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('customer') }})
    description: Optional[str] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description') }})
    ending_balance: Union[float, str] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ending_balance') }})
    entry_status: VoidInitiatedLedgerEntryEntryStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('entry_status') }})
    entry_type: VoidInitiatedLedgerEntryEntryType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('entry_type') }})
    id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }})
    ledger_sequence_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ledger_sequence_number') }})
    metadata: dict[str, str] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata') }})
    new_block_expiry_date: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('new_block_expiry_date'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse }})
    starting_balance: Union[float, str] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('starting_balance') }})
    void_amount: Union[float, str] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('void_amount') }})
    void_reason: Optional[str] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('void_reason') }})
    

