waldur-api-client 7.7.7__py3-none-any.whl → 7.7.8__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 waldur-api-client might be problematic. Click here for more details.
- waldur_api_client/api/customer_permissions_reviews/customer_permissions_reviews_count.py +19 -0
- waldur_api_client/api/customer_permissions_reviews/customer_permissions_reviews_list.py +19 -0
- waldur_api_client/api/customers/customers_users_list.py +141 -53
- waldur_api_client/api/invoices/invoices_items_retrieve.py +20 -0
- waldur_api_client/api/managed_rancher_cluster_resources/__init__.py +1 -0
- waldur_api_client/api/managed_rancher_cluster_resources/managed_rancher_cluster_resources_add_node.py +162 -0
- waldur_api_client/api/managed_rancher_cluster_resources/managed_rancher_cluster_resources_count.py +172 -0
- waldur_api_client/api/managed_rancher_cluster_resources/managed_rancher_cluster_resources_list.py +196 -0
- waldur_api_client/api/managed_rancher_cluster_resources/managed_rancher_cluster_resources_retrieve.py +171 -0
- waldur_api_client/api/marketplace_course_accounts/__init__.py +1 -0
- waldur_api_client/api/marketplace_course_accounts/marketplace_course_accounts_count.py +244 -0
- waldur_api_client/api/marketplace_course_accounts/marketplace_course_accounts_create.py +148 -0
- waldur_api_client/api/marketplace_course_accounts/marketplace_course_accounts_create_bulk.py +152 -0
- waldur_api_client/api/marketplace_course_accounts/marketplace_course_accounts_destroy.py +89 -0
- waldur_api_client/api/marketplace_course_accounts/marketplace_course_accounts_list.py +245 -0
- waldur_api_client/api/marketplace_course_accounts/marketplace_course_accounts_retrieve.py +140 -0
- waldur_api_client/api/marketplace_customer_service_accounts/marketplace_customer_service_accounts_count.py +25 -0
- waldur_api_client/api/marketplace_customer_service_accounts/marketplace_customer_service_accounts_list.py +25 -0
- waldur_api_client/api/marketplace_project_service_accounts/marketplace_project_service_accounts_count.py +25 -0
- waldur_api_client/api/marketplace_project_service_accounts/marketplace_project_service_accounts_list.py +25 -0
- waldur_api_client/api/marketplace_service_providers/marketplace_service_providers_course_accounts_list.py +284 -0
- waldur_api_client/api/marketplace_service_providers/marketplace_service_providers_project_service_accounts_list.py +29 -0
- waldur_api_client/api/project_permissions_reviews/__init__.py +1 -0
- waldur_api_client/api/project_permissions_reviews/project_permissions_reviews_close.py +91 -0
- waldur_api_client/api/project_permissions_reviews/project_permissions_reviews_count.py +266 -0
- waldur_api_client/api/project_permissions_reviews/project_permissions_reviews_list.py +269 -0
- waldur_api_client/api/project_permissions_reviews/project_permissions_reviews_retrieve.py +142 -0
- waldur_api_client/api/projects/projects_other_users_list.py +98 -23
- waldur_api_client/api/projects/projects_sync_user_roles.py +10 -9
- waldur_api_client/api/support_issue_statuses/__init__.py +1 -0
- waldur_api_client/api/support_issue_statuses/support_issue_statuses_count.py +172 -0
- waldur_api_client/api/support_issue_statuses/support_issue_statuses_create.py +148 -0
- waldur_api_client/api/support_issue_statuses/support_issue_statuses_destroy.py +89 -0
- waldur_api_client/api/support_issue_statuses/support_issue_statuses_list.py +173 -0
- waldur_api_client/api/support_issue_statuses/support_issue_statuses_partial_update.py +162 -0
- waldur_api_client/api/support_issue_statuses/support_issue_statuses_retrieve.py +140 -0
- waldur_api_client/api/support_issue_statuses/support_issue_statuses_update.py +162 -0
- waldur_api_client/api/user_group_invitations/user_group_invitations_submit_request.py +12 -12
- waldur_api_client/api/user_invitations/user_invitations_count.py +30 -0
- waldur_api_client/api/user_invitations/user_invitations_list.py +30 -0
- waldur_api_client/api/user_permission_requests/user_permission_requests_cancel_request.py +146 -0
- waldur_api_client/models/__init__.py +76 -4
- waldur_api_client/models/cancel_request_response.py +75 -0
- waldur_api_client/models/constance_settings.py +9 -0
- waldur_api_client/models/constance_settings_request.py +9 -0
- waldur_api_client/models/course_account.py +188 -0
- waldur_api_client/models/course_account_create_nested.py +68 -0
- waldur_api_client/models/course_account_create_nested_request.py +68 -0
- waldur_api_client/models/course_account_request.py +89 -0
- waldur_api_client/models/course_accounts_bulk_create.py +82 -0
- waldur_api_client/models/course_accounts_bulk_create_request.py +82 -0
- waldur_api_client/models/customer.py +9 -0
- waldur_api_client/models/customer_permission_review.py +16 -16
- waldur_api_client/models/customer_request.py +9 -0
- waldur_api_client/models/customer_service_account.py +9 -0
- waldur_api_client/models/customers_list_field_item.py +1 -0
- waldur_api_client/models/customers_retrieve_field_item.py +1 -0
- waldur_api_client/models/customers_users_list_o.py +9 -0
- waldur_api_client/models/customers_users_list_organization_role_item_type_0.py +10 -0
- waldur_api_client/models/customers_users_list_project_role_item_type_0.py +10 -0
- waldur_api_client/models/dependency_logic_operator_enum.py +9 -0
- waldur_api_client/models/event_subscription.py +1 -1
- waldur_api_client/models/event_types_enum.py +4 -0
- waldur_api_client/models/group_invitation.py +9 -0
- waldur_api_client/models/invitation.py +9 -0
- waldur_api_client/models/invoices_items_retrieve_o.py +15 -0
- waldur_api_client/models/issue_status.py +103 -0
- waldur_api_client/models/issue_status_request.py +78 -0
- waldur_api_client/models/issue_status_type_enum.py +9 -0
- waldur_api_client/models/kind_enum.py +10 -0
- waldur_api_client/models/managed_rancher_cluster_resources_list_field_item.py +82 -0
- waldur_api_client/models/managed_rancher_cluster_resources_retrieve_field_item.py +82 -0
- waldur_api_client/models/managed_rancher_create_node_request.py +186 -0
- waldur_api_client/models/marketplace_course_accounts_count_state_item.py +10 -0
- waldur_api_client/models/marketplace_course_accounts_list_state_item.py +10 -0
- waldur_api_client/models/marketplace_customer_service_accounts_count_state_item.py +10 -0
- waldur_api_client/models/marketplace_customer_service_accounts_list_state_item.py +10 -0
- waldur_api_client/models/marketplace_project_service_accounts_count_state_item.py +10 -0
- waldur_api_client/models/marketplace_project_service_accounts_list_state_item.py +10 -0
- waldur_api_client/models/marketplace_service_providers_course_accounts_list_state_item.py +10 -0
- waldur_api_client/models/marketplace_service_providers_project_service_accounts_list_state_item.py +10 -0
- waldur_api_client/models/marketplace_service_providers_projects_list_field_item.py +1 -0
- waldur_api_client/models/nested_security_group_rule.py +223 -0
- waldur_api_client/models/{open_stack_nested_security_group_rules_item.py → nested_security_group_rule_request.py} +67 -76
- waldur_api_client/models/open_stack_backup_restoration_request.py +0 -22
- waldur_api_client/models/open_stack_fixed_ip.py +13 -3
- waldur_api_client/models/open_stack_fixed_ip_request.py +7 -2
- waldur_api_client/models/open_stack_instance_create_order_attributes.py +20 -20
- waldur_api_client/models/open_stack_nested_security_group.py +16 -16
- waldur_api_client/models/open_stack_port_ip_update_request.py +6 -2
- waldur_api_client/models/open_stack_static_route.py +13 -4
- waldur_api_client/models/open_stack_static_route_request.py +7 -3
- waldur_api_client/models/open_stack_sub_net.py +15 -2
- waldur_api_client/models/open_stack_sub_net_allocation_pool.py +27 -8
- waldur_api_client/models/open_stack_sub_net_allocation_pool_request.py +14 -5
- waldur_api_client/models/open_stack_sub_net_request.py +15 -2
- waldur_api_client/models/patched_customer_request.py +9 -0
- waldur_api_client/models/patched_issue_status_request.py +76 -0
- waldur_api_client/models/patched_open_stack_sub_net_request.py +15 -2
- waldur_api_client/models/patched_project_request.py +17 -0
- waldur_api_client/models/patched_question_admin_request.py +17 -0
- waldur_api_client/models/patched_rancher_service_request.py +1 -1
- waldur_api_client/models/permission_request.py +16 -0
- waldur_api_client/models/project.py +17 -0
- waldur_api_client/models/project_permission_review.py +166 -0
- waldur_api_client/models/project_permissions_reviews_count_o_item.py +11 -0
- waldur_api_client/models/project_permissions_reviews_list_o_item.py +11 -0
- waldur_api_client/models/project_request.py +17 -0
- waldur_api_client/models/project_service_account.py +9 -0
- waldur_api_client/models/projects_list_field_item.py +1 -0
- waldur_api_client/models/projects_other_users_list_o.py +9 -0
- waldur_api_client/models/projects_retrieve_field_item.py +1 -0
- waldur_api_client/models/proposal.py +8 -0
- waldur_api_client/models/proposal_review.py +8 -0
- waldur_api_client/models/question_admin.py +17 -0
- waldur_api_client/models/question_admin_request.py +17 -0
- waldur_api_client/models/rancher_nested_public_ip.py +25 -7
- waldur_api_client/models/rancher_service.py +1 -1
- waldur_api_client/models/rancher_service_request.py +1 -1
- waldur_api_client/models/rmq_connection.py +8 -3
- waldur_api_client/models/rmq_subscription.py +7 -3
- waldur_api_client/models/robot_account.py +9 -17
- waldur_api_client/models/robot_account_details.py +9 -17
- waldur_api_client/models/service_account_state.py +10 -0
- waldur_api_client/models/submit_request_response.py +75 -0
- waldur_api_client/models/visible_invitation_details.py +9 -0
- {waldur_api_client-7.7.7.dist-info → waldur_api_client-7.7.8.dist-info}/METADATA +1 -1
- {waldur_api_client-7.7.7.dist-info → waldur_api_client-7.7.8.dist-info}/RECORD +130 -69
- waldur_api_client/models/robot_account_states.py +0 -13
- {waldur_api_client-7.7.7.dist-info → waldur_api_client-7.7.8.dist-info}/LICENSE +0 -0
- {waldur_api_client-7.7.7.dist-info → waldur_api_client-7.7.8.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Union
|
|
3
|
+
from uuid import UUID
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.managed_rancher_cluster_resources_retrieve_field_item import (
|
|
10
|
+
ManagedRancherClusterResourcesRetrieveFieldItem,
|
|
11
|
+
)
|
|
12
|
+
from ...models.resource import Resource
|
|
13
|
+
from ...types import UNSET, Response, Unset
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _get_kwargs(
|
|
17
|
+
uuid: UUID,
|
|
18
|
+
*,
|
|
19
|
+
field: Union[Unset, list[ManagedRancherClusterResourcesRetrieveFieldItem]] = UNSET,
|
|
20
|
+
) -> dict[str, Any]:
|
|
21
|
+
params: dict[str, Any] = {}
|
|
22
|
+
|
|
23
|
+
json_field: Union[Unset, list[str]] = UNSET
|
|
24
|
+
if not isinstance(field, Unset):
|
|
25
|
+
json_field = []
|
|
26
|
+
for field_item_data in field:
|
|
27
|
+
field_item = field_item_data.value
|
|
28
|
+
json_field.append(field_item)
|
|
29
|
+
|
|
30
|
+
params["field"] = json_field
|
|
31
|
+
|
|
32
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
33
|
+
|
|
34
|
+
_kwargs: dict[str, Any] = {
|
|
35
|
+
"method": "get",
|
|
36
|
+
"url": f"/api/managed-rancher-cluster-resources/{uuid}/",
|
|
37
|
+
"params": params,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return _kwargs
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Resource:
|
|
44
|
+
if response.status_code == 200:
|
|
45
|
+
response_200 = Resource.from_dict(response.json())
|
|
46
|
+
|
|
47
|
+
return response_200
|
|
48
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Resource]:
|
|
52
|
+
return Response(
|
|
53
|
+
status_code=HTTPStatus(response.status_code),
|
|
54
|
+
content=response.content,
|
|
55
|
+
headers=response.headers,
|
|
56
|
+
parsed=_parse_response(client=client, response=response),
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def sync_detailed(
|
|
61
|
+
uuid: UUID,
|
|
62
|
+
*,
|
|
63
|
+
client: AuthenticatedClient,
|
|
64
|
+
field: Union[Unset, list[ManagedRancherClusterResourcesRetrieveFieldItem]] = UNSET,
|
|
65
|
+
) -> Response[Resource]:
|
|
66
|
+
"""
|
|
67
|
+
Args:
|
|
68
|
+
uuid (UUID):
|
|
69
|
+
field (Union[Unset, list[ManagedRancherClusterResourcesRetrieveFieldItem]]):
|
|
70
|
+
|
|
71
|
+
Raises:
|
|
72
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
73
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
74
|
+
|
|
75
|
+
Returns:
|
|
76
|
+
Response[Resource]
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
kwargs = _get_kwargs(
|
|
80
|
+
uuid=uuid,
|
|
81
|
+
field=field,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
response = client.get_httpx_client().request(
|
|
85
|
+
**kwargs,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
return _build_response(client=client, response=response)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def sync(
|
|
92
|
+
uuid: UUID,
|
|
93
|
+
*,
|
|
94
|
+
client: AuthenticatedClient,
|
|
95
|
+
field: Union[Unset, list[ManagedRancherClusterResourcesRetrieveFieldItem]] = UNSET,
|
|
96
|
+
) -> Resource:
|
|
97
|
+
"""
|
|
98
|
+
Args:
|
|
99
|
+
uuid (UUID):
|
|
100
|
+
field (Union[Unset, list[ManagedRancherClusterResourcesRetrieveFieldItem]]):
|
|
101
|
+
|
|
102
|
+
Raises:
|
|
103
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
104
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
Resource
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
return sync_detailed(
|
|
111
|
+
uuid=uuid,
|
|
112
|
+
client=client,
|
|
113
|
+
field=field,
|
|
114
|
+
).parsed
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
async def asyncio_detailed(
|
|
118
|
+
uuid: UUID,
|
|
119
|
+
*,
|
|
120
|
+
client: AuthenticatedClient,
|
|
121
|
+
field: Union[Unset, list[ManagedRancherClusterResourcesRetrieveFieldItem]] = UNSET,
|
|
122
|
+
) -> Response[Resource]:
|
|
123
|
+
"""
|
|
124
|
+
Args:
|
|
125
|
+
uuid (UUID):
|
|
126
|
+
field (Union[Unset, list[ManagedRancherClusterResourcesRetrieveFieldItem]]):
|
|
127
|
+
|
|
128
|
+
Raises:
|
|
129
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
130
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
131
|
+
|
|
132
|
+
Returns:
|
|
133
|
+
Response[Resource]
|
|
134
|
+
"""
|
|
135
|
+
|
|
136
|
+
kwargs = _get_kwargs(
|
|
137
|
+
uuid=uuid,
|
|
138
|
+
field=field,
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
142
|
+
|
|
143
|
+
return _build_response(client=client, response=response)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
async def asyncio(
|
|
147
|
+
uuid: UUID,
|
|
148
|
+
*,
|
|
149
|
+
client: AuthenticatedClient,
|
|
150
|
+
field: Union[Unset, list[ManagedRancherClusterResourcesRetrieveFieldItem]] = UNSET,
|
|
151
|
+
) -> Resource:
|
|
152
|
+
"""
|
|
153
|
+
Args:
|
|
154
|
+
uuid (UUID):
|
|
155
|
+
field (Union[Unset, list[ManagedRancherClusterResourcesRetrieveFieldItem]]):
|
|
156
|
+
|
|
157
|
+
Raises:
|
|
158
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
159
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
160
|
+
|
|
161
|
+
Returns:
|
|
162
|
+
Resource
|
|
163
|
+
"""
|
|
164
|
+
|
|
165
|
+
return (
|
|
166
|
+
await asyncio_detailed(
|
|
167
|
+
uuid=uuid,
|
|
168
|
+
client=client,
|
|
169
|
+
field=field,
|
|
170
|
+
)
|
|
171
|
+
).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Union
|
|
3
|
+
from uuid import UUID
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.marketplace_course_accounts_count_state_item import MarketplaceCourseAccountsCountStateItem
|
|
10
|
+
from ...types import UNSET, Response, Unset
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
*,
|
|
15
|
+
email: Union[Unset, str] = UNSET,
|
|
16
|
+
page: Union[Unset, int] = UNSET,
|
|
17
|
+
page_size: Union[Unset, int] = UNSET,
|
|
18
|
+
project_uuid: Union[Unset, UUID] = UNSET,
|
|
19
|
+
state: Union[Unset, list[MarketplaceCourseAccountsCountStateItem]] = UNSET,
|
|
20
|
+
username: Union[Unset, str] = UNSET,
|
|
21
|
+
) -> dict[str, Any]:
|
|
22
|
+
params: dict[str, Any] = {}
|
|
23
|
+
|
|
24
|
+
params["email"] = email
|
|
25
|
+
|
|
26
|
+
params["page"] = page
|
|
27
|
+
|
|
28
|
+
params["page_size"] = page_size
|
|
29
|
+
|
|
30
|
+
json_project_uuid: Union[Unset, str] = UNSET
|
|
31
|
+
if not isinstance(project_uuid, Unset):
|
|
32
|
+
json_project_uuid = str(project_uuid)
|
|
33
|
+
params["project_uuid"] = json_project_uuid
|
|
34
|
+
|
|
35
|
+
json_state: Union[Unset, list[str]] = UNSET
|
|
36
|
+
if not isinstance(state, Unset):
|
|
37
|
+
json_state = []
|
|
38
|
+
for state_item_data in state:
|
|
39
|
+
state_item = state_item_data.value
|
|
40
|
+
json_state.append(state_item)
|
|
41
|
+
|
|
42
|
+
params["state"] = json_state
|
|
43
|
+
|
|
44
|
+
params["username"] = username
|
|
45
|
+
|
|
46
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
47
|
+
|
|
48
|
+
_kwargs: dict[str, Any] = {
|
|
49
|
+
"method": "head",
|
|
50
|
+
"url": "/api/marketplace-course-accounts/",
|
|
51
|
+
"params": params,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return _kwargs
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> int:
|
|
58
|
+
if response.status_code == HTTPStatus.OK:
|
|
59
|
+
try:
|
|
60
|
+
return int(response.headers["x-result-count"])
|
|
61
|
+
except KeyError:
|
|
62
|
+
raise errors.UnexpectedStatus(
|
|
63
|
+
response.status_code, b"Expected 'X-Result-Count' header for HEAD request, but it was not found."
|
|
64
|
+
)
|
|
65
|
+
except ValueError:
|
|
66
|
+
count_val = response.headers.get("x-result-count")
|
|
67
|
+
msg = f"Expected 'X-Result-Count' header to be an integer, but got '{count_val}'."
|
|
68
|
+
raise errors.UnexpectedStatus(response.status_code, msg.encode())
|
|
69
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[int]:
|
|
73
|
+
return Response(
|
|
74
|
+
status_code=HTTPStatus(response.status_code),
|
|
75
|
+
content=response.content,
|
|
76
|
+
headers=response.headers,
|
|
77
|
+
parsed=_parse_response(client=client, response=response),
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def sync_detailed(
|
|
82
|
+
*,
|
|
83
|
+
client: AuthenticatedClient,
|
|
84
|
+
email: Union[Unset, str] = UNSET,
|
|
85
|
+
page: Union[Unset, int] = UNSET,
|
|
86
|
+
page_size: Union[Unset, int] = UNSET,
|
|
87
|
+
project_uuid: Union[Unset, UUID] = UNSET,
|
|
88
|
+
state: Union[Unset, list[MarketplaceCourseAccountsCountStateItem]] = UNSET,
|
|
89
|
+
username: Union[Unset, str] = UNSET,
|
|
90
|
+
) -> Response[int]:
|
|
91
|
+
"""Get number of items in the collection matching the request parameters.
|
|
92
|
+
|
|
93
|
+
Args:
|
|
94
|
+
email (Union[Unset, str]):
|
|
95
|
+
page (Union[Unset, int]):
|
|
96
|
+
page_size (Union[Unset, int]):
|
|
97
|
+
project_uuid (Union[Unset, UUID]):
|
|
98
|
+
state (Union[Unset, list[MarketplaceCourseAccountsCountStateItem]]):
|
|
99
|
+
username (Union[Unset, str]):
|
|
100
|
+
|
|
101
|
+
Raises:
|
|
102
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
103
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
104
|
+
|
|
105
|
+
Returns:
|
|
106
|
+
Response[int]
|
|
107
|
+
"""
|
|
108
|
+
|
|
109
|
+
kwargs = _get_kwargs(
|
|
110
|
+
email=email,
|
|
111
|
+
page=page,
|
|
112
|
+
page_size=page_size,
|
|
113
|
+
project_uuid=project_uuid,
|
|
114
|
+
state=state,
|
|
115
|
+
username=username,
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
response = client.get_httpx_client().request(
|
|
119
|
+
**kwargs,
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
return _build_response(client=client, response=response)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def sync(
|
|
126
|
+
*,
|
|
127
|
+
client: AuthenticatedClient,
|
|
128
|
+
email: Union[Unset, str] = UNSET,
|
|
129
|
+
page: Union[Unset, int] = UNSET,
|
|
130
|
+
page_size: Union[Unset, int] = UNSET,
|
|
131
|
+
project_uuid: Union[Unset, UUID] = UNSET,
|
|
132
|
+
state: Union[Unset, list[MarketplaceCourseAccountsCountStateItem]] = UNSET,
|
|
133
|
+
username: Union[Unset, str] = UNSET,
|
|
134
|
+
) -> int:
|
|
135
|
+
"""Get number of items in the collection matching the request parameters.
|
|
136
|
+
|
|
137
|
+
Args:
|
|
138
|
+
email (Union[Unset, str]):
|
|
139
|
+
page (Union[Unset, int]):
|
|
140
|
+
page_size (Union[Unset, int]):
|
|
141
|
+
project_uuid (Union[Unset, UUID]):
|
|
142
|
+
state (Union[Unset, list[MarketplaceCourseAccountsCountStateItem]]):
|
|
143
|
+
username (Union[Unset, str]):
|
|
144
|
+
|
|
145
|
+
Raises:
|
|
146
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
147
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
148
|
+
|
|
149
|
+
Returns:
|
|
150
|
+
int
|
|
151
|
+
"""
|
|
152
|
+
|
|
153
|
+
return sync_detailed(
|
|
154
|
+
client=client,
|
|
155
|
+
email=email,
|
|
156
|
+
page=page,
|
|
157
|
+
page_size=page_size,
|
|
158
|
+
project_uuid=project_uuid,
|
|
159
|
+
state=state,
|
|
160
|
+
username=username,
|
|
161
|
+
).parsed
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
async def asyncio_detailed(
|
|
165
|
+
*,
|
|
166
|
+
client: AuthenticatedClient,
|
|
167
|
+
email: Union[Unset, str] = UNSET,
|
|
168
|
+
page: Union[Unset, int] = UNSET,
|
|
169
|
+
page_size: Union[Unset, int] = UNSET,
|
|
170
|
+
project_uuid: Union[Unset, UUID] = UNSET,
|
|
171
|
+
state: Union[Unset, list[MarketplaceCourseAccountsCountStateItem]] = UNSET,
|
|
172
|
+
username: Union[Unset, str] = UNSET,
|
|
173
|
+
) -> Response[int]:
|
|
174
|
+
"""Get number of items in the collection matching the request parameters.
|
|
175
|
+
|
|
176
|
+
Args:
|
|
177
|
+
email (Union[Unset, str]):
|
|
178
|
+
page (Union[Unset, int]):
|
|
179
|
+
page_size (Union[Unset, int]):
|
|
180
|
+
project_uuid (Union[Unset, UUID]):
|
|
181
|
+
state (Union[Unset, list[MarketplaceCourseAccountsCountStateItem]]):
|
|
182
|
+
username (Union[Unset, str]):
|
|
183
|
+
|
|
184
|
+
Raises:
|
|
185
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
186
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
187
|
+
|
|
188
|
+
Returns:
|
|
189
|
+
Response[int]
|
|
190
|
+
"""
|
|
191
|
+
|
|
192
|
+
kwargs = _get_kwargs(
|
|
193
|
+
email=email,
|
|
194
|
+
page=page,
|
|
195
|
+
page_size=page_size,
|
|
196
|
+
project_uuid=project_uuid,
|
|
197
|
+
state=state,
|
|
198
|
+
username=username,
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
202
|
+
|
|
203
|
+
return _build_response(client=client, response=response)
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
async def asyncio(
|
|
207
|
+
*,
|
|
208
|
+
client: AuthenticatedClient,
|
|
209
|
+
email: Union[Unset, str] = UNSET,
|
|
210
|
+
page: Union[Unset, int] = UNSET,
|
|
211
|
+
page_size: Union[Unset, int] = UNSET,
|
|
212
|
+
project_uuid: Union[Unset, UUID] = UNSET,
|
|
213
|
+
state: Union[Unset, list[MarketplaceCourseAccountsCountStateItem]] = UNSET,
|
|
214
|
+
username: Union[Unset, str] = UNSET,
|
|
215
|
+
) -> int:
|
|
216
|
+
"""Get number of items in the collection matching the request parameters.
|
|
217
|
+
|
|
218
|
+
Args:
|
|
219
|
+
email (Union[Unset, str]):
|
|
220
|
+
page (Union[Unset, int]):
|
|
221
|
+
page_size (Union[Unset, int]):
|
|
222
|
+
project_uuid (Union[Unset, UUID]):
|
|
223
|
+
state (Union[Unset, list[MarketplaceCourseAccountsCountStateItem]]):
|
|
224
|
+
username (Union[Unset, str]):
|
|
225
|
+
|
|
226
|
+
Raises:
|
|
227
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
228
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
229
|
+
|
|
230
|
+
Returns:
|
|
231
|
+
int
|
|
232
|
+
"""
|
|
233
|
+
|
|
234
|
+
return (
|
|
235
|
+
await asyncio_detailed(
|
|
236
|
+
client=client,
|
|
237
|
+
email=email,
|
|
238
|
+
page=page,
|
|
239
|
+
page_size=page_size,
|
|
240
|
+
project_uuid=project_uuid,
|
|
241
|
+
state=state,
|
|
242
|
+
username=username,
|
|
243
|
+
)
|
|
244
|
+
).parsed
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.course_account import CourseAccount
|
|
9
|
+
from ...models.course_account_request import CourseAccountRequest
|
|
10
|
+
from ...types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
*,
|
|
15
|
+
body: CourseAccountRequest,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
headers: dict[str, Any] = {}
|
|
18
|
+
|
|
19
|
+
_kwargs: dict[str, Any] = {
|
|
20
|
+
"method": "post",
|
|
21
|
+
"url": "/api/marketplace-course-accounts/",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
_kwargs["json"] = body.to_dict()
|
|
25
|
+
|
|
26
|
+
headers["Content-Type"] = "application/json"
|
|
27
|
+
|
|
28
|
+
_kwargs["headers"] = headers
|
|
29
|
+
return _kwargs
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> CourseAccount:
|
|
33
|
+
if response.status_code == 201:
|
|
34
|
+
response_201 = CourseAccount.from_dict(response.json())
|
|
35
|
+
|
|
36
|
+
return response_201
|
|
37
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[CourseAccount]:
|
|
41
|
+
return Response(
|
|
42
|
+
status_code=HTTPStatus(response.status_code),
|
|
43
|
+
content=response.content,
|
|
44
|
+
headers=response.headers,
|
|
45
|
+
parsed=_parse_response(client=client, response=response),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def sync_detailed(
|
|
50
|
+
*,
|
|
51
|
+
client: AuthenticatedClient,
|
|
52
|
+
body: CourseAccountRequest,
|
|
53
|
+
) -> Response[CourseAccount]:
|
|
54
|
+
"""
|
|
55
|
+
Args:
|
|
56
|
+
body (CourseAccountRequest):
|
|
57
|
+
|
|
58
|
+
Raises:
|
|
59
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
60
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
61
|
+
|
|
62
|
+
Returns:
|
|
63
|
+
Response[CourseAccount]
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
kwargs = _get_kwargs(
|
|
67
|
+
body=body,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
response = client.get_httpx_client().request(
|
|
71
|
+
**kwargs,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
return _build_response(client=client, response=response)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def sync(
|
|
78
|
+
*,
|
|
79
|
+
client: AuthenticatedClient,
|
|
80
|
+
body: CourseAccountRequest,
|
|
81
|
+
) -> CourseAccount:
|
|
82
|
+
"""
|
|
83
|
+
Args:
|
|
84
|
+
body (CourseAccountRequest):
|
|
85
|
+
|
|
86
|
+
Raises:
|
|
87
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
88
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
89
|
+
|
|
90
|
+
Returns:
|
|
91
|
+
CourseAccount
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
return sync_detailed(
|
|
95
|
+
client=client,
|
|
96
|
+
body=body,
|
|
97
|
+
).parsed
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
async def asyncio_detailed(
|
|
101
|
+
*,
|
|
102
|
+
client: AuthenticatedClient,
|
|
103
|
+
body: CourseAccountRequest,
|
|
104
|
+
) -> Response[CourseAccount]:
|
|
105
|
+
"""
|
|
106
|
+
Args:
|
|
107
|
+
body (CourseAccountRequest):
|
|
108
|
+
|
|
109
|
+
Raises:
|
|
110
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
111
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
112
|
+
|
|
113
|
+
Returns:
|
|
114
|
+
Response[CourseAccount]
|
|
115
|
+
"""
|
|
116
|
+
|
|
117
|
+
kwargs = _get_kwargs(
|
|
118
|
+
body=body,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
122
|
+
|
|
123
|
+
return _build_response(client=client, response=response)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
async def asyncio(
|
|
127
|
+
*,
|
|
128
|
+
client: AuthenticatedClient,
|
|
129
|
+
body: CourseAccountRequest,
|
|
130
|
+
) -> CourseAccount:
|
|
131
|
+
"""
|
|
132
|
+
Args:
|
|
133
|
+
body (CourseAccountRequest):
|
|
134
|
+
|
|
135
|
+
Raises:
|
|
136
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
137
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
138
|
+
|
|
139
|
+
Returns:
|
|
140
|
+
CourseAccount
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
await asyncio_detailed(
|
|
145
|
+
client=client,
|
|
146
|
+
body=body,
|
|
147
|
+
)
|
|
148
|
+
).parsed
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.course_accounts_bulk_create import CourseAccountsBulkCreate
|
|
9
|
+
from ...models.course_accounts_bulk_create_request import CourseAccountsBulkCreateRequest
|
|
10
|
+
from ...types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
*,
|
|
15
|
+
body: CourseAccountsBulkCreateRequest,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
headers: dict[str, Any] = {}
|
|
18
|
+
|
|
19
|
+
_kwargs: dict[str, Any] = {
|
|
20
|
+
"method": "post",
|
|
21
|
+
"url": "/api/marketplace-course-accounts/create_bulk/",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
_kwargs["json"] = body.to_dict()
|
|
25
|
+
|
|
26
|
+
headers["Content-Type"] = "application/json"
|
|
27
|
+
|
|
28
|
+
_kwargs["headers"] = headers
|
|
29
|
+
return _kwargs
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _parse_response(
|
|
33
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
34
|
+
) -> CourseAccountsBulkCreate:
|
|
35
|
+
if response.status_code == 200:
|
|
36
|
+
response_200 = CourseAccountsBulkCreate.from_dict(response.json())
|
|
37
|
+
|
|
38
|
+
return response_200
|
|
39
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _build_response(
|
|
43
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
44
|
+
) -> Response[CourseAccountsBulkCreate]:
|
|
45
|
+
return Response(
|
|
46
|
+
status_code=HTTPStatus(response.status_code),
|
|
47
|
+
content=response.content,
|
|
48
|
+
headers=response.headers,
|
|
49
|
+
parsed=_parse_response(client=client, response=response),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def sync_detailed(
|
|
54
|
+
*,
|
|
55
|
+
client: AuthenticatedClient,
|
|
56
|
+
body: CourseAccountsBulkCreateRequest,
|
|
57
|
+
) -> Response[CourseAccountsBulkCreate]:
|
|
58
|
+
"""
|
|
59
|
+
Args:
|
|
60
|
+
body (CourseAccountsBulkCreateRequest):
|
|
61
|
+
|
|
62
|
+
Raises:
|
|
63
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
64
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
Response[CourseAccountsBulkCreate]
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
kwargs = _get_kwargs(
|
|
71
|
+
body=body,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
response = client.get_httpx_client().request(
|
|
75
|
+
**kwargs,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
return _build_response(client=client, response=response)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def sync(
|
|
82
|
+
*,
|
|
83
|
+
client: AuthenticatedClient,
|
|
84
|
+
body: CourseAccountsBulkCreateRequest,
|
|
85
|
+
) -> CourseAccountsBulkCreate:
|
|
86
|
+
"""
|
|
87
|
+
Args:
|
|
88
|
+
body (CourseAccountsBulkCreateRequest):
|
|
89
|
+
|
|
90
|
+
Raises:
|
|
91
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
92
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
93
|
+
|
|
94
|
+
Returns:
|
|
95
|
+
CourseAccountsBulkCreate
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
return sync_detailed(
|
|
99
|
+
client=client,
|
|
100
|
+
body=body,
|
|
101
|
+
).parsed
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
async def asyncio_detailed(
|
|
105
|
+
*,
|
|
106
|
+
client: AuthenticatedClient,
|
|
107
|
+
body: CourseAccountsBulkCreateRequest,
|
|
108
|
+
) -> Response[CourseAccountsBulkCreate]:
|
|
109
|
+
"""
|
|
110
|
+
Args:
|
|
111
|
+
body (CourseAccountsBulkCreateRequest):
|
|
112
|
+
|
|
113
|
+
Raises:
|
|
114
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
115
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
116
|
+
|
|
117
|
+
Returns:
|
|
118
|
+
Response[CourseAccountsBulkCreate]
|
|
119
|
+
"""
|
|
120
|
+
|
|
121
|
+
kwargs = _get_kwargs(
|
|
122
|
+
body=body,
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
126
|
+
|
|
127
|
+
return _build_response(client=client, response=response)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
async def asyncio(
|
|
131
|
+
*,
|
|
132
|
+
client: AuthenticatedClient,
|
|
133
|
+
body: CourseAccountsBulkCreateRequest,
|
|
134
|
+
) -> CourseAccountsBulkCreate:
|
|
135
|
+
"""
|
|
136
|
+
Args:
|
|
137
|
+
body (CourseAccountsBulkCreateRequest):
|
|
138
|
+
|
|
139
|
+
Raises:
|
|
140
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
141
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
142
|
+
|
|
143
|
+
Returns:
|
|
144
|
+
CourseAccountsBulkCreate
|
|
145
|
+
"""
|
|
146
|
+
|
|
147
|
+
return (
|
|
148
|
+
await asyncio_detailed(
|
|
149
|
+
client=client,
|
|
150
|
+
body=body,
|
|
151
|
+
)
|
|
152
|
+
).parsed
|