waldur-api-client 7.8.3__py3-none-any.whl → 7.8.4__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 (118) hide show
  1. waldur_api_client/api/booking_resources/booking_resources_count.py +18 -0
  2. waldur_api_client/api/booking_resources/booking_resources_list.py +18 -0
  3. waldur_api_client/api/marketplace_offering_users/marketplace_offering_users_checklist_template_count.py +125 -0
  4. waldur_api_client/api/marketplace_offering_users/marketplace_offering_users_checklist_template_retrieve.py +126 -0
  5. waldur_api_client/api/marketplace_provider_offerings/marketplace_provider_offerings_tos_stats_retrieve.py +146 -0
  6. waldur_api_client/api/marketplace_provider_resources/marketplace_provider_resources_count.py +18 -0
  7. waldur_api_client/api/marketplace_provider_resources/marketplace_provider_resources_list.py +18 -0
  8. waldur_api_client/api/marketplace_provider_resources/marketplace_provider_resources_update_options.py +168 -0
  9. waldur_api_client/api/marketplace_resources/marketplace_resources_count.py +18 -0
  10. waldur_api_client/api/marketplace_resources/marketplace_resources_list.py +18 -0
  11. waldur_api_client/api/marketplace_resources/marketplace_resources_renew.py +166 -0
  12. waldur_api_client/api/marketplace_service_providers/service_provider_checklists_summary.py +189 -0
  13. waldur_api_client/api/onboarding/__init__.py +1 -0
  14. waldur_api_client/api/onboarding/onboarding_supported_countries_retrieve.py +74 -0
  15. waldur_api_client/api/onboarding_justifications/__init__.py +1 -0
  16. waldur_api_client/api/onboarding_justifications/onboarding_justifications_attach_document.py +211 -0
  17. waldur_api_client/api/onboarding_justifications/onboarding_justifications_count.py +172 -0
  18. waldur_api_client/api/onboarding_justifications/onboarding_justifications_create.py +150 -0
  19. waldur_api_client/api/onboarding_justifications/onboarding_justifications_create_justification.py +154 -0
  20. waldur_api_client/api/onboarding_justifications/onboarding_justifications_destroy.py +89 -0
  21. waldur_api_client/api/onboarding_justifications/onboarding_justifications_list.py +175 -0
  22. waldur_api_client/api/onboarding_justifications/onboarding_justifications_partial_update.py +164 -0
  23. waldur_api_client/api/onboarding_justifications/onboarding_justifications_retrieve.py +142 -0
  24. waldur_api_client/api/onboarding_justifications/onboarding_justifications_update.py +164 -0
  25. waldur_api_client/api/onboarding_verifications/__init__.py +1 -0
  26. waldur_api_client/api/onboarding_verifications/onboarding_verifications_count.py +172 -0
  27. waldur_api_client/api/onboarding_verifications/onboarding_verifications_create.py +150 -0
  28. waldur_api_client/api/onboarding_verifications/onboarding_verifications_create_customer.py +144 -0
  29. waldur_api_client/api/onboarding_verifications/onboarding_verifications_destroy.py +89 -0
  30. waldur_api_client/api/onboarding_verifications/onboarding_verifications_list.py +175 -0
  31. waldur_api_client/api/onboarding_verifications/onboarding_verifications_partial_update.py +164 -0
  32. waldur_api_client/api/onboarding_verifications/onboarding_verifications_retrieve.py +142 -0
  33. waldur_api_client/api/onboarding_verifications/onboarding_verifications_update.py +164 -0
  34. waldur_api_client/api/onboarding_verifications/onboarding_verifications_validate_company.py +154 -0
  35. waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_count.py +33 -0
  36. waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_create.py +154 -0
  37. waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_destroy.py +91 -0
  38. waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_list.py +33 -0
  39. waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_partial_update.py +164 -0
  40. waldur_api_client/api/openstack_network_rbac_policies/openstack_network_rbac_policies_update.py +164 -0
  41. waldur_api_client/api/openstack_networks/openstack_networks_rbac_policy_create.py +24 -22
  42. waldur_api_client/api/projects/projects_checklist_template_count.py +125 -0
  43. waldur_api_client/api/projects/projects_checklist_template_retrieve.py +126 -0
  44. waldur_api_client/api/proposal_proposals/proposal_proposals_checklist_template_count.py +125 -0
  45. waldur_api_client/api/proposal_proposals/proposal_proposals_checklist_template_retrieve.py +126 -0
  46. waldur_api_client/api/proposal_protected_calls/proposal_protected_calls_offerings_list.py +15 -0
  47. waldur_api_client/models/__init__.py +62 -4
  48. waldur_api_client/models/booking_resource.py +4 -11
  49. waldur_api_client/models/call_round.py +4 -4
  50. waldur_api_client/models/checklist_template.py +99 -0
  51. waldur_api_client/models/checklist_template_checklist.py +44 -0
  52. waldur_api_client/models/constance_settings.py +45 -0
  53. waldur_api_client/models/constance_settings_request.py +45 -0
  54. waldur_api_client/models/constance_settings_request_form.py +45 -0
  55. waldur_api_client/models/constance_settings_request_multipart.py +85 -0
  56. waldur_api_client/models/customer.py +9 -0
  57. waldur_api_client/models/customers_list_field_item.py +1 -0
  58. waldur_api_client/models/customers_retrieve_field_item.py +1 -0
  59. waldur_api_client/models/deprecated_network_rbac_policy.py +137 -0
  60. waldur_api_client/models/deprecated_network_rbac_policy_request.py +78 -0
  61. waldur_api_client/models/event_types_enum.py +1 -0
  62. waldur_api_client/models/marketplace_service_providers_projects_list_field_item.py +1 -0
  63. waldur_api_client/models/merged_plugin_options.py +18 -0
  64. waldur_api_client/models/merged_plugin_options_request.py +18 -0
  65. waldur_api_client/models/nested_round.py +5 -5
  66. waldur_api_client/models/network_rbac_policy_request.py +8 -0
  67. waldur_api_client/models/notification.py +9 -9
  68. waldur_api_client/models/{notification_context_fields.py → notification_context_schema.py} +6 -6
  69. waldur_api_client/models/notification_template_detail_serializers.py +9 -3
  70. waldur_api_client/models/offering_component.py +79 -0
  71. waldur_api_client/models/offering_component_request.py +80 -0
  72. waldur_api_client/models/onboarding_company_validation_request_request.py +88 -0
  73. waldur_api_client/models/onboarding_justification.py +183 -0
  74. waldur_api_client/models/onboarding_justification_create_request.py +68 -0
  75. waldur_api_client/models/onboarding_justification_documentation.py +108 -0
  76. waldur_api_client/models/onboarding_justification_documentation_request.py +84 -0
  77. waldur_api_client/models/onboarding_justification_documentation_request_form.py +84 -0
  78. waldur_api_client/models/onboarding_justification_documentation_request_multipart.py +98 -0
  79. waldur_api_client/models/onboarding_justification_request.py +75 -0
  80. waldur_api_client/models/onboarding_verification.py +250 -0
  81. waldur_api_client/models/onboarding_verification_request.py +128 -0
  82. waldur_api_client/models/onboarding_verification_status_enum.py +12 -0
  83. waldur_api_client/models/open_stack_create_floating_ip_request.py +20 -1
  84. waldur_api_client/models/order_create.py +4 -4
  85. waldur_api_client/models/order_details.py +4 -11
  86. waldur_api_client/models/patched_network_rbac_policy_request.py +85 -0
  87. waldur_api_client/models/patched_onboarding_justification_request.py +77 -0
  88. waldur_api_client/models/patched_onboarding_verification_request.py +128 -0
  89. waldur_api_client/models/patched_project_credit_request.py +13 -0
  90. waldur_api_client/models/patched_project_request.py +1 -2
  91. waldur_api_client/models/patched_project_request_form.py +1 -2
  92. waldur_api_client/models/patched_project_request_multipart.py +1 -2
  93. waldur_api_client/models/project.py +10 -2
  94. waldur_api_client/models/project_credit.py +13 -0
  95. waldur_api_client/models/project_credit_request.py +13 -0
  96. waldur_api_client/models/project_request.py +1 -2
  97. waldur_api_client/models/project_request_form.py +1 -2
  98. waldur_api_client/models/project_request_multipart.py +1 -2
  99. waldur_api_client/models/projects_list_field_item.py +1 -0
  100. waldur_api_client/models/projects_retrieve_field_item.py +1 -0
  101. waldur_api_client/models/protected_round.py +4 -4
  102. waldur_api_client/models/question.py +102 -0
  103. waldur_api_client/models/question_options.py +79 -0
  104. waldur_api_client/models/resource.py +4 -11
  105. waldur_api_client/models/resource_renew_request.py +83 -0
  106. waldur_api_client/models/resource_renew_request_limits.py +44 -0
  107. waldur_api_client/models/{status_enum.py → round_status.py} +1 -1
  108. waldur_api_client/models/service_provider_checklist_summary.py +98 -0
  109. waldur_api_client/models/time_series_to_s_data.py +69 -0
  110. waldur_api_client/models/to_s_consent_dashboard.py +155 -0
  111. waldur_api_client/models/update_offering_component_request.py +79 -0
  112. waldur_api_client/models/validation_decision_enum.py +10 -0
  113. waldur_api_client/models/validation_method_enum.py +8 -0
  114. waldur_api_client/models/version_adoption.py +67 -0
  115. {waldur_api_client-7.8.3.dist-info → waldur_api_client-7.8.4.dist-info}/METADATA +1 -1
  116. {waldur_api_client-7.8.3.dist-info → waldur_api_client-7.8.4.dist-info}/RECORD +118 -54
  117. {waldur_api_client-7.8.3.dist-info → waldur_api_client-7.8.4.dist-info}/WHEEL +0 -0
  118. {waldur_api_client-7.8.3.dist-info → waldur_api_client-7.8.4.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,164 @@
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.network_rbac_policy import NetworkRBACPolicy
10
+ from ...models.patched_network_rbac_policy_request import PatchedNetworkRBACPolicyRequest
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ uuid: UUID,
16
+ *,
17
+ body: PatchedNetworkRBACPolicyRequest,
18
+ ) -> dict[str, Any]:
19
+ headers: dict[str, Any] = {}
20
+
21
+ _kwargs: dict[str, Any] = {
22
+ "method": "patch",
23
+ "url": f"/api/openstack-network-rbac-policies/{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) -> NetworkRBACPolicy:
35
+ if response.status_code == 200:
36
+ response_200 = NetworkRBACPolicy.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[NetworkRBACPolicy]:
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
+ uuid: UUID,
55
+ *,
56
+ client: AuthenticatedClient,
57
+ body: PatchedNetworkRBACPolicyRequest,
58
+ ) -> Response[NetworkRBACPolicy]:
59
+ """
60
+ Args:
61
+ uuid (UUID):
62
+ body (PatchedNetworkRBACPolicyRequest):
63
+
64
+ Raises:
65
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
66
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
67
+
68
+ Returns:
69
+ Response[NetworkRBACPolicy]
70
+ """
71
+
72
+ kwargs = _get_kwargs(
73
+ uuid=uuid,
74
+ body=body,
75
+ )
76
+
77
+ response = client.get_httpx_client().request(
78
+ **kwargs,
79
+ )
80
+
81
+ return _build_response(client=client, response=response)
82
+
83
+
84
+ def sync(
85
+ uuid: UUID,
86
+ *,
87
+ client: AuthenticatedClient,
88
+ body: PatchedNetworkRBACPolicyRequest,
89
+ ) -> NetworkRBACPolicy:
90
+ """
91
+ Args:
92
+ uuid (UUID):
93
+ body (PatchedNetworkRBACPolicyRequest):
94
+
95
+ Raises:
96
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
97
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
98
+
99
+ Returns:
100
+ NetworkRBACPolicy
101
+ """
102
+
103
+ return sync_detailed(
104
+ uuid=uuid,
105
+ client=client,
106
+ body=body,
107
+ ).parsed
108
+
109
+
110
+ async def asyncio_detailed(
111
+ uuid: UUID,
112
+ *,
113
+ client: AuthenticatedClient,
114
+ body: PatchedNetworkRBACPolicyRequest,
115
+ ) -> Response[NetworkRBACPolicy]:
116
+ """
117
+ Args:
118
+ uuid (UUID):
119
+ body (PatchedNetworkRBACPolicyRequest):
120
+
121
+ Raises:
122
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
123
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
124
+
125
+ Returns:
126
+ Response[NetworkRBACPolicy]
127
+ """
128
+
129
+ kwargs = _get_kwargs(
130
+ uuid=uuid,
131
+ body=body,
132
+ )
133
+
134
+ response = await client.get_async_httpx_client().request(**kwargs)
135
+
136
+ return _build_response(client=client, response=response)
137
+
138
+
139
+ async def asyncio(
140
+ uuid: UUID,
141
+ *,
142
+ client: AuthenticatedClient,
143
+ body: PatchedNetworkRBACPolicyRequest,
144
+ ) -> NetworkRBACPolicy:
145
+ """
146
+ Args:
147
+ uuid (UUID):
148
+ body (PatchedNetworkRBACPolicyRequest):
149
+
150
+ Raises:
151
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
152
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
153
+
154
+ Returns:
155
+ NetworkRBACPolicy
156
+ """
157
+
158
+ return (
159
+ await asyncio_detailed(
160
+ uuid=uuid,
161
+ client=client,
162
+ body=body,
163
+ )
164
+ ).parsed
@@ -0,0 +1,164 @@
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.network_rbac_policy import NetworkRBACPolicy
10
+ from ...models.network_rbac_policy_request import NetworkRBACPolicyRequest
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ uuid: UUID,
16
+ *,
17
+ body: NetworkRBACPolicyRequest,
18
+ ) -> dict[str, Any]:
19
+ headers: dict[str, Any] = {}
20
+
21
+ _kwargs: dict[str, Any] = {
22
+ "method": "put",
23
+ "url": f"/api/openstack-network-rbac-policies/{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) -> NetworkRBACPolicy:
35
+ if response.status_code == 200:
36
+ response_200 = NetworkRBACPolicy.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[NetworkRBACPolicy]:
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
+ uuid: UUID,
55
+ *,
56
+ client: AuthenticatedClient,
57
+ body: NetworkRBACPolicyRequest,
58
+ ) -> Response[NetworkRBACPolicy]:
59
+ """
60
+ Args:
61
+ uuid (UUID):
62
+ body (NetworkRBACPolicyRequest):
63
+
64
+ Raises:
65
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
66
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
67
+
68
+ Returns:
69
+ Response[NetworkRBACPolicy]
70
+ """
71
+
72
+ kwargs = _get_kwargs(
73
+ uuid=uuid,
74
+ body=body,
75
+ )
76
+
77
+ response = client.get_httpx_client().request(
78
+ **kwargs,
79
+ )
80
+
81
+ return _build_response(client=client, response=response)
82
+
83
+
84
+ def sync(
85
+ uuid: UUID,
86
+ *,
87
+ client: AuthenticatedClient,
88
+ body: NetworkRBACPolicyRequest,
89
+ ) -> NetworkRBACPolicy:
90
+ """
91
+ Args:
92
+ uuid (UUID):
93
+ body (NetworkRBACPolicyRequest):
94
+
95
+ Raises:
96
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
97
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
98
+
99
+ Returns:
100
+ NetworkRBACPolicy
101
+ """
102
+
103
+ return sync_detailed(
104
+ uuid=uuid,
105
+ client=client,
106
+ body=body,
107
+ ).parsed
108
+
109
+
110
+ async def asyncio_detailed(
111
+ uuid: UUID,
112
+ *,
113
+ client: AuthenticatedClient,
114
+ body: NetworkRBACPolicyRequest,
115
+ ) -> Response[NetworkRBACPolicy]:
116
+ """
117
+ Args:
118
+ uuid (UUID):
119
+ body (NetworkRBACPolicyRequest):
120
+
121
+ Raises:
122
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
123
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
124
+
125
+ Returns:
126
+ Response[NetworkRBACPolicy]
127
+ """
128
+
129
+ kwargs = _get_kwargs(
130
+ uuid=uuid,
131
+ body=body,
132
+ )
133
+
134
+ response = await client.get_async_httpx_client().request(**kwargs)
135
+
136
+ return _build_response(client=client, response=response)
137
+
138
+
139
+ async def asyncio(
140
+ uuid: UUID,
141
+ *,
142
+ client: AuthenticatedClient,
143
+ body: NetworkRBACPolicyRequest,
144
+ ) -> NetworkRBACPolicy:
145
+ """
146
+ Args:
147
+ uuid (UUID):
148
+ body (NetworkRBACPolicyRequest):
149
+
150
+ Raises:
151
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
152
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
153
+
154
+ Returns:
155
+ NetworkRBACPolicy
156
+ """
157
+
158
+ return (
159
+ await asyncio_detailed(
160
+ uuid=uuid,
161
+ client=client,
162
+ body=body,
163
+ )
164
+ ).parsed
@@ -6,15 +6,15 @@ import httpx
6
6
 
