Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions fragment/sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
SchemaConsistencyMode,
SchemaLedgerAccountStatus,
SchemaLedgerEntryStatus,
SchemaPaymentEntryStatus,
SchemaPaymentTypeDirection,
SchemaSystemLineKind,
StripeEnv,
TxType,
UnitEnv,
Expand Down Expand Up @@ -222,6 +225,7 @@
LedgerLineInput,
LedgerLineMatchInput,
LedgerLinesFilterSet,
LedgerLineTagInput,
LedgerMatchInput,
LedgersFilterSet,
LedgerTypeFilter,
Expand All @@ -245,7 +249,13 @@
SchemaLedgerEntryTagInput,
SchemaLedgerLineInput,
SchemaMatchInput,
SchemaPaymentAccountingInput,
SchemaPaymentEntryInput,
SchemaPaymentInput,
SchemaPaymentLineInput,
SchemaPaymentsInput,
SchemaPaymentTypeDetailsInput,
SchemaPaymentTypeInput,
SchemaRepeatedConfigInput,
SchemaTxMatchInput,
StringFilter,
Expand All @@ -257,6 +267,7 @@
UpdateLedgerAccountInput,
UpdateLedgerEntryInput,
UpdateLedgerInput,
UpdateLedgerLineInput,
)
from .list_ledger_account_balances import (
ListLedgerAccountBalances,
Expand Down Expand Up @@ -577,6 +588,7 @@
"LedgerEntryTagInput",
"LedgerLineInput",
"LedgerLineMatchInput",
"LedgerLineTagInput",
"LedgerLinesConsistencyMode",
"LedgerLinesFilterSet",
"LedgerMatchInput",
Expand Down Expand Up @@ -693,8 +705,17 @@
"SchemaLedgerEntryTagInput",
"SchemaLedgerLineInput",
"SchemaMatchInput",
"SchemaPaymentAccountingInput",
"SchemaPaymentEntryInput",
"SchemaPaymentEntryStatus",
"SchemaPaymentInput",
"SchemaPaymentLineInput",
"SchemaPaymentTypeDetailsInput",
"SchemaPaymentTypeDirection",
"SchemaPaymentTypeInput",
"SchemaPaymentsInput",
"SchemaRepeatedConfigInput",
"SchemaSystemLineKind",
"SchemaTxMatchInput",
"StoreSchema",
"StoreSchemaStoreSchemaBadRequestError",
Expand Down Expand Up @@ -736,6 +757,7 @@
"UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLinesNodesAccount",
"UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryTags",
"UpdateLedgerInput",
"UpdateLedgerLineInput",
"UpdateLedgerUpdateLedgerBadRequestError",
"UpdateLedgerUpdateLedgerInternalError",
"UpdateLedgerUpdateLedgerUpdateLedgerResult",
Expand Down
14 changes: 14 additions & 0 deletions fragment/sdk/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,20 @@ class SchemaLedgerEntryStatus(str, Enum):
disabled = "disabled"


class SchemaPaymentEntryStatus(str, Enum):
active = "active"


class SchemaPaymentTypeDirection(str, Enum):
payin = "payin"
payout = "payout"


class SchemaSystemLineKind(str, Enum):
payment_fee_line = "payment_fee_line"
payment_settlement_line = "payment_settlement_line"


class StripeEnv(str, Enum):
livemode = "livemode"
testmode = "testmode"
Expand Down
101 changes: 101 additions & 0 deletions fragment/sdk/input_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
SchemaConsistencyMode,
SchemaLedgerAccountStatus,
SchemaLedgerEntryStatus,
SchemaPaymentEntryStatus,
SchemaPaymentTypeDirection,
SchemaSystemLineKind,
TxType,
)

Expand Down Expand Up @@ -576,6 +579,13 @@ class LedgerLineMatchInput(BaseModel):
"The FRAGMENT ID of the ledger line"


class LedgerLineTagInput(BaseModel):
key: Any
"The key of this tag. Can be up to 128 characters long."
value: Any
"The value associated with this tag's key. Can be up to 128 characters long."


class LedgerLinesFilterSet(BaseModel):
created: Optional["DateTimeFilter"] = None
"Filter by the created timestamp of the Ledger Line. This is the wall-clock time when the Ledger Line was created."
Expand Down Expand Up @@ -726,6 +736,8 @@ class SchemaInput(BaseModel):
"The Ledger Entries to add to the Schema."
name: Optional[Any] = None
"The human-readable name of the Schema."
payments: Optional["SchemaPaymentsInput"] = None
"EXPERIMENTAL: The Payment Types to add to the Schema."
scenes: Optional[list["SceneInput"]] = None
"Any scenes associated with this Schema."

