# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Dict, Union, Optional
from datetime import datetime
from typing_extensions import Literal

from pydantic import Field as FieldInfo

from ..._models import BaseModel

__all__ = ["ScheduleResponse"]


class ScheduleResponse(BaseModel):
    id: str
    """The UUID of the entity."""

    amount: Optional[float] = None
    """The amount of each Balance Transaction created by this Schedule."""

    balance_id: Optional[str] = FieldInfo(alias="balanceId", default=None)
    """
    The unique identifier (UUID) for the Balance this Balance Transaction Schedule
    was created for.
    """

    code: Optional[str] = None
    """Unique short code of the Balance Transaction Schedule."""

    created_by: Optional[str] = FieldInfo(alias="createdBy", default=None)
    """
    The unique identifier (UUID) of the user who created this Balance Transaction
    Schedule.
    """

    currency_paid: Optional[str] = FieldInfo(alias="currencyPaid", default=None)
    """The currency code of the payment if it differs from the Balance currency.

    For example: USD, GBP or EUR.
    """

    custom_fields: Optional[Dict[str, Union[str, float]]] = FieldInfo(alias="customFields", default=None)
    """User defined fields enabling you to attach custom data.

    The value for a custom field can be either a string or a number.

    If `customFields` can also be defined for this entity at the Organizational
    level,`customField` values defined at individual level override values of
    `customFields` with the same name defined at Organization level.

    See
    [Working with Custom Fields](https://www.m3ter.com/docs/guides/creating-and-managing-products/working-with-custom-fields)
    in the m3ter documentation for more information.
    """

    dt_created: Optional[datetime] = FieldInfo(alias="dtCreated", default=None)
    """
    The date and time (_in ISO-8601 format_) when the Balance Transaction Schedule
    was created.
    """

    dt_last_modified: Optional[datetime] = FieldInfo(alias="dtLastModified", default=None)
    """
    The date and time (_in ISO-8601 format_) when the Balance Transaction Schedule
    was last modified.
    """

    end_date: Optional[datetime] = FieldInfo(alias="endDate", default=None)
    """The end date (_in ISO-8601 format_) of the Balance Transaction Schedule."""

    frequency: Optional[Literal["DAILY", "WEEKLY", "MONTHLY", "ANNUALLY"]] = None
    """Represents standard scheduling frequencies options for a job."""

    frequency_interval: Optional[int] = FieldInfo(alias="frequencyInterval", default=None)
    """
    Used in conjunction with `frequency` to define how often Balance Transactions
    are generated. For example, if `frequency` is MONTHLY and `frequencyInterval` is
    3, Balance Transactions are generated every three months.
    """

    last_modified_by: Optional[str] = FieldInfo(alias="lastModifiedBy", default=None)
    """
    The unique identifier (UUID) of the user who last modified this Balance
    Transaction Schedule.
    """

    name: Optional[str] = None
    """The name of the Balance Transaction Schedule."""

    next_run: Optional[datetime] = FieldInfo(alias="nextRun", default=None)
    """
    The date and time (_in ISO-8601 format_) when the next Transaction will be
    generated by the Balance Transaction Schedule.
    """

    paid: Optional[float] = None
    """The payment amount if the payment currency differs from the Balance currency."""

    previous_run: Optional[datetime] = FieldInfo(alias="previousRun", default=None)
    """
    The date and time (_in ISO-8601 format_) when the previous Transaction was
    generated by the Balance Transaction Schedule.
    """

    start_date: Optional[datetime] = FieldInfo(alias="startDate", default=None)
    """The start date (_in ISO-8601 format_) of the Balance Transaction Schedule."""

    transaction_description: Optional[str] = FieldInfo(alias="transactionDescription", default=None)
    """The description of each Balance Transaction created by this Schedule."""

    transaction_type_id: Optional[str] = FieldInfo(alias="transactionTypeId", default=None)
    """
    The unique identifier (UUID) of the transaction type used for Transactions
    created by this Schedule.
    """

    version: Optional[int] = None
    """The version number:

    - **Create:** On initial Create to insert a new entity, the version is set at 1
      in the response.
    - **Update:** On successful Update, the version is incremented by 1 in the
      response.
    """