7
7
  from ... import errors
8
8
  from ...client import AuthenticatedClient, Client
9
- from ...models.network_rbac_policy import NetworkRBACPolicy
10
- from ...models.network_rbac_policy_request import NetworkRBACPolicyRequest
9
+ from ...models.deprecated_network_rbac_policy import DeprecatedNetworkRBACPolicy
10
+ from ...models.deprecated_network_rbac_policy_request import DeprecatedNetworkRBACPolicyRequest
11
11
  from ...types import Response
12
12
 
13
13
 
14
14
  def _get_kwargs(
15
15
  uuid: UUID,
16
16
  *,
17
- body: NetworkRBACPolicyRequest,
17
+ body: DeprecatedNetworkRBACPolicyRequest,
18
18
  ) -> dict[str, Any]:
19
19
  headers: dict[str, Any] = {}
20
20
 
@@ -31,9 +31,11 @@ def _get_kwargs(
31
31
  return _kwargs
32
32
 
33
33
 
34
- def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> NetworkRBACPolicy:
34
+ def _parse_response(
35
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
36
+ ) -> DeprecatedNetworkRBACPolicy:
35
37
  if response.status_code == 200:
36
- response_200 = NetworkRBACPolicy.from_dict(response.json())
38
+ response_200 = DeprecatedNetworkRBACPolicy.from_dict(response.json())
37
39
 
38
40
  return response_200
39
41
  raise errors.UnexpectedStatus(response.status_code, response.content)
@@ -41,7 +43,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt
41
43
 
42
44
  def _build_response(
43
45
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
44
- ) -> Response[NetworkRBACPolicy]:
46
+ ) -> Response[DeprecatedNetworkRBACPolicy]:
45
47
  return Response(
46
48
  status_code=HTTPStatus(response.status_code),
47
49
  content=response.content,
@@ -54,20 +56,20 @@ def sync_detailed(
54
56
  uuid: UUID,
55
57
  *,
56
58
  client: AuthenticatedClient,
57
- body: NetworkRBACPolicyRequest,
58
- ) -> Response[NetworkRBACPolicy]:
59
+ body: DeprecatedNetworkRBACPolicyRequest,
60
+ ) -> Response[DeprecatedNetworkRBACPolicy]:
59
61
  """Create RBAC policy for the network
60
62
 
61
63
  Args:
62
64
  uuid (UUID):
63
- body (NetworkRBACPolicyRequest):
65
+ body (DeprecatedNetworkRBACPolicyRequest):
64
66
 
65
67
  Raises:
66
68
  errors.UnexpectedStatus: If the server returns an undocumented status code.
67
69
  httpx.TimeoutException: If the request takes longer than Client.timeout.
68
70
 
69
71
  Returns:
70
- Response[NetworkRBACPolicy]
72
+ Response[DeprecatedNetworkRBACPolicy]
71
73
  """
72
74
 
73
75
  kwargs = _get_kwargs(
@@ -86,20 +88,20 @@ def sync(
86
88
  uuid: UUID,
87
89
  *,
88
90
  client: AuthenticatedClient,
89
- body: NetworkRBACPolicyRequest,
90
- ) -> NetworkRBACPolicy:
91
+ body: DeprecatedNetworkRBACPolicyRequest,
92
+ ) -> DeprecatedNetworkRBACPolicy:
91
93
  """Create RBAC policy for the network
92
94
 
93
95
  Args:
94
96
  uuid (UUID):
95
- body (NetworkRBACPolicyRequest):
97
+ body (DeprecatedNetworkRBACPolicyRequest):
96
98
 
97
99
  Raises:
98
100
  errors.UnexpectedStatus: If the server returns an undocumented status code.
99
101
  httpx.TimeoutException: If the request takes longer than Client.timeout.
100
102
 
101
103
  Returns:
102
- NetworkRBACPolicy
104
+ DeprecatedNetworkRBACPolicy
103
105
  """
104
106
 
105
107
  return sync_detailed(
@@ -113,20 +115,20 @@ async def asyncio_detailed(
113
115
  uuid: UUID,
114
116
  *,
115
117
  client: AuthenticatedClient,
116
- body: NetworkRBACPolicyRequest,
117
- ) -> Response[NetworkRBACPolicy]:
118
+ body: DeprecatedNetworkRBACPolicyRequest,
119
+ ) -> Response[DeprecatedNetworkRBACPolicy]:
118
120
  """Create RBAC policy for the network
119
121
 
120
122
  Args:
121
123
  uuid (UUID):
122
- body (NetworkRBACPolicyRequest):
124
+ body (DeprecatedNetworkRBACPolicyRequest):
123
125
 
124
126
  Raises:
125
127
  errors.UnexpectedStatus: If the server returns an undocumented status code.
126
128
  httpx.TimeoutException: If the request takes longer than Client.timeout.
127
129
 
128
130
  Returns:
129
- Response[NetworkRBACPolicy]
131
+ Response[DeprecatedNetworkRBACPolicy]
130
132
  """