Expand Down Expand Up @@ -879,12 +891,80 @@ class SchemaMatchInput(BaseModel):
"Optional parameter to specify version of requested Schema. If not provided, it defaults to 0, representing the latest available version for the provided Schema key."


class SchemaPaymentAccountingInput(BaseModel):
"""EXPERIMENTAL: The Ledger Entries a Payment Type posts as a payment moves
through its lifecycle, keyed by lifecycle transition."""

needs_confirmation_to_processing: Optional["SchemaPaymentEntryInput"] = None
"Posted when the payment enters processing. Optional."
processing_to_settled: "SchemaPaymentEntryInput"
"Posted when the payment settles. Every Payment Type must define it."


class SchemaPaymentEntryInput(BaseModel):
"""EXPERIMENTAL: The Ledger Entry a Payment Type posts on a payment lifecycle event."""

description: Optional[Any] = None
"Human-readable description of the payment entry."
lines: list["SchemaPaymentLineInput"]
"The Ledger Lines in the payment entry."


class SchemaPaymentInput(BaseModel):
"""EXPERIMENTAL: Marks a Ledger Account as a Payment Account."""

penguin: bool


class SchemaPaymentLineInput(BaseModel):
"""EXPERIMENTAL: A Ledger Line in a payment entry."""

account: "SchemaLedgerAccountMatchInput"
"The Ledger Account this line will be posted to.\nIt supports parameters in its attributes via handlebars syntax."
amount: Any
"The amount of the line. It supports parameters via the handlebars syntax and addition (+) and subtraction (-)."
currency: Optional["SchemaCurrencyMatchInput"] = None
"The currency of the line. This is required if the Ledger Account has currencyMode multi.\nIt supports parameters in its attributes via handlebars syntax."
description: Optional[Any] = None
"Human-readable description of the line."
key: Any
"The key for the line. Keys must be unique within a payment entry."
system: Optional[SchemaSystemLineKind] = None
"Marks this as a system-owned line. Fragment fills the amounts of system\nlines when the payment entry is posted."


class SchemaPaymentTypeDetailsInput(BaseModel):
"""EXPERIMENTAL: The payment a Payment Type creates."""

amount: Any
"The amount requested for the payment, as a parameterized expression filled\nfrom createPayment parameters."
direction: SchemaPaymentTypeDirection
"The direction the payment moves money."


class SchemaPaymentTypeInput(BaseModel):
"""EXPERIMENTAL: A Payment Type in a Schema. All Payment Types defined in a
Schema must have a unique `type` and `typeVersion` pair."""

accounting: "SchemaPaymentAccountingInput"
"The Ledger Entries posted as the payment moves through its lifecycle."
payment: "SchemaPaymentTypeDetailsInput"
"The payment this Payment Type creates."
status: SchemaPaymentEntryStatus
"The status of this Payment Type."
type_: Any = Field(alias="type")
"The type of this Payment Type. This is a stable, unique identifier for it.\nUniqueness is enforced at the Schema level."
type_version: int = Field(alias="typeVersion")
"The version of the Payment Type."


class SchemaPaymentsInput(BaseModel):
"""EXPERIMENTAL: The Payment Types in your Schema."""

types: list["SchemaPaymentTypeInput"]
"A list of Payment Type definitions."


