41
41
from ..models import *
42
42
43
43
44
- class AccessControlApi (ApiBase ):
44
+ class PermissionBasedAccessControlApi (ApiBase ):
45
45
"""NOTE: This class is auto generated by the swagger code generator program.
46
46
47
47
Do not edit the class manually.
48
48
Ref: https://github.com/swagger-api/swagger-codegen
49
49
"""
50
50
51
- def get_access_control_categories (
52
- self , * , database_key : "str"
53
- ) -> "Union[GsaAccessControlCategoriesInfo , None]" :
54
- """Get all access control categories for the specified database .
51
+ def get_access_control_category (
52
+ self , * , database_key : "str" , category_guid : "str"
53
+ ) -> "Union[GsaPermissionCategory , None]" :
54
+ """Get a permission-based access control category with a specified guid .
55
55
56
56
This method makes a synchronous HTTP request.
57
57
58
58
Parameters
59
59
----------
60
60
database_key: str
61
+ category_guid: str
61
62
62
63
Returns
63
64
-------
64
- Union[GsaAccessControlCategoriesInfo , None]
65
+ Union[GsaPermissionCategory , None]
65
66
"""
66
- data = self ._get_access_control_categories_with_http_info (
67
- database_key , _return_http_data_only = True
67
+ data = self ._get_access_control_category_with_http_info (
68
+ database_key , category_guid , _return_http_data_only = True
68
69
)
69
70
return data # type: ignore[no-any-return]
70
71
71
- def _get_access_control_categories_with_http_info (
72
- self , database_key : "str" , ** kwargs : Any
72
+ def _get_access_control_category_with_http_info (
73
+ self , database_key : "str" , category_guid : "str" , ** kwargs : Any
73
74
) -> Any :
74
75
all_params = [
75
76
"database_key" ,
77
+ "category_guid" ,
76
78
"_return_http_data_only" ,
77
79
"_preload_content" ,
78
80
"_request_timeout" ,
@@ -82,21 +84,28 @@ def _get_access_control_categories_with_http_info(
82
84
for key , val in params ["kwargs" ].items ():
83
85
if key not in all_params :
84
86
raise TypeError (
85
- f"Got an unexpected keyword argument '{ key } ' to method get_access_control_categories "
87
+ f"Got an unexpected keyword argument '{ key } ' to method get_access_control_category "
86
88
)
87
89
params [key ] = val
88
90
del params ["kwargs" ]
89
91
# verify the required parameter "database_key" is set
90
92
if "database_key" not in params or params ["database_key" ] is None :
91
93
raise ValueError (
92
- "Missing the required parameter 'database_key' when calling 'get_access_control_categories'"
94
+ "Missing the required parameter 'database_key' when calling 'get_access_control_category'"
95
+ )
96
+ # verify the required parameter "category_guid" is set
97
+ if "category_guid" not in params or params ["category_guid" ] is None :
98
+ raise ValueError (
99
+ "Missing the required parameter 'category_guid' when calling 'get_access_control_category'"
93
100
)
94
101
95
102
collection_formats : dict [str , Any ] = {}
96
103
97
104
path_params : dict [str , Any ] = {}
98
105
if "database_key" in params and database_key is not None :
99
106
path_params ["database-key" ] = params ["database_key" ]
107
+ if "category_guid" in params and category_guid is not None :
108
+ path_params ["category-guid" ] = params ["category_guid" ]
100
109
101
110
query_params : list [Any ] = []
102
111
@@ -110,13 +119,13 @@ def _get_access_control_categories_with_http_info(
110
119
header_params ["Accept" ] = self .api_client .select_header_accept (["application/json" ])
111
120
112
121
response_type_map : dict [int , Optional [str ]] = {
113
- 200 : "GsaAccessControlCategoriesInfo " ,
122
+ 200 : "GsaPermissionCategory " ,
114
123
403 : None ,
115
124
404 : None ,
116
125
}
117
126
118
127
return self .api_client .call_api (
119
- "/v1alpha/databases/{database-key}/access-control- categories" ,
128
+ "/v1alpha/databases/{database-key}/permission- categories/{category-guid} " ,
120
129
"GET" ,
121
130
path_params ,
122
131
query_params ,
@@ -131,33 +140,29 @@ def _get_access_control_categories_with_http_info(
131
140
response_type_map = response_type_map ,
132
141
)
133
142
134
- def get_access_control_category (
135
- self , * , database_key : "str" , category_guid : "str"
136
- ) -> "Union[GsaAccessControlCategory , None]" :
137
- """Get an access control category with a specified guid .
143
+ def get_permission_categories (
144
+ self , * , database_key : "str"
145
+ ) -> "Union[GsaPermissionCategoriesInfo , None]" :
146
+ """Get all permission-based access control categories for the specified database .
138
147
139
148
This method makes a synchronous HTTP request.
140
149
141
150
Parameters
142
151
----------
143
152
database_key: str
144
- category_guid: str
145
153
146
154
Returns
147
155
-------
148
- Union[GsaAccessControlCategory , None]
156
+ Union[GsaPermissionCategoriesInfo , None]
149
157
"""
150
- data = self ._get_access_control_category_with_http_info (
151
- database_key , category_guid , _return_http_data_only = True
158
+ data = self ._get_permission_categories_with_http_info (
159
+ database_key , _return_http_data_only = True
152
160
)
153
161
return data # type: ignore[no-any-return]
154
162
155
- def _get_access_control_category_with_http_info (
156
- self , database_key : "str" , category_guid : "str" , ** kwargs : Any
157
- ) -> Any :
163
+ def _get_permission_categories_with_http_info (self , database_key : "str" , ** kwargs : Any ) -> Any :
158
164
all_params = [
159
165
"database_key" ,
160
- "category_guid" ,
161
166
"_return_http_data_only" ,
162
167
"_preload_content" ,
163
168
"_request_timeout" ,
@@ -167,28 +172,21 @@ def _get_access_control_category_with_http_info(
167
172
for key , val in params ["kwargs" ].items ():
168
173
if key not in all_params :
169
174
raise TypeError (
170
- f"Got an unexpected keyword argument '{ key } ' to method get_access_control_category "
175
+ f"Got an unexpected keyword argument '{ key } ' to method get_permission_categories "
171
176
)
172
177
params [key ] = val
173
178
del params ["kwargs" ]
174
179
# verify the required parameter "database_key" is set
175
180
if "database_key" not in params or params ["database_key" ] is None :
176
181
raise ValueError (
177
- "Missing the required parameter 'database_key' when calling 'get_access_control_category'"
178
- )
179
- # verify the required parameter "category_guid" is set
180
- if "category_guid" not in params or params ["category_guid" ] is None :
181
- raise ValueError (
182
- "Missing the required parameter 'category_guid' when calling 'get_access_control_category'"
182
+ "Missing the required parameter 'database_key' when calling 'get_permission_categories'"
183
183
)
184
184
185
185
collection_formats : dict [str , Any ] = {}
186
186
187
187
path_params : dict [str , Any ] = {}
188
188
if "database_key" in params and database_key is not None :
189
189
path_params ["database-key" ] = params ["database_key" ]
190
- if "category_guid" in params and category_guid is not None :
191
- path_params ["category-guid" ] = params ["category_guid" ]
192
190
193
191
query_params : list [Any ] = []
194
192
@@ -202,13 +200,13 @@ def _get_access_control_category_with_http_info(
202
200
header_params ["Accept" ] = self .api_client .select_header_accept (["application/json" ])
203
201
204
202
response_type_map : dict [int , Optional [str ]] = {
205
- 200 : "GsaAccessControlCategory " ,
203
+ 200 : "GsaPermissionCategoriesInfo " ,
206
204
403 : None ,
207
205
404 : None ,
208
206
}
209
207
210
208
return self .api_client .call_api (
211
- "/v1alpha/databases/{database-key}/access-control- categories/{category-guid} " ,
209
+ "/v1alpha/databases/{database-key}/permission- categories" ,
212
210
"GET" ,
213
211
path_params ,
214
212
query_params ,
0 commit comments