131
133
 
132
134
  kwargs = _get_kwargs(
@@ -143,20 +145,20 @@ async def asyncio(
143
145
  uuid: UUID,
144
146
  *,
145
147
  client: AuthenticatedClient,
146
- body: NetworkRBACPolicyRequest,
147
- ) -> NetworkRBACPolicy:
148
+ body: DeprecatedNetworkRBACPolicyRequest,
149
+ ) -> DeprecatedNetworkRBACPolicy:
148
150
  """Create RBAC policy for the network
149
151
 
150
152
  Args:
151
153
  uuid (UUID):
152
- body (NetworkRBACPolicyRequest):
154
+ body (DeprecatedNetworkRBACPolicyRequest):
153
155
 
154
156
  Raises:
155
157
  errors.UnexpectedStatus: If the server returns an undocumented status code.
156
158
  httpx.TimeoutException: If the request takes longer than Client.timeout.
157
159
 
158
160
  Returns:
159
- NetworkRBACPolicy
161
+ DeprecatedNetworkRBACPolicy
160
162
  """
161
163
 
162
164
  return (
@@ -0,0 +1,125 @@
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 ...types import Response
9
+
10
+
11
+ def _get_kwargs() -> dict[str, Any]:
12
+ _kwargs: dict[str, Any] = {
13
+ "method": "head",
14
+ "url": "/api/projects/checklist-template/",
15
+ }
16
+
17
+ return _kwargs
18
+
19
+
20
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> int:
21
+ if response.status_code == HTTPStatus.OK:
22
+ try:
23
+ return int(response.headers["x-result-count"])
24
+ except KeyError:
25
+ raise errors.UnexpectedStatus(
26
+ response.status_code, b"Expected 'X-Result-Count' header for HEAD request, but it was not found."
27
+ )
28
+ except ValueError:
29
+ count_val = response.headers.get("x-result-count")
30
+ msg = f"Expected 'X-Result-Count' header to be an integer, but got '{count_val}'."
31
+ raise errors.UnexpectedStatus(response.status_code, msg.encode())
32
+ raise errors.UnexpectedStatus(response.status_code, response.content)
33
+
34
+
35
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[int]:
36
+ return Response(
37
+ status_code=HTTPStatus(response.status_code),
38
+ content=response.content,
39
+ headers=response.headers,
40
+ parsed=_parse_response(client=client, response=response),
41
+ )
42
+
43
+
44
+ def sync_detailed(
45
+ *,
46
+ client: AuthenticatedClient,
47
+ ) -> Response[int]:
48
+ """Get number of items in the collection matching the request parameters.
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[int]
56
+ """
57
+
58
+ kwargs = _get_kwargs()
59
+
60
+ response = client.get_httpx_client().request(
61
+ **kwargs,
62
+ )
63
+
64
+ return _build_response(client=client, response=response)
65
+
66
+
67
+ def sync(
68
+ *,
69
+ client: AuthenticatedClient,
70
+ ) -> int:
71
+ """Get number of items in the collection matching the request parameters.
72
+
73
+ Raises:
74
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
75
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
76
+
77
+ Returns:
78
+ int
79
+ """
80
+
81
+ return sync_detailed(
82
+ client=client,
83
+ ).parsed
84
+
85
+
86
+ async def asyncio_detailed(
87
+ *,
88
+ client: AuthenticatedClient,
89
+ ) -> Response[int]:
90
+ """Get number of items in the collection matching the request parameters.
91
+
92
+ Raises:
93
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
94
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
95
+
96
+ Returns:
97
+ Response[int]
98
+ """
99
+
100
+ kwargs = _get_kwargs()
101
+
102
+ response = await client.get_async_httpx_client().request(**kwargs)
103
+
104
+ return _build_response(client=client, response=response)
105
+
106
+
107
+ async def asyncio(
108
+ *,
109
+ client: AuthenticatedClient,
110
+ ) -> int:
111
+ """Get number of items in the collection matching the request parameters.
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
+ int
119
+ """
120
+
121
+ return (
122
+ await asyncio_detailed(
123
+ client=client,
124
+ )
125
+ ).parsed