robosystems-client 0.2.8__py3-none-any.whl → 0.2.10__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 (77) hide show
  1. robosystems_client/api/graphs/get_graphs.py +120 -92
  2. robosystems_client/api/{user_subscriptions/cancel_shared_repository_subscription.py → subscriptions/cancel_subscription.py} +41 -25
  3. robosystems_client/api/subscriptions/create_repository_subscription.py +217 -0
  4. robosystems_client/api/subscriptions/get_graph_subscription.py +197 -0
  5. robosystems_client/api/{user_subscriptions/upgrade_shared_repository_subscription.py → subscriptions/upgrade_subscription.py} +57 -55
  6. robosystems_client/api/usage/get_graph_usage_analytics.py +377 -0
  7. robosystems_client/api/{user_limits/get_user_usage.py → user/get_user_limits.py} +13 -9
  8. robosystems_client/models/__init__.py +18 -82
  9. robosystems_client/models/{credits_summary_response_credits_by_addon_type_0_item.py → create_repository_subscription_request.py} +22 -6
  10. robosystems_client/models/credit_summary.py +55 -89
  11. robosystems_client/models/{graph_usage_response_storage_usage.py → credit_summary_operation_breakdown.py} +6 -6
  12. robosystems_client/models/graph_info.py +33 -2
  13. robosystems_client/models/graph_subscription_response.py +200 -0
  14. robosystems_client/models/graph_tier_instance.py +7 -7
  15. robosystems_client/models/graph_usage_response.py +136 -39
  16. robosystems_client/models/{user_analytics_response_limits.py → graph_usage_response_recent_events_item.py} +6 -6
  17. robosystems_client/models/performance_insights.py +120 -0
  18. robosystems_client/models/{graph_usage_response_recent_activity.py → performance_insights_operation_stats.py} +6 -6
  19. robosystems_client/models/{user_analytics_response_api_usage.py → performance_insights_slow_queries_item.py} +6 -6
  20. robosystems_client/models/storage_summary.py +100 -0
  21. robosystems_client/models/{tier_upgrade_request.py → upgrade_subscription_request.py} +12 -14
  22. {robosystems_client-0.2.8.dist-info → robosystems_client-0.2.10.dist-info}/METADATA +1 -1
  23. {robosystems_client-0.2.8.dist-info → robosystems_client-0.2.10.dist-info}/RECORD +34 -71
  24. robosystems_client/api/graph_analytics/get_graph_usage_stats.py +0 -289
  25. robosystems_client/api/graph_billing/get_current_graph_bill.py +0 -253
  26. robosystems_client/api/graph_billing/get_graph_billing_history.py +0 -298
  27. robosystems_client/api/graph_billing/get_graph_monthly_bill.py +0 -284
  28. robosystems_client/api/graph_billing/get_graph_usage_details.py +0 -320
  29. robosystems_client/api/user/get_all_credit_summaries.py +0 -169
  30. robosystems_client/api/user_analytics/__init__.py +0 -1
  31. robosystems_client/api/user_analytics/get_detailed_user_analytics.py +0 -188
  32. robosystems_client/api/user_analytics/get_user_usage_overview.py +0 -135
  33. robosystems_client/api/user_limits/__init__.py +0 -1
  34. robosystems_client/api/user_limits/get_all_shared_repository_limits.py +0 -141
  35. robosystems_client/api/user_limits/get_shared_repository_limits.py +0 -213
  36. robosystems_client/api/user_limits/get_user_limits.py +0 -139
  37. robosystems_client/api/user_subscriptions/__init__.py +0 -1
  38. robosystems_client/api/user_subscriptions/get_repository_credits.py +0 -173
  39. robosystems_client/api/user_subscriptions/get_shared_repository_credits.py +0 -143
  40. robosystems_client/api/user_subscriptions/get_user_shared_subscriptions.py +0 -181
  41. robosystems_client/api/user_subscriptions/subscribe_to_shared_repository.py +0 -186
  42. robosystems_client/models/add_on_credit_info.py +0 -119
  43. robosystems_client/models/credits_summary_response.py +0 -148
  44. robosystems_client/models/get_all_credit_summaries_response_getallcreditsummaries.py +0 -44
  45. robosystems_client/models/get_all_shared_repository_limits_response_getallsharedrepositorylimits.py +0 -46
  46. robosystems_client/models/get_current_graph_bill_response_getcurrentgraphbill.py +0 -44
  47. robosystems_client/models/get_graph_billing_history_response_getgraphbillinghistory.py +0 -44
  48. robosystems_client/models/get_graph_monthly_bill_response_getgraphmonthlybill.py +0 -44
  49. robosystems_client/models/get_graph_usage_details_response_getgraphusagedetails.py +0 -44
  50. robosystems_client/models/get_shared_repository_limits_response_getsharedrepositorylimits.py +0 -44
  51. robosystems_client/models/graph_usage_response_query_statistics.py +0 -44
  52. robosystems_client/models/repository_credits_response.py +0 -128
  53. robosystems_client/models/repository_plan.py +0 -10
  54. robosystems_client/models/repository_type.py +0 -10
  55. robosystems_client/models/subscription_info.py +0 -152
  56. robosystems_client/models/subscription_info_metadata.py +0 -44
  57. robosystems_client/models/subscription_request.py +0 -80
  58. robosystems_client/models/subscription_response.py +0 -74
  59. robosystems_client/models/user_analytics_response.py +0 -132
  60. robosystems_client/models/user_analytics_response_graph_usage.py +0 -44
  61. robosystems_client/models/user_analytics_response_recent_activity_item.py +0 -44
  62. robosystems_client/models/user_analytics_response_user_info.py +0 -44
  63. robosystems_client/models/user_graph_summary.py +0 -134
  64. robosystems_client/models/user_subscriptions_response.py +0 -90
  65. robosystems_client/models/user_usage_summary_response.py +0 -130
  66. robosystems_client/models/user_usage_summary_response_usage_vs_limits.py +0 -44
  67. /robosystems_client/api/{graph_analytics → credits_}/__init__.py +0 -0
  68. /robosystems_client/api/{graph_credits → credits_}/check_credit_balance.py +0 -0
  69. /robosystems_client/api/{graph_credits → credits_}/check_storage_limits.py +0 -0
  70. /robosystems_client/api/{graph_credits → credits_}/get_credit_summary.py +0 -0
  71. /robosystems_client/api/{graph_credits → credits_}/get_storage_usage.py +0 -0
  72. /robosystems_client/api/{graph_credits → credits_}/list_credit_transactions.py +0 -0
  73. /robosystems_client/api/{graph_billing → subscriptions}/__init__.py +0 -0
  74. /robosystems_client/api/{graph_credits → usage}/__init__.py +0 -0
  75. /robosystems_client/api/{graph_analytics → usage}/get_graph_metrics.py +0 -0
  76. {robosystems_client-0.2.8.dist-info → robosystems_client-0.2.10.dist-info}/WHEEL +0 -0
  77. {robosystems_client-0.2.8.dist-info → robosystems_client-0.2.10.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,200 @@
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="GraphSubscriptionResponse")
10
+
11
+
12
+ @_attrs_define
13
+ class GraphSubscriptionResponse:
14
+ """Response for graph or repository subscription details.
15
+
16
+ Attributes:
17
+ id (str): Subscription ID
18
+ resource_type (str): Resource type (graph or repository)
19
+ resource_id (str): Resource identifier
20
+ plan_name (str): Current plan name
21
+ billing_interval (str): Billing interval
22
+ status (str): Subscription status
23
+ base_price_cents (int): Base price in cents
24
+ created_at (str): Creation timestamp
25
+ current_period_start (Union[None, Unset, str]): Current billing period start
26
+ current_period_end (Union[None, Unset, str]): Current billing period end
27
+ started_at (Union[None, Unset, str]): Subscription start date
28
+ canceled_at (Union[None, Unset, str]): Cancellation date
29
+ """
30
+
31
+ id: str
32
+ resource_type: str
33
+ resource_id: str
34
+ plan_name: str
35
+ billing_interval: str
36
+ status: str
37
+ base_price_cents: int
38
+ created_at: str
39
+ current_period_start: Union[None, Unset, str] = UNSET
40
+ current_period_end: Union[None, Unset, str] = UNSET
41
+ started_at: Union[None, Unset, str] = UNSET
42
+ canceled_at: Union[None, Unset, str] = UNSET
43
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
44
+
45
+ def to_dict(self) -> dict[str, Any]:
46
+ id = self.id
47
+
48
+ resource_type = self.resource_type
49
+
50
+ resource_id = self.resource_id
51
+
52
+ plan_name = self.plan_name
53
+
54
+ billing_interval = self.billing_interval
55
+
56
+ status = self.status
57
+
58
+ base_price_cents = self.base_price_cents
59
+
60
+ created_at = self.created_at
61
+
62
+ current_period_start: Union[None, Unset, str]
63
+ if isinstance(self.current_period_start, Unset):
64
+ current_period_start = UNSET
65
+ else:
66
+ current_period_start = self.current_period_start
67
+
68
+ current_period_end: Union[None, Unset, str]
69
+ if isinstance(self.current_period_end, Unset):
70
+ current_period_end = UNSET
71
+ else:
72
+ current_period_end = self.current_period_end
73
+
74
+ started_at: Union[None, Unset, str]
75
+ if isinstance(self.started_at, Unset):
76
+ started_at = UNSET
77
+ else:
78
+ started_at = self.started_at
79
+
80
+ canceled_at: Union[None, Unset, str]
81
+ if isinstance(self.canceled_at, Unset):
82
+ canceled_at = UNSET
83
+ else:
84
+ canceled_at = self.canceled_at
85
+
86
+ field_dict: dict[str, Any] = {}
87
+ field_dict.update(self.additional_properties)
88
+ field_dict.update(
89
+ {
90
+ "id": id,
91
+ "resource_type": resource_type,
92
+ "resource_id": resource_id,
93
+ "plan_name": plan_name,
94
+ "billing_interval": billing_interval,
95
+ "status": status,
96
+ "base_price_cents": base_price_cents,
97
+ "created_at": created_at,
98
+ }
99
+ )
100
+ if current_period_start is not UNSET:
101
+ field_dict["current_period_start"] = current_period_start
102
+ if current_period_end is not UNSET:
103
+ field_dict["current_period_end"] = current_period_end
104
+ if started_at is not UNSET:
105
+ field_dict["started_at"] = started_at
106
+ if canceled_at is not UNSET:
107
+ field_dict["canceled_at"] = canceled_at
108
+
109
+ return field_dict
110
+
111
+ @classmethod
112
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
113
+ d = dict(src_dict)
114
+ id = d.pop("id")
115
+
116
+ resource_type = d.pop("resource_type")
117
+
118
+ resource_id = d.pop("resource_id")
119
+
120
+ plan_name = d.pop("plan_name")
121
+
122
+ billing_interval = d.pop("billing_interval")
123
+
124
+ status = d.pop("status")
125
+
126
+ base_price_cents = d.pop("base_price_cents")
127
+
128
+ created_at = d.pop("created_at")
129
+
130
+ def _parse_current_period_start(data: object) -> Union[None, Unset, str]:
131
+ if data is None:
132
+ return data
133
+ if isinstance(data, Unset):
134
+ return data
135
+ return cast(Union[None, Unset, str], data)
136
+
137
+ current_period_start = _parse_current_period_start(
138
+ d.pop("current_period_start", UNSET)
139
+ )
140
+
141
+ def _parse_current_period_end(data: object) -> Union[None, Unset, str]:
142
+ if data is None:
143
+ return data
144
+ if isinstance(data, Unset):
145
+ return data
146
+ return cast(Union[None, Unset, str], data)
147
+
148
+ current_period_end = _parse_current_period_end(d.pop("current_period_end", UNSET))
149
+
150
+ def _parse_started_at(data: object) -> Union[None, Unset, str]:
151
+ if data is None:
152
+ return data
153
+ if isinstance(data, Unset):
154
+ return data
155
+ return cast(Union[None, Unset, str], data)
156
+
157
+ started_at = _parse_started_at(d.pop("started_at", UNSET))
158
+
159
+ def _parse_canceled_at(data: object) -> Union[None, Unset, str]:
160
+ if data is None:
161
+ return data
162
+ if isinstance(data, Unset):
163
+ return data
164
+ return cast(Union[None, Unset, str], data)
165
+
166
+ canceled_at = _parse_canceled_at(d.pop("canceled_at", UNSET))
167
+
168
+ graph_subscription_response = cls(
169
+ id=id,
170
+ resource_type=resource_type,
171
+ resource_id=resource_id,
172
+ plan_name=plan_name,
173
+ billing_interval=billing_interval,
174
+ status=status,
175
+ base_price_cents=base_price_cents,
176
+ created_at=created_at,
177
+ current_period_start=current_period_start,
178
+ current_period_end=current_period_end,
179
+ started_at=started_at,
180
+ canceled_at=canceled_at,
181
+ )
182
+
183
+ graph_subscription_response.additional_properties = d
184
+ return graph_subscription_response
185
+
186
+ @property
187
+ def additional_keys(self) -> list[str]:
188
+ return list(self.additional_properties.keys())
189
+
190
+ def __getitem__(self, key: str) -> Any:
191
+ return self.additional_properties[key]
192
+
193
+ def __setitem__(self, key: str, value: Any) -> None:
194
+ self.additional_properties[key] = value
195
+
196
+ def __delitem__(self, key: str) -> None:
197
+ del self.additional_properties[key]
198
+
199
+ def __contains__(self, key: str) -> bool:
200
+ return key in self.additional_properties
@@ -13,13 +13,13 @@ class GraphTierInstance:
13
13
 
