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
2 changes: 2 additions & 0 deletions fragment/sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
CreatePaymentCreatePaymentBadRequestError,
CreatePaymentCreatePaymentCreatePaymentResult,
CreatePaymentCreatePaymentCreatePaymentResultPayment,
CreatePaymentCreatePaymentCreatePaymentResultPaymentCurrency,
CreatePaymentCreatePaymentInternalError,
)
from .delete_custom_txs import (
Expand Down Expand Up @@ -498,6 +499,7 @@
"CreatePaymentCreatePaymentBadRequestError",
"CreatePaymentCreatePaymentCreatePaymentResult",
"CreatePaymentCreatePaymentCreatePaymentResultPayment",
"CreatePaymentCreatePaymentCreatePaymentResultPaymentCurrency",
"CreatePaymentCreatePaymentInternalError",
"CreatePaymentInput",
"CurrencyCode",
Expand Down
7 changes: 7 additions & 0 deletions fragment/sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1858,8 +1858,15 @@ async def create_payment(
__typename
... on CreatePaymentResult {
payment {
id
ik
clientSecret
status
amount
mode
currency {
code
}
}
}
... on BadRequestError {
Expand Down
14 changes: 12 additions & 2 deletions fragment/sdk/create_payment.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Generated by fragment (with the help of ariadne-codegen)
# Source: queries/

from typing import Literal, Union
from typing import Any, Literal, Union

from pydantic import Field

from .base_model import BaseModel
from .enums import PaymentStatus
from .enums import PaymentCurrencyCode, PaymentMode, PaymentStatus


class CreatePayment(BaseModel):
Expand All @@ -30,8 +30,17 @@ class CreatePaymentCreatePaymentCreatePaymentResult(BaseModel):


class CreatePaymentCreatePaymentCreatePaymentResultPayment(BaseModel):
id: str
ik: Any
client_secret: str = Field(alias="clientSecret")
status: PaymentStatus
amount: Any
mode: PaymentMode
currency: "CreatePaymentCreatePaymentCreatePaymentResultPaymentCurrency"


class CreatePaymentCreatePaymentCreatePaymentResultPaymentCurrency(BaseModel):
code: PaymentCurrencyCode


class CreatePaymentCreatePaymentInternalError(BaseModel):
Expand All @@ -43,3 +52,4 @@ class CreatePaymentCreatePaymentInternalError(BaseModel):

CreatePayment.model_rebuild()
CreatePaymentCreatePaymentCreatePaymentResult.model_rebuild()
CreatePaymentCreatePaymentCreatePaymentResultPayment.model_rebuild()
2 changes: 1 addition & 1 deletion fragment/sdk/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class PaymentMode(str, Enum):


class PaymentStatus(str, Enum):
approved = "approved"
accepted = "accepted"
needs_payment_method = "needs_payment_method"
processing = "processing"
settled = "settled"
Expand Down
10 changes: 8 additions & 2 deletions fragment/sdk/input_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,8 @@ class LedgerLinesFilterSet(BaseModel):
"Filter by the currency of the Ledger Line."
date: Optional["DateFilter"] = None
"Use this filter to filter Ledger Lines by their `posted` date."
external_tx_ids: Optional[list[str]] = Field(alias="externalTxIds", default=None)
"Filter Ledger Lines by the external IDs of their linked transactions. Only supported on `LedgerAccount.lines` for a linked Ledger Account."
is_reversal: Optional[bool] = Field(alias="isReversal", default=None)
"Use this to filter Ledger Lines that were posted to this Ledger Account, using `reverseLedgerEntry`."
is_reversed: Optional[bool] = Field(alias="isReversed", default=None)
Expand Down Expand Up @@ -648,7 +650,11 @@ class LedgersFilterSet(BaseModel):


class LinkMatchInput(BaseModel):
id: str
"""Specify a Link by ID, or a Custom Link by its creation IK."""

id: Optional[str] = None
ik: Optional[Any] = None
"The IK passed to createCustomLink. If id is also provided, both must identify the same Link."


class MigrateLedgerEntryInput(BaseModel):
Expand Down Expand Up @@ -965,7 +971,7 @@ class SchemaPaymentAccountingInput(BaseModel):
through its lifecycle, keyed by lifecycle transition."""

initiated: Optional["SchemaPaymentEntryInput"] = None
"Posted when the payment is approved. Optional."
"Posted when the payment is captured. Optional."
settled: "SchemaPaymentEntryInput"
"Posted when the payment settles. Every Payment Type must define it."

Expand Down
7 changes: 7 additions & 0 deletions fragment/std_queries/queries.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1291,8 +1291,15 @@ mutation createPayment(
__typename
... on CreatePaymentResult {
payment {
id
ik
clientSecret
status
amount
mode
currency {
code
}
}
}
... on BadRequestError {
Expand Down
2 changes: 2 additions & 0 deletions fragment/sync_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
CreatePaymentCreatePaymentBadRequestError,
CreatePaymentCreatePaymentCreatePaymentResult,
CreatePaymentCreatePaymentCreatePaymentResultPayment,
CreatePaymentCreatePaymentCreatePaymentResultPaymentCurrency,
CreatePaymentCreatePaymentInternalError,
)
from .delete_custom_txs import (
Expand Down Expand Up @@ -497,6 +498,7 @@
"CreatePaymentCreatePaymentBadRequestError",
"CreatePaymentCreatePaymentCreatePaymentResult",
"CreatePaymentCreatePaymentCreatePaymentResultPayment",
"CreatePaymentCreatePaymentCreatePaymentResultPaymentCurrency",
"CreatePaymentCreatePaymentInternalError",
"CreatePaymentInput",
"CurrencyCode",
Expand Down
7 changes: 7 additions & 0 deletions fragment/sync_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1852,8 +1852,15 @@ def create_payment(
__typename
... on CreatePaymentResult {
payment {
id
ik
clientSecret
status
amount
mode
currency {
code
}
}
}
... on BadRequestError {
Expand Down
14 changes: 12 additions & 2 deletions fragment/sync_sdk/create_payment.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Generated by fragment (with the help of ariadne-codegen)
# Source: queries/

from typing import Literal, Union
from typing import Any, Literal, Union

from pydantic import Field

from .base_model import BaseModel
from .enums import PaymentStatus
from .enums import PaymentCurrencyCode, PaymentMode, PaymentStatus


class CreatePayment(BaseModel):
Expand All @@ -30,8 +30,17 @@ class CreatePaymentCreatePaymentCreatePaymentResult(BaseModel):


class CreatePaymentCreatePaymentCreatePaymentResultPayment(BaseModel):
id: str
ik: Any
client_secret: str = Field(alias="clientSecret")
status: PaymentStatus
amount: Any
mode: PaymentMode
currency: "CreatePaymentCreatePaymentCreatePaymentResultPaymentCurrency"


class CreatePaymentCreatePaymentCreatePaymentResultPaymentCurrency(BaseModel):
code: PaymentCurrencyCode


class CreatePaymentCreatePaymentInternalError(BaseModel):
Expand All @@ -43,3 +52,4 @@ class CreatePaymentCreatePaymentInternalError(BaseModel):

CreatePayment.model_rebuild()
CreatePaymentCreatePaymentCreatePaymentResult.model_rebuild()
CreatePaymentCreatePaymentCreatePaymentResultPayment.model_rebuild()
2 changes: 1 addition & 1 deletion fragment/sync_sdk/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class PaymentMode(str, Enum):


class PaymentStatus(str, Enum):
approved = "approved"
accepted = "accepted"
needs_payment_method = "needs_payment_method"
processing = "processing"
settled = "settled"
Expand Down
10 changes: 8 additions & 2 deletions fragment/sync_sdk/input_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,8 @@ class LedgerLinesFilterSet(BaseModel):
"Filter by the currency of the Ledger Line."
date: Optional["DateFilter"] = None
"Use this filter to filter Ledger Lines by their `posted` date."
external_tx_ids: Optional[list[str]] = Field(alias="externalTxIds", default=None)
"Filter Ledger Lines by the external IDs of their linked transactions. Only supported on `LedgerAccount.lines` for a linked Ledger Account."
is_reversal: Optional[bool] = Field(alias="isReversal", default=None)
"Use this to filter Ledger Lines that were posted to this Ledger Account, using `reverseLedgerEntry`."
is_reversed: Optional[bool] = Field(alias="isReversed", default=None)
Expand Down Expand Up @@ -648,7 +650,11 @@ class LedgersFilterSet(BaseModel):


class LinkMatchInput(BaseModel):
id: str
"""Specify a Link by ID, or a Custom Link by its creation IK."""

id: Optional[str] = None
ik: Optional[Any] = None
"The IK passed to createCustomLink. If id is also provided, both must identify the same Link."


class MigrateLedgerEntryInput(BaseModel):
Expand Down Expand Up @@ -965,7 +971,7 @@ class SchemaPaymentAccountingInput(BaseModel):
through its lifecycle, keyed by lifecycle transition."""

initiated: Optional["SchemaPaymentEntryInput"] = None
"Posted when the payment is approved. Optional."
"Posted when the payment is captured. Optional."
settled: "SchemaPaymentEntryInput"
"Posted when the payment settles. Every Payment Type must define it."

Expand Down
2 changes: 2 additions & 0 deletions tests/snapshots/001-marketing-schema/sdk/__init__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions tests/snapshots/001-marketing-schema/sdk/client.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions tests/snapshots/001-marketing-schema/sdk/create_payment.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/snapshots/001-marketing-schema/sdk/enums.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions tests/snapshots/001-marketing-schema/sdk/input_types.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading