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.

Files changed (131) hide show
  1. waldur_api_client/api/customer_permissions_reviews/customer_permissions_reviews_count.py +19 -0
  2. waldur_api_client/api/customer_permissions_reviews/customer_permissions_reviews_list.py +19 -0
  3. waldur_api_client/api/customers/customers_users_list.py +141 -53
  4. waldur_api_client/api/invoices/invoices_items_retrieve.py +20 -0
  5. waldur_api_client/api/managed_rancher_cluster_resources/__init__.py +1 -0
  6. waldur_api_client/api/managed_rancher_cluster_resources/managed_rancher_cluster_resources_add_node.py +162 -0
  7. waldur_api_client/api/managed_rancher_cluster_resources/managed_rancher_cluster_resources_count.py +172 -0
  8. waldur_api_client/api/managed_rancher_cluster_resources/managed_rancher_cluster_resources_list.py +196 -0
  9. waldur_api_client/api/managed_rancher_cluster_resources/managed_rancher_cluster_resources_retrieve.py +171 -0
  10. waldur_api_client/api/marketplace_course_accounts/__init__.py +1 -0
  11. waldur_api_client/api/marketplace_course_accounts/marketplace_course_accounts_count.py +244 -0
  12. waldur_api_client/api/marketplace_course_accounts/marketplace_course_accounts_create.py +148 -0
  13. waldur_api_client/api/marketplace_course_accounts/marketplace_course_accounts_create_bulk.py +152 -0
  14. waldur_api_client/api/marketplace_course_accounts/marketplace_course_accounts_destroy.py +89 -0
  15. waldur_api_client/api/marketplace_course_accounts/marketplace_course_accounts_list.py +245 -0
  16. waldur_api_client/api/marketplace_course_accounts/marketplace_course_accounts_retrieve.py +140 -0
  17. waldur_api_client/api/marketplace_customer_service_accounts/marketplace_customer_service_accounts_count.py +25 -0
  18. waldur_api_client/api/marketplace_customer_service_accounts/marketplace_customer_service_accounts_list.py +25 -0
  19. waldur_api_client/api/marketplace_project_service_accounts/marketplace_project_service_accounts_count.py +25 -0
  20. waldur_api_client/api/marketplace_project_service_accounts/marketplace_project_service_accounts_list.py +25 -0
  21. waldur_api_client/api/marketplace_service_providers/marketplace_service_providers_course_accounts_list.py +284 -0
  22. waldur_api_client/api/marketplace_service_providers/marketplace_service_providers_project_service_accounts_list.py +29 -0
  23. waldur_api_client/api/project_permissions_reviews/__init__.py +1 -0
  24. waldur_api_client/api/project_permissions_reviews/project_permissions_reviews_close.py +91 -0
  25. waldur_api_client/api/project_permissions_reviews/project_permissions_reviews_count.py +266 -0
  26. waldur_api_client/api/project_permissions_reviews/project_permissions_reviews_list.py +269 -0
  27. waldur_api_client/api/project_permissions_reviews/project_permissions_reviews_retrieve.py +142 -0
  28. waldur_api_client/api/projects/projects_other_users_list.py +98 -23
  29. waldur_api_client/api/projects/projects_sync_user_roles.py +10 -9
  30. waldur_api_client/api/support_issue_statuses/__init__.py +1 -0
  31. waldur_api_client/api/support_issue_statuses/support_issue_statuses_count.py +172 -0
  32. waldur_api_client/api/support_issue_statuses/support_issue_statuses_create.py +148 -0
  33. waldur_api_client/api/support_issue_statuses/support_issue_statuses_destroy.py +89 -0
  34. waldur_api_client/api/support_issue_statuses/support_issue_statuses_list.py +173 -0
  35. waldur_api_client/api/support_issue_statuses/support_issue_statuses_partial_update.py +162 -0
  36. waldur_api_client/api/support_issue_statuses/support_issue_statuses_retrieve.py +140 -0
  37. waldur_api_client/api/support_issue_statuses/support_issue_statuses_update.py +162 -0
  38. waldur_api_client/api/user_group_invitations/user_group_invitations_submit_request.py +12 -12
  39. waldur_api_client/api/user_invitations/user_invitations_count.py +30 -0
  40. waldur_api_client/api/user_invitations/user_invitations_list.py +30 -0
  41. waldur_api_client/api/user_permission_requests/user_permission_requests_cancel_request.py +146 -0
  42. waldur_api_client/models/__init__.py +76 -4
  43. waldur_api_client/models/cancel_request_response.py +75 -0
  44. waldur_api_client/models/constance_settings.py +9 -0
  45. waldur_api_client/models/constance_settings_request.py +9 -0
  46. waldur_api_client/models/course_account.py +188 -0
  47. waldur_api_client/models/course_account_create_nested.py +68 -0
  48. waldur_api_client/models/course_account_create_nested_request.py +68 -0
  49. waldur_api_client/models/course_account_request.py +89 -0
  50. waldur_api_client/models/course_accounts_bulk_create.py +82 -0
  51. waldur_api_client/models/course_accounts_bulk_create_request.py +82 -0
  52. waldur_api_client/models/customer.py +9 -0
  53. waldur_api_client/models/customer_permission_review.py +16 -16
  54. waldur_api_client/models/customer_request.py +9 -0
  55. waldur_api_client/models/customer_service_account.py +9 -0
  56. waldur_api_client/models/customers_list_field_item.py +1 -0
  57. waldur_api_client/models/customers_retrieve_field_item.py +1 -0
  58. waldur_api_client/models/customers_users_list_o.py +9 -0
  59. waldur_api_client/models/customers_users_list_organization_role_item_type_0.py +10 -0
  60. waldur_api_client/models/customers_users_list_project_role_item_type_0.py +10 -0
  61. waldur_api_client/models/dependency_logic_operator_enum.py +9 -0
  62. waldur_api_client/models/event_subscription.py +1 -1
  63. waldur_api_client/models/event_types_enum.py +4 -0
  64. waldur_api_client/models/group_invitation.py +9 -0
  65. waldur_api_client/models/invitation.py +9 -0
  66. waldur_api_client/models/invoices_items_retrieve_o.py +15 -0
  67. waldur_api_client/models/issue_status.py +103 -0
  68. waldur_api_client/models/issue_status_request.py +78 -0
  69. waldur_api_client/models/issue_status_type_enum.py +9 -0
  70. waldur_api_client/models/kind_enum.py +10 -0
  71. waldur_api_client/models/managed_rancher_cluster_resources_list_field_item.py +82 -0
  72. waldur_api_client/models/managed_rancher_cluster_resources_retrieve_field_item.py +82 -0
  73. waldur_api_client/models/managed_rancher_create_node_request.py +186 -0
  74. waldur_api_client/models/marketplace_course_accounts_count_state_item.py +10 -0
  75. waldur_api_client/models/marketplace_course_accounts_list_state_item.py +10 -0
  76. waldur_api_client/models/marketplace_customer_service_accounts_count_state_item.py +10 -0
  77. waldur_api_client/models/marketplace_customer_service_accounts_list_state_item.py +10 -0
  78. waldur_api_client/models/marketplace_project_service_accounts_count_state_item.py +10 -0
  79. waldur_api_client/models/marketplace_project_service_accounts_list_state_item.py +10 -0
  80. waldur_api_client/models/marketplace_service_providers_course_accounts_list_state_item.py +10 -0
  81. waldur_api_client/models/marketplace_service_providers_project_service_accounts_list_state_item.py +10 -0
  82. waldur_api_client/models/marketplace_service_providers_projects_list_field_item.py +1 -0
  83. waldur_api_client/models/nested_security_group_rule.py +223 -0
  84. waldur_api_client/models/{open_stack_nested_security_group_rules_item.py → nested_security_group_rule_request.py} +67 -76
  85. waldur_api_client/models/open_stack_backup_restoration_request.py +0 -22
  86. waldur_api_client/models/open_stack_fixed_ip.py +13 -3
  87. waldur_api_client/models/open_stack_fixed_ip_request.py +7 -2
  88. waldur_api_client/models/open_stack_instance_create_order_attributes.py +20 -20
  89. waldur_api_client/models/open_stack_nested_security_group.py +16 -16
  90. waldur_api_client/models/open_stack_port_ip_update_request.py +6 -2
  91. waldur_api_client/models/open_stack_static_route.py +13 -4
  92. waldur_api_client/models/open_stack_static_route_request.py +7 -3
  93. waldur_api_client/models/open_stack_sub_net.py +15 -2
  94. waldur_api_client/models/open_stack_sub_net_allocation_pool.py +27 -8
  95. waldur_api_client/models/open_stack_sub_net_allocation_pool_request.py +14 -5
  96. waldur_api_client/models/open_stack_sub_net_request.py +15 -2
  97. waldur_api_client/models/patched_customer_request.py +9 -0
  98. waldur_api_client/models/patched_issue_status_request.py +76 -0
  99. waldur_api_client/models/patched_open_stack_sub_net_request.py +15 -2
  100. waldur_api_client/models/patched_project_request.py +17 -0
  101. waldur_api_client/models/patched_question_admin_request.py +17 -0
  102. waldur_api_client/models/patched_rancher_service_request.py +1 -1
  103. waldur_api_client/models/permission_request.py +16 -0
  104. waldur_api_client/models/project.py +17 -0
  105. waldur_api_client/models/project_permission_review.py +166 -0
  106. waldur_api_client/models/project_permissions_reviews_count_o_item.py +11 -0
  107. waldur_api_client/models/project_permissions_reviews_list_o_item.py +11 -0
  108. waldur_api_client/models/project_request.py +17 -0
  109. waldur_api_client/models/project_service_account.py +9 -0
  110. waldur_api_client/models/projects_list_field_item.py +1 -0
  111. waldur_api_client/models/projects_other_users_list_o.py +9 -0
  112. waldur_api_client/models/projects_retrieve_field_item.py +1 -0
  113. waldur_api_client/models/proposal.py +8 -0
  114. waldur_api_client/models/proposal_review.py +8 -0
  115. waldur_api_client/models/question_admin.py +17 -0
  116. waldur_api_client/models/question_admin_request.py +17 -0
  117. waldur_api_client/models/rancher_nested_public_ip.py +25 -7
  118. waldur_api_client/models/rancher_service.py +1 -1
  119. waldur_api_client/models/rancher_service_request.py +1 -1
  120. waldur_api_client/models/rmq_connection.py +8 -3
  121. waldur_api_client/models/rmq_subscription.py +7 -3
  122. waldur_api_client/models/robot_account.py +9 -17
  123. waldur_api_client/models/robot_account_details.py +9 -17
  124. waldur_api_client/models/service_account_state.py +10 -0
  125. waldur_api_client/models/submit_request_response.py +75 -0
  126. waldur_api_client/models/visible_invitation_details.py +9 -0
  127. {waldur_api_client-7.7.7.dist-info → waldur_api_client-7.7.8.dist-info}/METADATA +1 -1
  128. {waldur_api_client-7.7.7.dist-info → waldur_api_client-7.7.8.dist-info}/RECORD +130 -69
  129. waldur_api_client/models/robot_account_states.py +0 -13
  130. {waldur_api_client-7.7.7.dist-info → waldur_api_client-7.7.8.dist-info}/LICENSE +0 -0
  131. {waldur_api_client-7.7.7.dist-info → waldur_api_client-7.7.8.dist-info}/WHEEL +0 -0
