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

from __future__ import annotations
import dataclasses
from dataclasses_json import Undefined, dataclass_json
from enum import Enum
from orb import utils
from typing import Optional, Union



@dataclasses.dataclass
class AddVoidCreditLedgerEntryRequestParamsAmount:
    pass

class AddVoidCreditLedgerEntryRequestParamsEntryType(str, Enum):
    VOID = 'void'



@dataclasses.dataclass
class AddVoidCreditLedgerEntryRequestParamsMetadata:
    r"""User-specified key/value pairs for the ledger entry resource."""
    


class AddVoidCreditLedgerEntryRequestParamsVoidReason(str, Enum):
    r"""Can only be specified when `entry_type=void`. The reason for the void."""
    REFUND = 'refund'


@dataclass_json(undefined=Undefined.EXCLUDE)

@dataclasses.dataclass
class AddVoidCreditLedgerEntryRequestParams:
    amount: Union[float, str] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amount') }})
    r"""The number of credits to effect. Note that this is required for increment, decrement, void, or undo operations."""
    block_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('block_id') }})
    r"""The ID of the block to void."""
    entry_type: AddVoidCreditLedgerEntryRequestParamsEntryType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('entry_type') }})
    description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description') }})
    r"""Optional metadata that can be specified when adding ledger results via the API. For example, this can be used to note an increment refers to trial credits, or for noting corrections as a result of an incident, etc."""
    metadata: Optional[AddVoidCreditLedgerEntryRequestParamsMetadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }})
    r"""User-specified key/value pairs for the ledger entry resource."""
    void_reason: Optional[AddVoidCreditLedgerEntryRequestParamsVoidReason] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('void_reason') }})
    r"""Can only be specified when `entry_type=void`. The reason for the void."""
    