class SchemaRepeatedConfigInput(BaseModel):
"""Configuration for repeated expansion of a line or condition. The key names a client-supplied
array parameter whose elements each generate one copy of the line or condition at runtime.
Expand Down Expand Up @@ -995,6 +1075,10 @@ class UpdateLedgerAccountInput(BaseModel):
class UpdateLedgerEntryInput(BaseModel):
groups: Optional[list["LedgerEntryGroupInput"]] = None
"The list of Groups to add to this Ledger Entry."
ledger_lines: Optional[list["UpdateLedgerLineInput"]] = Field(
alias="ledgerLines", default=None
)
"The list of Ledger Line updates to apply to Ledger Lines on this Ledger Entry."
tags: Optional[list["LedgerEntryTagInput"]] = None
"The list of Tags to add and/or update on this Ledger Entry."
tags_to_remove: Optional[list["LedgerEntryTagInput"]] = Field(
Expand All @@ -1008,6 +1092,17 @@ class UpdateLedgerInput(BaseModel):
"The new Ledger name. "


class UpdateLedgerLineInput(BaseModel):
ledger_line: "LedgerLineMatchInput" = Field(alias="ledgerLine")
"The Ledger Line that is being updated. It must belong to the Ledger Entry being updated."
tags: Optional[list["LedgerLineTagInput"]] = None
"The list of Tags to add and/or update on this Ledger Line."
tags_to_remove: Optional[list["LedgerLineTagInput"]] = Field(
alias="tagsToRemove", default=None
)
"The list of Tags to remove from this Ledger Line."


AddLedgerEntryInput.model_rebuild()
ChartOfAccountsInput.model_rebuild()
CreateLedgerAccountInput.model_rebuild()
Expand Down Expand Up @@ -1049,6 +1144,12 @@ class UpdateLedgerInput(BaseModel):
SchemaLedgerEntryConditionInput.model_rebuild()
SchemaLedgerEntryInput.model_rebuild()
SchemaLedgerLineInput.model_rebuild()
SchemaPaymentAccountingInput.model_rebuild()
SchemaPaymentEntryInput.model_rebuild()
SchemaPaymentLineInput.model_rebuild()
SchemaPaymentTypeInput.model_rebuild()
SchemaPaymentsInput.model_rebuild()
TagFilter.model_rebuild()
UpdateLedgerAccountInput.model_rebuild()
UpdateLedgerEntryInput.model_rebuild()
UpdateLedgerLineInput.model_rebuild()
22 changes: 22 additions & 0 deletions fragment/sync_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
SchemaConsistencyMode,
SchemaLedgerAccountStatus,
SchemaLedgerEntryStatus,
SchemaPaymentEntryStatus,
SchemaPaymentTypeDirection,
SchemaSystemLineKind,
StripeEnv,
TxType,
UnitEnv,
Expand Down Expand Up @@ -221,6 +224,7 @@
LedgerLineInput,
LedgerLineMatchInput,
LedgerLinesFilterSet,
LedgerLineTagInput,
LedgerMatchInput,
LedgersFilterSet,
LedgerTypeFilter,
Expand All @@ -244,7 +248,13 @@
SchemaLedgerEntryTagInput,
SchemaLedgerLineInput,
SchemaMatchInput,
SchemaPaymentAccountingInput,
SchemaPaymentEntryInput,
SchemaPaymentInput,
SchemaPaymentLineInput,
SchemaPaymentsInput,
SchemaPaymentTypeDetailsInput,
SchemaPaymentTypeInput,
SchemaRepeatedConfigInput,
SchemaTxMatchInput,
StringFilter,
Expand All @@ -256,6 +266,7 @@
UpdateLedgerAccountInput,
UpdateLedgerEntryInput,
UpdateLedgerInput,
UpdateLedgerLineInput,
)
from .list_ledger_account_balances import (
ListLedgerAccountBalances,
Expand Down Expand Up @@ -576,6 +587,7 @@
"LedgerEntryTagInput",
"LedgerLineInput",
"LedgerLineMatchInput",
"LedgerLineTagInput",
"LedgerLinesConsistencyMode",
"LedgerLinesFilterSet",
"LedgerMatchInput",
Expand Down Expand Up @@ -692,8 +704,17 @@
"SchemaLedgerEntryTagInput",
"SchemaLedgerLineInput",
"SchemaMatchInput",
"SchemaPaymentAccountingInput",
"SchemaPaymentEntryInput",
"SchemaPaymentEntryStatus",
"SchemaPaymentInput",
"SchemaPaymentLineInput",
"SchemaPaymentTypeDetailsInput",
"SchemaPaymentTypeDirection",
"SchemaPaymentTypeInput",
"SchemaPaymentsInput",
"SchemaRepeatedConfigInput",
"SchemaSystemLineKind",
"SchemaTxMatchInput",
"StoreSchema",
"StoreSchemaStoreSchemaBadRequestError",
Expand Down Expand Up @@ -736,6 +757,7 @@
"UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryLinesNodesAccount",
"UpdateLedgerEntryUpdateLedgerEntryUpdateLedgerEntryResultEntryTags",
"UpdateLedgerInput",
"UpdateLedgerLineInput",
"UpdateLedgerUpdateLedgerBadRequestError",
"UpdateLedgerUpdateLedgerInternalError",
"UpdateLedgerUpdateLedgerUpdateLedgerResult",
Expand Down
14 changes: 14 additions & 0 deletions fragment/sync_sdk/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,20 @@ class SchemaLedgerEntryStatus(str, Enum):
disabled = "disabled"


class SchemaPaymentEntryStatus(str, Enum):
active = "active"


class SchemaPaymentTypeDirection(str, Enum):
payin = "payin"
payout = "payout"


class SchemaSystemLineKind(str, Enum):
payment_fee_line = "payment_fee_line"
payment_settlement_line = "payment_settlement_line"


class StripeEnv(str, Enum):
livemode = "livemode"
testmode = "testmode"
Expand Down
Loading
Loading