google.generativeai.types.Permissions
google.generativeai.types.Permissions(
parent
)
Methods
create
View source
create(
role: RoleOptions,
grantee_type: Optional[GranteeTypeOptions] = None,
email_address: Optional[str] = None,
client: (glm.PermissionServiceClient | None) = None
) -> Permission
Create a new permission on a resource (self).
Args |
`parent`
|
The resource name of the parent resource in which the permission will be listed.
|
`role`
|
role that will be granted by the permission.
|
`grantee_type`
|
The type of the grantee for the permission.
|
`email_address`
|
The email address of the grantee.
|
Returns |
`Permission` object with specified parent, role, grantee type, and email address.
|
Raises |
`ValueError`
|
When email_address is specified and grantee_type is set to EVERYONE.
|
`ValueError`
|
When email_address is not specified and grantee_type is not set to EVERYONE.
|
create_async
View source
create_async(
role, grantee_type=None, email_address=None, client=None
)
This is the async version of PermissionAdapter.create_permission
.
get
View source
@classmethod
get(
name: str
) -> Permission
Get information about a specific permission.
Args |
`name`
|
The name of the permission to get.
|
Returns |
Requested permission as an instance of `Permission`.
|
get_async
View source
get_async(
name
)
Get information about a specific permission.
Args |
`name`
|
The name of the permission to get.
|
Returns |
Requested permission as an instance of `Permission`.
|
list
View source
list(
page_size: Optional[int] = None,
client: (glm.PermissionServiceClient | None) = None
) -> Iterable[Permission]
List Permission
s enforced on a resource (self).
Args |
`parent`
|
The resource name of the parent resource in which the permission will be listed.
|
`page_size`
|
The maximum number of permissions to return (per page). The service may return fewer permissions.
|
Returns |
Paginated list of `Permission` objects.
|
list_async
View source
list_async(
page_size=None, client=None
)
This is the async version of PermissionAdapter.list_permissions
.
transfer_ownership
View source
transfer_ownership(
email_address: str, client: (glm.PermissionServiceClient | None) = None
) -> None
Transfer ownership of a resource (self) to a new owner.
Args |
`name`
|
Name of the resource to transfer ownership.
|
`email_address`
|
Email address of the new owner.
|
transfer_ownership_async
View source
transfer_ownership_async(
email_address, client=None
)
This is the async version of PermissionAdapter.transfer_ownership
.
__iter__
View source
__iter__()