14
14
  Attributes:
15
15
  type_ (str): Instance type identifier
16
- memory_mb (int): Memory in megabytes
17
- databases_per_instance (int): Databases per instance
16
+ memory_mb (int): Memory allocated to your graph in megabytes
17
+ is_multitenant (bool): Whether this tier shares infrastructure with other graphs
18
18
  """
19
19
 
20
20
  type_: str
21
21
  memory_mb: int
22
- databases_per_instance: int
22
+ is_multitenant: bool
23
23
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
24
24
 
25
25
  def to_dict(self) -> dict[str, Any]:
@@ -27,7 +27,7 @@ class GraphTierInstance:
27
27
 
28
28
  memory_mb = self.memory_mb
29
29
 
30
- databases_per_instance = self.databases_per_instance
30
+ is_multitenant = self.is_multitenant
31
31
 
32
32
  field_dict: dict[str, Any] = {}
33
33
  field_dict.update(self.additional_properties)
@@ -35,7 +35,7 @@ class GraphTierInstance:
35
35
  {
36
36
  "type": type_,
37
37
  "memory_mb": memory_mb,
38
- "databases_per_instance": databases_per_instance,
38
+ "is_multitenant": is_multitenant,
39
39
  }
40
40
  )
41
41
 
@@ -48,12 +48,12 @@ class GraphTierInstance:
48
48
 
49
49
  memory_mb = d.pop("memory_mb")
50
50
 
51
- databases_per_instance = d.pop("databases_per_instance")
51
+ is_multitenant = d.pop("is_multitenant")
52
52
 
53
53
  graph_tier_instance = cls(
54
54
  type_=type_,
55
55
  memory_mb=memory_mb,
56
- databases_per_instance=databases_per_instance,
56
+ is_multitenant=is_multitenant,
57
57
  )
58
58
 
59
59
  graph_tier_instance.additional_properties = d
@@ -1,17 +1,18 @@
1
1
  from collections.abc import Mapping
2
- from typing import TYPE_CHECKING, Any, TypeVar
2
+ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
3
3
 
4
4
  from attrs import define as _attrs_define
5
5
  from attrs import field as _attrs_field
6
6
 
7
+ from ..types import UNSET, Unset
8
+
7
9
  if TYPE_CHECKING:
8
- from ..models.graph_usage_response_query_statistics import (
9
- GraphUsageResponseQueryStatistics,
10
- )
11
- from ..models.graph_usage_response_recent_activity import (
12
- GraphUsageResponseRecentActivity,
10
+ from ..models.credit_summary import CreditSummary
11
+ from ..models.graph_usage_response_recent_events_item import (
12
+ GraphUsageResponseRecentEventsItem,
13
13
  )
14
- from ..models.graph_usage_response_storage_usage import GraphUsageResponseStorageUsage
14
+ from ..models.performance_insights import PerformanceInsights
15
+ from ..models.storage_summary import StorageSummary
15
16
 
16
17
 
17
18
  T = TypeVar("T", bound="GraphUsageResponse")
@@ -23,77 +24,173 @@ class GraphUsageResponse:
23
24
 
24
25
  Attributes:
25
26
  graph_id (str): Graph database identifier
26
- storage_usage (GraphUsageResponseStorageUsage): Storage usage information
27
- query_statistics (GraphUsageResponseQueryStatistics): Query statistics
28
- recent_activity (GraphUsageResponseRecentActivity): Recent activity summary
27
+ time_range (str): Time range for usage data
29
28
  timestamp (str): Usage collection timestamp
29
+ storage_summary (Union['StorageSummary', None, Unset]): Storage usage summary
30
+ credit_summary (Union['CreditSummary', None, Unset]): Credit consumption summary
31
+ performance_insights (Union['PerformanceInsights', None, Unset]): Performance analytics
32
+ recent_events (Union[Unset, list['GraphUsageResponseRecentEventsItem']]): Recent usage events
30
33
  """
