22
22
23
23
from google .protobuf import field_mask_pb2
24
24
25
- from google .generativeai .client import get_dafault_permission_client
26
- from google .generativeai .client import get_dafault_permission_async_client
25
+ from google .generativeai .client import get_default_permission_client
26
+ from google .generativeai .client import get_default_permission_async_client
27
27
from google .generativeai .utils import flatten_update_paths
28
28
from google .generativeai import string_utils
29
29
@@ -107,7 +107,7 @@ def delete(
107
107
Delete permission (self).
108
108
"""
109
109
if client is None :
110
- client = get_dafault_permission_client ()
110
+ client = get_default_permission_client ()
111
111
delete_request = glm .DeletePermissionRequest (name = self .name )
112
112
client .delete_permission (request = delete_request )
113
113
@@ -119,7 +119,7 @@ async def delete_async(
119
119
This is the async version of `Permission.delete`.
120
120
"""
121
121
if client is None :
122
- client = get_dafault_permission_async_client ()
122
+ client = get_default_permission_async_client ()
123
123
delete_request = glm .DeletePermissionRequest (name = self .name )
124
124
await client .delete_permission (request = delete_request )
125
125
@@ -146,7 +146,7 @@ def update(
146
146
`Permission` object with specified updates.
147
147
"""
148
148
if client is None :
149
- client = get_dafault_permission_client ()
149
+ client = get_default_permission_client ()
150
150
151
151
updates = flatten_update_paths (updates )
152
152
for update_path in updates :
@@ -176,7 +176,7 @@ async def update_async(
176
176
This is the async version of `Permission.update`.
177
177
"""
178
178
if client is None :
179
- client = get_dafault_permission_async_client ()
179
+ client = get_default_permission_async_client ()
180
180
181
181
updates = flatten_update_paths (updates )
182
182
for update_path in updates :
@@ -224,7 +224,7 @@ def get(
224
224
Requested permission as an instance of `Permission`.
225
225
"""
226
226
if client is None :
227
- client = get_dafault_permission_client ()
227
+ client = get_default_permission_client ()
228
228
get_perm_request = glm .GetPermissionRequest (name = name )
229
229
get_perm_response = client .get_permission (request = get_perm_request )
230
230
get_perm_response = type (get_perm_response ).to_dict (get_perm_response )
@@ -240,7 +240,7 @@ async def get_async(
240
240
This is the async version of `Permission.get`.
241
241
"""
242
242
if client is None :
243
- client = get_dafault_permission_async_client ()
243
+ client = get_default_permission_async_client ()
244
244
get_perm_request = glm .GetPermissionRequest (name = name )
245
245
get_perm_response = await client .get_permission (request = get_perm_request )
246
246
get_perm_response = type (get_perm_response ).to_dict (get_perm_response )
@@ -313,7 +313,7 @@ def create(
313
313
ValueError: When email_address is not specified and grantee_type is not set to EVERYONE.
314
314
"""
315
315
if client is None :
316
- client = get_dafault_permission_client ()
316
+ client = get_default_permission_client ()
317
317
318
318
request = self ._make_create_permission_request (
319
319
role = role , grantee_type = grantee_type , email_address = email_address
@@ -333,7 +333,7 @@ async def create_async(
333
333
This is the async version of `PermissionAdapter.create_permission`.
334
334
"""
335
335
if client is None :
336
- client = get_dafault_permission_async_client ()
336
+ client = get_default_permission_async_client ()
337
337
338
338
request = self ._make_create_permission_request (
339
339
role = role , grantee_type = grantee_type , email_address = email_address
@@ -358,7 +358,7 @@ def list(
358
358
Paginated list of `Permission` objects.
359
359
"""
360
360
if client is None :
361
- client = get_dafault_permission_client ()
361
+ client = get_default_permission_client ()
362
362
363
363
request = glm .ListPermissionsRequest (
364
364
parent = self .parent , page_size = page_size # pytype: disable=attribute-error
@@ -376,7 +376,7 @@ async def list_async(
376
376
This is the async version of `PermissionAdapter.list_permissions`.
377
377
"""
378
378
if client is None :
379
- client = get_dafault_permission_async_client ()
379
+ client = get_default_permission_async_client ()
380
380
381
381
request = glm .ListPermissionsRequest (
382
382
parent = self .parent , page_size = page_size # pytype: disable=attribute-error
@@ -400,7 +400,7 @@ def transfer_ownership(
400
400
if self .parent .startswith ("corpora" ):
401
401
raise NotImplementedError ("Can'/t transfer_ownership for a Corpus" )
402
402
if client is None :
403
- client = get_dafault_permission_client ()
403
+ client = get_default_permission_client ()
404
404
transfer_request = glm .TransferOwnershipRequest (
405
405
name = self .parent , email_address = email_address # pytype: disable=attribute-error
406
406
)
@@ -415,7 +415,7 @@ async def transfer_ownership_async(
415
415
if self .parent .startswith ("corpora" ):
416
416
raise NotImplementedError ("Can'/t transfer_ownership for a Corpus" )
417
417
if client is None :
418
- client = get_dafault_permission_async_client ()
418
+ client = get_default_permission_async_client ()
419
419
transfer_request = glm .TransferOwnershipRequest (
420
420
name = self .parent , email_address = email_address # pytype: disable=attribute-error
421
421
)
0 commit comments