@@ -48,7 +48,88 @@ class PermissionBasedAccessControlApi(ApiBase):
48
48
Ref: https://github.com/swagger-api/swagger-codegen
49
49
"""
50
50
51
- def get_access_control_category (
51
+ def get_permission_categories (
52
+ self , * , database_key : "str"
53
+ ) -> "Union[GsaPermissionCategoriesInfo, None]" :
54
+ """Get all permission-based access control categories for the specified database.
55
+
56
+ This method makes a synchronous HTTP request.
57
+
58
+ Parameters
59
+ ----------
60
+ database_key: str
61
+
62
+ Returns
63
+ -------
64
+ Union[GsaPermissionCategoriesInfo, None]
65
+ """
66
+ data = self ._get_permission_categories_with_http_info (
67
+ database_key , _return_http_data_only = True
68
+ )
69
+ return data # type: ignore[no-any-return]
70
+
71
+ def _get_permission_categories_with_http_info (self , database_key : "str" , ** kwargs : Any ) -> Any :
72
+ all_params = [
73
+ "database_key" ,
74
+ "_return_http_data_only" ,
75
+ "_preload_content" ,
76
+ "_request_timeout" ,
77
+ ]
78
+
79
+ params = locals ()
80
+ for key , val in params ["kwargs" ].items ():
81
+ if key not in all_params :
82
+ raise TypeError (
83
+ f"Got an unexpected keyword argument '{ key } ' to method get_permission_categories"
84
+ )
85
+ params [key ] = val
86
+ del params ["kwargs" ]
87
+ # verify the required parameter "database_key" is set
88
+ if "database_key" not in params or params ["database_key" ] is None :
89
+ raise ValueError (
90
+ "Missing the required parameter 'database_key' when calling 'get_permission_categories'"
91
+ )
92
+
93
+ collection_formats : dict [str , Any ] = {}
94
+
95
+ path_params : dict [str , Any ] = {}
96
+ if "database_key" in params and database_key is not None :
97
+ path_params ["database-key" ] = params ["database_key" ]
98
+
99
+ query_params : list [Any ] = []
100
+
101
+ header_params : dict [str , Any ] = {}
102
+
103
+ form_params : list [Any ] = []
104
+ local_var_files : dict [str , Any ] = {}
105
+
106
+ body_params = None
107
+ # HTTP header 'Accept'
108
+ header_params ["Accept" ] = self .api_client .select_header_accept (["application/json" ])
109
+
110
+ response_type_map : dict [int , Optional [str ]] = {
111
+ 200 : "GsaPermissionCategoriesInfo" ,
112
+ 403 : None ,
113
+ 404 : None ,
114
+ }
115
+
116
+ return self .api_client .call_api (
117
+ "/v1alpha/databases/{database-key}/permission-categories" ,
118
+ "GET" ,
119
+ path_params ,
120
+ query_params ,
121
+ header_params ,
122
+ body = body_params ,
123
+ post_params = form_params ,
124
+ files = local_var_files ,
125
+ _return_http_data_only = params .get ("_return_http_data_only" ),
126
+ _preload_content = params .get ("_preload_content" , True ),
127
+ _request_timeout = params .get ("_request_timeout" ),
128
+ collection_formats = collection_formats ,
129
+ response_type_map = response_type_map ,
130
+ )
131
+
132
+ def get_permission_category (
52
133
self , * , database_key : "str" , category_guid : "str"
53
134
) -> "Union[GsaPermissionCategory, None]" :
54
135
"""Get a permission-based access control category with a specified guid.
@@ -64,12 +145,12 @@ def get_access_control_category(
64
145
-------
65
146
Union[GsaPermissionCategory, None]
66
147
"""
67
- data = self ._get_access_control_category_with_http_info (
148
+ data = self ._get_permission_category_with_http_info (
68
149
database_key , category_guid , _return_http_data_only = True
69
150
)
70
151
return data # type: ignore[no-any-return]
71
152
72
- def _get_access_control_category_with_http_info (
153
+ def _get_permission_category_with_http_info (
73
154
self , database_key : "str" , category_guid : "str" , ** kwargs : Any
74
155
) -> Any :
75
156
all_params = [
@@ -84,19 +165,19 @@ def _get_access_control_category_with_http_info(
84
165
for key , val in params ["kwargs" ].items ():
85
166
if key not in all_params :
86
167
raise TypeError (
87
- f"Got an unexpected keyword argument '{ key } ' to method get_access_control_category "
168
+ f"Got an unexpected keyword argument '{ key } ' to method get_permission_category "
88
169
)
89
170
params [key ] = val
90
171
del params ["kwargs" ]
91
172
# verify the required parameter "database_key" is set
92
173
if "database_key" not in params or params ["database_key" ] is None :
93
174
raise ValueError (
94
- "Missing the required parameter 'database_key' when calling 'get_access_control_category '"
175
+ "Missing the required parameter 'database_key' when calling 'get_permission_category '"
95
176
)
96
177
# verify the required parameter "category_guid" is set
97
178
if "category_guid" not in params or params ["category_guid" ] is None :
98
179
raise ValueError (
99
- "Missing the required parameter 'category_guid' when calling 'get_access_control_category '"
180
+ "Missing the required parameter 'category_guid' when calling 'get_permission_category '"
100
181
)
101
182
102
183
collection_formats : dict [str , Any ] = {}
@@ -140,29 +221,35 @@ def _get_access_control_category_with_http_info(
140
221
response_type_map = response_type_map ,
141
222
)
142
223
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 .
224
+ def get_permission_in_category (
225
+ self , * , database_key : "str" , category_guid : "str" , permission_guid : "str"
226
+ ) -> "Union[GsaPermission , None]" :
227
+ """Get a permission-based access control permission with a given guid in the specified category .
147
228
148
229
This method makes a synchronous HTTP request.
149
230
150
231
Parameters
151
232
----------
152
233
database_key: str
234
+ category_guid: str
235
+ permission_guid: str
153
236
154
237
Returns
155
238
-------
156
- Union[GsaPermissionCategoriesInfo , None]
239
+ Union[GsaPermission , None]
157
240
"""
158
- data = self ._get_permission_categories_with_http_info (
159
- database_key , _return_http_data_only = True
241
+ data = self ._get_permission_in_category_with_http_info (
242
+ database_key , category_guid , permission_guid , _return_http_data_only = True
160
243
)
161
244
return data # type: ignore[no-any-return]
162
245
163
- def _get_permission_categories_with_http_info (self , database_key : "str" , ** kwargs : Any ) -> Any :
246
+ def _get_permission_in_category_with_http_info (
247
+ self , database_key : "str" , category_guid : "str" , permission_guid : "str" , ** kwargs : Any
248
+ ) -> Any :
164
249
all_params = [
165
250
"database_key" ,
251
+ "category_guid" ,
252
+ "permission_guid" ,
166
253
"_return_http_data_only" ,
167
254
"_preload_content" ,
168
255
"_request_timeout" ,
@@ -172,21 +259,35 @@ def _get_permission_categories_with_http_info(self, database_key: "str", **kwarg
172
259
for key , val in params ["kwargs" ].items ():
173
260
if key not in all_params :
174
261
raise TypeError (
175
- f"Got an unexpected keyword argument '{ key } ' to method get_permission_categories "
262
+ f"Got an unexpected keyword argument '{ key } ' to method get_permission_in_category "
176
263
)
177
264
params [key ] = val
178
265
del params ["kwargs" ]
179
266
# verify the required parameter "database_key" is set
180
267
if "database_key" not in params or params ["database_key" ] is None :
181
268
raise ValueError (
182
- "Missing the required parameter 'database_key' when calling 'get_permission_categories'"
269
+ "Missing the required parameter 'database_key' when calling 'get_permission_in_category'"
270
+ )
271
+ # verify the required parameter "category_guid" is set
272
+ if "category_guid" not in params or params ["category_guid" ] is None :
273
+ raise ValueError (
274
+ "Missing the required parameter 'category_guid' when calling 'get_permission_in_category'"
275
+ )
276
+ # verify the required parameter "permission_guid" is set
277
+ if "permission_guid" not in params or params ["permission_guid" ] is None :
278
+ raise ValueError (
279
+ "Missing the required parameter 'permission_guid' when calling 'get_permission_in_category'"
183
280
)
184
281
185
282
collection_formats : dict [str , Any ] = {}
186
283
187
284
path_params : dict [str , Any ] = {}
188
285
if "database_key" in params and database_key is not None :
189
286
path_params ["database-key" ] = params ["database_key" ]
287
+ if "category_guid" in params and category_guid is not None :
288
+ path_params ["category-guid" ] = params ["category_guid" ]
289
+ if "permission_guid" in params and permission_guid is not None :
290
+ path_params ["permission-guid" ] = params ["permission_guid" ]
190
291
191
292
query_params : list [Any ] = []
192
293
@@ -200,13 +301,105 @@ def _get_permission_categories_with_http_info(self, database_key: "str", **kwarg
200
301
header_params ["Accept" ] = self .api_client .select_header_accept (["application/json" ])
201
302
202
303
response_type_map : dict [int , Optional [str ]] = {
203
- 200 : "GsaPermissionCategoriesInfo " ,
304
+ 200 : "GsaPermission " ,
204
305
403 : None ,
205
306
404 : None ,
206
307
}
207
308
208
309
return self .api_client .call_api (
209
- "/v1alpha/databases/{database-key}/permission-categories" ,
310
+ "/v1alpha/databases/{database-key}/permission-categories/{category-guid}/permissions/{permission-guid}" ,
311
+ "GET" ,
312
+ path_params ,
313
+ query_params ,
314
+ header_params ,
315
+ body = body_params ,
316
+ post_params = form_params ,
317
+ files = local_var_files ,
318
+ _return_http_data_only = params .get ("_return_http_data_only" ),
319
+ _preload_content = params .get ("_preload_content" , True ),
320
+ _request_timeout = params .get ("_request_timeout" ),
321
+ collection_formats = collection_formats ,
322
+ response_type_map = response_type_map ,
323
+ )
324
+
325
+ def get_permissions_in_category (
326
+ self , * , database_key : "str" , category_guid : "str"
327
+ ) -> "Union[GsaPermissionsInfo, None]" :
328
+ """Get all permission-based access control permissions for the specified category.
329
+
330
+ This method makes a synchronous HTTP request.
331
+
332
+ Parameters
333
+ ----------
334
+ database_key: str
335
+ category_guid: str
336
+
337
+ Returns
338
+ -------
339
+ Union[GsaPermissionsInfo, None]
340
+ """
341
+ data = self ._get_permissions_in_category_with_http_info (
342
+ database_key , category_guid , _return_http_data_only = True
343
+ )
344
+ return data # type: ignore[no-any-return]
345
+
346
+ def _get_permissions_in_category_with_http_info (
347
+ self , database_key : "str" , category_guid : "str" , ** kwargs : Any
348
+ ) -> Any :
349
+ all_params = [
350
+ "database_key" ,
351
+ "category_guid" ,
352
+ "_return_http_data_only" ,
353
+ "_preload_content" ,
354
+ "_request_timeout" ,
355
+ ]
356
+
357
+ params = locals ()
358
+ for key , val in params ["kwargs" ].items ():
359
+ if key not in all_params :
360
+ raise TypeError (
361
+ f"Got an unexpected keyword argument '{ key } ' to method get_permissions_in_category"
362
+ )
363
+ params [key ] = val
364
+ del params ["kwargs" ]
365
+ # verify the required parameter "database_key" is set
366
+ if "database_key" not in params or params ["database_key" ] is None :
367
+ raise ValueError (
368
+ "Missing the required parameter 'database_key' when calling 'get_permissions_in_category'"
369
+ )
370
+ # verify the required parameter "category_guid" is set
371
+ if "category_guid" not in params or params ["category_guid" ] is None :
372
+ raise ValueError (
373
+ "Missing the required parameter 'category_guid' when calling 'get_permissions_in_category'"
374
+ )
375
+
376
+ collection_formats : dict [str , Any ] = {}
377
+
378
+ path_params : dict [str , Any ] = {}
379
+ if "database_key" in params and database_key is not None :
380
+ path_params ["database-key" ] = params ["database_key" ]
381
+ if "category_guid" in params and category_guid is not None :
382
+ path_params ["category-guid" ] = params ["category_guid" ]
383
+
384
+ query_params : list [Any ] = []
385
+
386
+ header_params : dict [str , Any ] = {}
387
+
388
+ form_params : list [Any ] = []
389
+ local_var_files : dict [str , Any ] = {}
390
+
391
+ body_params = None
392
+ # HTTP header 'Accept'
393
+ header_params ["Accept" ] = self .api_client .select_header_accept (["application/json" ])
394
+
395
+ response_type_map : dict [int , Optional [str ]] = {
396
+ 200 : "GsaPermissionsInfo" ,
397
+ 403 : None ,
398
+ 404 : None ,
399
+ }
400
+
401
+ return self .api_client .call_api (
402
+ "/v1alpha/databases/{database-key}/permission-categories/{category-guid}/permissions" ,
210
403
"GET" ,
211
404
path_params ,
212
405
query_params ,
0 commit comments