31
34
 
32
35
  graph_id: str
33
- storage_usage: "GraphUsageResponseStorageUsage"
34
- query_statistics: "GraphUsageResponseQueryStatistics"
35
- recent_activity: "GraphUsageResponseRecentActivity"
36
+ time_range: str
36
37
  timestamp: str
38
+ storage_summary: Union["StorageSummary", None, Unset] = UNSET
39
+ credit_summary: Union["CreditSummary", None, Unset] = UNSET
40
+ performance_insights: Union["PerformanceInsights", None, Unset] = UNSET
41
+ recent_events: Union[Unset, list["GraphUsageResponseRecentEventsItem"]] = UNSET
37
42
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
38
43
 
39
44
  def to_dict(self) -> dict[str, Any]:
40
- graph_id = self.graph_id
45
+ from ..models.credit_summary import CreditSummary
46
+ from ..models.performance_insights import PerformanceInsights
47
+ from ..models.storage_summary import StorageSummary
41
48
 
42
- storage_usage = self.storage_usage.to_dict()
43
-
44
- query_statistics = self.query_statistics.to_dict()
49
+ graph_id = self.graph_id
45
50
 
46
- recent_activity = self.recent_activity.to_dict()
51
+ time_range = self.time_range
47
52
 
48
53
  timestamp = self.timestamp
