robosystems-client 0.2.10__py3-none-any.whl → 0.2.11__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 (27) hide show
  1. robosystems_client/api/billing/__init__.py +1 -0
  2. robosystems_client/api/billing/cancel_subscription.py +173 -0
  3. robosystems_client/api/billing/create_checkout_session.py +230 -0
  4. robosystems_client/api/billing/get_billing_customer.py +143 -0
  5. robosystems_client/api/billing/get_checkout_status.py +221 -0
  6. robosystems_client/api/billing/get_subscription.py +165 -0
  7. robosystems_client/api/billing/get_upcoming_invoice.py +157 -0
  8. robosystems_client/api/billing/list_invoices.py +181 -0
  9. robosystems_client/api/billing/list_subscriptions.py +152 -0
  10. robosystems_client/api/billing/update_payment_method.py +182 -0
  11. robosystems_client/models/__init__.py +24 -0
  12. robosystems_client/models/billing_customer.py +128 -0
  13. robosystems_client/models/checkout_response.py +87 -0
  14. robosystems_client/models/checkout_status_response.py +130 -0
  15. robosystems_client/models/create_checkout_request.py +88 -0
  16. robosystems_client/models/create_checkout_request_resource_config.py +44 -0
  17. robosystems_client/models/invoice.py +244 -0
  18. robosystems_client/models/invoice_line_item.py +118 -0
  19. robosystems_client/models/invoices_response.py +90 -0
  20. robosystems_client/models/payment_method.py +158 -0
  21. robosystems_client/models/upcoming_invoice.py +128 -0
  22. robosystems_client/models/update_payment_method_request.py +60 -0
  23. robosystems_client/models/update_payment_method_response.py +74 -0
  24. {robosystems_client-0.2.10.dist-info → robosystems_client-0.2.11.dist-info}/METADATA +1 -1
  25. {robosystems_client-0.2.10.dist-info → robosystems_client-0.2.11.dist-info}/RECORD +27 -5
  26. {robosystems_client-0.2.10.dist-info → robosystems_client-0.2.11.dist-info}/WHEEL +0 -0
  27. {robosystems_client-0.2.10.dist-info → robosystems_client-0.2.11.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,128 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ if TYPE_CHECKING:
10
+ from ..models.payment_method import PaymentMethod
11
+
12
+
13
+ T = TypeVar("T", bound="BillingCustomer")
14
+
15
+
16
+ @_attrs_define
17
+ class BillingCustomer:
18
+ """Billing customer information.
19
+
20
+ Attributes:
21
+ user_id (str): User ID
22
+ has_payment_method (bool): Whether customer has a payment method on file
23
+ invoice_billing_enabled (bool): Whether invoice billing is enabled (enterprise customers)
24
+ payment_methods (list['PaymentMethod']): List of payment methods on file
25
+ created_at (str): Customer creation timestamp (ISO format)
26
+ stripe_customer_id (Union[None, Unset, str]): Stripe customer ID if applicable
27
+ """
28
+
29
+ user_id: str
30
+ has_payment_method: bool
31
+ invoice_billing_enabled: bool
32
+ payment_methods: list["PaymentMethod"]
33
+ created_at: str
34
+ stripe_customer_id: Union[None, Unset, str] = UNSET
35
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
36
+
37
+ def to_dict(self) -> dict[str, Any]:
38
+ user_id = self.user_id
39
+
40
+ has_payment_method = self.has_payment_method
41
+
42
+ invoice_billing_enabled = self.invoice_billing_enabled
43
+
44
+ payment_methods = []
45
+ for payment_methods_item_data in self.payment_methods:
46
+ payment_methods_item = payment_methods_item_data.to_dict()
47
+ payment_methods.append(payment_methods_item)
48
+
49
+ created_at = self.created_at
50
+
51
+ stripe_customer_id: Union[None, Unset, str]
52
+ if isinstance(self.stripe_customer_id, Unset):
53
+ stripe_customer_id = UNSET
54
+ else:
55
+ stripe_customer_id = self.stripe_customer_id
56
+
57
+ field_dict: dict[str, Any] = {}
58
+ field_dict.update(self.additional_properties)
59
+ field_dict.update(
60
+ {
61
+ "user_id": user_id,
62
+ "has_payment_method": has_payment_method,
63
+ "invoice_billing_enabled": invoice_billing_enabled,
64
+ "payment_methods": payment_methods,
65
+ "created_at": created_at,
66
+ }
67
+ )
68
+ if stripe_customer_id is not UNSET:
69
+ field_dict["stripe_customer_id"] = stripe_customer_id
70
+
71
+ return field_dict
72
+
73
+ @classmethod
74
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
75
+ from ..models.payment_method import PaymentMethod
76
+
77
+ d = dict(src_dict)
78
+ user_id = d.pop("user_id")
79
+
80
+ has_payment_method = d.pop("has_payment_method")
81
+
82
+ invoice_billing_enabled = d.pop("invoice_billing_enabled")
83
+
84
+ payment_methods = []
85
+ _payment_methods = d.pop("payment_methods")
86
+ for payment_methods_item_data in _payment_methods:
87
+ payment_methods_item = PaymentMethod.from_dict(payment_methods_item_data)
88
+
89
+ payment_methods.append(payment_methods_item)
90
+
91
+ created_at = d.pop("created_at")
92
+
93
+ def _parse_stripe_customer_id(data: object) -> Union[None, Unset, str]:
94
+ if data is None:
95
+ return data
96
+ if isinstance(data, Unset):
97
+ return data
98
+ return cast(Union[None, Unset, str], data)
99
+
100
+ stripe_customer_id = _parse_stripe_customer_id(d.pop("stripe_customer_id", UNSET))
101
+
102
+ billing_customer = cls(
103
+ user_id=user_id,
104
+ has_payment_method=has_payment_method,
105
+ invoice_billing_enabled=invoice_billing_enabled,
106
+ payment_methods=payment_methods,
107
+ created_at=created_at,
108
+ stripe_customer_id=stripe_customer_id,
109
+ )
110
+
111
+ billing_customer.additional_properties = d
112
+ return billing_customer
113
+
114
+ @property
115
+ def additional_keys(self) -> list[str]:
116
+ return list(self.additional_properties.keys())
117
+
118
+ def __getitem__(self, key: str) -> Any:
119
+ return self.additional_properties[key]
120
+
121
+ def __setitem__(self, key: str, value: Any) -> None:
122
+ self.additional_properties[key] = value
123
+
124
+ def __delitem__(self, key: str) -> None:
125
+ del self.additional_properties[key]
126
+
127
+ def __contains__(self, key: str) -> bool:
128
+ return key in self.additional_properties
@@ -0,0 +1,87 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar, Union
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ T = TypeVar("T", bound="CheckoutResponse")
10
+
11
+
12
+ @_attrs_define
13
+ class CheckoutResponse:
14
+ """Response from checkout session creation.
15
+
16
+ Attributes:
17
+ checkout_url (str): URL to redirect user to for payment
18
+ session_id (str): Checkout session ID for status polling
19
+ subscription_id (str): Internal subscription ID
20
+ requires_checkout (Union[Unset, bool]): Whether checkout is required Default: True.
21
+ """
22
+
23
+ checkout_url: str
24
+ session_id: str
25
+ subscription_id: str
26
+ requires_checkout: Union[Unset, bool] = True
27
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
28
+
29
+ def to_dict(self) -> dict[str, Any]:
30
+ checkout_url = self.checkout_url
31
+
32
+ session_id = self.session_id
33
+
34
+ subscription_id = self.subscription_id
35
+
36
+ requires_checkout = self.requires_checkout
37
+
38
+ field_dict: dict[str, Any] = {}
39
+ field_dict.update(self.additional_properties)
40
+ field_dict.update(
41
+ {
42
+ "checkout_url": checkout_url,
43
+ "session_id": session_id,
44
+ "subscription_id": subscription_id,
45
+ }
46
+ )
47
+ if requires_checkout is not UNSET:
48
+ field_dict["requires_checkout"] = requires_checkout
49
+
50
+ return field_dict
51
+
52
+ @classmethod
53
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
54
+ d = dict(src_dict)
55
+ checkout_url = d.pop("checkout_url")
56
+
57
+ session_id = d.pop("session_id")
58
+
59
+ subscription_id = d.pop("subscription_id")
60
+
61
+ requires_checkout = d.pop("requires_checkout", UNSET)
62
+
63
+ checkout_response = cls(
64
+ checkout_url=checkout_url,
65
+ session_id=session_id,
66
+ subscription_id=subscription_id,
67
+ requires_checkout=requires_checkout,
68
+ )
69
+
70
+ checkout_response.additional_properties = d
71
+ return checkout_response
72
+
73
+ @property
74
+ def additional_keys(self) -> list[str]:
75
+ return list(self.additional_properties.keys())
76
+
77
+ def __getitem__(self, key: str) -> Any:
78
+ return self.additional_properties[key]
79
+
80
+ def __setitem__(self, key: str, value: Any) -> None:
81
+ self.additional_properties[key] = value
82
+
83
+ def __delitem__(self, key: str) -> None:
84
+ del self.additional_properties[key]
85
+
86
+ def __contains__(self, key: str) -> bool:
87
+ return key in self.additional_properties
@@ -0,0 +1,130 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar, Union, cast
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ T = TypeVar("T", bound="CheckoutStatusResponse")
10
+
11
+
12
+ @_attrs_define
13
+ class CheckoutStatusResponse:
14
+ """Status of a checkout session.
15
+
16
+ Attributes:
17
+ status (str): Checkout status: 'pending_payment', 'provisioning', 'completed', 'failed'
18
+ subscription_id (str): Internal subscription ID
19
+ resource_id (Union[None, Unset, str]): Resource ID (graph_id or repository name) once provisioned
20
+ operation_id (Union[None, Unset, str]): SSE operation ID for monitoring provisioning progress
21
+ error (Union[None, Unset, str]): Error message if checkout failed
22
+ """
23
+
24
+ status: str
25
+ subscription_id: str
26
+ resource_id: Union[None, Unset, str] = UNSET
27
+ operation_id: Union[None, Unset, str] = UNSET
28
+ error: Union[None, Unset, str] = UNSET
29
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
30
+
31
+ def to_dict(self) -> dict[str, Any]:
32
+ status = self.status
33
+
34
+ subscription_id = self.subscription_id
35
+
36
+ resource_id: Union[None, Unset, str]
37
+ if isinstance(self.resource_id, Unset):
38
+ resource_id = UNSET
39
+ else:
40
+ resource_id = self.resource_id
41
+
42
+ operation_id: Union[None, Unset, str]
43
+ if isinstance(self.operation_id, Unset):
44
+ operation_id = UNSET
45
+ else:
46
+ operation_id = self.operation_id
47
+
48
+ error: Union[None, Unset, str]
49
+ if isinstance(self.error, Unset):
50
+ error = UNSET
51
+ else:
52
+ error = self.error
53
+
54
+ field_dict: dict[str, Any] = {}
55
+ field_dict.update(self.additional_properties)
56
+ field_dict.update(
57
+ {
58
+ "status": status,
59
+ "subscription_id": subscription_id,
60
+ }
61
+ )
62
+ if resource_id is not UNSET:
63
+ field_dict["resource_id"] = resource_id
64
+ if operation_id is not UNSET:
65
+ field_dict["operation_id"] = operation_id
66
+ if error is not UNSET:
67
+ field_dict["error"] = error
68
+
69
+ return field_dict
70
+
71
+ @classmethod
72
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
73
+ d = dict(src_dict)
74
+ status = d.pop("status")
75
+
76
+ subscription_id = d.pop("subscription_id")
77
+
78
+ def _parse_resource_id(data: object) -> Union[None, Unset, str]:
79
+ if data is None:
80
+ return data
81
+ if isinstance(data, Unset):
82
+ return data
83
+ return cast(Union[None, Unset, str], data)
84
+
85
+ resource_id = _parse_resource_id(d.pop("resource_id", UNSET))
86
+
87
+ def _parse_operation_id(data: object) -> Union[None, Unset, str]:
88
+ if data is None:
89
+ return data
90
+ if isinstance(data, Unset):
91
+ return data
92
+ return cast(Union[None, Unset, str], data)
93
+
94
+ operation_id = _parse_operation_id(d.pop("operation_id", UNSET))
95
+
96
+ def _parse_error(data: object) -> Union[None, Unset, str]:
97
+ if data is None:
98
+ return data
99
+ if isinstance(data, Unset):
100
+ return data
101
+ return cast(Union[None, Unset, str], data)
102
+
103
+ error = _parse_error(d.pop("error", UNSET))
104
+
105
+ checkout_status_response = cls(
106
+ status=status,
107
+ subscription_id=subscription_id,
108
+ resource_id=resource_id,
109
+ operation_id=operation_id,
110
+ error=error,
111
+ )
112
+
113
+ checkout_status_response.additional_properties = d
114
+ return checkout_status_response
115
+
116
+ @property
117
+ def additional_keys(self) -> list[str]:
118
+ return list(self.additional_properties.keys())
119
+
120
+ def __getitem__(self, key: str) -> Any:
121
+ return self.additional_properties[key]
122
+
123
+ def __setitem__(self, key: str, value: Any) -> None:
124
+ self.additional_properties[key] = value
125
+
126
+ def __delitem__(self, key: str) -> None:
127
+ del self.additional_properties[key]
128
+
129
+ def __contains__(self, key: str) -> bool:
130
+ return key in self.additional_properties
@@ -0,0 +1,88 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ if TYPE_CHECKING:
8
+ from ..models.create_checkout_request_resource_config import (
9
+ CreateCheckoutRequestResourceConfig,
10
+ )
11
+
12
+
13
+ T = TypeVar("T", bound="CreateCheckoutRequest")
14
+
15
+
16
+ @_attrs_define
17
+ class CreateCheckoutRequest:
18
+ """Request to create a checkout session for payment collection.
19
+
20
+ Attributes:
21
+ plan_name (str): Billing plan name (e.g., 'kuzu-standard')
22
+ resource_type (str): Resource type ('graph' or 'repository')
23
+ resource_config (CreateCheckoutRequestResourceConfig): Configuration for the resource to be provisioned
24
+ """
25
+
26
+ plan_name: str
27
+ resource_type: str
28
+ resource_config: "CreateCheckoutRequestResourceConfig"
29
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
30
+
31
+ def to_dict(self) -> dict[str, Any]:
32
+ plan_name = self.plan_name
33
+
34
+ resource_type = self.resource_type
35
+
36
+ resource_config = self.resource_config.to_dict()
37
+
38
+ field_dict: dict[str, Any] = {}
39
+ field_dict.update(self.additional_properties)
40
+ field_dict.update(
41
+ {
42
+ "plan_name": plan_name,
43
+ "resource_type": resource_type,
44
+ "resource_config": resource_config,
45
+ }
46
+ )
47
+
48
+ return field_dict
49
+
50
+ @classmethod
51
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
52
+ from ..models.create_checkout_request_resource_config import (
53
+ CreateCheckoutRequestResourceConfig,
54
+ )
55
+
56
+ d = dict(src_dict)
57
+ plan_name = d.pop("plan_name")
58
+
59
+ resource_type = d.pop("resource_type")
60
+
61
+ resource_config = CreateCheckoutRequestResourceConfig.from_dict(
62
+ d.pop("resource_config")
63
+ )
64
+
65
+ create_checkout_request = cls(
66
+ plan_name=plan_name,
67
+ resource_type=resource_type,
68
+ resource_config=resource_config,
69
+ )
70
+
71
+ create_checkout_request.additional_properties = d
72
+ return create_checkout_request
73
+
74
+ @property
75
+ def additional_keys(self) -> list[str]:
76
+ return list(self.additional_properties.keys())
77
+
78
+ def __getitem__(self, key: str) -> Any:
79
+ return self.additional_properties[key]
80
+
81
+ def __setitem__(self, key: str, value: Any) -> None:
82
+ self.additional_properties[key] = value
83
+
84
+ def __delitem__(self, key: str) -> None:
85
+ del self.additional_properties[key]
86
+
87
+ def __contains__(self, key: str) -> bool:
88
+ return key in self.additional_properties
@@ -0,0 +1,44 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ T = TypeVar("T", bound="CreateCheckoutRequestResourceConfig")
8
+
9
+
10
+ @_attrs_define
11
+ class CreateCheckoutRequestResourceConfig:
12
+ """Configuration for the resource to be provisioned"""
13
+
14
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
15
+
16
+ def to_dict(self) -> dict[str, Any]:
17
+ field_dict: dict[str, Any] = {}
18
+ field_dict.update(self.additional_properties)
19
+
20
+ return field_dict
21
+
22
+ @classmethod
23
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
24
+ d = dict(src_dict)
25
+ create_checkout_request_resource_config = cls()
26
+
27
+ create_checkout_request_resource_config.additional_properties = d
28
+ return create_checkout_request_resource_config
29
+
30
+ @property
31
+ def additional_keys(self) -> list[str]:
32
+ return list(self.additional_properties.keys())
33
+
34
+ def __getitem__(self, key: str) -> Any:
35
+ return self.additional_properties[key]
36
+
37
+ def __setitem__(self, key: str, value: Any) -> None:
38
+ self.additional_properties[key] = value
39
+
40
+ def __delitem__(self, key: str) -> None:
41
+ del self.additional_properties[key]
42
+
43
+ def __contains__(self, key: str) -> bool:
44
+ return key in self.additional_properties