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.
- vortex/__init__.py +265 -0
- vortex/api/__init__.py +24 -0
- vortex/api/billing_api.py +34608 -0
- vortex/api/catalog_api.py +708 -0
- vortex/api/checkout_api.py +372 -0
- vortex/api/credit_notes_api.py +1688 -0
- vortex/api/customer_balance_api.py +1747 -0
- vortex/api/customers_api.py +387 -0
- vortex/api/discounts_api.py +2623 -0
- vortex/api/entitlements_api.py +1646 -0
- vortex/api/hosted_api.py +2855 -0
- vortex/api/invoices_api.py +2402 -0
- vortex/api/payables_api.py +1380 -0
- vortex/api/payment_methods_api.py +2069 -0
- vortex/api/payment_requests_api.py +1877 -0
- vortex/api/payments_api.py +694 -0
- vortex/api/payments_readiness_api.py +2311 -0
- vortex/api/public_api.py +6931 -0
- vortex/api/quotes_api.py +6817 -0
- vortex/api/receipts_api.py +1111 -0
- vortex/api/subscriptions_api.py +1059 -0
- vortex/api/tax_api.py +1397 -0
- vortex/api/webhooks_api.py +4931 -0
- vortex/api_client.py +804 -0
- vortex/api_response.py +21 -0
- vortex/configuration.py +658 -0
- vortex/exceptions.py +218 -0
- vortex/models/__init__.py +104 -0
- vortex/models/api_error.py +103 -0
- vortex/models/api_error_error.py +114 -0
- vortex/models/api_write_envelope.py +101 -0
- vortex/models/apply_coupon_request.py +97 -0
- vortex/models/billing_order_form_sign_request.py +103 -0
- vortex/models/billing_order_form_signature_request_request.py +86 -0
- vortex/models/billing_order_form_void_request.py +86 -0
- vortex/models/billing_order_forms_expire_due_request.py +90 -0
- vortex/models/billing_order_update_request.py +99 -0
- vortex/models/billing_orders_execute_due_request.py +90 -0
- vortex/models/billing_quote_create_request.py +119 -0
- vortex/models/billing_quote_line_input.py +93 -0
- vortex/models/billing_quote_version_approve_request.py +87 -0
- vortex/models/billing_quote_version_create_request.py +103 -0
- vortex/models/billing_quote_version_update_request.py +102 -0
- vortex/models/billing_quote_version_void_request.py +96 -0
- vortex/models/checkout_session_line_item_request.py +91 -0
- vortex/models/coupon_targets.py +89 -0
- vortex/models/create_checkout_session_request.py +140 -0
- vortex/models/create_coupon_request.py +132 -0
- vortex/models/create_deposit_balance_payable_request.py +172 -0
- vortex/models/create_installment_payable_request.py +170 -0
- vortex/models/create_payable_request.py +158 -0
- vortex/models/create_recurring_payable_request.py +181 -0
- vortex/models/create_recurring_payable_request_cadence.py +96 -0
- vortex/models/credit_note_create_line.py +105 -0
- vortex/models/credit_note_create_request.py +112 -0
- vortex/models/credit_note_reason.py +39 -0
- vortex/models/credit_note_refund_reconcile_request.py +86 -0
- vortex/models/credit_note_refund_request.py +94 -0
- vortex/models/customer_balance_targets.py +102 -0
- vortex/models/customer_default_payment_method_request.py +88 -0
- vortex/models/customer_payment_method_archive_request.py +88 -0
- vortex/models/customer_payment_method_attach_request.py +94 -0
- vortex/models/customer_payment_method_setup_request.py +100 -0
- vortex/models/customer_upsert_request.py +96 -0
- vortex/models/expire_customer_balance_request.py +98 -0
- vortex/models/grant_customer_balance_from_payment_request.py +103 -0
- vortex/models/grant_customer_balance_request.py +106 -0
- vortex/models/grant_entitlement_request.py +106 -0
- vortex/models/invoice_collect_request.py +86 -0
- vortex/models/invoice_create_request.py +92 -0
- vortex/models/invoice_finalize_request.py +86 -0
- vortex/models/invoice_mark_uncollectible_request.py +90 -0
- vortex/models/invoice_tax.py +142 -0
- vortex/models/invoice_void_request.py +88 -0
- vortex/models/merchant_account_create_request.py +183 -0
- vortex/models/merchant_address.py +96 -0
- vortex/models/merchant_associated_identity.py +114 -0
- vortex/models/merchant_onboarding_link_request.py +95 -0
- vortex/models/merchant_profile_date.py +90 -0
- vortex/models/merchant_settlement_bank_account.py +94 -0
- vortex/models/merchant_tax_profile_request.py +125 -0
- vortex/models/merchant_tax_profile_request_registrations_inner.py +88 -0
- vortex/models/merchant_underwriting_data.py +127 -0
- vortex/models/merchant_underwriting_data_card_volume_distribution.py +90 -0
- vortex/models/merchant_underwriting_data_volume_distribution_by_business_type.py +90 -0
- vortex/models/open_api_invoice_tax_response.py +92 -0
- vortex/models/open_api_invoice_tax_response_all_of_data.py +92 -0
- vortex/models/payment_request_collect_request.py +86 -0
- vortex/models/payment_request_create_request.py +100 -0
- vortex/models/payment_request_link_create_request.py +89 -0
- vortex/models/price_create_request.py +122 -0
- vortex/models/product_create_request.py +92 -0
- vortex/models/reverse_customer_balance_request.py +98 -0
- vortex/models/revoke_entitlement_request.py +106 -0
- vortex/models/subscription_change_request.py +111 -0
- vortex/models/subscription_create_request.py +122 -0
- vortex/models/subscription_item_change_preview_request.py +100 -0
- vortex/models/subscription_item_change_request_item.py +91 -0
- vortex/models/tax_address.py +96 -0
- vortex/models/tax_behavior.py +36 -0
- vortex/models/tax_behavior_policy.py +100 -0
- vortex/models/tax_behavior_policy_request.py +89 -0
- vortex/models/tax_failure.py +104 -0
- vortex/models/tax_finalize_request.py +98 -0
- vortex/models/tax_jurisdiction_evidence.py +94 -0
- vortex/models/tax_line_evidence.py +103 -0
- vortex/models/tax_quote_request.py +98 -0
- vortex/models/terminate_applied_coupon_request.py +87 -0
- vortex/models/terminate_coupon_request.py +87 -0
- vortex/models/webhook_deliveries_dispatch_request.py +91 -0
- vortex/models/webhook_deliveries_redrive_request.py +107 -0
- vortex/models/webhook_delivery_replay_request.py +88 -0
- vortex/models/webhook_endpoint_create_request.py +91 -0
- vortex/models/webhook_endpoint_secret_rotate_request.py +87 -0
- vortex/models/webhook_endpoint_test_request.py +88 -0
- vortex/models/webhook_endpoint_update_request.py +103 -0
- vortex/models/webhook_event_resend_request.py +86 -0
- vortex/rest.py +263 -0
- vortex_sdk-0.2.0.dist-info/METADATA +34 -0
- vortex_sdk-0.2.0.dist-info/RECORD +123 -0
- vortex_sdk-0.2.0.dist-info/WHEEL +5 -0
- vortex_sdk-0.2.0.dist-info/licenses/LICENSE +21 -0
- vortex_sdk-0.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,106 @@
|
|
|
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, 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 RevokeEntitlementRequest(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
RevokeEntitlementRequest
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
customer_external_id: StrictStr = Field(alias="customerExternalId")
|
|
31
|
+
billing_account_id: Optional[StrictStr] = Field(default=None, alias="billingAccountId")
|
|
32
|
+
entitlement_key: StrictStr = Field(alias="entitlementKey")
|
|
33
|
+
source: Optional[StrictStr] = None
|
|
34
|
+
source_ref: Optional[StrictStr] = Field(default=None, alias="sourceRef")
|
|
35
|
+
reason: Optional[StrictStr] = None
|
|
36
|
+
__properties: ClassVar[List[str]] = ["customerExternalId", "billingAccountId", "entitlementKey", "source", "sourceRef", "reason"]
|
|
37
|
+
|
|
38
|
+
@field_validator('source')
|
|
39
|
+
def source_validate_enum(cls, value):
|
|
40
|
+
"""Validates the enum"""
|
|
41
|
+
if value is None:
|
|
42
|
+
return value
|
|
43
|
+
|
|
44
|
+
if value not in set(['subscription', 'operator', 'promotion']):
|
|
45
|
+
raise ValueError("must be one of enum values ('subscription', 'operator', 'promotion')")
|
|
46
|
+
return value
|
|
47
|
+
|
|
48
|
+
model_config = ConfigDict(
|
|
49
|
+
validate_by_name=True,
|
|
50
|
+
validate_by_alias=True,
|
|
51
|
+
validate_assignment=True,
|
|
52
|
+
protected_namespaces=(),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def to_str(self) -> str:
|
|
57
|
+
"""Returns the string representation of the model using alias"""
|
|
58
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
59
|
+
|
|
60
|
+
def to_json(self) -> str:
|
|
61
|
+
"""Returns the JSON representation of the model using alias"""
|
|
62
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
66
|
+
"""Create an instance of RevokeEntitlementRequest from a JSON string"""
|
|
67
|
+
return cls.from_dict(json.loads(json_str))
|
|
68
|
+
|
|
69
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
70
|
+
"""Return the dictionary representation of the model using alias.
|
|
71
|
+
|
|
72
|
+
This has the following differences from calling pydantic's
|
|
73
|
+
`self.model_dump(by_alias=True)`:
|
|
74
|
+
|
|
75
|
+
* `None` is only added to the output dict for nullable fields that
|
|
76
|
+
were set at model initialization. Other fields with value `None`
|
|
77
|
+
are ignored.
|
|
78
|
+
"""
|
|
79
|
+
excluded_fields: Set[str] = set([
|
|
80
|
+
])
|
|
81
|
+
|
|
82
|
+
_dict = self.model_dump(
|
|
83
|
+
by_alias=True,
|
|
84
|
+
exclude=excluded_fields,
|
|
85
|
+
exclude_none=True,
|
|
86
|
+
)
|
|
87
|
+
return _dict
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
91
|
+
"""Create an instance of RevokeEntitlementRequest from a dict"""
|
|
92
|
+
if obj is None:
|
|
93
|
+
return None
|
|
94
|
+
|
|
95
|
+
if not isinstance(obj, dict):
|
|
96
|
+
return cls.model_validate(obj)
|
|
97
|
+
|
|
98
|
+
_obj = cls.model_validate({
|
|
99
|
+
"customerExternalId": obj.get("customerExternalId"),
|
|
100
|
+
"billingAccountId": obj.get("billingAccountId"),
|
|
101
|
+
"entitlementKey": obj.get("entitlementKey"),
|
|
102
|
+
"source": obj.get("source"),
|
|
103
|
+
"sourceRef": obj.get("sourceRef"),
|
|
104
|
+
"reason": obj.get("reason")
|
|
105
|
+
})
|
|
106
|
+
return _obj
|
|
@@ -0,0 +1,111 @@
|
|
|
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.subscription_item_change_request_item import SubscriptionItemChangeRequestItem
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
from pydantic_core import to_jsonable_python
|
|
28
|
+
|
|
29
|
+
class SubscriptionChangeRequest(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
SubscriptionChangeRequest
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
action: StrictStr
|
|
34
|
+
cancel_at: Optional[datetime] = Field(default=None, alias="cancelAt")
|
|
35
|
+
effective_at: Optional[datetime] = Field(default=None, alias="effectiveAt")
|
|
36
|
+
items: Optional[Annotated[List[SubscriptionItemChangeRequestItem], Field(min_length=1)]] = None
|
|
37
|
+
requested_by_ref: Optional[StrictStr] = Field(default=None, alias="requestedByRef")
|
|
38
|
+
__properties: ClassVar[List[str]] = ["action", "cancelAt", "effectiveAt", "items", "requestedByRef"]
|
|
39
|
+
|
|
40
|
+
@field_validator('action')
|
|
41
|
+
def action_validate_enum(cls, value):
|
|
42
|
+
"""Validates the enum"""
|
|
43
|
+
if value not in set(['pause', 'resume', 'cancel', 'update_items']):
|
|
44
|
+
raise ValueError("must be one of enum values ('pause', 'resume', 'cancel', 'update_items')")
|
|
45
|
+
return value
|
|
46
|
+
|
|
47
|
+
model_config = ConfigDict(
|
|
48
|
+
validate_by_name=True,
|
|
49
|
+
validate_by_alias=True,
|
|
50
|
+
validate_assignment=True,
|
|
51
|
+
protected_namespaces=(),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def to_str(self) -> str:
|
|
56
|
+
"""Returns the string representation of the model using alias"""
|
|
57
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
58
|
+
|
|
59
|
+
def to_json(self) -> str:
|
|
60
|
+
"""Returns the JSON representation of the model using alias"""
|
|
61
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
62
|
+
|
|
63
|
+
@classmethod
|
|
64
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
65
|
+
"""Create an instance of SubscriptionChangeRequest from a JSON string"""
|
|
66
|
+
return cls.from_dict(json.loads(json_str))
|
|
67
|
+
|
|
68
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
69
|
+
"""Return the dictionary representation of the model using alias.
|
|
70
|
+
|
|
71
|
+
This has the following differences from calling pydantic's
|
|
72
|
+
`self.model_dump(by_alias=True)`:
|
|
73
|
+
|
|
74
|
+
* `None` is only added to the output dict for nullable fields that
|
|
75
|
+
were set at model initialization. Other fields with value `None`
|
|
76
|
+
are ignored.
|
|
77
|
+
"""
|
|
78
|
+
excluded_fields: Set[str] = set([
|
|
79
|
+
])
|
|
80
|
+
|
|
81
|
+
_dict = self.model_dump(
|
|
82
|
+
by_alias=True,
|
|
83
|
+
exclude=excluded_fields,
|
|
84
|
+
exclude_none=True,
|
|
85
|
+
)
|
|
86
|
+
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
|
87
|
+
_items = []
|
|
88
|
+
if self.items:
|
|
89
|
+
for _item_items in self.items:
|
|
90
|
+
if _item_items:
|
|
91
|
+
_items.append(_item_items.to_dict())
|
|
92
|
+
_dict['items'] = _items
|
|
93
|
+
return _dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
+
"""Create an instance of SubscriptionChangeRequest from a dict"""
|
|
98
|
+
if obj is None:
|
|
99
|
+
return None
|
|
100
|
+
|
|
101
|
+
if not isinstance(obj, dict):
|
|
102
|
+
return cls.model_validate(obj)
|
|
103
|
+
|
|
104
|
+
_obj = cls.model_validate({
|
|
105
|
+
"action": obj.get("action"),
|
|
106
|
+
"cancelAt": obj.get("cancelAt"),
|
|
107
|
+
"effectiveAt": obj.get("effectiveAt"),
|
|
108
|
+
"items": [SubscriptionItemChangeRequestItem.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
|
|
109
|
+
"requestedByRef": obj.get("requestedByRef")
|
|
110
|
+
})
|
|
111
|
+
return _obj
|
|
@@ -0,0 +1,122 @@
|
|
|
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 import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class SubscriptionCreateRequest(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
SubscriptionCreateRequest
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
customer_external_id: StrictStr = Field(alias="customerExternalId")
|
|
32
|
+
subscription_external_id: StrictStr = Field(alias="subscriptionExternalId")
|
|
33
|
+
plan_code: StrictStr = Field(alias="planCode")
|
|
34
|
+
collection_mode: Optional[StrictStr] = Field(default=None, alias="collectionMode")
|
|
35
|
+
items: Optional[List[Dict[str, Any]]] = None
|
|
36
|
+
trial_ends_at: Optional[datetime] = Field(default=None, alias="trialEndsAt")
|
|
37
|
+
metadata: Optional[Dict[str, StrictStr]] = None
|
|
38
|
+
additional_properties: Dict[str, Any] = {}
|
|
39
|
+
__properties: ClassVar[List[str]] = ["customerExternalId", "subscriptionExternalId", "planCode", "collectionMode", "items", "trialEndsAt", "metadata"]
|
|
40
|
+
|
|
41
|
+
@field_validator('collection_mode')
|
|
42
|
+
def collection_mode_validate_enum(cls, value):
|
|
43
|
+
"""Validates the enum"""
|
|
44
|
+
if value is None:
|
|
45
|
+
return value
|
|
46
|
+
|
|
47
|
+
if value not in set(['automatic', 'manual']):
|
|
48
|
+
raise ValueError("must be one of enum values ('automatic', 'manual')")
|
|
49
|
+
return value
|
|
50
|
+
|
|
51
|
+
model_config = ConfigDict(
|
|
52
|
+
validate_by_name=True,
|
|
53
|
+
validate_by_alias=True,
|
|
54
|
+
validate_assignment=True,
|
|
55
|
+
protected_namespaces=(),
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def to_str(self) -> str:
|
|
60
|
+
"""Returns the string representation of the model using alias"""
|
|
61
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
62
|
+
|
|
63
|
+
def to_json(self) -> str:
|
|
64
|
+
"""Returns the JSON representation of the model using alias"""
|
|
65
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
66
|
+
|
|
67
|
+
@classmethod
|
|
68
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
69
|
+
"""Create an instance of SubscriptionCreateRequest from a JSON string"""
|
|
70
|
+
return cls.from_dict(json.loads(json_str))
|
|
71
|
+
|
|
72
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
73
|
+
"""Return the dictionary representation of the model using alias.
|
|
74
|
+
|
|
75
|
+
This has the following differences from calling pydantic's
|
|
76
|
+
`self.model_dump(by_alias=True)`:
|
|
77
|
+
|
|
78
|
+
* `None` is only added to the output dict for nullable fields that
|
|
79
|
+
were set at model initialization. Other fields with value `None`
|
|
80
|
+
are ignored.
|
|
81
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
82
|
+
"""
|
|
83
|
+
excluded_fields: Set[str] = set([
|
|
84
|
+
"additional_properties",
|
|
85
|
+
])
|
|
86
|
+
|
|
87
|
+
_dict = self.model_dump(
|
|
88
|
+
by_alias=True,
|
|
89
|
+
exclude=excluded_fields,
|
|
90
|
+
exclude_none=True,
|
|
91
|
+
)
|
|
92
|
+
# puts key-value pairs in additional_properties in the top level
|
|
93
|
+
if self.additional_properties is not None:
|
|
94
|
+
for _key, _value in self.additional_properties.items():
|
|
95
|
+
_dict[_key] = _value
|
|
96
|
+
|
|
97
|
+
return _dict
|
|
98
|
+
|
|
99
|
+
@classmethod
|
|
100
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
101
|
+
"""Create an instance of SubscriptionCreateRequest from a dict"""
|
|
102
|
+
if obj is None:
|
|
103
|
+
return None
|
|
104
|
+
|
|
105
|
+
if not isinstance(obj, dict):
|
|
106
|
+
return cls.model_validate(obj)
|
|
107
|
+
|
|
108
|
+
_obj = cls.model_validate({
|
|
109
|
+
"customerExternalId": obj.get("customerExternalId"),
|
|
110
|
+
"subscriptionExternalId": obj.get("subscriptionExternalId"),
|
|
111
|
+
"planCode": obj.get("planCode"),
|
|
112
|
+
"collectionMode": obj.get("collectionMode"),
|
|
113
|
+
"items": obj.get("items"),
|
|
114
|
+
"trialEndsAt": obj.get("trialEndsAt"),
|
|
115
|
+
"metadata": obj.get("metadata")
|
|
116
|
+
})
|
|
117
|
+
# store additional fields in additional_properties
|
|
118
|
+
for _key in obj.keys():
|
|
119
|
+
if _key not in cls.__properties:
|
|
120
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
121
|
+
|
|
122
|
+
return _obj
|
|
@@ -0,0 +1,100 @@
|
|
|
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
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing_extensions import Annotated
|
|
24
|
+
from vortex.models.subscription_item_change_request_item import SubscriptionItemChangeRequestItem
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
from pydantic_core import to_jsonable_python
|
|
28
|
+
|
|
29
|
+
class SubscriptionItemChangePreviewRequest(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
SubscriptionItemChangePreviewRequest
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
effective_at: Optional[datetime] = Field(default=None, alias="effectiveAt")
|
|
34
|
+
items: Annotated[List[SubscriptionItemChangeRequestItem], Field(min_length=1)]
|
|
35
|
+
requested_by_ref: Optional[StrictStr] = Field(default=None, alias="requestedByRef")
|
|
36
|
+
__properties: ClassVar[List[str]] = ["effectiveAt", "items", "requestedByRef"]
|
|
37
|
+
|
|
38
|
+
model_config = ConfigDict(
|
|
39
|
+
validate_by_name=True,
|
|
40
|
+
validate_by_alias=True,
|
|
41
|
+
validate_assignment=True,
|
|
42
|
+
protected_namespaces=(),
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def to_str(self) -> str:
|
|
47
|
+
"""Returns the string representation of the model using alias"""
|
|
48
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
49
|
+
|
|
50
|
+
def to_json(self) -> str:
|
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
|
52
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
|
+
"""Create an instance of SubscriptionItemChangePreviewRequest from a JSON string"""
|
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
|
58
|
+
|
|
59
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
60
|
+
"""Return the dictionary representation of the model using alias.
|
|
61
|
+
|
|
62
|
+
This has the following differences from calling pydantic's
|
|
63
|
+
`self.model_dump(by_alias=True)`:
|
|
64
|
+
|
|
65
|
+
* `None` is only added to the output dict for nullable fields that
|
|
66
|
+
were set at model initialization. Other fields with value `None`
|
|
67
|
+
are ignored.
|
|
68
|
+
"""
|
|
69
|
+
excluded_fields: Set[str] = set([
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
|
78
|
+
_items = []
|
|
79
|
+
if self.items:
|
|
80
|
+
for _item_items in self.items:
|
|
81
|
+
if _item_items:
|
|
82
|
+
_items.append(_item_items.to_dict())
|
|
83
|
+
_dict['items'] = _items
|
|
84
|
+
return _dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
88
|
+
"""Create an instance of SubscriptionItemChangePreviewRequest from a dict"""
|
|
89
|
+
if obj is None:
|
|
90
|
+
return None
|
|
91
|
+
|
|
92
|
+
if not isinstance(obj, dict):
|
|
93
|
+
return cls.model_validate(obj)
|
|
94
|
+
|
|
95
|
+
_obj = cls.model_validate({
|
|
96
|
+
"effectiveAt": obj.get("effectiveAt"),
|
|
97
|
+
"items": [SubscriptionItemChangeRequestItem.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
|
|
98
|
+
"requestedByRef": obj.get("requestedByRef")
|
|
99
|
+
})
|
|
100
|
+
return _obj
|
|
@@ -0,0 +1,91 @@
|
|
|
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 SubscriptionItemChangeRequestItem(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
SubscriptionItemChangeRequestItem
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
price_id: StrictStr = Field(alias="priceId")
|
|
32
|
+
quantity: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
33
|
+
metadata: Optional[Dict[str, StrictStr]] = None
|
|
34
|
+
__properties: ClassVar[List[str]] = ["priceId", "quantity", "metadata"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
validate_by_name=True,
|
|
38
|
+
validate_by_alias=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of SubscriptionItemChangeRequestItem from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
return _dict
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of SubscriptionItemChangeRequestItem from a dict"""
|
|
80
|
+
if obj is None:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
if not isinstance(obj, dict):
|
|
84
|
+
return cls.model_validate(obj)
|
|
85
|
+
|
|
86
|
+
_obj = cls.model_validate({
|
|
87
|
+
"priceId": obj.get("priceId"),
|
|
88
|
+
"quantity": obj.get("quantity"),
|
|
89
|
+
"metadata": obj.get("metadata")
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
@@ -0,0 +1,96 @@
|
|
|
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 import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
from pydantic_core import to_jsonable_python
|
|
25
|
+
|
|
26
|
+
class TaxAddress(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
TaxAddress
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
line1: StrictStr
|
|
31
|
+
line2: Optional[StrictStr] = None
|
|
32
|
+
city: StrictStr
|
|
33
|
+
region: StrictStr
|
|
34
|
+
postal_code: StrictStr = Field(alias="postalCode")
|
|
35
|
+
country: StrictStr
|
|
36
|
+
__properties: ClassVar[List[str]] = ["line1", "line2", "city", "region", "postalCode", "country"]
|
|
37
|
+
|
|
38
|
+
model_config = ConfigDict(
|
|
39
|
+
validate_by_name=True,
|
|
40
|
+
validate_by_alias=True,
|
|
41
|
+
validate_assignment=True,
|
|
42
|
+
protected_namespaces=(),
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def to_str(self) -> str:
|
|
47
|
+
"""Returns the string representation of the model using alias"""
|
|
48
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
49
|
+
|
|
50
|
+
def to_json(self) -> str:
|
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
|
52
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
|
+
"""Create an instance of TaxAddress from a JSON string"""
|
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
|
58
|
+
|
|
59
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
60
|
+
"""Return the dictionary representation of the model using alias.
|
|
61
|
+
|
|
62
|
+
This has the following differences from calling pydantic's
|
|
63
|
+
`self.model_dump(by_alias=True)`:
|
|
64
|
+
|
|
65
|
+
* `None` is only added to the output dict for nullable fields that
|
|
66
|
+
were set at model initialization. Other fields with value `None`
|
|
67
|
+
are ignored.
|
|
68
|
+
"""
|
|
69
|
+
excluded_fields: Set[str] = set([
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
return _dict
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
+
"""Create an instance of TaxAddress from a dict"""
|
|
82
|
+
if obj is None:
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
if not isinstance(obj, dict):
|
|
86
|
+
return cls.model_validate(obj)
|
|
87
|
+
|
|
88
|
+
_obj = cls.model_validate({
|
|
89
|
+
"line1": obj.get("line1"),
|
|
90
|
+
"line2": obj.get("line2"),
|
|
91
|
+
"city": obj.get("city"),
|
|
92
|
+
"region": obj.get("region"),
|
|
93
|
+
"postalCode": obj.get("postalCode"),
|
|
94
|
+
"country": obj.get("country")
|
|
95
|
+
})
|
|
96
|
+
return _obj
|
|
@@ -0,0 +1,36 @@
|
|
|
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 json
|
|
17
|
+
from enum import Enum
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class TaxBehavior(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
TaxBehavior
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
EXCLUSIVE = 'exclusive'
|
|
30
|
+
INCLUSIVE = 'inclusive'
|
|
31
|
+
LOCATION_BASED = 'location_based'
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def from_json(cls, json_str: str) -> Self:
|
|
35
|
+
"""Create an instance of TaxBehavior from a JSON string"""
|
|
36
|
+
return cls(json.loads(json_str))
|