49
54
 
55
+ storage_summary: Union[None, Unset, dict[str, Any]]
56
+ if isinstance(self.storage_summary, Unset):
57
+ storage_summary = UNSET
58
+ elif isinstance(self.storage_summary, StorageSummary):
59
+ storage_summary = self.storage_summary.to_dict()
60
+ else:
61
+ storage_summary = self.storage_summary
62
+
63
+ credit_summary: Union[None, Unset, dict[str, Any]]
64
+ if isinstance(self.credit_summary, Unset):
65
+ credit_summary = UNSET
66
+ elif isinstance(self.credit_summary, CreditSummary):
67
+ credit_summary = self.credit_summary.to_dict()
68
+ else:
69
+ credit_summary = self.credit_summary
70
+
71
+ performance_insights: Union[None, Unset, dict[str, Any]]
72
+ if isinstance(self.performance_insights, Unset):
73
+ performance_insights = UNSET
74
+ elif isinstance(self.performance_insights, PerformanceInsights):
75
+ performance_insights = self.performance_insights.to_dict()
76
+ else:
77
+ performance_insights = self.performance_insights
78
+
79
+ recent_events: Union[Unset, list[dict[str, Any]]] = UNSET
80
+ if not isinstance(self.recent_events, Unset):
81
+ recent_events = []
82
+ for recent_events_item_data in self.recent_events:
83
+ recent_events_item = recent_events_item_data.to_dict()
84
+ recent_events.append(recent_events_item)
85
+
50
86
  field_dict: dict[str, Any] = {}
