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

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



@dataclasses.dataclass
class AddExpirationChangeCreditLedgerEntryRequestParamsAmount:
    pass

class AddExpirationChangeCreditLedgerEntryRequestParamsEntryType(str, Enum):
    EXPIRATION_CHANGE = 'expiration_change'



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



@dataclass_json(undefined=Undefined.EXCLUDE)

@dataclasses.dataclass
class AddExpirationChangeCreditLedgerEntryRequestParams:
    entry_type: AddExpirationChangeCreditLedgerEntryRequestParamsEntryType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('entry_type') }})
    expiry_date: Optional[date] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('expiry_date'), 'encoder': utils.dateisoformat(False), 'decoder': utils.datefromisoformat }})
    r"""A future date (specified in YYYY-MM-DD format) that identifies the origination credit block to expire"""
    target_expiry_date: date = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('target_expiry_date'), 'encoder': utils.dateisoformat(False), 'decoder': utils.datefromisoformat }})
    r"""A future date (specified in YYYY-MM-DD format) used for expiration change, denoting when credits transferred (as part of a partial block expiration) should expire."""
    amount: Optional[Union[float, str]] = dataclasses.field(default=None, 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: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('block_id') }})
    r"""The ID of the block affected by an expiration_change, used to differentiate between multiple blocks with the same `expiry_date`."""
    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[AddExpirationChangeCreditLedgerEntryRequestParamsMetadata] = 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."""
    