@@ -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.issue_status import IssueStatus
9
+ from ...models.issue_status_request import IssueStatusRequest
10
+ from ...types import Response
11
+
12
+
13
+ def _get_kwargs(
14
+ *,
15
+ body: IssueStatusRequest,
16
+ ) -> dict[str, Any]:
17
+ headers: dict[str, Any] = {}
18
+
19
+ _kwargs: dict[str, Any] = {
20
+ "method": "post",
21
+ "url": "/api/support-issue-statuses/",
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) -> IssueStatus:
33
+ if response.status_code == 201:
34
+ response_201 = IssueStatus.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[IssueStatus]:
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: IssueStatusRequest,
53
+ ) -> Response[IssueStatus]:
54
+ """
55
+ Args:
56
+ body (IssueStatusRequest):
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[IssueStatus]
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: IssueStatusRequest,
81
+ ) -> IssueStatus:
82
+ """
83
+ Args:
84
+ body (IssueStatusRequest):
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
+ IssueStatus
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: IssueStatusRequest,
104
+ ) -> Response[IssueStatus]:
105
+ """
106
+ Args:
107
+ body (IssueStatusRequest):
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[IssueStatus]
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: IssueStatusRequest,
130
+ ) -> IssueStatus:
131
+ """
132
+ Args:
133
+ body (IssueStatusRequest):
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
+ IssueStatus
141
+ """
142
+
143
+ return (
144
+ await asyncio_detailed(
145
+ client=client,
146
+ body=body,
147
+ )
148
+ ).parsed
@@ -0,0 +1,89 @@
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 ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ uuid: UUID,
14
+ ) -> dict[str, Any]:
15
+ _kwargs: dict[str, Any] = {
16
+ "method": "delete",
17
+ "url": f"/api/support-issue-statuses/{uuid}/",
18
+ }
19
+
20
+ return _kwargs
21
+
22
+
23
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Any:
24
+ if response.status_code == 204:
25
+ return None
26
+ raise errors.UnexpectedStatus(response.status_code, response.content)
27
+
28
+
29
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
30
+ return Response(
31
+ status_code=HTTPStatus(response.status_code),
32
+ content=response.content,
33
+ headers=response.headers,
34
+ parsed=_parse_response(client=client, response=response),
35
+ )
36
+
37
+
38
+ def sync_detailed(
39
+ uuid: UUID,
40
+ *,
41
+ client: AuthenticatedClient,
42
+ ) -> Response[Any]:
43
+ """
44
+ Args:
45
+ uuid (UUID):
46
+
47
+ Raises:
48
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
49
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
50
+
51
+ Returns:
52
+ Response[Any]
53
+ """
54
+
55
+ kwargs = _get_kwargs(
56
+ uuid=uuid,
57
+ )
58
+
59
+ response = client.get_httpx_client().request(
60
+ **kwargs,
61
+ )
62
+
63
+ return _build_response(client=client, response=response)
64
+
65
+
66
+ async def asyncio_detailed(
67
+ uuid: UUID,
68
+ *,
69
+ client: AuthenticatedClient,
70
+ ) -> Response[Any]:
71
+ """
72
+ Args:
73
+ uuid (UUID):
74
+
75
+ Raises:
76
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
77
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
78
+
79
+ Returns:
80
+ Response[Any]
81
+ """
82
+
83
+ kwargs = _get_kwargs(
84
+ uuid=uuid,
85
+ )
86
+
87
+ response = await client.get_async_httpx_client().request(**kwargs)
88
+
89
+ return _build_response(client=client, response=response)
@@ -0,0 +1,173 @@
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.issue_status import IssueStatus
9
+ from ...types import UNSET, Response, Unset
10
+
11
+
12
+ def _get_kwargs(
13
+ *,
14
+ page: Union[Unset, int] = UNSET,
15
+ page_size: Union[Unset, int] = UNSET,
16
+ ) -> dict[str, Any]:
17
+ params: dict[str, Any] = {}
18
+
19
+ params["page"] = page
20
+
21
+ params["page_size"] = page_size
22
+
23
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
24
+
25
+ _kwargs: dict[str, Any] = {
26
+ "method": "get",
27
+ "url": "/api/support-issue-statuses/",
28
+ "params": params,
29
+ }
30
+
31
+ return _kwargs
32
+
33
+
34
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> list["IssueStatus"]:
35
+ if response.status_code == 200:
36
+ response_200 = []
37
+ _response_200 = response.json()
38
+ for response_200_item_data in _response_200:
39
+ response_200_item = IssueStatus.from_dict(response_200_item_data)
40
+
41
+ response_200.append(response_200_item)
42
+
43
+ return response_200
44
+ raise errors.UnexpectedStatus(response.status_code, response.content)
45
+
46
+
47
+ def _build_response(
48
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
49
+ ) -> Response[list["IssueStatus"]]:
50
+ return Response(
51
+ status_code=HTTPStatus(response.status_code),
52
+ content=response.content,
53
+ headers=response.headers,
54
+ parsed=_parse_response(client=client, response=response),
55
+ )
56
+
57
+
58
+ def sync_detailed(
59
+ *,
60
+ client: AuthenticatedClient,
61
+ page: Union[Unset, int] = UNSET,
62
+ page_size: Union[Unset, int] = UNSET,
63
+ ) -> Response[list["IssueStatus"]]:
64
+ """Mixin to optimize HEAD requests for DRF views bypassing serializer processing
65
+
66
+ Args:
67
+ page (Union[Unset, int]):
68
+ page_size (Union[Unset, int]):
69
+
70
+ Raises:
71
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
72
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
73
+
74
+ Returns:
75
+ Response[list['IssueStatus']]
76
+ """
77
+
78
+ kwargs = _get_kwargs(
79
+ page=page,
80
+ page_size=page_size,
81
+ )
82
+
83
+ response = client.get_httpx_client().request(
84
+ **kwargs,
85
+ )
86
+
87
+ return _build_response(client=client, response=response)
88
+
89
+
90
+ def sync(
91
+ *,
92
+ client: AuthenticatedClient,
93
+ page: Union[Unset, int] = UNSET,
94
+ page_size: Union[Unset, int] = UNSET,
95
+ ) -> list["IssueStatus"]:
96
+ """Mixin to optimize HEAD requests for DRF views bypassing serializer processing
97
+
98
+ Args:
99
+ page (Union[Unset, int]):
100
+ page_size (Union[Unset, int]):
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
+ list['IssueStatus']
108
+ """
109
+
110
+ return sync_detailed(
111
+ client=client,
112
+ page=page,
113
+ page_size=page_size,
114
+ ).parsed
115
+
116
+
117
+ async def asyncio_detailed(
118
+ *,
119
+ client: AuthenticatedClient,
120
+ page: Union[Unset, int] = UNSET,
121
+ page_size: Union[Unset, int] = UNSET,
122
+ ) -> Response[list["IssueStatus"]]:
123
+ """Mixin to optimize HEAD requests for DRF views bypassing serializer processing
124
+
125
+ Args:
126
+ page (Union[Unset, int]):
127
+ page_size (Union[Unset, int]):
128
+
129
+ Raises:
130
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
131
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
132
+
133
+ Returns:
134
+ Response[list['IssueStatus']]
135
+ """
136
+
137
+ kwargs = _get_kwargs(
138
+ page=page,
139
+ page_size=page_size,
140
+ )
141
+
142
+ response = await client.get_async_httpx_client().request(**kwargs)
143
+
144
+ return _build_response(client=client, response=response)
145
+
146
+
147
+ async def asyncio(
148
+ *,
149
+ client: AuthenticatedClient,
150
+ page: Union[Unset, int] = UNSET,
151
+ page_size: Union[Unset, int] = UNSET,
152
+ ) -> list["IssueStatus"]:
153
+ """Mixin to optimize HEAD requests for DRF views bypassing serializer processing
154
+
155
+ Args:
156
+ page (Union[Unset, int]):
157
+ page_size (Union[Unset, int]):
158
+
159
+ Raises:
160
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
161
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
162
+
163
+ Returns:
164
+ list['IssueStatus']
165
+ """
166
+
167
+ return (
168
+ await asyncio_detailed(
169
+ client=client,
170
+ page=page,
171
+ page_size=page_size,
172
+ )
173
+ ).parsed
@@ -0,0 +1,162 @@
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.issue_status import IssueStatus
10
+ from ...models.patched_issue_status_request import PatchedIssueStatusRequest
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ uuid: UUID,
16
+ *,
17
+ body: PatchedIssueStatusRequest,
18
+ ) -> dict[str, Any]:
19
+ headers: dict[str, Any] = {}
20
+
21
+ _kwargs: dict[str, Any] = {
22
+ "method": "patch",
23
+ "url": f"/api/support-issue-statuses/{uuid}/",
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(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> IssueStatus:
35
+ if response.status_code == 200:
36
+ response_200 = IssueStatus.from_dict(response.json())
37
+
38
+ return response_200
39
+ raise errors.UnexpectedStatus(response.status_code, response.content)
40
+
41
+
42
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[IssueStatus]:
43
+ return Response(
44
+ status_code=HTTPStatus(response.status_code),
45
+ content=response.content,
46
+ headers=response.headers,
47
+ parsed=_parse_response(client=client, response=response),
48
+ )
49
+
50
+
51
+ def sync_detailed(
52
+ uuid: UUID,
53
+ *,
54
+ client: AuthenticatedClient,
55
+ body: PatchedIssueStatusRequest,
56
+ ) -> Response[IssueStatus]:
57
+ """
58
+ Args:
59
+ uuid (UUID):
60
+ body (PatchedIssueStatusRequest):
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[IssueStatus]
68
+ """
69
+
70
+ kwargs = _get_kwargs(
71
+ uuid=uuid,
72
+ body=body,
73
+ )
74
+
75
+ response = client.get_httpx_client().request(
76
+ **kwargs,
77
+ )
78
+
79
+ return _build_response(client=client, response=response)
80
+
81
+
82
+ def sync(
83
+ uuid: UUID,
84
+ *,
85
+ client: AuthenticatedClient,
86
+ body: PatchedIssueStatusRequest,
87
+ ) -> IssueStatus:
88
+ """
89
+ Args:
90
+ uuid (UUID):
91
+ body (PatchedIssueStatusRequest):
92
+
93
+ Raises:
94
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
95
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
96
+
97
+ Returns:
98
+ IssueStatus
99
+ """
100
+
101
+ return sync_detailed(
102
+ uuid=uuid,
103
+ client=client,
104
+ body=body,
105
+ ).parsed
106
+
107
+
108
+ async def asyncio_detailed(
109
+ uuid: UUID,
110
+ *,
111
+ client: AuthenticatedClient,
112
+ body: PatchedIssueStatusRequest,
113
+ ) -> Response[IssueStatus]:
114
+ """
115
+ Args:
116
+ uuid (UUID):
117
+ body (PatchedIssueStatusRequest):
118
+
119
+ Raises:
120
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
121
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
122
+
123
+ Returns:
124
+ Response[IssueStatus]
125
+ """
126
+
127
+ kwargs = _get_kwargs(
128
+ uuid=uuid,
129
+ body=body,
130
+ )
131
+
132
+ response = await client.get_async_httpx_client().request(**kwargs)
133
+
134
+ return _build_response(client=client, response=response)
135
+
136
+
137
+ async def asyncio(
138
+ uuid: UUID,
139
+ *,
140
+ client: AuthenticatedClient,
141
+ body: PatchedIssueStatusRequest,
142
+ ) -> IssueStatus:
143
+ """
144
+ Args:
145
+ uuid (UUID):
146
+ body (PatchedIssueStatusRequest):
147
+
148
+ Raises:
149
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
150
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
151
+
152
+ Returns:
153
+ IssueStatus
154
+ """
155
+
156
+ return (
157
+ await asyncio_detailed(
158
+ uuid=uuid,
159
+ client=client,
160
+ body=body,
161
+ )
162
+ ).parsed
@@ -0,0 +1,140 @@
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.issue_status import IssueStatus
10
+ from ...types import Response
11
+
12
+
13
+ def _get_kwargs(
14
+ uuid: UUID,
15
+ ) -> dict[str, Any]:
16
+ _kwargs: dict[str, Any] = {
17
+ "method": "get",
18
+ "url": f"/api/support-issue-statuses/{uuid}/",
19
+ }
20
+
21
+ return _kwargs
22
+
23
+
24
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> IssueStatus:
25
+ if response.status_code == 200:
26
+ response_200 = IssueStatus.from_dict(response.json())
27
+
28
+ return response_200
29
+ raise errors.UnexpectedStatus(response.status_code, response.content)
30
+
31
+
32
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[IssueStatus]:
33
+ return Response(
34
+ status_code=HTTPStatus(response.status_code),
35
+ content=response.content,
36
+ headers=response.headers,
37
+ parsed=_parse_response(client=client, response=response),
38
+ )
39
+
40
+
41
+ def sync_detailed(
42
+ uuid: UUID,
43
+ *,
44
+ client: AuthenticatedClient,
45
+ ) -> Response[IssueStatus]:
46
+ """
47
+ Args:
48
+ uuid (UUID):
49
+
50
+ Raises:
51
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
52
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
53
+
54
+ Returns:
55
+ Response[IssueStatus]
56
+ """
57
+
58
+ kwargs = _get_kwargs(
59
+ uuid=uuid,
60
+ )
61
+
62
+ response = client.get_httpx_client().request(
63
+ **kwargs,
64
+ )
65
+
66
+ return _build_response(client=client, response=response)
67
+
68
+
69
+ def sync(
70
+ uuid: UUID,
71
+ *,
72
+ client: AuthenticatedClient,
73
+ ) -> IssueStatus:
74
+ """
75
+ Args:
76
+ uuid (UUID):
77
+
78
+ Raises:
79
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
80
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
81
+
82
+ Returns:
83
+ IssueStatus
84
+ """
85
+
86
+ return sync_detailed(
87
+ uuid=uuid,
88
+ client=client,
89
+ ).parsed
90
+
91
+
92
+ async def asyncio_detailed(
93
+ uuid: UUID,
94
+ *,
95
+ client: AuthenticatedClient,
96
+ ) -> Response[IssueStatus]:
97
+ """
98
+ Args:
99
+ uuid (UUID):
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[IssueStatus]
107
+ """
108
+
109
+ kwargs = _get_kwargs(
110
+ uuid=uuid,
111
+ )
112
+
113
+ response = await client.get_async_httpx_client().request(**kwargs)
114
+
115
+ return _build_response(client=client, response=response)
116
+
117
+
118
+ async def asyncio(
119
+ uuid: UUID,
120
+ *,
121
+ client: AuthenticatedClient,
122
+ ) -> IssueStatus:
123
+ """
124
+ Args:
125
+ uuid (UUID):
126
+
127
+ Raises:
128
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
129
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
130
+
131
+ Returns:
132
+ IssueStatus
133
+ """
134
+
135
+ return (
136
+ await asyncio_detailed(
137
+ uuid=uuid,
138
+ client=client,
139
+ )
140
+ ).parsed