51
87
  field_dict.update(self.additional_properties)
52
88
  field_dict.update(
53
89
  {
54
90
  "graph_id": graph_id,
55
- "storage_usage": storage_usage,
56
- "query_statistics": query_statistics,
57
- "recent_activity": recent_activity,
91
+ "time_range": time_range,
58
92
  "timestamp": timestamp,
59
93
  }
60
94
  )
95
+ if storage_summary is not UNSET:
96
+ field_dict["storage_summary"] = storage_summary
97
+ if credit_summary is not UNSET:
98
+ field_dict["credit_summary"] = credit_summary
99
+ if performance_insights is not UNSET:
100
+ field_dict["performance_insights"] = performance_insights
101
+ if recent_events is not UNSET:
102
+ field_dict["recent_events"] = recent_events
61
103
 
62
104
  return field_dict
63
105
 
64
106
  @classmethod
65
107
  def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
66
- from ..models.graph_usage_response_query_statistics import (
67
- GraphUsageResponseQueryStatistics,
68
- )
69
- from ..models.graph_usage_response_recent_activity import (
70
- GraphUsageResponseRecentActivity,
71
- )
72
- from ..models.graph_usage_response_storage_usage import (
73
- GraphUsageResponseStorageUsage,
108
+ from ..models.credit_summary import CreditSummary
109
+ from ..models.graph_usage_response_recent_events_item import (
110
+ GraphUsageResponseRecentEventsItem,
74
111
  )
112
+ from ..models.performance_insights import PerformanceInsights
113
+ from ..models.storage_summary import StorageSummary
75
114
 
76
115
  d = dict(src_dict)
77
116
  graph_id = d.pop("graph_id")
78
117
 
79
- storage_usage = GraphUsageResponseStorageUsage.from_dict(d.pop("storage_usage"))
118
+ time_range = d.pop("time_range")
80
119
 
81
- query_statistics = GraphUsageResponseQueryStatistics.from_dict(
82
- d.pop("query_statistics")
83
- )
120
+ timestamp = d.pop("timestamp")
84
121
 
85
- recent_activity = GraphUsageResponseRecentActivity.from_dict(
86
- d.pop("recent_activity")
122
+ def _parse_storage_summary(data: object) -> Union["StorageSummary", None, Unset]:
123
+ if data is None:
124
+ return data
125
+ if isinstance(data, Unset):
126
+ return data
127
+ try:
128
+ if not isinstance(data, dict):
129
+ raise TypeError()
130
+ storage_summary_type_0 = StorageSummary.from_dict(data)
131
+
132
+ return storage_summary_type_0
133
+ except: # noqa: E722
134
+ pass
135
+ return cast(Union["StorageSummary", None, Unset], data)
136
+
137
+ storage_summary = _parse_storage_summary(d.pop("storage_summary", UNSET))
138
+
139
+ def _parse_credit_summary(data: object) -> Union["CreditSummary", None, Unset]:
140
+ if data is None:
141
+ return data
142
+ if isinstance(data, Unset):
143
+ return data
144
+ try:
145
+ if not isinstance(data, dict):
146
+ raise TypeError()
147
+ credit_summary_type_0 = CreditSummary.from_dict(data)
148
+
149
+ return credit_summary_type_0
150
+ except: # noqa: E722
151
+ pass
152
+ return cast(Union["CreditSummary", None, Unset], data)
153
+
154
+ credit_summary = _parse_credit_summary(d.pop("credit_summary", UNSET))
155
+
156
+ def _parse_performance_insights(
157
+ data: object,
158
+ ) -> Union["PerformanceInsights", None, Unset]:
159
+ if data is None:
160
+ return data
161
+ if isinstance(data, Unset):
162
+ return data
163
+ try:
164
+ if not isinstance(data, dict):
165
+ raise TypeError()
166
+ performance_insights_type_0 = PerformanceInsights.from_dict(data)
167
+
168
+ return performance_insights_type_0
169
+ except: # noqa: E722
170
+ pass
171
+ return cast(Union["PerformanceInsights", None, Unset], data)
172
+
173
+ performance_insights = _parse_performance_insights(
174
+ d.pop("performance_insights", UNSET)
87
175
  )
88
176
 
89
- timestamp = d.pop("timestamp")
177
+ recent_events = []
178
+ _recent_events = d.pop("recent_events", UNSET)
179
+ for recent_events_item_data in _recent_events or []:
180
+ recent_events_item = GraphUsageResponseRecentEventsItem.from_dict(
181
+ recent_events_item_data
182
+ )
183
+
184
+ recent_events.append(recent_events_item)
90
185
 
91
186
  graph_usage_response = cls(
92
187
  graph_id=graph_id,
93
- storage_usage=storage_usage,
94
- query_statistics=query_statistics,
95
- recent_activity=recent_activity,
188
+ time_range=time_range,
96
189
  timestamp=timestamp,
190
+ storage_summary=storage_summary,
191
+ credit_summary=credit_summary,
192
+ performance_insights=performance_insights,
193
+ recent_events=recent_events,
97
194
  )
98
195
 
99
196
  graph_usage_response.additional_properties = d
@@ -4,12 +4,12 @@ from typing import Any, TypeVar
4
4
  from attrs import define as _attrs_define
5
5
  from attrs import field as _attrs_field
6
6
 
7
- T = TypeVar("T", bound="UserAnalyticsResponseLimits")
7
+ T = TypeVar("T", bound="GraphUsageResponseRecentEventsItem")
8
8
 
9
9
 
10
10
  @_attrs_define
11
- class UserAnalyticsResponseLimits:
12
- """Current limits and restrictions"""
11
+ class GraphUsageResponseRecentEventsItem:
12
+ """ """
13
13
 
14
14
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
15
15
 
@@ -22,10 +22,10 @@ class UserAnalyticsResponseLimits:
22
22
  @classmethod
23
23
  def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
24
24
  d = dict(src_dict)
25
- user_analytics_response_limits = cls()
25
+ graph_usage_response_recent_events_item = cls()
26
26
 
27
- user_analytics_response_limits.additional_properties = d
28
- return user_analytics_response_limits
27
+ graph_usage_response_recent_events_item.additional_properties = d
28
+ return graph_usage_response_recent_events_item
29
29
 
30
30
  @property
31
31
  def additional_keys(self) -> list[str]:
@@ -0,0 +1,120 @@
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.performance_insights_operation_stats import (
9
+ PerformanceInsightsOperationStats,
10
+ )
11
+ from ..models.performance_insights_slow_queries_item import (
12
+ PerformanceInsightsSlowQueriesItem,
13
+ )
14
+
15
+
16
+ T = TypeVar("T", bound="PerformanceInsights")
17
+
18
+
19
+ @_attrs_define
20
+ class PerformanceInsights:
21
+ """Performance analytics.
22
+
23
+ Attributes:
24
+ analysis_period_days (int): Analysis period in days
25
+ total_operations (int): Total operations analyzed
26
+ operation_stats (PerformanceInsightsOperationStats): Performance stats by operation type
27
+ slow_queries (list['PerformanceInsightsSlowQueriesItem']): Top slow queries (over 5 seconds)
28
+ performance_score (int): Performance score (0-100)
29
+ """
30
+
31
+ analysis_period_days: int
32
+ total_operations: int
33
+ operation_stats: "PerformanceInsightsOperationStats"
34
+ slow_queries: list["PerformanceInsightsSlowQueriesItem"]
35
+ performance_score: int
36
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
37
+
38
+ def to_dict(self) -> dict[str, Any]:
39
+ analysis_period_days = self.analysis_period_days
40
+
41
+ total_operations = self.total_operations
42
+
43
+ operation_stats = self.operation_stats.to_dict()
44
+
45
+ slow_queries = []
46
+ for slow_queries_item_data in self.slow_queries:
47
+ slow_queries_item = slow_queries_item_data.to_dict()
48
+ slow_queries.append(slow_queries_item)
49
+
50
+ performance_score = self.performance_score
51
+
52
+ field_dict: dict[str, Any] = {}
53
+ field_dict.update(self.additional_properties)
54
+ field_dict.update(
55
+ {
56
+ "analysis_period_days": analysis_period_days,
57
+ "total_operations": total_operations,
58
+ "operation_stats": operation_stats,
59
+ "slow_queries": slow_queries,
60
+ "performance_score": performance_score,
61
+ }
62
+ )
63
+
64
+ return field_dict
65
+
66
+ @classmethod
67
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
68
+ from ..models.performance_insights_operation_stats import (
69
+ PerformanceInsightsOperationStats,
70
+ )
71
+ from ..models.performance_insights_slow_queries_item import (
72
+ PerformanceInsightsSlowQueriesItem,
73
+ )
74
+
75
+ d = dict(src_dict)
76
+ analysis_period_days = d.pop("analysis_period_days")
77
+
78
+ total_operations = d.pop("total_operations")
79
+
80
+ operation_stats = PerformanceInsightsOperationStats.from_dict(
81
+ d.pop("operation_stats")
82
+ )
83
+
84
+ slow_queries = []
85
+ _slow_queries = d.pop("slow_queries")
86
+ for slow_queries_item_data in _slow_queries:
87
+ slow_queries_item = PerformanceInsightsSlowQueriesItem.from_dict(
88
+ slow_queries_item_data
89
+ )
90
+
91
+ slow_queries.append(slow_queries_item)
92
+
93
+ performance_score = d.pop("performance_score")
94
+
95
+ performance_insights = cls(
96
+ analysis_period_days=analysis_period_days,
97
+ total_operations=total_operations,
98
+ operation_stats=operation_stats,
99
+ slow_queries=slow_queries,
100
+ performance_score=performance_score,
101
+ )
102
+
103
+ performance_insights.additional_properties = d
104
+ return performance_insights
105
+
106
+ @property
107
+ def additional_keys(self) -> list[str]:
108
+ return list(self.additional_properties.keys())
109
+
110
+ def __getitem__(self, key: str) -> Any:
111
+ return self.additional_properties[key]
112
+
113
+ def __setitem__(self, key: str, value: Any) -> None:
114
+ self.additional_properties[key] = value
115
+
116
+ def __delitem__(self, key: str) -> None:
117
+ del self.additional_properties[key]
118
+
119
+ def __contains__(self, key: str) -> bool:
120
+ return key in self.additional_properties
@@ -4,12 +4,12 @@ from typing import Any, TypeVar
4
4
  from attrs import define as _attrs_define
5
5
  from attrs import field as _attrs_field
6
6
 
7
- T = TypeVar("T", bound="GraphUsageResponseRecentActivity")
7
+ T = TypeVar("T", bound="PerformanceInsightsOperationStats")
8
8
 
9
9
 
10
10
  @_attrs_define
11
- class GraphUsageResponseRecentActivity:
12
- """Recent activity summary"""
11
+ class PerformanceInsightsOperationStats:
12
+ """Performance stats by operation type"""
13
13
 
14
14
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
15
15
 
@@ -22,10 +22,10 @@ class GraphUsageResponseRecentActivity:
22
22
  @classmethod
23
23
  def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
24
24
  d = dict(src_dict)
25
- graph_usage_response_recent_activity = cls()
25
+ performance_insights_operation_stats = cls()
26
26
 
27
- graph_usage_response_recent_activity.additional_properties = d
28
- return graph_usage_response_recent_activity
27
+ performance_insights_operation_stats.additional_properties = d
28
+ return performance_insights_operation_stats
29
29
 
30
30
  @property
31
31
  def additional_keys(self) -> list[str]:
@@ -4,12 +4,12 @@ from typing import Any, TypeVar
4
4
  from attrs import define as _attrs_define
5
5
  from attrs import field as _attrs_field
6
6
 
7
- T = TypeVar("T", bound="UserAnalyticsResponseApiUsage")
7
+ T = TypeVar("T", bound="PerformanceInsightsSlowQueriesItem")
8
8
 
9
9
 
10
10
  @_attrs_define
11
- class UserAnalyticsResponseApiUsage:
12
- """API usage statistics"""
11
+ class PerformanceInsightsSlowQueriesItem:
12
+ """ """
13
13
 
14
14
  additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
15
15
 
@@ -22,10 +22,10 @@ class UserAnalyticsResponseApiUsage:
22
22
  @classmethod
23
23
  def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
24
24
  d = dict(src_dict)
25
- user_analytics_response_api_usage = cls()
25
+ performance_insights_slow_queries_item = cls()
26
26
 
27
- user_analytics_response_api_usage.additional_properties = d
28
- return user_analytics_response_api_usage
27
+ performance_insights_slow_queries_item.additional_properties = d
28
+ return performance_insights_slow_queries_item
29
29
 
30
30
  @property
31
31
  def additional_keys(self) -> list[str]: