vortex-sdk 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. vortex/__init__.py +265 -0
  2. vortex/api/__init__.py +24 -0
  3. vortex/api/billing_api.py +34608 -0
  4. vortex/api/catalog_api.py +708 -0
  5. vortex/api/checkout_api.py +372 -0
  6. vortex/api/credit_notes_api.py +1688 -0
  7. vortex/api/customer_balance_api.py +1747 -0
  8. vortex/api/customers_api.py +387 -0
  9. vortex/api/discounts_api.py +2623 -0
  10. vortex/api/entitlements_api.py +1646 -0
  11. vortex/api/hosted_api.py +2855 -0
  12. vortex/api/invoices_api.py +2402 -0
  13. vortex/api/payables_api.py +1380 -0
  14. vortex/api/payment_methods_api.py +2069 -0
  15. vortex/api/payment_requests_api.py +1877 -0
  16. vortex/api/payments_api.py +694 -0
  17. vortex/api/payments_readiness_api.py +2311 -0
  18. vortex/api/public_api.py +6931 -0
  19. vortex/api/quotes_api.py +6817 -0
  20. vortex/api/receipts_api.py +1111 -0
  21. vortex/api/subscriptions_api.py +1059 -0
  22. vortex/api/tax_api.py +1397 -0
  23. vortex/api/webhooks_api.py +4931 -0
  24. vortex/api_client.py +804 -0
  25. vortex/api_response.py +21 -0
  26. vortex/configuration.py +658 -0
  27. vortex/exceptions.py +218 -0
  28. vortex/models/__init__.py +104 -0
  29. vortex/models/api_error.py +103 -0
  30. vortex/models/api_error_error.py +114 -0
  31. vortex/models/api_write_envelope.py +101 -0
  32. vortex/models/apply_coupon_request.py +97 -0
  33. vortex/models/billing_order_form_sign_request.py +103 -0
  34. vortex/models/billing_order_form_signature_request_request.py +86 -0
  35. vortex/models/billing_order_form_void_request.py +86 -0
  36. vortex/models/billing_order_forms_expire_due_request.py +90 -0
  37. vortex/models/billing_order_update_request.py +99 -0
  38. vortex/models/billing_orders_execute_due_request.py +90 -0
  39. vortex/models/billing_quote_create_request.py +119 -0
  40. vortex/models/billing_quote_line_input.py +93 -0
  41. vortex/models/billing_quote_version_approve_request.py +87 -0
  42. vortex/models/billing_quote_version_create_request.py +103 -0
  43. vortex/models/billing_quote_version_update_request.py +102 -0
  44. vortex/models/billing_quote_version_void_request.py +96 -0
  45. vortex/models/checkout_session_line_item_request.py +91 -0
  46. vortex/models/coupon_targets.py +89 -0
  47. vortex/models/create_checkout_session_request.py +140 -0
  48. vortex/models/create_coupon_request.py +132 -0
  49. vortex/models/create_deposit_balance_payable_request.py +172 -0
  50. vortex/models/create_installment_payable_request.py +170 -0
  51. vortex/models/create_payable_request.py +158 -0
  52. vortex/models/create_recurring_payable_request.py +181 -0
  53. vortex/models/create_recurring_payable_request_cadence.py +96 -0
  54. vortex/models/credit_note_create_line.py +105 -0
  55. vortex/models/credit_note_create_request.py +112 -0
  56. vortex/models/credit_note_reason.py +39 -0
  57. vortex/models/credit_note_refund_reconcile_request.py +86 -0
  58. vortex/models/credit_note_refund_request.py +94 -0
  59. vortex/models/customer_balance_targets.py +102 -0
  60. vortex/models/customer_default_payment_method_request.py +88 -0
  61. vortex/models/customer_payment_method_archive_request.py +88 -0
  62. vortex/models/customer_payment_method_attach_request.py +94 -0
  63. vortex/models/customer_payment_method_setup_request.py +100 -0
  64. vortex/models/customer_upsert_request.py +96 -0
  65. vortex/models/expire_customer_balance_request.py +98 -0
  66. vortex/models/grant_customer_balance_from_payment_request.py +103 -0
  67. vortex/models/grant_customer_balance_request.py +106 -0
  68. vortex/models/grant_entitlement_request.py +106 -0
  69. vortex/models/invoice_collect_request.py +86 -0
  70. vortex/models/invoice_create_request.py +92 -0
  71. vortex/models/invoice_finalize_request.py +86 -0
  72. vortex/models/invoice_mark_uncollectible_request.py +90 -0
  73. vortex/models/invoice_tax.py +142 -0
  74. vortex/models/invoice_void_request.py +88 -0
  75. vortex/models/merchant_account_create_request.py +183 -0
  76. vortex/models/merchant_address.py +96 -0
  77. vortex/models/merchant_associated_identity.py +114 -0
  78. vortex/models/merchant_onboarding_link_request.py +95 -0
  79. vortex/models/merchant_profile_date.py +90 -0
  80. vortex/models/merchant_settlement_bank_account.py +94 -0
  81. vortex/models/merchant_tax_profile_request.py +125 -0
  82. vortex/models/merchant_tax_profile_request_registrations_inner.py +88 -0
  83. vortex/models/merchant_underwriting_data.py +127 -0
  84. vortex/models/merchant_underwriting_data_card_volume_distribution.py +90 -0
  85. vortex/models/merchant_underwriting_data_volume_distribution_by_business_type.py +90 -0
  86. vortex/models/open_api_invoice_tax_response.py +92 -0
  87. vortex/models/open_api_invoice_tax_response_all_of_data.py +92 -0
  88. vortex/models/payment_request_collect_request.py +86 -0
  89. vortex/models/payment_request_create_request.py +100 -0
  90. vortex/models/payment_request_link_create_request.py +89 -0
  91. vortex/models/price_create_request.py +122 -0
  92. vortex/models/product_create_request.py +92 -0
  93. vortex/models/reverse_customer_balance_request.py +98 -0
  94. vortex/models/revoke_entitlement_request.py +106 -0
  95. vortex/models/subscription_change_request.py +111 -0
  96. vortex/models/subscription_create_request.py +122 -0
  97. vortex/models/subscription_item_change_preview_request.py +100 -0
  98. vortex/models/subscription_item_change_request_item.py +91 -0
  99. vortex/models/tax_address.py +96 -0
  100. vortex/models/tax_behavior.py +36 -0
  101. vortex/models/tax_behavior_policy.py +100 -0
  102. vortex/models/tax_behavior_policy_request.py +89 -0
  103. vortex/models/tax_failure.py +104 -0
  104. vortex/models/tax_finalize_request.py +98 -0
  105. vortex/models/tax_jurisdiction_evidence.py +94 -0
  106. vortex/models/tax_line_evidence.py +103 -0
  107. vortex/models/tax_quote_request.py +98 -0
  108. vortex/models/terminate_applied_coupon_request.py +87 -0
  109. vortex/models/terminate_coupon_request.py +87 -0
  110. vortex/models/webhook_deliveries_dispatch_request.py +91 -0
  111. vortex/models/webhook_deliveries_redrive_request.py +107 -0
  112. vortex/models/webhook_delivery_replay_request.py +88 -0
  113. vortex/models/webhook_endpoint_create_request.py +91 -0
  114. vortex/models/webhook_endpoint_secret_rotate_request.py +87 -0
  115. vortex/models/webhook_endpoint_test_request.py +88 -0
  116. vortex/models/webhook_endpoint_update_request.py +103 -0
  117. vortex/models/webhook_event_resend_request.py +86 -0
  118. vortex/rest.py +263 -0
  119. vortex_sdk-0.2.0.dist-info/METADATA +34 -0
  120. vortex_sdk-0.2.0.dist-info/RECORD +123 -0
  121. vortex_sdk-0.2.0.dist-info/WHEEL +5 -0
  122. vortex_sdk-0.2.0.dist-info/licenses/LICENSE +21 -0
  123. vortex_sdk-0.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,89 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Vortex Payments API
