robosystems-client 0.2.10__py3-none-any.whl → 0.2.12__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.

Potentially problematic release.


This version of robosystems-client might be problematic. Click here for more details.

Files changed (73) hide show
  1. robosystems_client/api/auth/register_user.py +36 -8
  2. robosystems_client/api/billing/__init__.py +1 -0
  3. robosystems_client/api/billing/cancel_org_subscription.py +198 -0
  4. robosystems_client/api/billing/create_checkout_session.py +238 -0
  5. robosystems_client/api/billing/get_checkout_status.py +221 -0
  6. robosystems_client/api/billing/get_org_billing_customer.py +189 -0
  7. robosystems_client/api/billing/get_org_subscription.py +190 -0
  8. robosystems_client/api/billing/get_org_upcoming_invoice.py +203 -0
  9. robosystems_client/api/billing/list_org_invoices.py +210 -0
  10. robosystems_client/api/billing/list_org_subscriptions.py +194 -0
  11. robosystems_client/api/billing/update_org_payment_method.py +207 -0
  12. robosystems_client/api/org/__init__.py +1 -0
  13. robosystems_client/api/org/create_org.py +174 -0
  14. robosystems_client/api/org/get_org.py +165 -0
  15. robosystems_client/api/org/list_org_graphs.py +170 -0
  16. robosystems_client/api/{user/get_user_limits.py → org/list_user_orgs.py} +21 -25
  17. robosystems_client/api/org/update_org.py +187 -0
  18. robosystems_client/api/org_members/__init__.py +1 -0
  19. robosystems_client/api/org_members/invite_org_member.py +207 -0
  20. robosystems_client/api/org_members/list_org_members.py +165 -0
  21. robosystems_client/api/org_members/remove_org_member.py +176 -0
  22. robosystems_client/api/org_members/update_org_member_role.py +200 -0
  23. robosystems_client/api/org_usage/__init__.py +1 -0
  24. robosystems_client/api/org_usage/get_org_limits.py +165 -0
  25. robosystems_client/api/org_usage/get_org_usage.py +186 -0
  26. robosystems_client/api/service_offerings/get_service_offerings.py +32 -8
  27. robosystems_client/api/usage/get_graph_usage_analytics.py +4 -4
  28. robosystems_client/models/__init__.py +68 -6
  29. robosystems_client/models/auth_response.py +35 -0
  30. robosystems_client/models/{user_usage_response_graphs.py → auth_response_org_type_0.py} +6 -6
  31. robosystems_client/models/billing_customer.py +128 -0
  32. robosystems_client/models/checkout_response.py +130 -0
  33. robosystems_client/models/checkout_status_response.py +130 -0
  34. robosystems_client/models/create_checkout_request.py +88 -0
  35. robosystems_client/models/create_checkout_request_resource_config.py +44 -0
  36. robosystems_client/models/create_org_request.py +79 -0
  37. robosystems_client/models/graph_subscription_tier.py +40 -48
  38. robosystems_client/models/graph_subscriptions.py +17 -5
  39. robosystems_client/models/invite_member_request.py +93 -0
  40. robosystems_client/models/invoice.py +244 -0
  41. robosystems_client/models/invoice_line_item.py +118 -0
  42. robosystems_client/models/invoices_response.py +90 -0
  43. robosystems_client/models/list_org_graphs_response_200_item.py +44 -0
  44. robosystems_client/models/org_detail_response.py +174 -0
  45. robosystems_client/models/org_detail_response_graphs_item.py +44 -0
  46. robosystems_client/models/org_detail_response_limits_type_0.py +44 -0
  47. robosystems_client/models/org_detail_response_members_item.py +44 -0
  48. robosystems_client/models/org_limits_response.py +98 -0
  49. robosystems_client/models/org_limits_response_current_usage.py +44 -0
  50. robosystems_client/models/org_list_response.py +82 -0
  51. robosystems_client/models/org_member_list_response.py +90 -0
  52. robosystems_client/models/org_member_response.py +104 -0
  53. robosystems_client/models/org_response.py +121 -0
  54. robosystems_client/models/org_role.py +10 -0
  55. robosystems_client/models/org_type.py +10 -0
  56. robosystems_client/models/org_usage_response.py +146 -0
  57. robosystems_client/models/org_usage_response_daily_trend_item.py +44 -0
  58. robosystems_client/models/org_usage_response_graph_details_item.py +44 -0
  59. robosystems_client/models/org_usage_summary.py +158 -0
  60. robosystems_client/models/payment_method.py +158 -0
  61. robosystems_client/models/repository_subscriptions.py +15 -4
  62. robosystems_client/models/service_offerings_response.py +15 -0
  63. robosystems_client/models/upcoming_invoice.py +128 -0
  64. robosystems_client/models/update_member_role_request.py +62 -0
  65. robosystems_client/models/update_org_request.py +103 -0
  66. robosystems_client/models/update_payment_method_request.py +60 -0
  67. robosystems_client/models/update_payment_method_response.py +74 -0
  68. {robosystems_client-0.2.10.dist-info → robosystems_client-0.2.12.dist-info}/METADATA +1 -1
  69. {robosystems_client-0.2.10.dist-info → robosystems_client-0.2.12.dist-info}/RECORD +71 -17
  70. robosystems_client/models/user_limits_response.py +0 -95
  71. robosystems_client/models/user_usage_response.py +0 -90
  72. {robosystems_client-0.2.10.dist-info → robosystems_client-0.2.12.dist-info}/WHEEL +0 -0
  73. {robosystems_client-0.2.10.dist-info → robosystems_client-0.2.12.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,158 @@
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
+ T = TypeVar("T", bound="OrgUsageSummary")
8
+
9
+
10
+ @_attrs_define
11
+ class OrgUsageSummary:
12
+ """Organization usage summary.
13
+
14
+ Attributes:
15
+ total_credits_used (float):
16
+ total_ai_operations (int):
17
+ total_storage_gb (float):
18
+ total_api_calls (int):
19
+ daily_avg_credits (float):
20
+ daily_avg_api_calls (float):
21
+ projected_monthly_credits (float):
22
+ projected_monthly_api_calls (int):
23
+ credits_limit (Union[None, int]):
24
+ api_calls_limit (Union[None, int]):
25
+ storage_limit_gb (Union[None, int]):
26
+ """
27
+
28
+ total_credits_used: float
29
+ total_ai_operations: int
30
+ total_storage_gb: float
31
+ total_api_calls: int
32
+ daily_avg_credits: float
33
+ daily_avg_api_calls: float
34
+ projected_monthly_credits: float
35
+ projected_monthly_api_calls: int
36
+ credits_limit: Union[None, int]
37
+ api_calls_limit: Union[None, int]
38
+ storage_limit_gb: Union[None, int]
39
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
40
+
41
+ def to_dict(self) -> dict[str, Any]:
42
+ total_credits_used = self.total_credits_used
43
+
44
+ total_ai_operations = self.total_ai_operations
45
+
46
+ total_storage_gb = self.total_storage_gb
47
+
48
+ total_api_calls = self.total_api_calls
49
+
50
+ daily_avg_credits = self.daily_avg_credits
51
+
52
+ daily_avg_api_calls = self.daily_avg_api_calls
53
+
54
+ projected_monthly_credits = self.projected_monthly_credits
55
+
56
+ projected_monthly_api_calls = self.projected_monthly_api_calls
57
+
58
+ credits_limit: Union[None, int]
59
+ credits_limit = self.credits_limit
60
+
61
+ api_calls_limit: Union[None, int]
62
+ api_calls_limit = self.api_calls_limit
63
+
64
+ storage_limit_gb: Union[None, int]
65
+ storage_limit_gb = self.storage_limit_gb
66
+
67
+ field_dict: dict[str, Any] = {}
68
+ field_dict.update(self.additional_properties)
69
+ field_dict.update(
70
+ {
71
+ "total_credits_used": total_credits_used,
72
+ "total_ai_operations": total_ai_operations,
73
+ "total_storage_gb": total_storage_gb,
74
+ "total_api_calls": total_api_calls,
75
+ "daily_avg_credits": daily_avg_credits,
76
+ "daily_avg_api_calls": daily_avg_api_calls,
77
+ "projected_monthly_credits": projected_monthly_credits,
78
+ "projected_monthly_api_calls": projected_monthly_api_calls,
79
+ "credits_limit": credits_limit,
80
+ "api_calls_limit": api_calls_limit,
81
+ "storage_limit_gb": storage_limit_gb,
82
+ }
83
+ )
84
+
85
+ return field_dict
86
+
87
+ @classmethod
88
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
89
+ d = dict(src_dict)
90
+ total_credits_used = d.pop("total_credits_used")
91
+
92
+ total_ai_operations = d.pop("total_ai_operations")
93
+
94
+ total_storage_gb = d.pop("total_storage_gb")
95
+
96
+ total_api_calls = d.pop("total_api_calls")
97
+
98
+ daily_avg_credits = d.pop("daily_avg_credits")
99
+
100
+ daily_avg_api_calls = d.pop("daily_avg_api_calls")
101
+
102
+ projected_monthly_credits = d.pop("projected_monthly_credits")
103
+
104
+ projected_monthly_api_calls = d.pop("projected_monthly_api_calls")
105
+
106
+ def _parse_credits_limit(data: object) -> Union[None, int]:
107
+ if data is None:
108
+ return data
109
+ return cast(Union[None, int], data)
110
+
111
+ credits_limit = _parse_credits_limit(d.pop("credits_limit"))
112
+
113
+ def _parse_api_calls_limit(data: object) -> Union[None, int]:
114
+ if data is None:
115
+ return data
116
+ return cast(Union[None, int], data)
117
+
118
+ api_calls_limit = _parse_api_calls_limit(d.pop("api_calls_limit"))
119
+
120
+ def _parse_storage_limit_gb(data: object) -> Union[None, int]:
121
+ if data is None:
122
+ return data
123
+ return cast(Union[None, int], data)
124
+
125
+ storage_limit_gb = _parse_storage_limit_gb(d.pop("storage_limit_gb"))
126
+
127
+ org_usage_summary = cls(
128
+ total_credits_used=total_credits_used,
129
+ total_ai_operations=total_ai_operations,
130
+ total_storage_gb=total_storage_gb,
131
+ total_api_calls=total_api_calls,
132
+ daily_avg_credits=daily_avg_credits,
133
+ daily_avg_api_calls=daily_avg_api_calls,
134
+ projected_monthly_credits=projected_monthly_credits,
135
+ projected_monthly_api_calls=projected_monthly_api_calls,
136
+ credits_limit=credits_limit,
137
+ api_calls_limit=api_calls_limit,
138
+ storage_limit_gb=storage_limit_gb,
139
+ )
140
+
141
+ org_usage_summary.additional_properties = d
142
+ return org_usage_summary
143
+
144
+ @property
145
+ def additional_keys(self) -> list[str]:
146
+ return list(self.additional_properties.keys())
147
+
148
+ def __getitem__(self, key: str) -> Any:
149
+ return self.additional_properties[key]
150
+
151
+ def __setitem__(self, key: str, value: Any) -> None:
152
+ self.additional_properties[key] = value
153
+
154
+ def __delitem__(self, key: str) -> None:
155
+ del self.additional_properties[key]
156
+
157
+ def __contains__(self, key: str) -> bool:
158
+ return key in self.additional_properties
@@ -0,0 +1,158 @@
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="PaymentMethod")
10
+
11
+
12
+ @_attrs_define
13
+ class PaymentMethod:
14
+ """Payment method information.
15
+
16
+ Attributes:
17
+ id (str): Payment method ID
18
+ type_ (str): Payment method type (card, bank_account, etc.)
19
+ is_default (bool): Whether this is the default payment method
20
+ brand (Union[None, Unset, str]): Card brand (visa, mastercard, etc.)
21
+ last4 (Union[None, Unset, str]): Last 4 digits
22
+ exp_month (Union[None, Unset, int]): Expiration month
23
+ exp_year (Union[None, Unset, int]): Expiration year
24
+ """
25
+
26
+ id: str
27
+ type_: str
28
+ is_default: bool
29
+ brand: Union[None, Unset, str] = UNSET
30
+ last4: Union[None, Unset, str] = UNSET
31
+ exp_month: Union[None, Unset, int] = UNSET
32
+ exp_year: Union[None, Unset, int] = UNSET
33
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
34
+
35
+ def to_dict(self) -> dict[str, Any]:
36
+ id = self.id
37
+
38
+ type_ = self.type_
39
+
40
+ is_default = self.is_default
41
+
42
+ brand: Union[None, Unset, str]
43
+ if isinstance(self.brand, Unset):
44
+ brand = UNSET
45
+ else:
46
+ brand = self.brand
47
+
48
+ last4: Union[None, Unset, str]
49
+ if isinstance(self.last4, Unset):
50
+ last4 = UNSET
51
+ else:
52
+ last4 = self.last4
53
+
54
+ exp_month: Union[None, Unset, int]
55
+ if isinstance(self.exp_month, Unset):
56
+ exp_month = UNSET
57
+ else:
58
+ exp_month = self.exp_month
59
+
60
+ exp_year: Union[None, Unset, int]
61
+ if isinstance(self.exp_year, Unset):
62
+ exp_year = UNSET
63
+ else:
64
+ exp_year = self.exp_year
65
+
66
+ field_dict: dict[str, Any] = {}
67
+ field_dict.update(self.additional_properties)
68
+ field_dict.update(
69
+ {
70
+ "id": id,
71
+ "type": type_,
72
+ "is_default": is_default,
73
+ }
74
+ )
75
+ if brand is not UNSET:
76
+ field_dict["brand"] = brand
77
+ if last4 is not UNSET:
78
+ field_dict["last4"] = last4
79
+ if exp_month is not UNSET:
80
+ field_dict["exp_month"] = exp_month
81
+ if exp_year is not UNSET:
82
+ field_dict["exp_year"] = exp_year
83
+
84
+ return field_dict
85
+
86
+ @classmethod
87
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
88
+ d = dict(src_dict)
89
+ id = d.pop("id")
90
+
91
+ type_ = d.pop("type")
92
+
93
+ is_default = d.pop("is_default")
94
+
95
+ def _parse_brand(data: object) -> Union[None, Unset, str]:
96
+ if data is None:
97
+ return data
98
+ if isinstance(data, Unset):
99
+ return data
100
+ return cast(Union[None, Unset, str], data)
101
+
102
+ brand = _parse_brand(d.pop("brand", UNSET))
103
+
104
+ def _parse_last4(data: object) -> Union[None, Unset, str]:
105
+ if data is None:
106
+ return data
107
+ if isinstance(data, Unset):
108
+ return data
109
+ return cast(Union[None, Unset, str], data)
110
+
111
+ last4 = _parse_last4(d.pop("last4", UNSET))
112
+
113
+ def _parse_exp_month(data: object) -> Union[None, Unset, int]:
114
+ if data is None:
115
+ return data
116
+ if isinstance(data, Unset):
117
+ return data
118
+ return cast(Union[None, Unset, int], data)
119
+
120
+ exp_month = _parse_exp_month(d.pop("exp_month", UNSET))
121
+
122
+ def _parse_exp_year(data: object) -> Union[None, Unset, int]:
123
+ if data is None:
124
+ return data
125
+ if isinstance(data, Unset):
126
+ return data
127
+ return cast(Union[None, Unset, int], data)
128
+
129
+ exp_year = _parse_exp_year(d.pop("exp_year", UNSET))
130
+
131
+ payment_method = cls(
132
+ id=id,
133
+ type_=type_,
134
+ is_default=is_default,
135
+ brand=brand,
136
+ last4=last4,
137
+ exp_month=exp_month,
138
+ exp_year=exp_year,
139
+ )
140
+
141
+ payment_method.additional_properties = d
142
+ return payment_method
143
+
144
+ @property
145
+ def additional_keys(self) -> list[str]:
146
+ return list(self.additional_properties.keys())
147
+
148
+ def __getitem__(self, key: str) -> Any:
149
+ return self.additional_properties[key]
150
+
151
+ def __setitem__(self, key: str, value: Any) -> None:
152
+ self.additional_properties[key] = value
153
+
154
+ def __delitem__(self, key: str) -> None:
155
+ del self.additional_properties[key]
156
+
157
+ def __contains__(self, key: str) -> bool:
158
+ return key in self.additional_properties
@@ -15,13 +15,18 @@ T = TypeVar("T", bound="RepositorySubscriptions")
15
15
  class RepositorySubscriptions:
16
16
  """Repository subscription offerings.
17
17
 
18
- Attributes:
19
- description (str): Description of repository subscriptions
20
- repositories (list['RepositoryInfo']): Available repositories
21
- notes (list[str]): Important notes
18
+ Repository subscriptions are per-organization, not per-graph. All members
19
+ of an organization share access to subscribed repositories.
20
+
21
+ Attributes:
22
+ description (str): Description of repository subscriptions
23
+ pricing_model (str): Pricing model type (per_graph or per_organization)
24
+ repositories (list['RepositoryInfo']): Available repositories
25
+ notes (list[str]): Important notes
22
26
  """
23
27
 
24
28
  description: str
29
+ pricing_model: str
25
30
  repositories: list["RepositoryInfo"]
26
31
  notes: list[str]
27
32
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
@@ -29,6 +34,8 @@ class RepositorySubscriptions:
29
34
  def to_dict(self) -> dict[str, Any]:
30
35
  description = self.description
31
36
 
37
+ pricing_model = self.pricing_model
38
+
32
39
  repositories = []
33
40
  for repositories_item_data in self.repositories:
34
41
  repositories_item = repositories_item_data.to_dict()
@@ -41,6 +48,7 @@ class RepositorySubscriptions:
41
48
  field_dict.update(
42
49
  {
43
50
  "description": description,
51
+ "pricing_model": pricing_model,
44
52
  "repositories": repositories,
45
53
  "notes": notes,
46
54
  }
@@ -55,6 +63,8 @@ class RepositorySubscriptions:
55
63
  d = dict(src_dict)
56
64
  description = d.pop("description")
57
65
 
66
+ pricing_model = d.pop("pricing_model")
67
+
58
68
  repositories = []
59
69
  _repositories = d.pop("repositories")
60
70
  for repositories_item_data in _repositories:
@@ -66,6 +76,7 @@ class RepositorySubscriptions:
66
76
 
67
77
  repository_subscriptions = cls(
68
78
  description=description,
79
+ pricing_model=pricing_model,
69
80
  repositories=repositories,
70
81
  notes=notes,
71
82
  )
@@ -19,12 +19,21 @@ class ServiceOfferingsResponse:
19
19
  """Complete service offerings response.
20
20
 
21
21
  Attributes:
22
+ billing_enabled (bool): Whether billing and payments are enabled
22
23
  graph_subscriptions (GraphSubscriptions): Graph subscription offerings.
24
+
25
+ Graph subscriptions are per-graph, not per-organization. Each graph
26
+ created by an organization has its own subscription with its own
27
+ infrastructure tier, pricing, and credit allocation.
23
28
  repository_subscriptions (RepositorySubscriptions): Repository subscription offerings.
29
+
30
+ Repository subscriptions are per-organization, not per-graph. All members
31
+ of an organization share access to subscribed repositories.
24
32
  operation_costs (OperationCosts): Operation cost information.
25
33
  summary (ServiceOfferingSummary): Summary of service offerings.
26
34
  """
27
35
 
36
+ billing_enabled: bool
28
37
  graph_subscriptions: "GraphSubscriptions"
29
38
  repository_subscriptions: "RepositorySubscriptions"
30
39
  operation_costs: "OperationCosts"
@@ -32,6 +41,8 @@ class ServiceOfferingsResponse:
32
41
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
33
42
 
34
43
  def to_dict(self) -> dict[str, Any]:
44
+ billing_enabled = self.billing_enabled
45
+
35
46
  graph_subscriptions = self.graph_subscriptions.to_dict()
36
47
 
37
48
  repository_subscriptions = self.repository_subscriptions.to_dict()
@@ -44,6 +55,7 @@ class ServiceOfferingsResponse:
44
55
  field_dict.update(self.additional_properties)
45
56
  field_dict.update(
46
57
  {
58
+ "billing_enabled": billing_enabled,
47
59
  "graph_subscriptions": graph_subscriptions,
48
60
  "repository_subscriptions": repository_subscriptions,
49
61
  "operation_costs": operation_costs,
@@ -61,6 +73,8 @@ class ServiceOfferingsResponse:
61
73
  from ..models.service_offering_summary import ServiceOfferingSummary
62
74
 
63
75
  d = dict(src_dict)
76
+ billing_enabled = d.pop("billing_enabled")
77
+
64
78
  graph_subscriptions = GraphSubscriptions.from_dict(d.pop("graph_subscriptions"))
65
79
 
66
80
  repository_subscriptions = RepositorySubscriptions.from_dict(
@@ -72,6 +86,7 @@ class ServiceOfferingsResponse:
72
86
  summary = ServiceOfferingSummary.from_dict(d.pop("summary"))
73
87
 
74
88
  service_offerings_response = cls(
89
+ billing_enabled=billing_enabled,
75
90
  graph_subscriptions=graph_subscriptions,
76
91
  repository_subscriptions=repository_subscriptions,
77
92
  operation_costs=operation_costs,
@@ -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.invoice_line_item import InvoiceLineItem
11
+
12
+
13
+ T = TypeVar("T", bound="UpcomingInvoice")
14
+
15
+
16
+ @_attrs_define
17
+ class UpcomingInvoice:
18
+ """Upcoming invoice preview.
19
+
20
+ Attributes:
21
+ amount_due (int): Estimated amount due in cents
22
+ currency (str): Currency code
23
+ period_start (str): Billing period start
24
+ period_end (str): Billing period end
25
+ line_items (list['InvoiceLineItem']): Estimated line items
26
+ subscription_id (Union[None, Unset, str]): Associated subscription ID
27
+ """
28
+
29
+ amount_due: int
30
+ currency: str
31
+ period_start: str
32
+ period_end: str
33
+ line_items: list["InvoiceLineItem"]
34
+ subscription_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
+ amount_due = self.amount_due
39
+
40
+ currency = self.currency
41
+
42
+ period_start = self.period_start
43
+
44
+ period_end = self.period_end
45
+
46
+ line_items = []
47
+ for line_items_item_data in self.line_items:
48
+ line_items_item = line_items_item_data.to_dict()
49
+ line_items.append(line_items_item)
50
+
51
+ subscription_id: Union[None, Unset, str]
52
+ if isinstance(self.subscription_id, Unset):
53
+ subscription_id = UNSET
54
+ else:
55
+ subscription_id = self.subscription_id
56
+
57
+ field_dict: dict[str, Any] = {}
58
+ field_dict.update(self.additional_properties)
59
+ field_dict.update(
60
+ {
61
+ "amount_due": amount_due,
62
+ "currency": currency,
63
+ "period_start": period_start,
64
+ "period_end": period_end,
65
+ "line_items": line_items,
66
+ }
67
+ )
68
+ if subscription_id is not UNSET:
69
+ field_dict["subscription_id"] = subscription_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.invoice_line_item import InvoiceLineItem
76
+
77
+ d = dict(src_dict)
78
+ amount_due = d.pop("amount_due")
79
+
80
+ currency = d.pop("currency")
81
+
82
+ period_start = d.pop("period_start")
83
+
84
+ period_end = d.pop("period_end")
85
+
86
+ line_items = []
87
+ _line_items = d.pop("line_items")
88
+ for line_items_item_data in _line_items:
89
+ line_items_item = InvoiceLineItem.from_dict(line_items_item_data)
90
+
91
+ line_items.append(line_items_item)
92
+
93
+ def _parse_subscription_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
+ subscription_id = _parse_subscription_id(d.pop("subscription_id", UNSET))
101
+
102
+ upcoming_invoice = cls(
103
+ amount_due=amount_due,
104
+ currency=currency,
105
+ period_start=period_start,
106
+ period_end=period_end,
107
+ line_items=line_items,
108
+ subscription_id=subscription_id,
109
+ )
110
+
111
+ upcoming_invoice.additional_properties = d
112
+ return upcoming_invoice
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,62 @@
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
+ from ..models.org_role import OrgRole
8
+
9
+ T = TypeVar("T", bound="UpdateMemberRoleRequest")
10
+
11
+
12
+ @_attrs_define
13
+ class UpdateMemberRoleRequest:
14
+ """Request to update a member's role.
15
+
16
+ Attributes:
17
+ role (OrgRole):
18
+ """
19
+
20
+ role: OrgRole
21
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
22
+
23
+ def to_dict(self) -> dict[str, Any]:
24
+ role = self.role.value
25
+
26
+ field_dict: dict[str, Any] = {}
27
+ field_dict.update(self.additional_properties)
28
+ field_dict.update(
29
+ {
30
+ "role": role,
31
+ }
32
+ )
33
+
34
+ return field_dict
35
+
36
+ @classmethod
37
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
38
+ d = dict(src_dict)
39
+ role = OrgRole(d.pop("role"))
40
+
41
+ update_member_role_request = cls(
42
+ role=role,
43
+ )
44
+
45
+ update_member_role_request.additional_properties = d
46
+ return update_member_role_request
47
+
48
+ @property
49
+ def additional_keys(self) -> list[str]:
50
+ return list(self.additional_properties.keys())
51
+
52
+ def __getitem__(self, key: str) -> Any:
53
+ return self.additional_properties[key]
54
+
55
+ def __setitem__(self, key: str, value: Any) -> None:
56
+ self.additional_properties[key] = value
57
+
58
+ def __delitem__(self, key: str) -> None:
59
+ del self.additional_properties[key]
60
+
61
+ def __contains__(self, key: str) -> bool:
62
+ return key in self.additional_properties