Skip to main content

permissions

Creates, updates, deletes, gets or lists a permissions resource.

Overview

Namepermissions
TypeResource
Idgemini.tuned_models.permissions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringOutput only. Identifier. The permission name. A unique name will be generated on create. Examples: tunedModels/{tuned_model}/permissions/{permission} corpora/{corpus}/permissions/{permission} Output only.
emailAddressstringOptional. Immutable. The email address of the user of group which this permission refers. Field is not set when permission's grantee type is EVERYONE.
granteeTypestringOptional. Immutable. The type of the grantee. (GRANTEE_TYPE_UNSPECIFIED, USER, GROUP, EVERYONE)
rolestringRequired. The role granted by this permission. (ROLE_UNSPECIFIED, OWNER, WRITER, READER)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselecttunedModelsId, permissionsIdGets information about a specific Permission.
listselecttunedModelsIdLists permissions for the specific resource.
createinserttunedModelsIdCreate a permission to a specific resource.
patchupdatetunedModelsId, permissionsIdupdateMaskUpdates the permission.
deletedeletetunedModelsId, permissionsIdDeletes the permission.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
permissionsIdstring
tunedModelsIdstring
updateMaskstring (google-fieldmask)Required. The list of fields to update. Accepted ones: - role (Permission.role field)

SELECT examples

Gets information about a specific Permission.

SELECT
name,
emailAddress,
granteeType,
role
FROM gemini.tuned_models.permissions
WHERE tunedModelsId = '{{ tunedModelsId }}' -- required
AND permissionsId = '{{ permissionsId }}' -- required
;

INSERT examples

Create a permission to a specific resource.

INSERT INTO gemini.tuned_models.permissions (
emailAddress,
granteeType,
role,
tunedModelsId
)
SELECT
'{{ emailAddress }}',
'{{ granteeType }}',
'{{ role }}',
'{{ tunedModelsId }}'
RETURNING
name,
emailAddress,
granteeType,
role
;

UPDATE examples

Updates the permission.

UPDATE gemini.tuned_models.permissions
SET
emailAddress = '{{ emailAddress }}',
granteeType = '{{ granteeType }}',
role = '{{ role }}'
WHERE
tunedModelsId = '{{ tunedModelsId }}' --required
WHERE permissionsId = '{{ permissionsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
emailAddress,
granteeType,
role;

DELETE examples

Deletes the permission.

DELETE FROM gemini.tuned_models.permissions
WHERE tunedModelsId = '{{ tunedModelsId }}' --required
AND permissionsId = '{{ permissionsId }}' --required
;