5
+
6
+ Public Vortex Payments API for customers, subscriptions, invoices, payment requests, checkout, receipts, webhooks, tax.
7
+
8
+ The version of the OpenAPI document: 2026-08
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing_extensions import Annotated
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
26
+
27
+ class CouponTargets(BaseModel):
28
+ """
29
+ CouponTargets
30
+ """ # noqa: E501
31
+ price_ids: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, alias="priceIds")
32
+ meter_ids: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, alias="meterIds")
33
+ __properties: ClassVar[List[str]] = ["priceIds", "meterIds"]
34
+
35
+ model_config = ConfigDict(
36
+ validate_by_name=True,
37
+ validate_by_alias=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ return json.dumps(to_jsonable_python(self.to_dict()))
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of CouponTargets from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of CouponTargets from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({
86
+ "priceIds": obj.get("priceIds"),
87
+ "meterIds": obj.get("meterIds")
88
+ })
89
+ return _obj
@@ -0,0 +1,140 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Vortex Payments API
5
+
6
+ Public Vortex Payments API for customers, subscriptions, invoices, payment requests, checkout, receipts, webhooks, tax.
7
+
8
+ The version of the OpenAPI document: 2026-08
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing_extensions import Annotated
24
+ from vortex.models.checkout_session_line_item_request import CheckoutSessionLineItemRequest
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+ from pydantic_core import to_jsonable_python
28
+
29
+ class CreateCheckoutSessionRequest(BaseModel):
30
+ """
31
+ CreateCheckoutSessionRequest
32
+ """ # noqa: E501
33
+ mode: Optional[StrictStr] = None
34
+ invoice_number: Optional[StrictStr] = Field(default=None, alias="invoiceNumber")
35
+ invoice_numbers: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, alias="invoiceNumbers")
36
+ customer_external_id: Optional[StrictStr] = Field(default=None, alias="customerExternalId")
37
+ billing_account_id: Optional[StrictStr] = Field(default=None, alias="billingAccountId")
38
+ subscription_external_id: Optional[StrictStr] = Field(default=None, alias="subscriptionExternalId")
39
+ collection_mode: Optional[StrictStr] = Field(default=None, alias="collectionMode")
40
+ start_at: Optional[datetime] = Field(default=None, alias="startAt")
41
+ line_items: Optional[Annotated[List[CheckoutSessionLineItemRequest], Field(min_length=1)]] = Field(default=None, alias="lineItems")
42
+ payment_request_id: Optional[StrictStr] = Field(default=None, alias="paymentRequestId")
43
+ expires_at: Optional[datetime] = Field(default=None, alias="expiresAt")
44
+ created_by_ref: Optional[StrictStr] = Field(default=None, alias="createdByRef")
45
+ metadata: Optional[Dict[str, StrictStr]] = None
46
+ __properties: ClassVar[List[str]] = ["mode", "invoiceNumber", "invoiceNumbers", "customerExternalId", "billingAccountId", "subscriptionExternalId", "collectionMode", "startAt", "lineItems", "paymentRequestId", "expiresAt", "createdByRef", "metadata"]
47
+
48
+ @field_validator('mode')
49
+ def mode_validate_enum(cls, value):
50
+ """Validates the enum"""
51
+ if value is None:
52
+ return value
53
+
54
+ if value not in set(['payment', 'subscription']):
55
+ raise ValueError("must be one of enum values ('payment', 'subscription')")
56
+ return value
57
+
58
+ @field_validator('collection_mode')
59
+ def collection_mode_validate_enum(cls, value):
60
+ """Validates the enum"""
61
+ if value is None:
62
+ return value
63
+
64
+ if value not in set(['manual', 'automatic']):
65
+ raise ValueError("must be one of enum values ('manual', 'automatic')")
66
+ return value
67
+
68
+ model_config = ConfigDict(
69
+ validate_by_name=True,
70
+ validate_by_alias=True,
71
+ validate_assignment=True,
72
+ protected_namespaces=(),
73
+ )
74
+
75
+
76
+ def to_str(self) -> str:
77
+ """Returns the string representation of the model using alias"""
78
+ return pprint.pformat(self.model_dump(by_alias=True))
79
+
80
+ def to_json(self) -> str:
81
+ """Returns the JSON representation of the model using alias"""
82
+ return json.dumps(to_jsonable_python(self.to_dict()))
83
+
84
+ @classmethod
85
+ def from_json(cls, json_str: str) -> Optional[Self]:
86
+ """Create an instance of CreateCheckoutSessionRequest from a JSON string"""
87
+ return cls.from_dict(json.loads(json_str))
88
+
89
+ def to_dict(self) -> Dict[str, Any]:
90
+ """Return the dictionary representation of the model using alias.
91
+
92
+ This has the following differences from calling pydantic's
93
+ `self.model_dump(by_alias=True)`:
94
+
95
+ * `None` is only added to the output dict for nullable fields that
96
+ were set at model initialization. Other fields with value `None`
97
+ are ignored.
98
+ """
99
+ excluded_fields: Set[str] = set([
100
+ ])
101
+
102
+ _dict = self.model_dump(
103
+ by_alias=True,
104
+ exclude=excluded_fields,
105
+ exclude_none=True,
106
+ )
107
+ # override the default output from pydantic by calling `to_dict()` of each item in line_items (list)
108
+ _items = []
109
+ if self.line_items:
110
+ for _item_line_items in self.line_items:
111
+ if _item_line_items:
112
+ _items.append(_item_line_items.to_dict())
113
+ _dict['lineItems'] = _items
114
+ return _dict
115
+
116
+ @classmethod
117
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
118
+ """Create an instance of CreateCheckoutSessionRequest from a dict"""
119
+ if obj is None:
120
+ return None
121
+
122
+ if not isinstance(obj, dict):
123
+ return cls.model_validate(obj)
124
+
125
+ _obj = cls.model_validate({
126
+ "mode": obj.get("mode"),
127
+ "invoiceNumber": obj.get("invoiceNumber"),
128
+ "invoiceNumbers": obj.get("invoiceNumbers"),
129
+ "customerExternalId": obj.get("customerExternalId"),
130
+ "billingAccountId": obj.get("billingAccountId"),
131
+ "subscriptionExternalId": obj.get("subscriptionExternalId"),
132
+ "collectionMode": obj.get("collectionMode"),
133
+ "startAt": obj.get("startAt"),
134
+ "lineItems": [CheckoutSessionLineItemRequest.from_dict(_item) for _item in obj["lineItems"]] if obj.get("lineItems") is not None else None,
135
+ "paymentRequestId": obj.get("paymentRequestId"),
136
+ "expiresAt": obj.get("expiresAt"),
137
+ "createdByRef": obj.get("createdByRef"),
138
+ "metadata": obj.get("metadata")
139
+ })
140
+ return _obj
@@ -0,0 +1,132 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Vortex Payments API
5
+
6
+ Public Vortex Payments API for customers, subscriptions, invoices, payment requests, checkout, receipts, webhooks, tax.
7
+
8
+ The version of the OpenAPI document: 2026-08
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional, Union
23
+ from typing_extensions import Annotated
24
+ from vortex.models.coupon_targets import CouponTargets
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+ from pydantic_core import to_jsonable_python
28
+
29
+ class CreateCouponRequest(BaseModel):
30
+ """
31
+ CreateCouponRequest
32
+ """ # noqa: E501
33
+ coupon_id: Optional[StrictStr] = Field(default=None, alias="couponId")
34
+ code: StrictStr
35
+ name: StrictStr
36
+ description: Optional[StrictStr] = None
37
+ discount_type: StrictStr = Field(alias="discountType")
38
+ amount: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
39
+ currency: Optional[StrictStr] = Field(default=None, description="ISO 4217 alpha-3; only currencies processable on current rails are accepted", json_schema_extra={"examples": ["USD"]})
40
+ percentage: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)]]] = None
41
+ duration: StrictStr
42
+ duration_in_billing_periods: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, alias="durationInBillingPeriods")
43
+ reusable: Optional[StrictBool] = None
44
+ targets: Optional[CouponTargets] = None
45
+ expires_at: Optional[datetime] = Field(default=None, alias="expiresAt")
46
+ metadata: Optional[Dict[str, StrictStr]] = None
47
+ __properties: ClassVar[List[str]] = ["couponId", "code", "name", "description", "discountType", "amount", "currency", "percentage", "duration", "durationInBillingPeriods", "reusable", "targets", "expiresAt", "metadata"]
48
+
49
+ @field_validator('discount_type')
50
+ def discount_type_validate_enum(cls, value):
51
+ """Validates the enum"""
52
+ if value not in set(['fixed_amount', 'percentage']):
53
+ raise ValueError("must be one of enum values ('fixed_amount', 'percentage')")
54
+ return value
55
+
56
+ @field_validator('duration')
57
+ def duration_validate_enum(cls, value):
58
+ """Validates the enum"""
59
+ if value not in set(['once', 'repeating', 'forever']):
60
+ raise ValueError("must be one of enum values ('once', 'repeating', 'forever')")
61
+ return value
62
+
63
+ model_config = ConfigDict(
64
+ validate_by_name=True,
65
+ validate_by_alias=True,
66
+ validate_assignment=True,
67
+ protected_namespaces=(),
68
+ )
69
+
70
+
71
+ def to_str(self) -> str:
72
+ """Returns the string representation of the model using alias"""
73
+ return pprint.pformat(self.model_dump(by_alias=True))
74
+
75
+ def to_json(self) -> str:
76
+ """Returns the JSON representation of the model using alias"""
77
+ return json.dumps(to_jsonable_python(self.to_dict()))
78
+
79
+ @classmethod
80
+ def from_json(cls, json_str: str) -> Optional[Self]:
81
+ """Create an instance of CreateCouponRequest from a JSON string"""
82
+ return cls.from_dict(json.loads(json_str))
83
+
84
+ def to_dict(self) -> Dict[str, Any]:
85
+ """Return the dictionary representation of the model using alias.
86
+
87
+ This has the following differences from calling pydantic's
88
+ `self.model_dump(by_alias=True)`:
89
+
90
+ * `None` is only added to the output dict for nullable fields that
91
+ were set at model initialization. Other fields with value `None`
92
+ are ignored.
93
+ """
94
+ excluded_fields: Set[str] = set([
95
+ ])
96
+
97
+ _dict = self.model_dump(
98
+ by_alias=True,
99
+ exclude=excluded_fields,
100
+ exclude_none=True,
101
+ )
102
+ # override the default output from pydantic by calling `to_dict()` of targets
103
+ if self.targets:
104
+ _dict['targets'] = self.targets.to_dict()
105
+ return _dict
106
+
107
+ @classmethod
108
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
109
+ """Create an instance of CreateCouponRequest from a dict"""
110
+ if obj is None:
111
+ return None
112
+
113
+ if not isinstance(obj, dict):
114
+ return cls.model_validate(obj)
115
+
116
+ _obj = cls.model_validate({
117
+ "couponId": obj.get("couponId"),
118
+ "code": obj.get("code"),
119
+ "name": obj.get("name"),
120
+ "description": obj.get("description"),
121
+ "discountType": obj.get("discountType"),
122
+ "amount": obj.get("amount"),
123
+ "currency": obj.get("currency"),
124
+ "percentage": obj.get("percentage"),
125
+ "duration": obj.get("duration"),
126
+ "durationInBillingPeriods": obj.get("durationInBillingPeriods"),
127
+ "reusable": obj.get("reusable"),
128
+ "targets": CouponTargets.from_dict(obj["targets"]) if obj.get("targets") is not None else None,
129
+ "expiresAt": obj.get("expiresAt"),
130
+ "metadata": obj.get("metadata")
131
+ })
132
+ return _obj
@@ -0,0 +1,172 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Vortex Payments API
5
+
6
+ Public Vortex Payments API for customers, subscriptions, invoices, payment requests, checkout, receipts, webhooks, tax.
7
+
8
+ The version of the OpenAPI document: 2026-08
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+ from pydantic_core import to_jsonable_python
25
+
26
+ class CreateDepositBalancePayableRequest(BaseModel):
27
+ """
28
+ CreateDepositBalancePayableRequest
29
+ """ # noqa: E501
30
+ source_type: StrictStr = Field(alias="sourceType")
31
+ source_id: StrictStr = Field(alias="sourceId")
32
+ document_id: StrictStr = Field(alias="documentId")
33
+ payment_field_id: StrictStr = Field(alias="paymentFieldId")
34
+ customer_external_id: StrictStr = Field(alias="customerExternalId")
35
+ billing_account_id: StrictStr = Field(alias="billingAccountId")
36
+ merchant_account_id: Optional[StrictStr] = Field(default=None, alias="merchantAccountId")
37
+ currency: StrictStr = Field(description="ISO 4217 alpha-3; only currencies processable on current rails are accepted", json_schema_extra={"examples": ["USD"]})
38
+ tax_mode: StrictStr = Field(alias="taxMode")
39
+ taxable: Optional[StrictBool] = None
40
+ tax_behavior: Optional[StrictStr] = Field(default=None, alias="taxBehavior")
41
+ tax_classification_key: Optional[StrictStr] = Field(default=None, alias="taxClassificationKey")
42
+ collection_intent: StrictStr = Field(alias="collectionIntent")
43
+ fee_policy: Dict[str, Any] = Field(description="Adopter fee policy (modeled, not settlement-executed). Structure passed through to Vortex Payments.", alias="feePolicy")
44
+ deposit: Dict[str, Any]
45
+ balance: Dict[str, Any]
46
+ metadata: Dict[str, StrictStr]
47
+ additional_properties: Dict[str, Any] = {}
48
+ __properties: ClassVar[List[str]] = ["sourceType", "sourceId", "documentId", "paymentFieldId", "customerExternalId", "billingAccountId", "merchantAccountId", "currency", "taxMode", "taxable", "taxBehavior", "taxClassificationKey", "collectionIntent", "feePolicy", "deposit", "balance", "metadata"]
49
+
50
+ @field_validator('source_type')
51
+ def source_type_validate_enum(cls, value):
52
+ """Validates the enum"""
53
+ if value not in set(['document_payment_field']):
54
+ raise ValueError("must be one of enum values ('document_payment_field')")
55
+ return value
56
+
57
+ @field_validator('tax_mode')
58
+ def tax_mode_validate_enum(cls, value):
59
+ """Validates the enum"""
60
+ if value not in set(['not_taxable', 'taxable_requires_evidence']):
61
+ raise ValueError("must be one of enum values ('not_taxable', 'taxable_requires_evidence')")
62
+ return value
63
+
64
+ @field_validator('tax_behavior')
65
+ def tax_behavior_validate_enum(cls, value):
66
+ """Validates the enum"""
67
+ if value is None:
68
+ return value
69
+
70
+ if value not in set(['inclusive', 'exclusive']):
71
+ raise ValueError("must be one of enum values ('inclusive', 'exclusive')")
72
+ return value
73
+
74
+ @field_validator('tax_classification_key')
75
+ def tax_classification_key_validate_enum(cls, value):
76
+ """Validates the enum"""
77
+ if value is None:
78
+ return value
79
+
80
+ if value not in set(['standard_taxable']):
81
+ raise ValueError("must be one of enum values ('standard_taxable')")
82
+ return value
83
+
84
+ @field_validator('collection_intent')
85
+ def collection_intent_validate_enum(cls, value):
86
+ """Validates the enum"""
87
+ if value not in set(['manual']):
88
+ raise ValueError("must be one of enum values ('manual')")
89
+ return value
90
+
91
+ model_config = ConfigDict(
92
+ validate_by_name=True,
93
+ validate_by_alias=True,
94
+ validate_assignment=True,
95
+ protected_namespaces=(),
96
+ )
97
+
98
+
99
+ def to_str(self) -> str:
100
+ """Returns the string representation of the model using alias"""
101
+ return pprint.pformat(self.model_dump(by_alias=True))
102
+
103
+ def to_json(self) -> str:
104
+ """Returns the JSON representation of the model using alias"""
105
+ return json.dumps(to_jsonable_python(self.to_dict()))
106
+
107
+ @classmethod
108
+ def from_json(cls, json_str: str) -> Optional[Self]:
109
+ """Create an instance of CreateDepositBalancePayableRequest from a JSON string"""
110
+ return cls.from_dict(json.loads(json_str))
111
+
112
+ def to_dict(self) -> Dict[str, Any]:
113
+ """Return the dictionary representation of the model using alias.
114
+
115
+ This has the following differences from calling pydantic's
116
+ `self.model_dump(by_alias=True)`:
117
+
118
+ * `None` is only added to the output dict for nullable fields that
119
+ were set at model initialization. Other fields with value `None`
120
+ are ignored.
121
+ * Fields in `self.additional_properties` are added to the output dict.
122
+ """
123
+ excluded_fields: Set[str] = set([
124
+ "additional_properties",
125
+ ])
126
+
127
+ _dict = self.model_dump(
128
+ by_alias=True,
129
+ exclude=excluded_fields,
130
+ exclude_none=True,
131
+ )
132
+ # puts key-value pairs in additional_properties in the top level
133
+ if self.additional_properties is not None:
134
+ for _key, _value in self.additional_properties.items():
135
+ _dict[_key] = _value
136
+
137
+ return _dict
138
+
139
+ @classmethod
140
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
141
+ """Create an instance of CreateDepositBalancePayableRequest from a dict"""
142
+ if obj is None:
143
+ return None
144
+
145
+ if not isinstance(obj, dict):
146
+ return cls.model_validate(obj)
147
+
148
+ _obj = cls.model_validate({
149
+ "sourceType": obj.get("sourceType"),
150
+ "sourceId": obj.get("sourceId"),
151
+ "documentId": obj.get("documentId"),
152
+ "paymentFieldId": obj.get("paymentFieldId"),
153
+ "customerExternalId": obj.get("customerExternalId"),
154
+ "billingAccountId": obj.get("billingAccountId"),
155
+ "merchantAccountId": obj.get("merchantAccountId"),
156
+ "currency": obj.get("currency"),
157
+ "taxMode": obj.get("taxMode"),
158
+ "taxable": obj.get("taxable"),
159
+ "taxBehavior": obj.get("taxBehavior"),
160
+ "taxClassificationKey": obj.get("taxClassificationKey"),
161
+ "collectionIntent": obj.get("collectionIntent"),
162
+ "feePolicy": obj.get("feePolicy"),
163
+ "deposit": obj.get("deposit"),
164
+ "balance": obj.get("balance"),
165
+ "metadata": obj.get("metadata")
166
+ })
167
+ # store additional fields in additional_properties
168
+ for _key in obj.keys():
169
+ if _key not in cls.__properties:
170
+ _obj.additional_properties[_key] = obj.get(_key)
171
+
172
+ return _obj