Class AccessEntry (3.2.0)

AccessEntry(
    role: Optional[str] = None,
    entity_type: Optional[str] = None,
    entity_id: Optional[Union[Dict[str, Any], str]] = None,
)

Represents grant of an access role to an entity.

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.

See https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets.

Inheritance

builtins.object > AccessEntry

Properties

dataset

API resource representation of a dataset reference.

dataset_target_types

Which resources that the dataset in this entry applies to.

domain

A domain to grant access to.

entity_id

The entity_id of the entry.

entity_type

The entity_type of the entry.

group_by_email

An email address of a Google Group to grant access to.

role

The role of the entry.

routine

API resource representation of a routine reference.

special_group

A special group to grant access to.

user_by_email

An email address of a user to grant access to.

view

API resource representation of a view reference.

Methods

from_api_repr

from_api_repr(resource: dict)

Factory: construct an access entry given its API representation

Parameter
NameDescription
resource Dict[str, object]

Access entry resource representation returned from the API

Exceptions
TypeDescription
ValueErrorIf the resource has more keys than ``role`` and one additional key.
Returns
TypeDescription
google.cloud.bigquery.dataset.AccessEntryAccess entry parsed from ``resource``.

to_api_repr

to_api_repr()

Construct the API resource representation of this access entry

Returns
TypeDescription
Dict[str, object]Access entry represented as an API resource

__init__

__init__(
    role: Optional[str] = None,
    entity_type: Optional[str] = None,
    entity_id: Optional[Union[Dict[str, Any], str]] = None,
)

Initialize self. See help(type(self)) for accurate signature.

AccessEntry

AccessEntry(
    role: Optional[str] = None,
    entity_type: Optional[str] = None,
    entity_id: Optional[Union[Dict[str, Any], str]] = None,
)

Represents grant of an access role to an entity.

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.

See https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets.

Exceptions
TypeDescription
ValueErrorIf 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)