An entry must have exactly one of the allowed
xref_EntityTypes. If anything but view, routine,
or dataset are set, a role is also required. role is omitted for view,
routine, dataset, because they are always read-only.
Role granted to the entity. The following string values are supported: 'READER', 'WRITER', 'OWNER'. It may also be :data:None if the entity_type is view, routine, or dataset.
entity_type
str
Type of entity being granted the role. See EntityTypes for supported types.
entity_id
Union[str, Dict[str, str]]
If the entity_type is not 'view', 'routine', or 'dataset', the entity_id is the str ID of the entity being granted the role. If the entity_type is 'view' or 'routine', the entity_id is a dict representing the view or routine from a different dataset to grant access to in the following format for views:: { 'projectId': string, 'datasetId': string, 'tableId': string } For routines:: { 'projectId': string, 'datasetId': string, 'routineId': string } If the entity_type is 'dataset', the entity_id is a dict that includes a 'dataset' field with a dict representing the dataset and a 'target_types' field with a str value of the dataset's resource type:: { 'dataset': { 'projectId': string, 'datasetId': string, }, 'target_types: 'VIEWS' }
Inheritance
builtins.object > AccessEntry
Properties
entity_id
str: The entity_id of the entry.
entity_type
str: The entity_type of the entry.
role
str: The role of the entry.
Methods
from_api_repr
from_api_repr(resource:dict)
Factory: construct an access entry given its API representation
Parameter
Name
Description
resource
Dict[str, object]
Access entry resource representation returned from the API
Exceptions
Type
Description
ValueError
If the resource has more keys than ``role`` and one additional key.
Returns
Type
Description
google.cloud.bigquery.dataset.AccessEntry
Access entry parsed from ``resource``.
to_api_repr
to_api_repr()
Construct the API resource representation of this access entry
An entry must have exactly one of the allowed
xref_EntityTypes. If anything but view, routine,
or dataset are set, a role is also required. role is omitted for view,
routine, dataset, because they are always read-only.
Role granted to the entity. The following string values are supported: 'READER', 'WRITER', 'OWNER'. It may also be :data:None if the entity_type is view, routine, or dataset.
entity_type
str
Type of entity being granted the role. See EntityTypes for supported types.
entity_id
Union[str, Dict[str, str]]
If the entity_type is not 'view', 'routine', or 'dataset', the entity_id is the str ID of the entity being granted the role. If the entity_type is 'view' or 'routine', the entity_id is a dict representing the view or routine from a different dataset to grant access to in the following format for views:: { 'projectId': string, 'datasetId': string, 'tableId': string } For routines:: { 'projectId': string, 'datasetId': string, 'routineId': string } If the entity_type is 'dataset', the entity_id is a dict that includes a 'dataset' field with a dict representing the dataset and a 'target_types' field with a str value of the dataset's resource type:: { 'dataset': { 'projectId': string, 'datasetId': string, }, 'target_types: 'VIEWS' }
Exceptions
Type
Description
ValueError
If a ``view``, ``routine``, or ``dataset`` has ``role`` set, or a non ``view``, non ``routine``, and non ``dataset`` **does not** have a ``role`` set. .. rubric:: Examples >>> entry = AccessEntry('OWNER', 'userByEmail', 'user@example.com') >>> view = { ... 'projectId': 'my-project', ... 'datasetId': 'my_dataset', ... 'tableId': 'my_table' ... } >>> entry = AccessEntry(None, 'view', view)
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-05-07 UTC."],[],[]]