Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
feat(datacatalog): add policy tag manager clients (#9804)
Browse files Browse the repository at this point in the history
  • Loading branch information
tswast committed Nov 14, 2019
1 parent b689f6d commit 90534a4
Show file tree
Hide file tree
Showing 26 changed files with 5,367 additions and 28 deletions.
10 changes: 9 additions & 1 deletion google/cloud/datacatalog.py
Expand Up @@ -18,8 +18,16 @@
from __future__ import absolute_import

from google.cloud.datacatalog_v1beta1 import DataCatalogClient
from google.cloud.datacatalog_v1beta1 import PolicyTagManagerClient
from google.cloud.datacatalog_v1beta1 import PolicyTagManagerSerializationClient
from google.cloud.datacatalog_v1beta1 import enums
from google.cloud.datacatalog_v1beta1 import types


__all__ = ("enums", "types", "DataCatalogClient")
__all__ = (
"enums",
"types",
"DataCatalogClient",
"PolicyTagManagerClient",
"PolicyTagManagerSerializationClient",
)
26 changes: 25 additions & 1 deletion google/cloud/datacatalog_v1beta1/__init__.py
Expand Up @@ -19,11 +19,35 @@
from google.cloud.datacatalog_v1beta1 import types
from google.cloud.datacatalog_v1beta1.gapic import data_catalog_client
from google.cloud.datacatalog_v1beta1.gapic import enums
from google.cloud.datacatalog_v1beta1.gapic import policy_tag_manager_client
from google.cloud.datacatalog_v1beta1.gapic import (
policy_tag_manager_serialization_client,
)


class DataCatalogClient(data_catalog_client.DataCatalogClient):
__doc__ = data_catalog_client.DataCatalogClient.__doc__
enums = enums


__all__ = ("enums", "types", "DataCatalogClient")
class PolicyTagManagerClient(policy_tag_manager_client.PolicyTagManagerClient):
__doc__ = policy_tag_manager_client.PolicyTagManagerClient.__doc__
enums = enums


class PolicyTagManagerSerializationClient(
policy_tag_manager_serialization_client.PolicyTagManagerSerializationClient
):
__doc__ = (
policy_tag_manager_serialization_client.PolicyTagManagerSerializationClient.__doc__
)
enums = enums


__all__ = (
"enums",
"types",
"DataCatalogClient",
"PolicyTagManagerClient",
"PolicyTagManagerSerializationClient",
)
Expand Up @@ -436,6 +436,8 @@ def create_entry_group(
Note that this EntryGroup and its child resources may not actually be
stored in the location in this name.
entry_group_id (str): Required. The id of the entry group to create.
The id must begin with a letter or underscore, contain only English
letters, numbers and underscores, and be at most 64 characters.
entry_group (Union[dict, ~google.cloud.datacatalog_v1beta1.types.EntryGroup]): The entry group to create. Defaults to an empty entry group.
If a dict is provided, it must be of the same form as the protobuf
Expand Down Expand Up @@ -1012,7 +1014,8 @@ def lookup_entry(
- ``cloud_pubsub.project_id.topic_id``
- ``pubsub.project_id.`topic.id.with.dots```
- ``bigquery.project_id.dataset_id.table_id``
- ``bigquery.table.project_id.dataset_id.table_id``
- ``bigquery.dataset.project_id.dataset_id``
- ``datacatalog.project_id.location_id.entry_group_id.entry_id``
``*_id``\ s shoud satisfy the standard SQL rules for identifiers.
Expand Down
15 changes: 15 additions & 0 deletions google/cloud/datacatalog_v1beta1/gapic/enums.py
Expand Up @@ -89,3 +89,18 @@ class PrimitiveType(enum.IntEnum):
STRING = 2
BOOL = 3
TIMESTAMP = 4


class Taxonomy(object):
class PolicyType(enum.IntEnum):
"""
Defines policy types where policy tag can be used for.
Attributes:
POLICY_TYPE_UNSPECIFIED (int): Unspecified policy type.
FINE_GRAINED_ACCESS_CONTROL (int): Fine grained access control policy, which enables access control on
tagged resources.
"""

POLICY_TYPE_UNSPECIFIED = 0
FINE_GRAINED_ACCESS_CONTROL = 1

0 comments on commit 90534a4

Please sign in to comment.