Skip to content

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 authored Nov 14, 2019
1 parent 6751237 commit 0be280c
Show file tree
Hide file tree
Showing 26 changed files with 5,367 additions and 28 deletions.
10 changes: 9 additions & 1 deletion datacatalog/google/cloud/datacatalog.py
Original file line number Diff line number Diff line change
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 datacatalog/google/cloud/datacatalog_v1beta1/__init__.py
Original file line number Diff line number Diff line change
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",
)
Original file line number Diff line number Diff line change
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 datacatalog/google/cloud/datacatalog_v1beta1/gapic/enums.py
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 0be280c

Please sign in to comment.