robosystems-client 0.2.11__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 (61) hide show
  1. robosystems_client/api/auth/register_user.py +36 -8
  2. robosystems_client/api/billing/{cancel_subscription.py → cancel_org_subscription.py} +34 -9
  3. robosystems_client/api/billing/create_checkout_session.py +28 -20
  4. robosystems_client/api/billing/get_org_billing_customer.py +189 -0
  5. robosystems_client/api/billing/{get_subscription.py → get_org_subscription.py} +30 -5
  6. robosystems_client/api/billing/{get_upcoming_invoice.py → get_org_upcoming_invoice.py} +68 -22
  7. robosystems_client/api/billing/{list_invoices.py → list_org_invoices.py} +38 -9
  8. robosystems_client/api/billing/{list_subscriptions.py → list_org_subscriptions.py} +64 -22
  9. robosystems_client/api/billing/{update_payment_method.py → update_org_payment_method.py} +34 -9
  10. robosystems_client/api/org/__init__.py +1 -0
  11. robosystems_client/api/org/create_org.py +174 -0
  12. robosystems_client/api/{billing/get_billing_customer.py → org/get_org.py} +50 -28
  13. robosystems_client/api/org/list_org_graphs.py +170 -0
  14. robosystems_client/api/{user/get_user_limits.py → org/list_user_orgs.py} +21 -25
  15. robosystems_client/api/org/update_org.py +187 -0
  16. robosystems_client/api/org_members/__init__.py +1 -0
  17. robosystems_client/api/org_members/invite_org_member.py +207 -0
  18. robosystems_client/api/org_members/list_org_members.py +165 -0
  19. robosystems_client/api/org_members/remove_org_member.py +176 -0
  20. robosystems_client/api/org_members/update_org_member_role.py +200 -0
  21. robosystems_client/api/org_usage/__init__.py +1 -0
  22. robosystems_client/api/org_usage/get_org_limits.py +165 -0
  23. robosystems_client/api/org_usage/get_org_usage.py +186 -0
  24. robosystems_client/api/service_offerings/get_service_offerings.py +32 -8
  25. robosystems_client/api/usage/get_graph_usage_analytics.py +4 -4
  26. robosystems_client/models/__init__.py +44 -6
  27. robosystems_client/models/auth_response.py +35 -0
  28. robosystems_client/models/{user_usage_response_graphs.py → auth_response_org_type_0.py} +6 -6
  29. robosystems_client/models/billing_customer.py +8 -8
  30. robosystems_client/models/checkout_response.py +65 -22
  31. robosystems_client/models/create_org_request.py +79 -0
  32. robosystems_client/models/graph_subscription_tier.py +40 -48
  33. robosystems_client/models/graph_subscriptions.py +17 -5
  34. robosystems_client/models/invite_member_request.py +93 -0
  35. robosystems_client/models/list_org_graphs_response_200_item.py +44 -0
  36. robosystems_client/models/org_detail_response.py +174 -0
  37. robosystems_client/models/org_detail_response_graphs_item.py +44 -0
  38. robosystems_client/models/org_detail_response_limits_type_0.py +44 -0
  39. robosystems_client/models/org_detail_response_members_item.py +44 -0
  40. robosystems_client/models/org_limits_response.py +98 -0
  41. robosystems_client/models/org_limits_response_current_usage.py +44 -0
  42. robosystems_client/models/org_list_response.py +82 -0
  43. robosystems_client/models/org_member_list_response.py +90 -0
  44. robosystems_client/models/org_member_response.py +104 -0
  45. robosystems_client/models/org_response.py +121 -0
  46. robosystems_client/models/org_role.py +10 -0
  47. robosystems_client/models/org_type.py +10 -0
  48. robosystems_client/models/org_usage_response.py +146 -0
  49. robosystems_client/models/org_usage_response_daily_trend_item.py +44 -0
  50. robosystems_client/models/org_usage_response_graph_details_item.py +44 -0
  51. robosystems_client/models/org_usage_summary.py +158 -0
  52. robosystems_client/models/repository_subscriptions.py +15 -4
  53. robosystems_client/models/service_offerings_response.py +15 -0
  54. robosystems_client/models/update_member_role_request.py +62 -0
  55. robosystems_client/models/update_org_request.py +103 -0
  56. {robosystems_client-0.2.11.dist-info → robosystems_client-0.2.12.dist-info}/METADATA +1 -1
  57. {robosystems_client-0.2.11.dist-info → robosystems_client-0.2.12.dist-info}/RECORD +59 -27
  58. robosystems_client/models/user_limits_response.py +0 -95
  59. robosystems_client/models/user_usage_response.py +0 -90
  60. {robosystems_client-0.2.11.dist-info → robosystems_client-0.2.12.dist-info}/WHEEL +0 -0
  61. {robosystems_client-0.2.11.dist-info → robosystems_client-0.2.12.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,187 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.http_validation_error import HTTPValidationError
9
+ from ...models.org_detail_response import OrgDetailResponse
10
+ from ...models.update_org_request import UpdateOrgRequest
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ org_id: str,
16
+ *,
17
+ body: UpdateOrgRequest,
18
+ ) -> dict[str, Any]:
19
+ headers: dict[str, Any] = {}
20
+
21
+ _kwargs: dict[str, Any] = {
22
+ "method": "put",
23
+ "url": f"/v1/orgs/{org_id}",
24
+ }
25
+
26
+ _kwargs["json"] = body.to_dict()
27
+
28
+ headers["Content-Type"] = "application/json"
29
+
30
+ _kwargs["headers"] = headers
31
+ return _kwargs
32
+
33
+
34
+ def _parse_response(
35
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
36
+ ) -> Optional[Union[HTTPValidationError, OrgDetailResponse]]:
37
+ if response.status_code == 200:
38
+ response_200 = OrgDetailResponse.from_dict(response.json())
39
+
40
+ return response_200
41
+
42
+ if response.status_code == 422:
43
+ response_422 = HTTPValidationError.from_dict(response.json())
44
+
45
+ return response_422
46
+
47
+ if client.raise_on_unexpected_status:
48
+ raise errors.UnexpectedStatus(response.status_code, response.content)
49
+ else:
50
+ return None
51
+
52
+
53
+ def _build_response(
54
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
55
+ ) -> Response[Union[HTTPValidationError, OrgDetailResponse]]:
56
+ return Response(
57
+ status_code=HTTPStatus(response.status_code),
58
+ content=response.content,
59
+ headers=response.headers,
60
+ parsed=_parse_response(client=client, response=response),
61
+ )
62
+
63
+
64
+ def sync_detailed(
65
+ org_id: str,
66
+ *,
67
+ client: AuthenticatedClient,
68
+ body: UpdateOrgRequest,
69
+ ) -> Response[Union[HTTPValidationError, OrgDetailResponse]]:
70
+ """Update Organization
71
+
72
+ Update organization information. Requires admin or owner role.
73
+
74
+ Args:
75
+ org_id (str):
76
+ body (UpdateOrgRequest): Request to update organization details.
77
+
78
+ Raises:
79
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
80
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
81
+
82
+ Returns:
83
+ Response[Union[HTTPValidationError, OrgDetailResponse]]
84
+ """
85
+
86
+ kwargs = _get_kwargs(
87
+ org_id=org_id,
88
+ body=body,
89
+ )
90
+
91
+ response = client.get_httpx_client().request(
92
+ **kwargs,
93
+ )
94
+
95
+ return _build_response(client=client, response=response)
96
+
97
+
98
+ def sync(
99
+ org_id: str,
100
+ *,
101
+ client: AuthenticatedClient,
102
+ body: UpdateOrgRequest,
103
+ ) -> Optional[Union[HTTPValidationError, OrgDetailResponse]]:
104
+ """Update Organization
105
+
106
+ Update organization information. Requires admin or owner role.
107
+
108
+ Args:
109
+ org_id (str):
110
+ body (UpdateOrgRequest): Request to update organization details.
111
+
112
+ Raises:
113
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
114
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
115
+
116
+ Returns:
117
+ Union[HTTPValidationError, OrgDetailResponse]
118
+ """
119
+
120
+ return sync_detailed(
121
+ org_id=org_id,
122
+ client=client,
123
+ body=body,
124
+ ).parsed
125
+
126
+
127
+ async def asyncio_detailed(
128
+ org_id: str,
129
+ *,
130
+ client: AuthenticatedClient,
131
+ body: UpdateOrgRequest,
132
+ ) -> Response[Union[HTTPValidationError, OrgDetailResponse]]:
133
+ """Update Organization
134
+
135
+ Update organization information. Requires admin or owner role.
136
+
137
+ Args:
138
+ org_id (str):
139
+ body (UpdateOrgRequest): Request to update organization details.
140
+
141
+ Raises:
142
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
143
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
144
+
145
+ Returns:
146
+ Response[Union[HTTPValidationError, OrgDetailResponse]]
147
+ """
148
+
149
+ kwargs = _get_kwargs(
150
+ org_id=org_id,
151
+ body=body,
152
+ )
153
+
154
+ response = await client.get_async_httpx_client().request(**kwargs)
155
+
156
+ return _build_response(client=client, response=response)
157
+
158
+
159
+ async def asyncio(
160
+ org_id: str,
161
+ *,
162
+ client: AuthenticatedClient,
163
+ body: UpdateOrgRequest,
164
+ ) -> Optional[Union[HTTPValidationError, OrgDetailResponse]]:
165
+ """Update Organization
166
+
167
+ Update organization information. Requires admin or owner role.
168
+
169
+ Args:
170
+ org_id (str):
171
+ body (UpdateOrgRequest): Request to update organization details.
172
+
173
+ Raises:
174
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
175
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
176
+
177
+ Returns:
178
+ Union[HTTPValidationError, OrgDetailResponse]
179
+ """
180
+
181
+ return (
182
+ await asyncio_detailed(
183
+ org_id=org_id,
184
+ client=client,
185
+ body=body,
186
+ )
187
+ ).parsed
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""
@@ -0,0 +1,207 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.http_validation_error import HTTPValidationError
9
+ from ...models.invite_member_request import InviteMemberRequest
10
+ from ...models.org_member_response import OrgMemberResponse
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ org_id: str,
16
+ *,
17
+ body: InviteMemberRequest,
18
+ ) -> dict[str, Any]:
19
+ headers: dict[str, Any] = {}
20
+
21
+ _kwargs: dict[str, Any] = {
22
+ "method": "post",
23
+ "url": f"/v1/orgs/{org_id}/members",
24
+ }
25
+
26
+ _kwargs["json"] = body.to_dict()
27
+
28
+ headers["Content-Type"] = "application/json"
29
+
30
+ _kwargs["headers"] = headers
31
+ return _kwargs
32
+
33
+
34
+ def _parse_response(
35
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
36
+ ) -> Optional[Union[HTTPValidationError, OrgMemberResponse]]:
37
+ if response.status_code == 201:
38
+ response_201 = OrgMemberResponse.from_dict(response.json())
39
+
40
+ return response_201
41
+
42
+ if response.status_code == 422:
43
+ response_422 = HTTPValidationError.from_dict(response.json())
44
+
45
+ return response_422
46
+
47
+ if client.raise_on_unexpected_status:
48
+ raise errors.UnexpectedStatus(response.status_code, response.content)
49
+ else:
50
+ return None
51
+
52
+
53
+ def _build_response(
54
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
55
+ ) -> Response[Union[HTTPValidationError, OrgMemberResponse]]:
56
+ return Response(
57
+ status_code=HTTPStatus(response.status_code),
58
+ content=response.content,
59
+ headers=response.headers,
60
+ parsed=_parse_response(client=client, response=response),
61
+ )
62
+
63
+
64
+ def sync_detailed(
65
+ org_id: str,
66
+ *,
67
+ client: AuthenticatedClient,
68
+ body: InviteMemberRequest,
69
+ ) -> Response[Union[HTTPValidationError, OrgMemberResponse]]:
70
+ """Invite Member
71
+
72
+ Invite a user to join the organization. Requires admin or owner role.
73
+
74
+ **⚠️ FEATURE NOT READY**: This endpoint is disabled by default
75
+ (ORG_MEMBER_INVITATIONS_ENABLED=false).
76
+ Returns 501 NOT IMPLEMENTED when disabled. See endpoint implementation for TODO list before
77
+ enabling.
78
+
79
+ Args:
80
+ org_id (str):
81
+ body (InviteMemberRequest): Request to invite a member to an organization.
82
+
83
+ Raises:
84
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
85
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
86
+
87
+ Returns:
88
+ Response[Union[HTTPValidationError, OrgMemberResponse]]
89
+ """
90
+
91
+ kwargs = _get_kwargs(
92
+ org_id=org_id,
93
+ body=body,
94
+ )
95
+
96
+ response = client.get_httpx_client().request(
97
+ **kwargs,
98
+ )
99
+
100
+ return _build_response(client=client, response=response)
101
+
102
+
103
+ def sync(
104
+ org_id: str,
105
+ *,
106
+ client: AuthenticatedClient,
107
+ body: InviteMemberRequest,
108
+ ) -> Optional[Union[HTTPValidationError, OrgMemberResponse]]:
109
+ """Invite Member
110
+
111
+ Invite a user to join the organization. Requires admin or owner role.
112
+
113
+ **⚠️ FEATURE NOT READY**: This endpoint is disabled by default
114
+ (ORG_MEMBER_INVITATIONS_ENABLED=false).
115
+ Returns 501 NOT IMPLEMENTED when disabled. See endpoint implementation for TODO list before
116
+ enabling.
117
+
118
+ Args:
119
+ org_id (str):
120
+ body (InviteMemberRequest): Request to invite a member to an organization.
121
+
122
+ Raises:
123
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
124
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
125
+
126
+ Returns:
127
+ Union[HTTPValidationError, OrgMemberResponse]
128
+ """
129
+
130
+ return sync_detailed(
131
+ org_id=org_id,
132
+ client=client,
133
+ body=body,
134
+ ).parsed
135
+
136
+
137
+ async def asyncio_detailed(
138
+ org_id: str,
139
+ *,
140
+ client: AuthenticatedClient,
141
+ body: InviteMemberRequest,
142
+ ) -> Response[Union[HTTPValidationError, OrgMemberResponse]]:
143
+ """Invite Member
144
+
145
+ Invite a user to join the organization. Requires admin or owner role.
146
+
147
+ **⚠️ FEATURE NOT READY**: This endpoint is disabled by default
148
+ (ORG_MEMBER_INVITATIONS_ENABLED=false).
149
+ Returns 501 NOT IMPLEMENTED when disabled. See endpoint implementation for TODO list before
150
+ enabling.
151
+
152
+ Args:
153
+ org_id (str):
154
+ body (InviteMemberRequest): Request to invite a member to an organization.
155
+
156
+ Raises:
157
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
158
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
159
+
160
+ Returns:
161
+ Response[Union[HTTPValidationError, OrgMemberResponse]]
162
+ """
163
+
164
+ kwargs = _get_kwargs(
165
+ org_id=org_id,
166
+ body=body,
167
+ )
168
+
169
+ response = await client.get_async_httpx_client().request(**kwargs)
170
+
171
+ return _build_response(client=client, response=response)
172
+
173
+
174
+ async def asyncio(
175
+ org_id: str,
176
+ *,
177
+ client: AuthenticatedClient,
178
+ body: InviteMemberRequest,
179
+ ) -> Optional[Union[HTTPValidationError, OrgMemberResponse]]:
180
+ """Invite Member
181
+
182
+ Invite a user to join the organization. Requires admin or owner role.
183
+
184
+ **⚠️ FEATURE NOT READY**: This endpoint is disabled by default
185
+ (ORG_MEMBER_INVITATIONS_ENABLED=false).
186
+ Returns 501 NOT IMPLEMENTED when disabled. See endpoint implementation for TODO list before
187
+ enabling.
188
+
189
+ Args:
190
+ org_id (str):
191
+ body (InviteMemberRequest): Request to invite a member to an organization.
192
+
193
+ Raises:
194
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
195
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
196
+
197
+ Returns:
198
+ Union[HTTPValidationError, OrgMemberResponse]
199
+ """
200
+
201
+ return (
202
+ await asyncio_detailed(
203
+ org_id=org_id,
204
+ client=client,
205
+ body=body,
206
+ )
207
+ ).parsed
@@ -0,0 +1,165 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.http_validation_error import HTTPValidationError
9
+ from ...models.org_member_list_response import OrgMemberListResponse
10
+ from ...types import Response
11
+
12
+
13
+ def _get_kwargs(
14
+ org_id: str,
15
+ ) -> dict[str, Any]:
16
+ _kwargs: dict[str, Any] = {
17
+ "method": "get",
18
+ "url": f"/v1/orgs/{org_id}/members",
19
+ }
20
+
21
+ return _kwargs
22
+
23
+
24
+ def _parse_response(
25
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
+ ) -> Optional[Union[HTTPValidationError, OrgMemberListResponse]]:
27
+ if response.status_code == 200:
28
+ response_200 = OrgMemberListResponse.from_dict(response.json())
29
+
30
+ return response_200
31
+
32
+ if response.status_code == 422:
33
+ response_422 = HTTPValidationError.from_dict(response.json())
34
+
35
+ return response_422
36
+
37
+ if client.raise_on_unexpected_status:
38
+ raise errors.UnexpectedStatus(response.status_code, response.content)
39
+ else:
40
+ return None
41
+
42
+
43
+ def _build_response(
44
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
45
+ ) -> Response[Union[HTTPValidationError, OrgMemberListResponse]]:
46
+ return Response(
47
+ status_code=HTTPStatus(response.status_code),
48
+ content=response.content,
49
+ headers=response.headers,
50
+ parsed=_parse_response(client=client, response=response),
51
+ )
52
+
53
+
54
+ def sync_detailed(
55
+ org_id: str,
56
+ *,
57
+ client: AuthenticatedClient,
58
+ ) -> Response[Union[HTTPValidationError, OrgMemberListResponse]]:
59
+ """List Organization Members
60
+
61
+ Get all members of an organization with their roles.
62
+
63
+ Args:
64
+ org_id (str):
65
+
66
+ Raises:
67
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
68
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
69
+
70
+ Returns:
71
+ Response[Union[HTTPValidationError, OrgMemberListResponse]]
72
+ """
73
+
74
+ kwargs = _get_kwargs(
75
+ org_id=org_id,
76
+ )
77
+
78
+ response = client.get_httpx_client().request(
79
+ **kwargs,
80
+ )
81
+
82
+ return _build_response(client=client, response=response)
83
+
84
+
85
+ def sync(
86
+ org_id: str,
87
+ *,
88
+ client: AuthenticatedClient,
89
+ ) -> Optional[Union[HTTPValidationError, OrgMemberListResponse]]:
90
+ """List Organization Members
91
+
92
+ Get all members of an organization with their roles.
93
+
94
+ Args:
95
+ org_id (str):
96
+
97
+ Raises:
98
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
99
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
100
+
101
+ Returns:
102
+ Union[HTTPValidationError, OrgMemberListResponse]
103
+ """
104
+
105
+ return sync_detailed(
106
+ org_id=org_id,
107
+ client=client,
108
+ ).parsed
109
+
110
+
111
+ async def asyncio_detailed(
112
+ org_id: str,
113
+ *,
114
+ client: AuthenticatedClient,
115
+ ) -> Response[Union[HTTPValidationError, OrgMemberListResponse]]:
116
+ """List Organization Members
117
+
118
+ Get all members of an organization with their roles.
119
+
120
+ Args:
121
+ org_id (str):
122
+
123
+ Raises:
124
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
125
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
126
+
127
+ Returns:
128
+ Response[Union[HTTPValidationError, OrgMemberListResponse]]
129
+ """
130
+
131
+ kwargs = _get_kwargs(
132
+ org_id=org_id,
133
+ )
134
+
135
+ response = await client.get_async_httpx_client().request(**kwargs)
136
+
137
+ return _build_response(client=client, response=response)
138
+
139
+
140
+ async def asyncio(
141
+ org_id: str,
142
+ *,
143
+ client: AuthenticatedClient,
144
+ ) -> Optional[Union[HTTPValidationError, OrgMemberListResponse]]:
145
+ """List Organization Members
146
+
147
+ Get all members of an organization with their roles.
148
+
149
+ Args:
150
+ org_id (str):
151
+
152
+ Raises:
153
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
154
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
155
+
156
+ Returns:
157
+ Union[HTTPValidationError, OrgMemberListResponse]
158
+ """
159
+
160
+ return (
161
+ await asyncio_detailed(
162
+ org_id=org_id,
163
+ client=client,
164
+ )
165
+ ).parsed