diff --git a/datacatalog/google/cloud/datacatalog.py b/datacatalog/google/cloud/datacatalog.py index f26d34f6712d..49667a8fb274 100644 --- a/datacatalog/google/cloud/datacatalog.py +++ b/datacatalog/google/cloud/datacatalog.py @@ -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", +) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/__init__.py b/datacatalog/google/cloud/datacatalog_v1beta1/__init__.py index b025cf9d805e..fe3a50682ae9 100644 --- a/datacatalog/google/cloud/datacatalog_v1beta1/__init__.py +++ b/datacatalog/google/cloud/datacatalog_v1beta1/__init__.py @@ -19,6 +19,10 @@ 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): @@ -26,4 +30,24 @@ class DataCatalogClient(data_catalog_client.DataCatalogClient): 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", +) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/data_catalog_client.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/data_catalog_client.py index cea50cd34f7f..2f3a8fb7b70f 100644 --- a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/data_catalog_client.py +++ b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/data_catalog_client.py @@ -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 @@ -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. diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/enums.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/enums.py index de76fc9f8a3b..94c8c5b234e5 100644 --- a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/enums.py +++ b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/enums.py @@ -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 diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_client.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_client.py new file mode 100644 index 000000000000..aa65bf78b2bc --- /dev/null +++ b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_client.py @@ -0,0 +1,1155 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Accesses the google.cloud.datacatalog.v1beta1 PolicyTagManager API.""" + +import pkg_resources +import warnings + +from google.oauth2 import service_account +import google.api_core.client_options +import google.api_core.gapic_v1.client_info +import google.api_core.gapic_v1.config +import google.api_core.gapic_v1.method +import google.api_core.gapic_v1.routing_header +import google.api_core.grpc_helpers +import grpc + +from google.cloud.datacatalog_v1beta1.gapic import enums +from google.cloud.datacatalog_v1beta1.gapic import policy_tag_manager_client_config +from google.cloud.datacatalog_v1beta1.gapic.transports import ( + policy_tag_manager_grpc_transport, +) +from google.cloud.datacatalog_v1beta1.proto import datacatalog_pb2 +from google.cloud.datacatalog_v1beta1.proto import datacatalog_pb2_grpc +from google.cloud.datacatalog_v1beta1.proto import policytagmanager_pb2 +from google.cloud.datacatalog_v1beta1.proto import policytagmanager_pb2_grpc +from google.cloud.datacatalog_v1beta1.proto import tags_pb2 +from google.iam.v1 import iam_policy_pb2 +from google.iam.v1 import options_pb2 +from google.iam.v1 import policy_pb2 +from google.protobuf import empty_pb2 +from google.protobuf import field_mask_pb2 + + +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( + "google-cloud-datacatalog" +).version + + +class PolicyTagManagerClient(object): + """ + Policy tag manager API service allows clients to manage their taxonomies and + policy tags data. + """ + + SERVICE_ADDRESS = "datacatalog.googleapis.com:443" + """The default address of the service.""" + + # The name of the interface for this client. This is the key used to + # find the method configuration in the client_config dictionary. + _INTERFACE_NAME = "google.cloud.datacatalog.v1beta1.PolicyTagManager" + + @classmethod + def from_service_account_file(cls, filename, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + PolicyTagManagerClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_file(filename) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + from_service_account_json = from_service_account_file + + def __init__( + self, + transport=None, + channel=None, + credentials=None, + client_config=None, + client_info=None, + client_options=None, + ): + """Constructor. + + Args: + transport (Union[~.PolicyTagManagerGrpcTransport, + Callable[[~.Credentials, type], ~.PolicyTagManagerGrpcTransport]): A transport + instance, responsible for actually making the API calls. + The default transport uses the gRPC protocol. + This argument may also be a callable which returns a + transport instance. Callables will be sent the credentials + as the first argument and the default transport class as + the second argument. + channel (grpc.Channel): DEPRECATED. A ``Channel`` instance + through which to make calls. This argument is mutually exclusive + with ``credentials``; providing both will raise an exception. + credentials (google.auth.credentials.Credentials): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If none + are specified, the client will attempt to ascertain the + credentials from the environment. + This argument is mutually exclusive with providing a + transport instance to ``transport``; doing so will raise + an exception. + client_config (dict): DEPRECATED. A dictionary of call options for + each method. If not specified, the default configuration is used. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + client_options (Union[dict, google.api_core.client_options.ClientOptions]): + Client options used to set user options on the client. API Endpoint + should be set through client_options. + """ + # Raise deprecation warnings for things we want to go away. + if client_config is not None: + warnings.warn( + "The `client_config` argument is deprecated.", + PendingDeprecationWarning, + stacklevel=2, + ) + else: + client_config = policy_tag_manager_client_config.config + + if channel: + warnings.warn( + "The `channel` argument is deprecated; use " "`transport` instead.", + PendingDeprecationWarning, + stacklevel=2, + ) + + api_endpoint = self.SERVICE_ADDRESS + if client_options: + if type(client_options) == dict: + client_options = google.api_core.client_options.from_dict( + client_options + ) + if client_options.api_endpoint: + api_endpoint = client_options.api_endpoint + + # Instantiate the transport. + # The transport is responsible for handling serialization and + # deserialization and actually sending data to the service. + if transport: + if callable(transport): + self.transport = transport( + credentials=credentials, + default_class=policy_tag_manager_grpc_transport.PolicyTagManagerGrpcTransport, + address=api_endpoint, + ) + else: + if credentials: + raise ValueError( + "Received both a transport instance and " + "credentials; these are mutually exclusive." + ) + self.transport = transport + else: + self.transport = policy_tag_manager_grpc_transport.PolicyTagManagerGrpcTransport( + address=api_endpoint, channel=channel, credentials=credentials + ) + + if client_info is None: + client_info = google.api_core.gapic_v1.client_info.ClientInfo( + gapic_version=_GAPIC_LIBRARY_VERSION + ) + else: + client_info.gapic_version = _GAPIC_LIBRARY_VERSION + self._client_info = client_info + + # Parse out the default settings for retry and timeout for each RPC + # from the client configuration. + # (Ordinarily, these are the defaults specified in the `*_config.py` + # file next to this one.) + self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( + client_config["interfaces"][self._INTERFACE_NAME] + ) + + # Save a dictionary of cached API call functions. + # These are the actual callables which invoke the proper + # transport methods, wrapped with `wrap_method` to add retry, + # timeout, and the like. + self._inner_api_calls = {} + + # Service calls + def create_taxonomy( + self, + parent=None, + taxonomy=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Creates a new taxonomy in a given project. + + Example: + >>> from google.cloud import datacatalog_v1beta1 + >>> + >>> client = datacatalog_v1beta1.PolicyTagManagerClient() + >>> + >>> response = client.create_taxonomy() + + Args: + parent (str): Required. Resource name of the project that the newly created taxonomy + belongs to. + taxonomy (Union[dict, ~google.cloud.datacatalog_v1beta1.types.Taxonomy]): The taxonomy to be created. The name field must be left blank. The + display\_name field is mandatory. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datacatalog_v1beta1.types.Taxonomy` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datacatalog_v1beta1.types.Taxonomy` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "create_taxonomy" not in self._inner_api_calls: + self._inner_api_calls[ + "create_taxonomy" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.create_taxonomy, + default_retry=self._method_configs["CreateTaxonomy"].retry, + default_timeout=self._method_configs["CreateTaxonomy"].timeout, + client_info=self._client_info, + ) + + request = policytagmanager_pb2.CreateTaxonomyRequest( + parent=parent, taxonomy=taxonomy + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["create_taxonomy"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def delete_taxonomy( + self, + name=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Deletes a taxonomy. This operation will also delete all + policy tags in this taxonomy. + + Example: + >>> from google.cloud import datacatalog_v1beta1 + >>> + >>> client = datacatalog_v1beta1.PolicyTagManagerClient() + >>> + >>> client.delete_taxonomy() + + Args: + name (str): Required. Resource name of the taxonomy to be deleted. All policy tags in + this taxonomy will also be deleted. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "delete_taxonomy" not in self._inner_api_calls: + self._inner_api_calls[ + "delete_taxonomy" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.delete_taxonomy, + default_retry=self._method_configs["DeleteTaxonomy"].retry, + default_timeout=self._method_configs["DeleteTaxonomy"].timeout, + client_info=self._client_info, + ) + + request = policytagmanager_pb2.DeleteTaxonomyRequest(name=name) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + self._inner_api_calls["delete_taxonomy"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def update_taxonomy( + self, + taxonomy=None, + update_mask=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Updates a taxonomy. + + Example: + >>> from google.cloud import datacatalog_v1beta1 + >>> + >>> client = datacatalog_v1beta1.PolicyTagManagerClient() + >>> + >>> response = client.update_taxonomy() + + Args: + taxonomy (Union[dict, ~google.cloud.datacatalog_v1beta1.types.Taxonomy]): The taxonomy to update. Only description, display\_name, and activated + policy types can be updated. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datacatalog_v1beta1.types.Taxonomy` + update_mask (Union[dict, ~google.cloud.datacatalog_v1beta1.types.FieldMask]): The update mask applies to the resource. For the ``FieldMask`` + definition, see + https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + If not set, defaults to all of the fields that are allowed to update. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datacatalog_v1beta1.types.FieldMask` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datacatalog_v1beta1.types.Taxonomy` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "update_taxonomy" not in self._inner_api_calls: + self._inner_api_calls[ + "update_taxonomy" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.update_taxonomy, + default_retry=self._method_configs["UpdateTaxonomy"].retry, + default_timeout=self._method_configs["UpdateTaxonomy"].timeout, + client_info=self._client_info, + ) + + request = policytagmanager_pb2.UpdateTaxonomyRequest( + taxonomy=taxonomy, update_mask=update_mask + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("taxonomy.name", taxonomy.name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["update_taxonomy"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def list_taxonomies( + self, + parent=None, + page_size=None, + page_token=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Lists all taxonomies in a project in a particular location. + + Example: + >>> from google.cloud import datacatalog_v1beta1 + >>> + >>> client = datacatalog_v1beta1.PolicyTagManagerClient() + >>> + >>> response = client.list_taxonomies() + + Args: + parent (str): Required. Resource name of a project to list the taxonomies of. + page_size (int): The maximum number of items to return. If not set, defaults to 50. + page_token (str): The next\_page\_token value returned from a previous list request, if + any. If not set, defaults to an empty string. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datacatalog_v1beta1.types.ListTaxonomiesResponse` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "list_taxonomies" not in self._inner_api_calls: + self._inner_api_calls[ + "list_taxonomies" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.list_taxonomies, + default_retry=self._method_configs["ListTaxonomies"].retry, + default_timeout=self._method_configs["ListTaxonomies"].timeout, + client_info=self._client_info, + ) + + request = policytagmanager_pb2.ListTaxonomiesRequest( + parent=parent, page_size=page_size, page_token=page_token + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["list_taxonomies"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def get_taxonomy( + self, + name=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Gets a taxonomy. + + Example: + >>> from google.cloud import datacatalog_v1beta1 + >>> + >>> client = datacatalog_v1beta1.PolicyTagManagerClient() + >>> + >>> response = client.get_taxonomy() + + Args: + name (str): Required. Resource name of the taxonomy to be returned. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datacatalog_v1beta1.types.Taxonomy` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "get_taxonomy" not in self._inner_api_calls: + self._inner_api_calls[ + "get_taxonomy" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.get_taxonomy, + default_retry=self._method_configs["GetTaxonomy"].retry, + default_timeout=self._method_configs["GetTaxonomy"].timeout, + client_info=self._client_info, + ) + + request = policytagmanager_pb2.GetTaxonomyRequest(name=name) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["get_taxonomy"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def create_policy_tag( + self, + parent=None, + policy_tag=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Creates a policy tag in a taxonomy. + + Example: + >>> from google.cloud import datacatalog_v1beta1 + >>> + >>> client = datacatalog_v1beta1.PolicyTagManagerClient() + >>> + >>> response = client.create_policy_tag() + + Args: + parent (str): Required. Resource name of the taxonomy that the newly created policy tag + belongs to. + policy_tag (Union[dict, ~google.cloud.datacatalog_v1beta1.types.PolicyTag]): The policy tag to be created. The name, and taxonomy\_display\_name + field must be left blank. The display\_name field is mandatory and must + not be duplicated with existing policy tags in the same taxonomy. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datacatalog_v1beta1.types.PolicyTag` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datacatalog_v1beta1.types.PolicyTag` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "create_policy_tag" not in self._inner_api_calls: + self._inner_api_calls[ + "create_policy_tag" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.create_policy_tag, + default_retry=self._method_configs["CreatePolicyTag"].retry, + default_timeout=self._method_configs["CreatePolicyTag"].timeout, + client_info=self._client_info, + ) + + request = policytagmanager_pb2.CreatePolicyTagRequest( + parent=parent, policy_tag=policy_tag + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["create_policy_tag"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def delete_policy_tag( + self, + name=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Deletes a policy tag. Also deletes all of its descendant policy tags. + + Example: + >>> from google.cloud import datacatalog_v1beta1 + >>> + >>> client = datacatalog_v1beta1.PolicyTagManagerClient() + >>> + >>> client.delete_policy_tag() + + Args: + name (str): Required. Resource name of the policy tag to be deleted. All its descendant + policy tags will also be deleted. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "delete_policy_tag" not in self._inner_api_calls: + self._inner_api_calls[ + "delete_policy_tag" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.delete_policy_tag, + default_retry=self._method_configs["DeletePolicyTag"].retry, + default_timeout=self._method_configs["DeletePolicyTag"].timeout, + client_info=self._client_info, + ) + + request = policytagmanager_pb2.DeletePolicyTagRequest(name=name) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + self._inner_api_calls["delete_policy_tag"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def update_policy_tag( + self, + policy_tag=None, + update_mask=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Updates a policy tag. + + Example: + >>> from google.cloud import datacatalog_v1beta1 + >>> + >>> client = datacatalog_v1beta1.PolicyTagManagerClient() + >>> + >>> response = client.update_policy_tag() + + Args: + policy_tag (Union[dict, ~google.cloud.datacatalog_v1beta1.types.PolicyTag]): The policy tag to update. Only the description, display\_name, and + parent\_policy\_tag fields can be updated. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datacatalog_v1beta1.types.PolicyTag` + update_mask (Union[dict, ~google.cloud.datacatalog_v1beta1.types.FieldMask]): The update mask applies to the resource. Only display\_name, description + and parent\_policy\_tag can be updated and thus can be listed in the + mask. If update\_mask is not provided, all allowed fields (i.e. + display\_name, description and parent) will be updated. For more + information including the ``FieldMask`` definition, see + https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + If not set, defaults to all of the fields that are allowed to update. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datacatalog_v1beta1.types.FieldMask` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datacatalog_v1beta1.types.PolicyTag` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "update_policy_tag" not in self._inner_api_calls: + self._inner_api_calls[ + "update_policy_tag" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.update_policy_tag, + default_retry=self._method_configs["UpdatePolicyTag"].retry, + default_timeout=self._method_configs["UpdatePolicyTag"].timeout, + client_info=self._client_info, + ) + + request = policytagmanager_pb2.UpdatePolicyTagRequest( + policy_tag=policy_tag, update_mask=update_mask + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("policy_tag.name", policy_tag.name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["update_policy_tag"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def list_policy_tags( + self, + parent=None, + page_size=None, + page_token=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Lists all policy tags in a taxonomy. + + Example: + >>> from google.cloud import datacatalog_v1beta1 + >>> + >>> client = datacatalog_v1beta1.PolicyTagManagerClient() + >>> + >>> response = client.list_policy_tags() + + Args: + parent (str): Required. Resource name of a taxonomy to list the policy tags of. + page_size (int): The maximum number of items to return. If not set, defaults to 50. + page_token (str): The next\_page\_token value returned from a previous List request, if + any. If not set, defaults to an empty string. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datacatalog_v1beta1.types.ListPolicyTagsResponse` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "list_policy_tags" not in self._inner_api_calls: + self._inner_api_calls[ + "list_policy_tags" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.list_policy_tags, + default_retry=self._method_configs["ListPolicyTags"].retry, + default_timeout=self._method_configs["ListPolicyTags"].timeout, + client_info=self._client_info, + ) + + request = policytagmanager_pb2.ListPolicyTagsRequest( + parent=parent, page_size=page_size, page_token=page_token + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["list_policy_tags"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def get_policy_tag( + self, + name=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Gets a policy tag. + + Example: + >>> from google.cloud import datacatalog_v1beta1 + >>> + >>> client = datacatalog_v1beta1.PolicyTagManagerClient() + >>> + >>> response = client.get_policy_tag() + + Args: + name (str): Required. Resource name of the policy tag to be returned. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datacatalog_v1beta1.types.PolicyTag` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "get_policy_tag" not in self._inner_api_calls: + self._inner_api_calls[ + "get_policy_tag" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.get_policy_tag, + default_retry=self._method_configs["GetPolicyTag"].retry, + default_timeout=self._method_configs["GetPolicyTag"].timeout, + client_info=self._client_info, + ) + + request = policytagmanager_pb2.GetPolicyTagRequest(name=name) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["get_policy_tag"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def get_iam_policy( + self, + resource=None, + options_=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Gets the IAM policy for a taxonomy or a policy tag. + + Example: + >>> from google.cloud import datacatalog_v1beta1 + >>> + >>> client = datacatalog_v1beta1.PolicyTagManagerClient() + >>> + >>> response = client.get_iam_policy() + + Args: + resource (str): REQUIRED: The resource for which the policy is being requested. + See the operation documentation for the appropriate value for this field. + options_ (Union[dict, ~google.cloud.datacatalog_v1beta1.types.GetPolicyOptions]): OPTIONAL: A ``GetPolicyOptions`` object for specifying options to + ``GetIamPolicy``. This field is only used by Cloud IAM. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datacatalog_v1beta1.types.GetPolicyOptions` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datacatalog_v1beta1.types.Policy` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "get_iam_policy" not in self._inner_api_calls: + self._inner_api_calls[ + "get_iam_policy" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.get_iam_policy, + default_retry=self._method_configs["GetIamPolicy"].retry, + default_timeout=self._method_configs["GetIamPolicy"].timeout, + client_info=self._client_info, + ) + + request = iam_policy_pb2.GetIamPolicyRequest( + resource=resource, options=options_ + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("resource", resource)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["get_iam_policy"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def set_iam_policy( + self, + resource=None, + policy=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Sets the IAM policy for a taxonomy or a policy tag. + + Example: + >>> from google.cloud import datacatalog_v1beta1 + >>> + >>> client = datacatalog_v1beta1.PolicyTagManagerClient() + >>> + >>> response = client.set_iam_policy() + + Args: + resource (str): REQUIRED: The resource for which the policy is being specified. + See the operation documentation for the appropriate value for this field. + policy (Union[dict, ~google.cloud.datacatalog_v1beta1.types.Policy]): REQUIRED: The complete policy to be applied to the ``resource``. The + size of the policy is limited to a few 10s of KB. An empty policy is a + valid policy but certain Cloud Platform services (such as Projects) + might reject them. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datacatalog_v1beta1.types.Policy` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datacatalog_v1beta1.types.Policy` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "set_iam_policy" not in self._inner_api_calls: + self._inner_api_calls[ + "set_iam_policy" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.set_iam_policy, + default_retry=self._method_configs["SetIamPolicy"].retry, + default_timeout=self._method_configs["SetIamPolicy"].timeout, + client_info=self._client_info, + ) + + request = iam_policy_pb2.SetIamPolicyRequest(resource=resource, policy=policy) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("resource", resource)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["set_iam_policy"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def test_iam_permissions( + self, + resource=None, + permissions=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Returns permissions that a caller has on specified resources. + + Example: + >>> from google.cloud import datacatalog_v1beta1 + >>> + >>> client = datacatalog_v1beta1.PolicyTagManagerClient() + >>> + >>> response = client.test_iam_permissions() + + Args: + resource (str): REQUIRED: The resource for which the policy detail is being requested. + See the operation documentation for the appropriate value for this field. + permissions (list[str]): The set of permissions to check for the ``resource``. Permissions with + wildcards (such as '*' or 'storage.*') are not allowed. For more + information see `IAM + Overview `__. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datacatalog_v1beta1.types.TestIamPermissionsResponse` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "test_iam_permissions" not in self._inner_api_calls: + self._inner_api_calls[ + "test_iam_permissions" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.test_iam_permissions, + default_retry=self._method_configs["TestIamPermissions"].retry, + default_timeout=self._method_configs["TestIamPermissions"].timeout, + client_info=self._client_info, + ) + + request = iam_policy_pb2.TestIamPermissionsRequest( + resource=resource, permissions=permissions + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("resource", resource)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["test_iam_permissions"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_client_config.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_client_config.py new file mode 100644 index 000000000000..568750580247 --- /dev/null +++ b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_client_config.py @@ -0,0 +1,88 @@ +config = { + "interfaces": { + "google.cloud.datacatalog.v1beta1.PolicyTagManager": { + "retry_codes": { + "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], + "non_idempotent": [], + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000, + } + }, + "methods": { + "CreateTaxonomy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "DeleteTaxonomy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "UpdateTaxonomy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "ListTaxonomies": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "GetTaxonomy": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "CreatePolicyTag": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "DeletePolicyTag": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "UpdatePolicyTag": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "ListPolicyTags": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "GetPolicyTag": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "GetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "SetIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "TestIamPermissions": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + }, + } + } +} diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_serialization_client.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_serialization_client.py new file mode 100644 index 000000000000..a6c8d9c9a993 --- /dev/null +++ b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_serialization_client.py @@ -0,0 +1,372 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Accesses the google.cloud.datacatalog.v1beta1 PolicyTagManagerSerialization API.""" + +import pkg_resources +import warnings + +from google.oauth2 import service_account +import google.api_core.client_options +import google.api_core.gapic_v1.client_info +import google.api_core.gapic_v1.config +import google.api_core.gapic_v1.method +import google.api_core.gapic_v1.routing_header +import google.api_core.grpc_helpers +import google.api_core.protobuf_helpers +import grpc + +from google.cloud.datacatalog_v1beta1.gapic import enums +from google.cloud.datacatalog_v1beta1.gapic import ( + policy_tag_manager_serialization_client_config, +) +from google.cloud.datacatalog_v1beta1.gapic.transports import ( + policy_tag_manager_serialization_grpc_transport, +) +from google.cloud.datacatalog_v1beta1.proto import datacatalog_pb2 +from google.cloud.datacatalog_v1beta1.proto import datacatalog_pb2_grpc +from google.cloud.datacatalog_v1beta1.proto import policytagmanager_pb2 +from google.cloud.datacatalog_v1beta1.proto import policytagmanager_pb2_grpc +from google.cloud.datacatalog_v1beta1.proto import policytagmanagerserialization_pb2 +from google.cloud.datacatalog_v1beta1.proto import ( + policytagmanagerserialization_pb2_grpc, +) +from google.cloud.datacatalog_v1beta1.proto import tags_pb2 +from google.iam.v1 import iam_policy_pb2 +from google.iam.v1 import options_pb2 +from google.iam.v1 import policy_pb2 +from google.protobuf import empty_pb2 +from google.protobuf import field_mask_pb2 + + +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( + "google-cloud-datacatalog" +).version + + +class PolicyTagManagerSerializationClient(object): + """ + Policy tag manager serialization API service allows clients to manipulate + their taxonomies and policy tags data with serialized format. + """ + + SERVICE_ADDRESS = "datacatalog.googleapis.com:443" + """The default address of the service.""" + + # The name of the interface for this client. This is the key used to + # find the method configuration in the client_config dictionary. + _INTERFACE_NAME = "google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization" + + @classmethod + def from_service_account_file(cls, filename, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + PolicyTagManagerSerializationClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_file(filename) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + from_service_account_json = from_service_account_file + + def __init__( + self, + transport=None, + channel=None, + credentials=None, + client_config=None, + client_info=None, + client_options=None, + ): + """Constructor. + + Args: + transport (Union[~.PolicyTagManagerSerializationGrpcTransport, + Callable[[~.Credentials, type], ~.PolicyTagManagerSerializationGrpcTransport]): A transport + instance, responsible for actually making the API calls. + The default transport uses the gRPC protocol. + This argument may also be a callable which returns a + transport instance. Callables will be sent the credentials + as the first argument and the default transport class as + the second argument. + channel (grpc.Channel): DEPRECATED. A ``Channel`` instance + through which to make calls. This argument is mutually exclusive + with ``credentials``; providing both will raise an exception. + credentials (google.auth.credentials.Credentials): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If none + are specified, the client will attempt to ascertain the + credentials from the environment. + This argument is mutually exclusive with providing a + transport instance to ``transport``; doing so will raise + an exception. + client_config (dict): DEPRECATED. A dictionary of call options for + each method. If not specified, the default configuration is used. + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + client_options (Union[dict, google.api_core.client_options.ClientOptions]): + Client options used to set user options on the client. API Endpoint + should be set through client_options. + """ + # Raise deprecation warnings for things we want to go away. + if client_config is not None: + warnings.warn( + "The `client_config` argument is deprecated.", + PendingDeprecationWarning, + stacklevel=2, + ) + else: + client_config = policy_tag_manager_serialization_client_config.config + + if channel: + warnings.warn( + "The `channel` argument is deprecated; use " "`transport` instead.", + PendingDeprecationWarning, + stacklevel=2, + ) + + api_endpoint = self.SERVICE_ADDRESS + if client_options: + if type(client_options) == dict: + client_options = google.api_core.client_options.from_dict( + client_options + ) + if client_options.api_endpoint: + api_endpoint = client_options.api_endpoint + + # Instantiate the transport. + # The transport is responsible for handling serialization and + # deserialization and actually sending data to the service. + if transport: + if callable(transport): + self.transport = transport( + credentials=credentials, + default_class=policy_tag_manager_serialization_grpc_transport.PolicyTagManagerSerializationGrpcTransport, + address=api_endpoint, + ) + else: + if credentials: + raise ValueError( + "Received both a transport instance and " + "credentials; these are mutually exclusive." + ) + self.transport = transport + else: + self.transport = policy_tag_manager_serialization_grpc_transport.PolicyTagManagerSerializationGrpcTransport( + address=api_endpoint, channel=channel, credentials=credentials + ) + + if client_info is None: + client_info = google.api_core.gapic_v1.client_info.ClientInfo( + gapic_version=_GAPIC_LIBRARY_VERSION + ) + else: + client_info.gapic_version = _GAPIC_LIBRARY_VERSION + self._client_info = client_info + + # Parse out the default settings for retry and timeout for each RPC + # from the client configuration. + # (Ordinarily, these are the defaults specified in the `*_config.py` + # file next to this one.) + self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( + client_config["interfaces"][self._INTERFACE_NAME] + ) + + # Save a dictionary of cached API call functions. + # These are the actual callables which invoke the proper + # transport methods, wrapped with `wrap_method` to add retry, + # timeout, and the like. + self._inner_api_calls = {} + + # Service calls + def import_taxonomies( + self, + parent=None, + inline_source=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Imports all taxonomies and their policy tags to a project as new + taxonomies. + + This method provides a bulk taxonomy / policy tag creation using nested + proto structure. + + Example: + >>> from google.cloud import datacatalog_v1beta1 + >>> + >>> client = datacatalog_v1beta1.PolicyTagManagerSerializationClient() + >>> + >>> response = client.import_taxonomies() + + Args: + parent (str): Required. Resource name of project that the newly created taxonomies will + belong to. + inline_source (Union[dict, ~google.cloud.datacatalog_v1beta1.types.InlineSource]): Inline source used for taxonomies import + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.datacatalog_v1beta1.types.InlineSource` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datacatalog_v1beta1.types.ImportTaxonomiesResponse` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "import_taxonomies" not in self._inner_api_calls: + self._inner_api_calls[ + "import_taxonomies" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.import_taxonomies, + default_retry=self._method_configs["ImportTaxonomies"].retry, + default_timeout=self._method_configs["ImportTaxonomies"].timeout, + client_info=self._client_info, + ) + + # Sanity check: We have some fields which are mutually exclusive; + # raise ValueError if more than one is sent. + google.api_core.protobuf_helpers.check_oneof(inline_source=inline_source) + + request = policytagmanagerserialization_pb2.ImportTaxonomiesRequest( + parent=parent, inline_source=inline_source + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["import_taxonomies"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def export_taxonomies( + self, + parent=None, + taxonomies=None, + serialized_taxonomies=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Exports all taxonomies and their policy tags in a project. + + This method generates SerializedTaxonomy protos with nested policy tags + that can be used as an input for future ImportTaxonomies calls. + + Example: + >>> from google.cloud import datacatalog_v1beta1 + >>> + >>> client = datacatalog_v1beta1.PolicyTagManagerSerializationClient() + >>> + >>> response = client.export_taxonomies() + + Args: + parent (str): Required. Resource name of the project that taxonomies to be exported + will share. + taxonomies (list[str]): Required. Resource names of the taxonomies to be exported. + serialized_taxonomies (bool): Export taxonomies as serialized taxonomies. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.datacatalog_v1beta1.types.ExportTaxonomiesResponse` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "export_taxonomies" not in self._inner_api_calls: + self._inner_api_calls[ + "export_taxonomies" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.export_taxonomies, + default_retry=self._method_configs["ExportTaxonomies"].retry, + default_timeout=self._method_configs["ExportTaxonomies"].timeout, + client_info=self._client_info, + ) + + # Sanity check: We have some fields which are mutually exclusive; + # raise ValueError if more than one is sent. + google.api_core.protobuf_helpers.check_oneof( + serialized_taxonomies=serialized_taxonomies + ) + + request = policytagmanagerserialization_pb2.ExportTaxonomiesRequest( + parent=parent, + taxonomies=taxonomies, + serialized_taxonomies=serialized_taxonomies, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("parent", parent)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["export_taxonomies"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_serialization_client_config.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_serialization_client_config.py new file mode 100644 index 000000000000..98ba9b0bca34 --- /dev/null +++ b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/policy_tag_manager_serialization_client_config.py @@ -0,0 +1,33 @@ +config = { + "interfaces": { + "google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization": { + "retry_codes": { + "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], + "non_idempotent": [], + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 600000, + } + }, + "methods": { + "ImportTaxonomies": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default", + }, + "ExportTaxonomies": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + }, + } + } +} diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/policy_tag_manager_grpc_transport.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/policy_tag_manager_grpc_transport.py new file mode 100644 index 000000000000..988ea1d88f8b --- /dev/null +++ b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/policy_tag_manager_grpc_transport.py @@ -0,0 +1,280 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import google.api_core.grpc_helpers + +from google.cloud.datacatalog_v1beta1.proto import policytagmanager_pb2_grpc + + +class PolicyTagManagerGrpcTransport(object): + """gRPC transport class providing stubs for + google.cloud.datacatalog.v1beta1 PolicyTagManager API. + + The transport provides access to the raw gRPC stubs, + which can be used to take advantage of advanced + features of gRPC. + """ + + # The scopes needed to make gRPC calls to all of the methods defined + # in this service. + _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) + + def __init__( + self, channel=None, credentials=None, address="datacatalog.googleapis.com:443" + ): + """Instantiate the transport class. + + Args: + channel (grpc.Channel): A ``Channel`` instance through + which to make calls. This argument is mutually exclusive + with ``credentials``; providing both will raise an exception. + credentials (google.auth.credentials.Credentials): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If none + are specified, the client will attempt to ascertain the + credentials from the environment. + address (str): The address where the service is hosted. + """ + # If both `channel` and `credentials` are specified, raise an + # exception (channels come with credentials baked in already). + if channel is not None and credentials is not None: + raise ValueError( + "The `channel` and `credentials` arguments are mutually " "exclusive." + ) + + # Create the channel. + if channel is None: + channel = self.create_channel( + address=address, + credentials=credentials, + options={ + "grpc.max_send_message_length": -1, + "grpc.max_receive_message_length": -1, + }.items(), + ) + + self._channel = channel + + # gRPC uses objects called "stubs" that are bound to the + # channel and provide a basic method for each RPC. + self._stubs = { + "policy_tag_manager_stub": policytagmanager_pb2_grpc.PolicyTagManagerStub( + channel + ) + } + + @classmethod + def create_channel( + cls, address="datacatalog.googleapis.com:443", credentials=None, **kwargs + ): + """Create and return a gRPC channel object. + + Args: + address (str): The host for the channel to use. + credentials (~.Credentials): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If + none are specified, the client will attempt to ascertain + the credentials from the environment. + kwargs (dict): Keyword arguments, which are passed to the + channel creation. + + Returns: + grpc.Channel: A gRPC channel object. + """ + return google.api_core.grpc_helpers.create_channel( + address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs + ) + + @property + def channel(self): + """The gRPC channel used by the transport. + + Returns: + grpc.Channel: A gRPC channel object. + """ + return self._channel + + @property + def create_taxonomy(self): + """Return the gRPC stub for :meth:`PolicyTagManagerClient.create_taxonomy`. + + Creates a new taxonomy in a given project. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["policy_tag_manager_stub"].CreateTaxonomy + + @property + def delete_taxonomy(self): + """Return the gRPC stub for :meth:`PolicyTagManagerClient.delete_taxonomy`. + + Deletes a taxonomy. This operation will also delete all + policy tags in this taxonomy. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["policy_tag_manager_stub"].DeleteTaxonomy + + @property + def update_taxonomy(self): + """Return the gRPC stub for :meth:`PolicyTagManagerClient.update_taxonomy`. + + Updates a taxonomy. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["policy_tag_manager_stub"].UpdateTaxonomy + + @property + def list_taxonomies(self): + """Return the gRPC stub for :meth:`PolicyTagManagerClient.list_taxonomies`. + + Lists all taxonomies in a project in a particular location. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["policy_tag_manager_stub"].ListTaxonomies + + @property + def get_taxonomy(self): + """Return the gRPC stub for :meth:`PolicyTagManagerClient.get_taxonomy`. + + Gets a taxonomy. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["policy_tag_manager_stub"].GetTaxonomy + + @property + def create_policy_tag(self): + """Return the gRPC stub for :meth:`PolicyTagManagerClient.create_policy_tag`. + + Creates a policy tag in a taxonomy. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["policy_tag_manager_stub"].CreatePolicyTag + + @property + def delete_policy_tag(self): + """Return the gRPC stub for :meth:`PolicyTagManagerClient.delete_policy_tag`. + + Deletes a policy tag. Also deletes all of its descendant policy tags. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["policy_tag_manager_stub"].DeletePolicyTag + + @property + def update_policy_tag(self): + """Return the gRPC stub for :meth:`PolicyTagManagerClient.update_policy_tag`. + + Updates a policy tag. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["policy_tag_manager_stub"].UpdatePolicyTag + + @property + def list_policy_tags(self): + """Return the gRPC stub for :meth:`PolicyTagManagerClient.list_policy_tags`. + + Lists all policy tags in a taxonomy. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["policy_tag_manager_stub"].ListPolicyTags + + @property + def get_policy_tag(self): + """Return the gRPC stub for :meth:`PolicyTagManagerClient.get_policy_tag`. + + Gets a policy tag. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["policy_tag_manager_stub"].GetPolicyTag + + @property + def get_iam_policy(self): + """Return the gRPC stub for :meth:`PolicyTagManagerClient.get_iam_policy`. + + Gets the IAM policy for a taxonomy or a policy tag. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["policy_tag_manager_stub"].GetIamPolicy + + @property + def set_iam_policy(self): + """Return the gRPC stub for :meth:`PolicyTagManagerClient.set_iam_policy`. + + Sets the IAM policy for a taxonomy or a policy tag. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["policy_tag_manager_stub"].SetIamPolicy + + @property + def test_iam_permissions(self): + """Return the gRPC stub for :meth:`PolicyTagManagerClient.test_iam_permissions`. + + Returns permissions that a caller has on specified resources. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["policy_tag_manager_stub"].TestIamPermissions diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/policy_tag_manager_serialization_grpc_transport.py b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/policy_tag_manager_serialization_grpc_transport.py new file mode 100644 index 000000000000..2eca25f48045 --- /dev/null +++ b/datacatalog/google/cloud/datacatalog_v1beta1/gapic/transports/policy_tag_manager_serialization_grpc_transport.py @@ -0,0 +1,145 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +import google.api_core.grpc_helpers + +from google.cloud.datacatalog_v1beta1.proto import ( + policytagmanagerserialization_pb2_grpc, +) + + +class PolicyTagManagerSerializationGrpcTransport(object): + """gRPC transport class providing stubs for + google.cloud.datacatalog.v1beta1 PolicyTagManagerSerialization API. + + The transport provides access to the raw gRPC stubs, + which can be used to take advantage of advanced + features of gRPC. + """ + + # The scopes needed to make gRPC calls to all of the methods defined + # in this service. + _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) + + def __init__( + self, channel=None, credentials=None, address="datacatalog.googleapis.com:443" + ): + """Instantiate the transport class. + + Args: + channel (grpc.Channel): A ``Channel`` instance through + which to make calls. This argument is mutually exclusive + with ``credentials``; providing both will raise an exception. + credentials (google.auth.credentials.Credentials): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If none + are specified, the client will attempt to ascertain the + credentials from the environment. + address (str): The address where the service is hosted. + """ + # If both `channel` and `credentials` are specified, raise an + # exception (channels come with credentials baked in already). + if channel is not None and credentials is not None: + raise ValueError( + "The `channel` and `credentials` arguments are mutually " "exclusive." + ) + + # Create the channel. + if channel is None: + channel = self.create_channel( + address=address, + credentials=credentials, + options={ + "grpc.max_send_message_length": -1, + "grpc.max_receive_message_length": -1, + }.items(), + ) + + self._channel = channel + + # gRPC uses objects called "stubs" that are bound to the + # channel and provide a basic method for each RPC. + self._stubs = { + "policy_tag_manager_serialization_stub": policytagmanagerserialization_pb2_grpc.PolicyTagManagerSerializationStub( + channel + ) + } + + @classmethod + def create_channel( + cls, address="datacatalog.googleapis.com:443", credentials=None, **kwargs + ): + """Create and return a gRPC channel object. + + Args: + address (str): The host for the channel to use. + credentials (~.Credentials): The + authorization credentials to attach to requests. These + credentials identify this application to the service. If + none are specified, the client will attempt to ascertain + the credentials from the environment. + kwargs (dict): Keyword arguments, which are passed to the + channel creation. + + Returns: + grpc.Channel: A gRPC channel object. + """ + return google.api_core.grpc_helpers.create_channel( + address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs + ) + + @property + def channel(self): + """The gRPC channel used by the transport. + + Returns: + grpc.Channel: A gRPC channel object. + """ + return self._channel + + @property + def import_taxonomies(self): + """Return the gRPC stub for :meth:`PolicyTagManagerSerializationClient.import_taxonomies`. + + Imports all taxonomies and their policy tags to a project as new + taxonomies. + + This method provides a bulk taxonomy / policy tag creation using nested + proto structure. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["policy_tag_manager_serialization_stub"].ImportTaxonomies + + @property + def export_taxonomies(self): + """Return the gRPC stub for :meth:`PolicyTagManagerSerializationClient.export_taxonomies`. + + Exports all taxonomies and their policy tags in a project. + + This method generates SerializedTaxonomy protos with nested policy tags + that can be used as an input for future ImportTaxonomies calls. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["policy_tag_manager_serialization_stub"].ExportTaxonomies diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/datacatalog_pb2.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/datacatalog_pb2.py index 01f2e79352d9..bae30dbf3e1b 100644 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/datacatalog_pb2.py +++ b/datacatalog/google/cloud/datacatalog_v1beta1/proto/datacatalog_pb2.py @@ -49,10 +49,10 @@ package="google.cloud.datacatalog.v1beta1", syntax="proto3", serialized_options=_b( - "\n\034com.google.cloud.datacatalogP\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" + "\n$com.google.cloud.datacatalog.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" ), serialized_pb=_b( - '\n8google/cloud/datacatalog_v1beta1/proto/datacatalog.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a=google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec.proto\x1a\x33google/cloud/datacatalog_v1beta1/proto/schema.proto\x1a\x33google/cloud/datacatalog_v1beta1/proto/search.proto\x1a\x37google/cloud/datacatalog_v1beta1/proto/table_spec.proto\x1a\x31google/cloud/datacatalog_v1beta1/proto/tags.proto\x1a\x37google/cloud/datacatalog_v1beta1/proto/timestamps.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"\x9e\x02\n\x14SearchCatalogRequest\x12P\n\x05scope\x18\x06 \x01(\x0b\x32<.google.cloud.datacatalog.v1beta1.SearchCatalogRequest.ScopeB\x03\xe0\x41\x02\x12\x12\n\x05query\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x08order_by\x18\x05 \x01(\t\x1a\x62\n\x05Scope\x12\x17\n\x0finclude_org_ids\x18\x02 \x03(\t\x12\x1b\n\x13include_project_ids\x18\x03 \x03(\t\x12#\n\x1binclude_gcp_public_datasets\x18\x07 \x01(\x08"x\n\x15SearchCatalogResponse\x12\x46\n\x07results\x18\x01 \x03(\x0b\x32\x35.google.cloud.datacatalog.v1beta1.SearchCatalogResult\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t"\xb8\x01\n\x17\x43reateEntryGroupRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%datacatalog.googleapis.com/EntryGroup\x12\x1b\n\x0e\x65ntry_group_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x0b\x65ntry_group\x18\x02 \x01(\x0b\x32,.google.cloud.datacatalog.v1beta1.EntryGroup"\x82\x01\n\x14GetEntryGroupRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%datacatalog.googleapis.com/EntryGroup\x12-\n\tread_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"V\n\x17\x44\x65leteEntryGroupRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%datacatalog.googleapis.com/EntryGroup"\xa7\x01\n\x12\x43reateEntryRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%datacatalog.googleapis.com/EntryGroup\x12\x15\n\x08\x65ntry_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12;\n\x05\x65ntry\x18\x02 \x01(\x0b\x32\'.google.cloud.datacatalog.v1beta1.EntryB\x03\xe0\x41\x02"\x82\x01\n\x12UpdateEntryRequest\x12;\n\x05\x65ntry\x18\x01 \x01(\x0b\x32\'.google.cloud.datacatalog.v1beta1.EntryB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"L\n\x12\x44\x65leteEntryRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n datacatalog.googleapis.com/Entry"I\n\x0fGetEntryRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n datacatalog.googleapis.com/Entry"V\n\x12LookupEntryRequest\x12\x19\n\x0flinked_resource\x18\x01 \x01(\tH\x00\x12\x16\n\x0csql_resource\x18\x03 \x01(\tH\x00\x42\r\n\x0btarget_name"\xf4\x05\n\x05\x45ntry\x12\x38\n\x04name\x18\x01 \x01(\tB*\xfa\x41\'\n%datacatalog.googleapis.com/EntryGroup\x12\x1c\n\x0flinked_resource\x18\t \x01(\tB\x03\xe0\x41\x03\x12;\n\x04type\x18\x02 \x01(\x0e\x32+.google.cloud.datacatalog.v1beta1.EntryTypeH\x00\x12L\n\x10gcs_fileset_spec\x18\x06 \x01(\x0b\x32\x30.google.cloud.datacatalog.v1beta1.GcsFilesetSpecH\x01\x12R\n\x13\x62igquery_table_spec\x18\x0c \x01(\x0b\x32\x33.google.cloud.datacatalog.v1beta1.BigQueryTableSpecH\x01\x12_\n\x1a\x62igquery_date_sharded_spec\x18\x0f \x01(\x0b\x32\x39.google.cloud.datacatalog.v1beta1.BigQueryDateShardedSpecH\x01\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x38\n\x06schema\x18\x05 \x01(\x0b\x32(.google.cloud.datacatalog.v1beta1.Schema\x12Y\n\x18source_system_timestamps\x18\x07 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.SystemTimestampsB\x03\xe0\x41\x03:x\xea\x41u\n datacatalog.googleapis.com/Entry\x12Qprojects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}B\x0c\n\nentry_typeB\x0b\n\ttype_spec"\x8e\x02\n\nEntryGroup\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12X\n\x17\x64\x61ta_catalog_timestamps\x18\x04 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.SystemTimestampsB\x03\xe0\x41\x03:m\xea\x41j\n%datacatalog.googleapis.com/EntryGroup\x12\x41projects/{project}/locations/{location}/entryGroups/{entry_group}"\xc2\x01\n\x18\x43reateTagTemplateRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&datacatalog.googleapis.com/TagTemplate\x12\x1c\n\x0ftag_template_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12H\n\x0ctag_template\x18\x02 \x01(\x0b\x32-.google.cloud.datacatalog.v1beta1.TagTemplateB\x03\xe0\x41\x02"U\n\x15GetTagTemplateRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&datacatalog.googleapis.com/TagTemplate"\x95\x01\n\x18UpdateTagTemplateRequest\x12H\n\x0ctag_template\x18\x01 \x01(\x0b\x32-.google.cloud.datacatalog.v1beta1.TagTemplateB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"l\n\x18\x44\x65leteTagTemplateRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&datacatalog.googleapis.com/TagTemplate\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02"\x83\x01\n\x10\x43reateTagRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64\x61tacatalog.googleapis.com/Tag\x12\x37\n\x03tag\x18\x02 \x01(\x0b\x32%.google.cloud.datacatalog.v1beta1.TagB\x03\xe0\x41\x02"|\n\x10UpdateTagRequest\x12\x37\n\x03tag\x18\x01 \x01(\x0b\x32%.google.cloud.datacatalog.v1beta1.TagB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"H\n\x10\x44\x65leteTagRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64\x61tacatalog.googleapis.com/Tag"\xd8\x01\n\x1d\x43reateTagTemplateFieldRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&datacatalog.googleapis.com/TagTemplate\x12"\n\x15tag_template_field_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12S\n\x12tag_template_field\x18\x03 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.TagTemplateFieldB\x03\xe0\x41\x02"\xe8\x01\n\x1dUpdateTagTemplateFieldRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+datacatalog.googleapis.com/TagTemplateField\x12S\n\x12tag_template_field\x18\x02 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.TagTemplateFieldB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"\x8a\x01\n\x1dRenameTagTemplateFieldRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+datacatalog.googleapis.com/TagTemplateField\x12&\n\x19new_tag_template_field_id\x18\x02 \x01(\tB\x03\xe0\x41\x02"v\n\x1d\x44\x65leteTagTemplateFieldRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+datacatalog.googleapis.com/TagTemplateField\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02"p\n\x0fListTagsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64\x61tacatalog.googleapis.com/Tag\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"`\n\x10ListTagsResponse\x12\x33\n\x04tags\x18\x01 \x03(\x0b\x32%.google.cloud.datacatalog.v1beta1.Tag\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t*P\n\tEntryType\x12\x1a\n\x16\x45NTRY_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05TABLE\x10\x02\x12\x0f\n\x0b\x44\x41TA_STREAM\x10\x03\x12\x0b\n\x07\x46ILESET\x10\x04\x32\xc8+\n\x0b\x44\x61taCatalog\x12\xb2\x01\n\rSearchCatalog\x12\x36.google.cloud.datacatalog.v1beta1.SearchCatalogRequest\x1a\x37.google.cloud.datacatalog.v1beta1.SearchCatalogResponse"0\x82\xd3\xe4\x93\x02\x1c"\x17/v1beta1/catalog:search:\x01*\xda\x41\x0bscope,query\x12\xea\x01\n\x10\x43reateEntryGroup\x12\x39.google.cloud.datacatalog.v1beta1.CreateEntryGroupRequest\x1a,.google.cloud.datacatalog.v1beta1.EntryGroup"m\x82\xd3\xe4\x93\x02\x43"4/v1beta1/{parent=projects/*/locations/*}/entryGroups:\x0b\x65ntry_group\xda\x41!parent,entry_group_id,entry_group\x12\xcb\x01\n\rGetEntryGroup\x12\x36.google.cloud.datacatalog.v1beta1.GetEntryGroupRequest\x1a,.google.cloud.datacatalog.v1beta1.EntryGroup"T\x82\xd3\xe4\x93\x02\x36\x12\x34/v1beta1/{name=projects/*/locations/*/entryGroups/*}\xda\x41\x04name\xda\x41\x0ename,read_mask\x12\xaa\x01\n\x10\x44\x65leteEntryGroup\x12\x39.google.cloud.datacatalog.v1beta1.DeleteEntryGroupRequest\x1a\x16.google.protobuf.Empty"C\x82\xd3\xe4\x93\x02\x36*4/v1beta1/{name=projects/*/locations/*/entryGroups/*}\xda\x41\x04name\x12\xd3\x01\n\x0b\x43reateEntry\x12\x34.google.cloud.datacatalog.v1beta1.CreateEntryRequest\x1a\'.google.cloud.datacatalog.v1beta1.Entry"e\x82\xd3\xe4\x93\x02G">/v1beta1/{parent=projects/*/locations/*/entryGroups/*}/entries:\x05\x65ntry\xda\x41\x15parent,entry_id,entry\x12\xdd\x01\n\x0bUpdateEntry\x12\x34.google.cloud.datacatalog.v1beta1.UpdateEntryRequest\x1a\'.google.cloud.datacatalog.v1beta1.Entry"o\x82\xd3\xe4\x93\x02M2D/v1beta1/{entry.name=projects/*/locations/*/entryGroups/*/entries/*}:\x05\x65ntry\xda\x41\x05\x65ntry\xda\x41\x11\x65ntry,update_mask\x12\xaa\x01\n\x0b\x44\x65leteEntry\x12\x34.google.cloud.datacatalog.v1beta1.DeleteEntryRequest\x1a\x16.google.protobuf.Empty"M\x82\xd3\xe4\x93\x02@*>/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*}\xda\x41\x04name\x12\xb5\x01\n\x08GetEntry\x12\x31.google.cloud.datacatalog.v1beta1.GetEntryRequest\x1a\'.google.cloud.datacatalog.v1beta1.Entry"M\x82\xd3\xe4\x93\x02@\x12>/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*}\xda\x41\x04name\x12\x8d\x01\n\x0bLookupEntry\x12\x34.google.cloud.datacatalog.v1beta1.LookupEntryRequest\x1a\'.google.cloud.datacatalog.v1beta1.Entry"\x1f\x82\xd3\xe4\x93\x02\x19\x12\x17/v1beta1/entries:lookup\x12\xf1\x01\n\x11\x43reateTagTemplate\x12:.google.cloud.datacatalog.v1beta1.CreateTagTemplateRequest\x1a-.google.cloud.datacatalog.v1beta1.TagTemplate"q\x82\xd3\xe4\x93\x02\x45"5/v1beta1/{parent=projects/*/locations/*}/tagTemplates:\x0ctag_template\xda\x41#parent,tag_template_id,tag_template\x12\xbe\x01\n\x0eGetTagTemplate\x12\x37.google.cloud.datacatalog.v1beta1.GetTagTemplateRequest\x1a-.google.cloud.datacatalog.v1beta1.TagTemplate"D\x82\xd3\xe4\x93\x02\x37\x12\x35/v1beta1/{name=projects/*/locations/*/tagTemplates/*}\xda\x41\x04name\x12\x83\x02\n\x11UpdateTagTemplate\x12:.google.cloud.datacatalog.v1beta1.UpdateTagTemplateRequest\x1a-.google.cloud.datacatalog.v1beta1.TagTemplate"\x82\x01\x82\xd3\xe4\x93\x02R2B/v1beta1/{tag_template.name=projects/*/locations/*/tagTemplates/*}:\x0ctag_template\xda\x41\x0ctag_template\xda\x41\x18tag_template,update_mask\x12\xb3\x01\n\x11\x44\x65leteTagTemplate\x12:.google.cloud.datacatalog.v1beta1.DeleteTagTemplateRequest\x1a\x16.google.protobuf.Empty"J\x82\xd3\xe4\x93\x02\x37*5/v1beta1/{name=projects/*/locations/*/tagTemplates/*}\xda\x41\nname,force\x12\x9c\x02\n\x16\x43reateTagTemplateField\x12?.google.cloud.datacatalog.v1beta1.CreateTagTemplateFieldRequest\x1a\x32.google.cloud.datacatalog.v1beta1.TagTemplateField"\x8c\x01\x82\xd3\xe4\x93\x02T">/v1beta1/{parent=projects/*/locations/*/tagTemplates/*}/fields:\x12tag_template_field\xda\x41/parent,tag_template_field_id,tag_template_field\x12\xaa\x02\n\x16UpdateTagTemplateField\x12?.google.cloud.datacatalog.v1beta1.UpdateTagTemplateFieldRequest\x1a\x32.google.cloud.datacatalog.v1beta1.TagTemplateField"\x9a\x01\x82\xd3\xe4\x93\x02T2>/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}:\x12tag_template_field\xda\x41\x17name,tag_template_field\xda\x41#name,tag_template_field,update_mask\x12\x80\x02\n\x16RenameTagTemplateField\x12?.google.cloud.datacatalog.v1beta1.RenameTagTemplateFieldRequest\x1a\x32.google.cloud.datacatalog.v1beta1.TagTemplateField"q\x82\xd3\xe4\x93\x02J"E/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}:rename:\x01*\xda\x41\x1ename,new_tag_template_field_id\x12\xc6\x01\n\x16\x44\x65leteTagTemplateField\x12?.google.cloud.datacatalog.v1beta1.DeleteTagTemplateFieldRequest\x1a\x16.google.protobuf.Empty"S\x82\xd3\xe4\x93\x02@*>/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}\xda\x41\nname,force\x12\xc7\x01\n\tCreateTag\x12\x32.google.cloud.datacatalog.v1beta1.CreateTagRequest\x1a%.google.cloud.datacatalog.v1beta1.Tag"_\x82\xd3\xe4\x93\x02L"E/v1beta1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tags:\x03tag\xda\x41\nparent,tag\x12\xd6\x01\n\tUpdateTag\x12\x32.google.cloud.datacatalog.v1beta1.UpdateTagRequest\x1a%.google.cloud.datacatalog.v1beta1.Tag"n\x82\xd3\xe4\x93\x02P2I/v1beta1/{tag.name=projects/*/locations/*/entryGroups/*/entries/*/tags/*}:\x03tag\xda\x41\x03tag\xda\x41\x0ftag,update_mask\x12\xad\x01\n\tDeleteTag\x12\x32.google.cloud.datacatalog.v1beta1.DeleteTagRequest\x1a\x16.google.protobuf.Empty"T\x82\xd3\xe4\x93\x02G*E/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*/tags/*}\xda\x41\x04name\x12\xc9\x01\n\x08ListTags\x12\x31.google.cloud.datacatalog.v1beta1.ListTagsRequest\x1a\x32.google.cloud.datacatalog.v1beta1.ListTagsResponse"V\x82\xd3\xe4\x93\x02G\x12\x45/v1beta1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tags\xda\x41\x06parent\x12\xc0\x02\n\x0cSetIamPolicy\x12".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"\xf4\x01\x82\xd3\xe4\x93\x02\xed\x01"F/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:setIamPolicy:\x01*ZJ"E/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:setIamPolicy:\x01*ZT"O/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:setIamPolicy:\x01*\x12\xc0\x02\n\x0cGetIamPolicy\x12".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"\xf4\x01\x82\xd3\xe4\x93\x02\xed\x01"F/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:getIamPolicy:\x01*ZJ"E/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:getIamPolicy:\x01*ZT"O/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:getIamPolicy:\x01*\x12\xf2\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse"\x86\x02\x82\xd3\xe4\x93\x02\xff\x01"L/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:testIamPermissions:\x01*ZP"K/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:testIamPermissions:\x01*ZZ"U/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:testIamPermissions:\x01*\x1aN\xca\x41\x1a\x64\x61tacatalog.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBp\n\x1c\x63om.google.cloud.datacatalogP\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' + '\n8google/cloud/datacatalog_v1beta1/proto/datacatalog.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a=google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec.proto\x1a\x33google/cloud/datacatalog_v1beta1/proto/schema.proto\x1a\x33google/cloud/datacatalog_v1beta1/proto/search.proto\x1a\x37google/cloud/datacatalog_v1beta1/proto/table_spec.proto\x1a\x31google/cloud/datacatalog_v1beta1/proto/tags.proto\x1a\x37google/cloud/datacatalog_v1beta1/proto/timestamps.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"\x9e\x02\n\x14SearchCatalogRequest\x12P\n\x05scope\x18\x06 \x01(\x0b\x32<.google.cloud.datacatalog.v1beta1.SearchCatalogRequest.ScopeB\x03\xe0\x41\x02\x12\x12\n\x05query\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x08order_by\x18\x05 \x01(\t\x1a\x62\n\x05Scope\x12\x17\n\x0finclude_org_ids\x18\x02 \x03(\t\x12\x1b\n\x13include_project_ids\x18\x03 \x03(\t\x12#\n\x1binclude_gcp_public_datasets\x18\x07 \x01(\x08"x\n\x15SearchCatalogResponse\x12\x46\n\x07results\x18\x01 \x03(\x0b\x32\x35.google.cloud.datacatalog.v1beta1.SearchCatalogResult\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t"\xb8\x01\n\x17\x43reateEntryGroupRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%datacatalog.googleapis.com/EntryGroup\x12\x1b\n\x0e\x65ntry_group_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x0b\x65ntry_group\x18\x02 \x01(\x0b\x32,.google.cloud.datacatalog.v1beta1.EntryGroup"\x82\x01\n\x14GetEntryGroupRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%datacatalog.googleapis.com/EntryGroup\x12-\n\tread_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"V\n\x17\x44\x65leteEntryGroupRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%datacatalog.googleapis.com/EntryGroup"\xa7\x01\n\x12\x43reateEntryRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%datacatalog.googleapis.com/EntryGroup\x12\x15\n\x08\x65ntry_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12;\n\x05\x65ntry\x18\x02 \x01(\x0b\x32\'.google.cloud.datacatalog.v1beta1.EntryB\x03\xe0\x41\x02"\x82\x01\n\x12UpdateEntryRequest\x12;\n\x05\x65ntry\x18\x01 \x01(\x0b\x32\'.google.cloud.datacatalog.v1beta1.EntryB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"L\n\x12\x44\x65leteEntryRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n datacatalog.googleapis.com/Entry"I\n\x0fGetEntryRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n datacatalog.googleapis.com/Entry"V\n\x12LookupEntryRequest\x12\x19\n\x0flinked_resource\x18\x01 \x01(\tH\x00\x12\x16\n\x0csql_resource\x18\x03 \x01(\tH\x00\x42\r\n\x0btarget_name"\xf4\x05\n\x05\x45ntry\x12\x38\n\x04name\x18\x01 \x01(\tB*\xfa\x41\'\n%datacatalog.googleapis.com/EntryGroup\x12\x1c\n\x0flinked_resource\x18\t \x01(\tB\x03\xe0\x41\x03\x12;\n\x04type\x18\x02 \x01(\x0e\x32+.google.cloud.datacatalog.v1beta1.EntryTypeH\x00\x12L\n\x10gcs_fileset_spec\x18\x06 \x01(\x0b\x32\x30.google.cloud.datacatalog.v1beta1.GcsFilesetSpecH\x01\x12R\n\x13\x62igquery_table_spec\x18\x0c \x01(\x0b\x32\x33.google.cloud.datacatalog.v1beta1.BigQueryTableSpecH\x01\x12_\n\x1a\x62igquery_date_sharded_spec\x18\x0f \x01(\x0b\x32\x39.google.cloud.datacatalog.v1beta1.BigQueryDateShardedSpecH\x01\x12\x14\n\x0c\x64isplay_name\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x38\n\x06schema\x18\x05 \x01(\x0b\x32(.google.cloud.datacatalog.v1beta1.Schema\x12Y\n\x18source_system_timestamps\x18\x07 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.SystemTimestampsB\x03\xe0\x41\x03:x\xea\x41u\n datacatalog.googleapis.com/Entry\x12Qprojects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}B\x0c\n\nentry_typeB\x0b\n\ttype_spec"\x8e\x02\n\nEntryGroup\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12X\n\x17\x64\x61ta_catalog_timestamps\x18\x04 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.SystemTimestampsB\x03\xe0\x41\x03:m\xea\x41j\n%datacatalog.googleapis.com/EntryGroup\x12\x41projects/{project}/locations/{location}/entryGroups/{entry_group}"\xc2\x01\n\x18\x43reateTagTemplateRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&datacatalog.googleapis.com/TagTemplate\x12\x1c\n\x0ftag_template_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12H\n\x0ctag_template\x18\x02 \x01(\x0b\x32-.google.cloud.datacatalog.v1beta1.TagTemplateB\x03\xe0\x41\x02"U\n\x15GetTagTemplateRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&datacatalog.googleapis.com/TagTemplate"\x95\x01\n\x18UpdateTagTemplateRequest\x12H\n\x0ctag_template\x18\x01 \x01(\x0b\x32-.google.cloud.datacatalog.v1beta1.TagTemplateB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"l\n\x18\x44\x65leteTagTemplateRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&datacatalog.googleapis.com/TagTemplate\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02"\x83\x01\n\x10\x43reateTagRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x64\x61tacatalog.googleapis.com/Tag\x12\x37\n\x03tag\x18\x02 \x01(\x0b\x32%.google.cloud.datacatalog.v1beta1.TagB\x03\xe0\x41\x02"|\n\x10UpdateTagRequest\x12\x37\n\x03tag\x18\x01 \x01(\x0b\x32%.google.cloud.datacatalog.v1beta1.TagB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"H\n\x10\x44\x65leteTagRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64\x61tacatalog.googleapis.com/Tag"\xd8\x01\n\x1d\x43reateTagTemplateFieldRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&datacatalog.googleapis.com/TagTemplate\x12"\n\x15tag_template_field_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12S\n\x12tag_template_field\x18\x03 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.TagTemplateFieldB\x03\xe0\x41\x02"\xe8\x01\n\x1dUpdateTagTemplateFieldRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+datacatalog.googleapis.com/TagTemplateField\x12S\n\x12tag_template_field\x18\x02 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.TagTemplateFieldB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"\x8a\x01\n\x1dRenameTagTemplateFieldRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+datacatalog.googleapis.com/TagTemplateField\x12&\n\x19new_tag_template_field_id\x18\x02 \x01(\tB\x03\xe0\x41\x02"v\n\x1d\x44\x65leteTagTemplateFieldRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+datacatalog.googleapis.com/TagTemplateField\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08\x42\x03\xe0\x41\x02"p\n\x0fListTagsRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \x12\x1e\x64\x61tacatalog.googleapis.com/Tag\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"`\n\x10ListTagsResponse\x12\x33\n\x04tags\x18\x01 \x03(\x0b\x32%.google.cloud.datacatalog.v1beta1.Tag\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t*P\n\tEntryType\x12\x1a\n\x16\x45NTRY_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05TABLE\x10\x02\x12\x0f\n\x0b\x44\x41TA_STREAM\x10\x03\x12\x0b\n\x07\x46ILESET\x10\x04\x32\xc8+\n\x0b\x44\x61taCatalog\x12\xb2\x01\n\rSearchCatalog\x12\x36.google.cloud.datacatalog.v1beta1.SearchCatalogRequest\x1a\x37.google.cloud.datacatalog.v1beta1.SearchCatalogResponse"0\x82\xd3\xe4\x93\x02\x1c"\x17/v1beta1/catalog:search:\x01*\xda\x41\x0bscope,query\x12\xea\x01\n\x10\x43reateEntryGroup\x12\x39.google.cloud.datacatalog.v1beta1.CreateEntryGroupRequest\x1a,.google.cloud.datacatalog.v1beta1.EntryGroup"m\x82\xd3\xe4\x93\x02\x43"4/v1beta1/{parent=projects/*/locations/*}/entryGroups:\x0b\x65ntry_group\xda\x41!parent,entry_group_id,entry_group\x12\xcb\x01\n\rGetEntryGroup\x12\x36.google.cloud.datacatalog.v1beta1.GetEntryGroupRequest\x1a,.google.cloud.datacatalog.v1beta1.EntryGroup"T\x82\xd3\xe4\x93\x02\x36\x12\x34/v1beta1/{name=projects/*/locations/*/entryGroups/*}\xda\x41\x04name\xda\x41\x0ename,read_mask\x12\xaa\x01\n\x10\x44\x65leteEntryGroup\x12\x39.google.cloud.datacatalog.v1beta1.DeleteEntryGroupRequest\x1a\x16.google.protobuf.Empty"C\x82\xd3\xe4\x93\x02\x36*4/v1beta1/{name=projects/*/locations/*/entryGroups/*}\xda\x41\x04name\x12\xd3\x01\n\x0b\x43reateEntry\x12\x34.google.cloud.datacatalog.v1beta1.CreateEntryRequest\x1a\'.google.cloud.datacatalog.v1beta1.Entry"e\x82\xd3\xe4\x93\x02G">/v1beta1/{parent=projects/*/locations/*/entryGroups/*}/entries:\x05\x65ntry\xda\x41\x15parent,entry_id,entry\x12\xdd\x01\n\x0bUpdateEntry\x12\x34.google.cloud.datacatalog.v1beta1.UpdateEntryRequest\x1a\'.google.cloud.datacatalog.v1beta1.Entry"o\x82\xd3\xe4\x93\x02M2D/v1beta1/{entry.name=projects/*/locations/*/entryGroups/*/entries/*}:\x05\x65ntry\xda\x41\x05\x65ntry\xda\x41\x11\x65ntry,update_mask\x12\xaa\x01\n\x0b\x44\x65leteEntry\x12\x34.google.cloud.datacatalog.v1beta1.DeleteEntryRequest\x1a\x16.google.protobuf.Empty"M\x82\xd3\xe4\x93\x02@*>/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*}\xda\x41\x04name\x12\xb5\x01\n\x08GetEntry\x12\x31.google.cloud.datacatalog.v1beta1.GetEntryRequest\x1a\'.google.cloud.datacatalog.v1beta1.Entry"M\x82\xd3\xe4\x93\x02@\x12>/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*}\xda\x41\x04name\x12\x8d\x01\n\x0bLookupEntry\x12\x34.google.cloud.datacatalog.v1beta1.LookupEntryRequest\x1a\'.google.cloud.datacatalog.v1beta1.Entry"\x1f\x82\xd3\xe4\x93\x02\x19\x12\x17/v1beta1/entries:lookup\x12\xf1\x01\n\x11\x43reateTagTemplate\x12:.google.cloud.datacatalog.v1beta1.CreateTagTemplateRequest\x1a-.google.cloud.datacatalog.v1beta1.TagTemplate"q\x82\xd3\xe4\x93\x02\x45"5/v1beta1/{parent=projects/*/locations/*}/tagTemplates:\x0ctag_template\xda\x41#parent,tag_template_id,tag_template\x12\xbe\x01\n\x0eGetTagTemplate\x12\x37.google.cloud.datacatalog.v1beta1.GetTagTemplateRequest\x1a-.google.cloud.datacatalog.v1beta1.TagTemplate"D\x82\xd3\xe4\x93\x02\x37\x12\x35/v1beta1/{name=projects/*/locations/*/tagTemplates/*}\xda\x41\x04name\x12\x83\x02\n\x11UpdateTagTemplate\x12:.google.cloud.datacatalog.v1beta1.UpdateTagTemplateRequest\x1a-.google.cloud.datacatalog.v1beta1.TagTemplate"\x82\x01\x82\xd3\xe4\x93\x02R2B/v1beta1/{tag_template.name=projects/*/locations/*/tagTemplates/*}:\x0ctag_template\xda\x41\x0ctag_template\xda\x41\x18tag_template,update_mask\x12\xb3\x01\n\x11\x44\x65leteTagTemplate\x12:.google.cloud.datacatalog.v1beta1.DeleteTagTemplateRequest\x1a\x16.google.protobuf.Empty"J\x82\xd3\xe4\x93\x02\x37*5/v1beta1/{name=projects/*/locations/*/tagTemplates/*}\xda\x41\nname,force\x12\x9c\x02\n\x16\x43reateTagTemplateField\x12?.google.cloud.datacatalog.v1beta1.CreateTagTemplateFieldRequest\x1a\x32.google.cloud.datacatalog.v1beta1.TagTemplateField"\x8c\x01\x82\xd3\xe4\x93\x02T">/v1beta1/{parent=projects/*/locations/*/tagTemplates/*}/fields:\x12tag_template_field\xda\x41/parent,tag_template_field_id,tag_template_field\x12\xaa\x02\n\x16UpdateTagTemplateField\x12?.google.cloud.datacatalog.v1beta1.UpdateTagTemplateFieldRequest\x1a\x32.google.cloud.datacatalog.v1beta1.TagTemplateField"\x9a\x01\x82\xd3\xe4\x93\x02T2>/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}:\x12tag_template_field\xda\x41\x17name,tag_template_field\xda\x41#name,tag_template_field,update_mask\x12\x80\x02\n\x16RenameTagTemplateField\x12?.google.cloud.datacatalog.v1beta1.RenameTagTemplateFieldRequest\x1a\x32.google.cloud.datacatalog.v1beta1.TagTemplateField"q\x82\xd3\xe4\x93\x02J"E/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}:rename:\x01*\xda\x41\x1ename,new_tag_template_field_id\x12\xc6\x01\n\x16\x44\x65leteTagTemplateField\x12?.google.cloud.datacatalog.v1beta1.DeleteTagTemplateFieldRequest\x1a\x16.google.protobuf.Empty"S\x82\xd3\xe4\x93\x02@*>/v1beta1/{name=projects/*/locations/*/tagTemplates/*/fields/*}\xda\x41\nname,force\x12\xc7\x01\n\tCreateTag\x12\x32.google.cloud.datacatalog.v1beta1.CreateTagRequest\x1a%.google.cloud.datacatalog.v1beta1.Tag"_\x82\xd3\xe4\x93\x02L"E/v1beta1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tags:\x03tag\xda\x41\nparent,tag\x12\xd6\x01\n\tUpdateTag\x12\x32.google.cloud.datacatalog.v1beta1.UpdateTagRequest\x1a%.google.cloud.datacatalog.v1beta1.Tag"n\x82\xd3\xe4\x93\x02P2I/v1beta1/{tag.name=projects/*/locations/*/entryGroups/*/entries/*/tags/*}:\x03tag\xda\x41\x03tag\xda\x41\x0ftag,update_mask\x12\xad\x01\n\tDeleteTag\x12\x32.google.cloud.datacatalog.v1beta1.DeleteTagRequest\x1a\x16.google.protobuf.Empty"T\x82\xd3\xe4\x93\x02G*E/v1beta1/{name=projects/*/locations/*/entryGroups/*/entries/*/tags/*}\xda\x41\x04name\x12\xc9\x01\n\x08ListTags\x12\x31.google.cloud.datacatalog.v1beta1.ListTagsRequest\x1a\x32.google.cloud.datacatalog.v1beta1.ListTagsResponse"V\x82\xd3\xe4\x93\x02G\x12\x45/v1beta1/{parent=projects/*/locations/*/entryGroups/*/entries/*}/tags\xda\x41\x06parent\x12\xc0\x02\n\x0cSetIamPolicy\x12".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"\xf4\x01\x82\xd3\xe4\x93\x02\xed\x01"F/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:setIamPolicy:\x01*ZJ"E/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:setIamPolicy:\x01*ZT"O/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:setIamPolicy:\x01*\x12\xc0\x02\n\x0cGetIamPolicy\x12".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"\xf4\x01\x82\xd3\xe4\x93\x02\xed\x01"F/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:getIamPolicy:\x01*ZJ"E/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:getIamPolicy:\x01*ZT"O/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:getIamPolicy:\x01*\x12\xf2\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse"\x86\x02\x82\xd3\xe4\x93\x02\xff\x01"L/v1beta1/{resource=projects/*/locations/*/tagTemplates/*}:testIamPermissions:\x01*ZP"K/v1beta1/{resource=projects/*/locations/*/entryGroups/*}:testIamPermissions:\x01*ZZ"U/v1beta1/{resource=projects/*/locations/*/entryGroups/*/entries/*}:testIamPermissions:\x01*\x1aN\xca\x41\x1a\x64\x61tacatalog.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBx\n$com.google.cloud.datacatalog.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' ), dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, @@ -2185,7 +2185,10 @@ that this EntryGroup and its child resources may not actually be stored in the location in this name. entry_group_id: - Required. The id of the entry group to create. + 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: The entry group to create. Defaults to an empty entry group. """, @@ -2363,7 +2366,8 @@ The SQL name of the entry. SQL names are case-sensitive. Examples: - ``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. diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec_pb2.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec_pb2.py index 94aee77c5677..e891a3923a8f 100644 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec_pb2.py +++ b/datacatalog/google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec_pb2.py @@ -26,10 +26,10 @@ package="google.cloud.datacatalog.v1beta1", syntax="proto3", serialized_options=_b( - "\n\034com.google.cloud.datacatalogP\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" + "\n$com.google.cloud.datacatalog.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" ), serialized_pb=_b( - '\n=google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x37google/cloud/datacatalog_v1beta1/proto/timestamps.proto"\x7f\n\x0eGcsFilesetSpec\x12\x1a\n\rfile_patterns\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12Q\n\x15sample_gcs_file_specs\x18\x02 \x03(\x0b\x32-.google.cloud.datacatalog.v1beta1.GcsFileSpecB\x03\xe0\x41\x03"\x8f\x01\n\x0bGcsFileSpec\x12\x16\n\tfile_path\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12O\n\x0egcs_timestamps\x18\x02 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.SystemTimestampsB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03\x42p\n\x1c\x63om.google.cloud.datacatalogP\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' + '\n=google/cloud/datacatalog_v1beta1/proto/gcs_fileset_spec.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x37google/cloud/datacatalog_v1beta1/proto/timestamps.proto"\x7f\n\x0eGcsFilesetSpec\x12\x1a\n\rfile_patterns\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12Q\n\x15sample_gcs_file_specs\x18\x02 \x03(\x0b\x32-.google.cloud.datacatalog.v1beta1.GcsFileSpecB\x03\xe0\x41\x03"\x8f\x01\n\x0bGcsFileSpec\x12\x16\n\tfile_path\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12O\n\x0egcs_timestamps\x18\x02 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.SystemTimestampsB\x03\xe0\x41\x03\x12\x17\n\nsize_bytes\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03\x42x\n$com.google.cloud.datacatalog.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' ), dependencies=[ google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, @@ -213,7 +213,7 @@ dict( DESCRIPTOR=_GCSFILESPEC, __module__="google.cloud.datacatalog_v1beta1.proto.gcs_fileset_spec_pb2", - __doc__="""Specifications of a single file in GCS. + __doc__="""Specifications of a single file in Cloud Storage. Attributes: @@ -221,7 +221,7 @@ Required. The full file path. Example: ``gs://bucket_name/a/b.txt``. gcs_timestamps: - Output only. Timestamps about the GCS file. + Output only. Timestamps about the Cloud Storage file. size_bytes: Output only. The size of the file, in bytes. """, diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/policytagmanager_pb2.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/policytagmanager_pb2.py new file mode 100644 index 000000000000..cdd201e7794b --- /dev/null +++ b/datacatalog/google/cloud/datacatalog_v1beta1/proto/policytagmanager_pb2.py @@ -0,0 +1,1516 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/datacatalog_v1beta1/proto/policytagmanager.proto + +import sys + +_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +from google.protobuf import descriptor as _descriptor +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import client_pb2 as google_dot_api_dot_client__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 +from google.cloud.datacatalog_v1beta1.proto import ( + timestamps_pb2 as google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_timestamps__pb2, +) +from google.iam.v1 import iam_policy_pb2 as google_dot_iam_dot_v1_dot_iam__policy__pb2 +from google.iam.v1 import policy_pb2 as google_dot_iam_dot_v1_dot_policy__pb2 +from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 +from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name="google/cloud/datacatalog_v1beta1/proto/policytagmanager.proto", + package="google.cloud.datacatalog.v1beta1", + syntax="proto3", + serialized_options=_b( + "\n$com.google.cloud.datacatalog.v1beta1B\025PolicyTagManagerProtoP\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" + ), + serialized_pb=_b( + '\n=google/cloud/datacatalog_v1beta1/proto/policytagmanager.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x37google/cloud/datacatalog_v1beta1/proto/timestamps.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"\xe3\x02\n\x08Taxonomy\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12Z\n\x16\x61\x63tivated_policy_types\x18\x06 \x03(\x0e\x32\x35.google.cloud.datacatalog.v1beta1.Taxonomy.PolicyTypeB\x03\xe0\x41\x01"J\n\nPolicyType\x12\x1b\n\x17POLICY_TYPE_UNSPECIFIED\x10\x00\x12\x1f\n\x1b\x46INE_GRAINED_ACCESS_CONTROL\x10\x01:g\xea\x41\x64\n#datacatalog.googleapis.com/Taxonomy\x12=projects/{project}/locations/{location}/taxonomies/{taxonomy}"\x8c\x02\n\tPolicyTag\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x19\n\x11parent_policy_tag\x18\x04 \x01(\t\x12\x1e\n\x11\x63hild_policy_tags\x18\x05 \x03(\tB\x03\xe0\x41\x03:\x80\x01\xea\x41}\n$datacatalog.googleapis.com/PolicyTag\x12Uprojects/{project}/locations/{location}/taxonomies/{taxonomy}/policyTags/{policy_tag}"\x92\x01\n\x15\x43reateTaxonomyRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#datacatalog.googleapis.com/Taxonomy\x12<\n\x08taxonomy\x18\x02 \x01(\x0b\x32*.google.cloud.datacatalog.v1beta1.Taxonomy"R\n\x15\x44\x65leteTaxonomyRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#datacatalog.googleapis.com/Taxonomy"\x86\x01\n\x15UpdateTaxonomyRequest\x12<\n\x08taxonomy\x18\x01 \x01(\x0b\x32*.google.cloud.datacatalog.v1beta1.Taxonomy\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"{\n\x15ListTaxonomiesRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#datacatalog.googleapis.com/Taxonomy\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"q\n\x16ListTaxonomiesResponse\x12>\n\ntaxonomies\x18\x01 \x03(\x0b\x32*.google.cloud.datacatalog.v1beta1.Taxonomy\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"O\n\x12GetTaxonomyRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#datacatalog.googleapis.com/Taxonomy"\x97\x01\n\x16\x43reatePolicyTagRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$datacatalog.googleapis.com/PolicyTag\x12?\n\npolicy_tag\x18\x02 \x01(\x0b\x32+.google.cloud.datacatalog.v1beta1.PolicyTag"T\n\x16\x44\x65letePolicyTagRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$datacatalog.googleapis.com/PolicyTag"\x8a\x01\n\x16UpdatePolicyTagRequest\x12?\n\npolicy_tag\x18\x01 \x01(\x0b\x32+.google.cloud.datacatalog.v1beta1.PolicyTag\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"|\n\x15ListPolicyTagsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$datacatalog.googleapis.com/PolicyTag\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"s\n\x16ListPolicyTagsResponse\x12@\n\x0bpolicy_tags\x18\x01 \x03(\x0b\x32+.google.cloud.datacatalog.v1beta1.PolicyTag\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"Q\n\x13GetPolicyTagRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$datacatalog.googleapis.com/PolicyTag2\xe5\x16\n\x10PolicyTagManager\x12\xce\x01\n\x0e\x43reateTaxonomy\x12\x37.google.cloud.datacatalog.v1beta1.CreateTaxonomyRequest\x1a*.google.cloud.datacatalog.v1beta1.Taxonomy"W\x82\xd3\xe4\x93\x02?"3/v1beta1/{parent=projects/*/locations/*}/taxonomies:\x08taxonomy\xda\x41\x0fparent,taxonomy\x12\xa5\x01\n\x0e\x44\x65leteTaxonomy\x12\x37.google.cloud.datacatalog.v1beta1.DeleteTaxonomyRequest\x1a\x16.google.protobuf.Empty"B\x82\xd3\xe4\x93\x02\x35*3/v1beta1/{name=projects/*/locations/*/taxonomies/*}\xda\x41\x04name\x12\xd0\x01\n\x0eUpdateTaxonomy\x12\x37.google.cloud.datacatalog.v1beta1.UpdateTaxonomyRequest\x1a*.google.cloud.datacatalog.v1beta1.Taxonomy"Y\x82\xd3\xe4\x93\x02H2\n\ntaxonomies\x18\x01 \x03(\x0b\x32*.google.cloud.datacatalog.v1beta1.Taxonomy"\xc7\x01\n\x17\x45xportTaxonomiesRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#datacatalog.googleapis.com/Taxonomy\x12?\n\ntaxonomies\x18\x02 \x03(\tB+\xe0\x41\x02\xfa\x41%\n#datacatalog.googleapis.com/Taxonomy\x12\x1f\n\x15serialized_taxonomies\x18\x03 \x01(\x08H\x00\x42\r\n\x0b\x64\x65stination"d\n\x18\x45xportTaxonomiesResponse\x12H\n\ntaxonomies\x18\x01 \x03(\x0b\x32\x34.google.cloud.datacatalog.v1beta1.SerializedTaxonomy2\x92\x04\n\x1dPolicyTagManagerSerialization\x12\xd0\x01\n\x10ImportTaxonomies\x12\x39.google.cloud.datacatalog.v1beta1.ImportTaxonomiesRequest\x1a:.google.cloud.datacatalog.v1beta1.ImportTaxonomiesResponse"E\x82\xd3\xe4\x93\x02?":/v1beta1/{parent=projects/*/locations/*}/taxonomies:import:\x01*\x12\xcd\x01\n\x10\x45xportTaxonomies\x12\x39.google.cloud.datacatalog.v1beta1.ExportTaxonomiesRequest\x1a:.google.cloud.datacatalog.v1beta1.ExportTaxonomiesResponse"B\x82\xd3\xe4\x93\x02<\x12:/v1beta1/{parent=projects/*/locations/*}/taxonomies:export\x1aN\xca\x41\x1a\x64\x61tacatalog.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x9c\x01\n$com.google.cloud.datacatalog.v1beta1B"PolicyTagManagerSerializationProtoP\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' + ), + dependencies=[ + google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_api_dot_client__pb2.DESCRIPTOR, + google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, + google_dot_api_dot_resource__pb2.DESCRIPTOR, + google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanager__pb2.DESCRIPTOR, + google_dot_iam_dot_v1_dot_policy__pb2.DESCRIPTOR, + ], +) + + +_SERIALIZEDTAXONOMY = _descriptor.Descriptor( + name="SerializedTaxonomy", + full_name="google.cloud.datacatalog.v1beta1.SerializedTaxonomy", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="display_name", + full_name="google.cloud.datacatalog.v1beta1.SerializedTaxonomy.display_name", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b("\340A\002"), + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="description", + full_name="google.cloud.datacatalog.v1beta1.SerializedTaxonomy.description", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="policy_tags", + full_name="google.cloud.datacatalog.v1beta1.SerializedTaxonomy.policy_tags", + index=2, + number=3, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=319, + serialized_end=463, +) + + +_SERIALIZEDPOLICYTAG = _descriptor.Descriptor( + name="SerializedPolicyTag", + full_name="google.cloud.datacatalog.v1beta1.SerializedPolicyTag", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="display_name", + full_name="google.cloud.datacatalog.v1beta1.SerializedPolicyTag.display_name", + index=0, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b("\340A\002"), + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="description", + full_name="google.cloud.datacatalog.v1beta1.SerializedPolicyTag.description", + index=1, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="child_policy_tags", + full_name="google.cloud.datacatalog.v1beta1.SerializedPolicyTag.child_policy_tags", + index=2, + number=4, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=466, + serialized_end=617, +) + + +_IMPORTTAXONOMIESREQUEST = _descriptor.Descriptor( + name="ImportTaxonomiesRequest", + full_name="google.cloud.datacatalog.v1beta1.ImportTaxonomiesRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.datacatalog.v1beta1.ImportTaxonomiesRequest.parent", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b( + "\340A\002\372A%\022#datacatalog.googleapis.com/Taxonomy" + ), + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="inline_source", + full_name="google.cloud.datacatalog.v1beta1.ImportTaxonomiesRequest.inline_source", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="source", + full_name="google.cloud.datacatalog.v1beta1.ImportTaxonomiesRequest.source", + index=0, + containing_type=None, + fields=[], + ) + ], + serialized_start=620, + serialized_end=789, +) + + +_INLINESOURCE = _descriptor.Descriptor( + name="InlineSource", + full_name="google.cloud.datacatalog.v1beta1.InlineSource", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="taxonomies", + full_name="google.cloud.datacatalog.v1beta1.InlineSource.taxonomies", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b("\340A\002"), + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=791, + serialized_end=884, +) + + +_IMPORTTAXONOMIESRESPONSE = _descriptor.Descriptor( + name="ImportTaxonomiesResponse", + full_name="google.cloud.datacatalog.v1beta1.ImportTaxonomiesResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="taxonomies", + full_name="google.cloud.datacatalog.v1beta1.ImportTaxonomiesResponse.taxonomies", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=886, + serialized_end=976, +) + + +_EXPORTTAXONOMIESREQUEST = _descriptor.Descriptor( + name="ExportTaxonomiesRequest", + full_name="google.cloud.datacatalog.v1beta1.ExportTaxonomiesRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="parent", + full_name="google.cloud.datacatalog.v1beta1.ExportTaxonomiesRequest.parent", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b( + "\340A\002\372A%\022#datacatalog.googleapis.com/Taxonomy" + ), + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="taxonomies", + full_name="google.cloud.datacatalog.v1beta1.ExportTaxonomiesRequest.taxonomies", + index=1, + number=2, + type=9, + cpp_type=9, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b( + "\340A\002\372A%\n#datacatalog.googleapis.com/Taxonomy" + ), + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="serialized_taxonomies", + full_name="google.cloud.datacatalog.v1beta1.ExportTaxonomiesRequest.serialized_taxonomies", + index=2, + number=3, + type=8, + cpp_type=7, + label=1, + has_default_value=False, + default_value=False, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name="destination", + full_name="google.cloud.datacatalog.v1beta1.ExportTaxonomiesRequest.destination", + index=0, + containing_type=None, + fields=[], + ) + ], + serialized_start=979, + serialized_end=1178, +) + + +_EXPORTTAXONOMIESRESPONSE = _descriptor.Descriptor( + name="ExportTaxonomiesResponse", + full_name="google.cloud.datacatalog.v1beta1.ExportTaxonomiesResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name="taxonomies", + full_name="google.cloud.datacatalog.v1beta1.ExportTaxonomiesResponse.taxonomies", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ) + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1180, + serialized_end=1280, +) + +_SERIALIZEDTAXONOMY.fields_by_name["policy_tags"].message_type = _SERIALIZEDPOLICYTAG +_SERIALIZEDPOLICYTAG.fields_by_name[ + "child_policy_tags" +].message_type = _SERIALIZEDPOLICYTAG +_IMPORTTAXONOMIESREQUEST.fields_by_name["inline_source"].message_type = _INLINESOURCE +_IMPORTTAXONOMIESREQUEST.oneofs_by_name["source"].fields.append( + _IMPORTTAXONOMIESREQUEST.fields_by_name["inline_source"] +) +_IMPORTTAXONOMIESREQUEST.fields_by_name[ + "inline_source" +].containing_oneof = _IMPORTTAXONOMIESREQUEST.oneofs_by_name["source"] +_INLINESOURCE.fields_by_name["taxonomies"].message_type = _SERIALIZEDTAXONOMY +_IMPORTTAXONOMIESRESPONSE.fields_by_name[ + "taxonomies" +].message_type = ( + google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanager__pb2._TAXONOMY +) +_EXPORTTAXONOMIESREQUEST.oneofs_by_name["destination"].fields.append( + _EXPORTTAXONOMIESREQUEST.fields_by_name["serialized_taxonomies"] +) +_EXPORTTAXONOMIESREQUEST.fields_by_name[ + "serialized_taxonomies" +].containing_oneof = _EXPORTTAXONOMIESREQUEST.oneofs_by_name["destination"] +_EXPORTTAXONOMIESRESPONSE.fields_by_name[ + "taxonomies" +].message_type = _SERIALIZEDTAXONOMY +DESCRIPTOR.message_types_by_name["SerializedTaxonomy"] = _SERIALIZEDTAXONOMY +DESCRIPTOR.message_types_by_name["SerializedPolicyTag"] = _SERIALIZEDPOLICYTAG +DESCRIPTOR.message_types_by_name["ImportTaxonomiesRequest"] = _IMPORTTAXONOMIESREQUEST +DESCRIPTOR.message_types_by_name["InlineSource"] = _INLINESOURCE +DESCRIPTOR.message_types_by_name["ImportTaxonomiesResponse"] = _IMPORTTAXONOMIESRESPONSE +DESCRIPTOR.message_types_by_name["ExportTaxonomiesRequest"] = _EXPORTTAXONOMIESREQUEST +DESCRIPTOR.message_types_by_name["ExportTaxonomiesResponse"] = _EXPORTTAXONOMIESRESPONSE +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +SerializedTaxonomy = _reflection.GeneratedProtocolMessageType( + "SerializedTaxonomy", + (_message.Message,), + dict( + DESCRIPTOR=_SERIALIZEDTAXONOMY, + __module__="google.cloud.datacatalog_v1beta1.proto.policytagmanagerserialization_pb2", + __doc__="""Message capturing a taxonomy and its policy tag hierarchy as a nested + proto. Used for taxonomy import/export and mutation. + + + Attributes: + display_name: + Required. Display name of the taxonomy. Max 200 bytes when + encoded in UTF-8. + description: + Description of the serialized taxonomy. The length of the + description is limited to 2000 bytes when encoded in UTF-8. If + not set, defaults to an empty description. + policy_tags: + Top level policy tags associated with the taxonomy if any. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.SerializedTaxonomy) + ), +) +_sym_db.RegisterMessage(SerializedTaxonomy) + +SerializedPolicyTag = _reflection.GeneratedProtocolMessageType( + "SerializedPolicyTag", + (_message.Message,), + dict( + DESCRIPTOR=_SERIALIZEDPOLICYTAG, + __module__="google.cloud.datacatalog_v1beta1.proto.policytagmanagerserialization_pb2", + __doc__="""Message representing one policy tag when exported as a nested proto. + + + Attributes: + display_name: + Required. Display name of the policy tag. Max 200 bytes when + encoded in UTF-8. + description: + Description of the serialized policy tag. The length of the + description is limited to 2000 bytes when encoded in UTF-8. If + not set, defaults to an empty description. + child_policy_tags: + Children of the policy tag if any. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.SerializedPolicyTag) + ), +) +_sym_db.RegisterMessage(SerializedPolicyTag) + +ImportTaxonomiesRequest = _reflection.GeneratedProtocolMessageType( + "ImportTaxonomiesRequest", + (_message.Message,), + dict( + DESCRIPTOR=_IMPORTTAXONOMIESREQUEST, + __module__="google.cloud.datacatalog_v1beta1.proto.policytagmanagerserialization_pb2", + __doc__="""Request message for + [ImportTaxonomies][google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization.ImportTaxonomies]. + + + Attributes: + parent: + Required. Resource name of project that the newly created + taxonomies will belong to. + source: + Required. Source taxonomies to be imported in a tree + structure. + inline_source: + Inline source used for taxonomies import + """, + # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.ImportTaxonomiesRequest) + ), +) +_sym_db.RegisterMessage(ImportTaxonomiesRequest) + +InlineSource = _reflection.GeneratedProtocolMessageType( + "InlineSource", + (_message.Message,), + dict( + DESCRIPTOR=_INLINESOURCE, + __module__="google.cloud.datacatalog_v1beta1.proto.policytagmanagerserialization_pb2", + __doc__="""Inline source used for taxonomies import. + + + Attributes: + taxonomies: + Required. Taxonomies to be imported. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.InlineSource) + ), +) +_sym_db.RegisterMessage(InlineSource) + +ImportTaxonomiesResponse = _reflection.GeneratedProtocolMessageType( + "ImportTaxonomiesResponse", + (_message.Message,), + dict( + DESCRIPTOR=_IMPORTTAXONOMIESRESPONSE, + __module__="google.cloud.datacatalog_v1beta1.proto.policytagmanagerserialization_pb2", + __doc__="""Response message for + [ImportTaxonomies][google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization.ImportTaxonomies]. + + + Attributes: + taxonomies: + Taxonomies that were imported. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.ImportTaxonomiesResponse) + ), +) +_sym_db.RegisterMessage(ImportTaxonomiesResponse) + +ExportTaxonomiesRequest = _reflection.GeneratedProtocolMessageType( + "ExportTaxonomiesRequest", + (_message.Message,), + dict( + DESCRIPTOR=_EXPORTTAXONOMIESREQUEST, + __module__="google.cloud.datacatalog_v1beta1.proto.policytagmanagerserialization_pb2", + __doc__="""Request message for + [ExportTaxonomies][google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization.ExportTaxonomies]. + + + Attributes: + parent: + Required. Resource name of the project that taxonomies to be + exported will share. + taxonomies: + Required. Resource names of the taxonomies to be exported. + destination: + Required. Taxonomies export destination. + serialized_taxonomies: + Export taxonomies as serialized taxonomies. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.ExportTaxonomiesRequest) + ), +) +_sym_db.RegisterMessage(ExportTaxonomiesRequest) + +ExportTaxonomiesResponse = _reflection.GeneratedProtocolMessageType( + "ExportTaxonomiesResponse", + (_message.Message,), + dict( + DESCRIPTOR=_EXPORTTAXONOMIESRESPONSE, + __module__="google.cloud.datacatalog_v1beta1.proto.policytagmanagerserialization_pb2", + __doc__="""Response message for + [ExportTaxonomies][google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization.ExportTaxonomies]. + + + Attributes: + taxonomies: + List of taxonomies and policy tags in a tree structure. + """, + # @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1beta1.ExportTaxonomiesResponse) + ), +) +_sym_db.RegisterMessage(ExportTaxonomiesResponse) + + +DESCRIPTOR._options = None +_SERIALIZEDTAXONOMY.fields_by_name["display_name"]._options = None +_SERIALIZEDPOLICYTAG.fields_by_name["display_name"]._options = None +_IMPORTTAXONOMIESREQUEST.fields_by_name["parent"]._options = None +_INLINESOURCE.fields_by_name["taxonomies"]._options = None +_EXPORTTAXONOMIESREQUEST.fields_by_name["parent"]._options = None +_EXPORTTAXONOMIESREQUEST.fields_by_name["taxonomies"]._options = None + +_POLICYTAGMANAGERSERIALIZATION = _descriptor.ServiceDescriptor( + name="PolicyTagManagerSerialization", + full_name="google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization", + file=DESCRIPTOR, + index=0, + serialized_options=_b( + "\312A\032datacatalog.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" + ), + serialized_start=1283, + serialized_end=1813, + methods=[ + _descriptor.MethodDescriptor( + name="ImportTaxonomies", + full_name="google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization.ImportTaxonomies", + index=0, + containing_service=None, + input_type=_IMPORTTAXONOMIESREQUEST, + output_type=_IMPORTTAXONOMIESRESPONSE, + serialized_options=_b( + '\202\323\344\223\002?":/v1beta1/{parent=projects/*/locations/*}/taxonomies:import:\001*' + ), + ), + _descriptor.MethodDescriptor( + name="ExportTaxonomies", + full_name="google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization.ExportTaxonomies", + index=1, + containing_service=None, + input_type=_EXPORTTAXONOMIESREQUEST, + output_type=_EXPORTTAXONOMIESRESPONSE, + serialized_options=_b( + "\202\323\344\223\002<\022:/v1beta1/{parent=projects/*/locations/*}/taxonomies:export" + ), + ), + ], +) +_sym_db.RegisterServiceDescriptor(_POLICYTAGMANAGERSERIALIZATION) + +DESCRIPTOR.services_by_name[ + "PolicyTagManagerSerialization" +] = _POLICYTAGMANAGERSERIALIZATION + +# @@protoc_insertion_point(module_scope) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/policytagmanagerserialization_pb2_grpc.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/policytagmanagerserialization_pb2_grpc.py new file mode 100644 index 000000000000..74a7fdcfa5f7 --- /dev/null +++ b/datacatalog/google/cloud/datacatalog_v1beta1/proto/policytagmanagerserialization_pb2_grpc.py @@ -0,0 +1,76 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + +from google.cloud.datacatalog_v1beta1.proto import ( + policytagmanagerserialization_pb2 as google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2, +) + + +class PolicyTagManagerSerializationStub(object): + """Policy tag manager serialization API service allows clients to manipulate + their taxonomies and policy tags data with serialized format. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ImportTaxonomies = channel.unary_unary( + "/google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization/ImportTaxonomies", + request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2.ImportTaxonomiesRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2.ImportTaxonomiesResponse.FromString, + ) + self.ExportTaxonomies = channel.unary_unary( + "/google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization/ExportTaxonomies", + request_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2.ExportTaxonomiesRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2.ExportTaxonomiesResponse.FromString, + ) + + +class PolicyTagManagerSerializationServicer(object): + """Policy tag manager serialization API service allows clients to manipulate + their taxonomies and policy tags data with serialized format. + """ + + def ImportTaxonomies(self, request, context): + """Imports all taxonomies and their policy tags to a project as new + taxonomies. + + This method provides a bulk taxonomy / policy tag creation using nested + proto structure. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def ExportTaxonomies(self, request, context): + """Exports all taxonomies and their policy tags in a project. + + This method generates SerializedTaxonomy protos with nested policy tags + that can be used as an input for future ImportTaxonomies calls. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + +def add_PolicyTagManagerSerializationServicer_to_server(servicer, server): + rpc_method_handlers = { + "ImportTaxonomies": grpc.unary_unary_rpc_method_handler( + servicer.ImportTaxonomies, + request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2.ImportTaxonomiesRequest.FromString, + response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2.ImportTaxonomiesResponse.SerializeToString, + ), + "ExportTaxonomies": grpc.unary_unary_rpc_method_handler( + servicer.ExportTaxonomies, + request_deserializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2.ExportTaxonomiesRequest.FromString, + response_serializer=google_dot_cloud_dot_datacatalog__v1beta1_dot_proto_dot_policytagmanagerserialization__pb2.ExportTaxonomiesResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + "google.cloud.datacatalog.v1beta1.PolicyTagManagerSerialization", + rpc_method_handlers, + ) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/schema_pb2.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/schema_pb2.py index b5ac8e07cc8c..c76c50addf08 100644 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/schema_pb2.py +++ b/datacatalog/google/cloud/datacatalog_v1beta1/proto/schema_pb2.py @@ -23,10 +23,10 @@ package="google.cloud.datacatalog.v1beta1", syntax="proto3", serialized_options=_b( - "\n\034com.google.cloud.datacatalogP\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" + "\n$com.google.cloud.datacatalog.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" ), serialized_pb=_b( - '\n3google/cloud/datacatalog_v1beta1/proto/schema.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto"N\n\x06Schema\x12\x44\n\x07\x63olumns\x18\x02 \x03(\x0b\x32..google.cloud.datacatalog.v1beta1.ColumnSchemaB\x03\xe0\x41\x02"\xac\x01\n\x0c\x43olumnSchema\x12\x13\n\x06\x63olumn\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04mode\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12G\n\nsubcolumns\x18\x07 \x03(\x0b\x32..google.cloud.datacatalog.v1beta1.ColumnSchemaB\x03\xe0\x41\x01\x42p\n\x1c\x63om.google.cloud.datacatalogP\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' + '\n3google/cloud/datacatalog_v1beta1/proto/schema.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto"N\n\x06Schema\x12\x44\n\x07\x63olumns\x18\x02 \x03(\x0b\x32..google.cloud.datacatalog.v1beta1.ColumnSchemaB\x03\xe0\x41\x02"\xac\x01\n\x0c\x43olumnSchema\x12\x13\n\x06\x63olumn\x18\x06 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04type\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04mode\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12G\n\nsubcolumns\x18\x07 \x03(\x0b\x32..google.cloud.datacatalog.v1beta1.ColumnSchemaB\x03\xe0\x41\x01\x42x\n$com.google.cloud.datacatalog.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' ), dependencies=[google_dot_api_dot_field__behavior__pb2.DESCRIPTOR], ) diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/search_pb2.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/search_pb2.py index 480288089982..d62fcf90acc8 100644 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/search_pb2.py +++ b/datacatalog/google/cloud/datacatalog_v1beta1/proto/search_pb2.py @@ -25,10 +25,10 @@ package="google.cloud.datacatalog.v1beta1", syntax="proto3", serialized_options=_b( - "\n\034com.google.cloud.datacatalogP\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" + "\n$com.google.cloud.datacatalog.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" ), serialized_pb=_b( - '\n3google/cloud/datacatalog_v1beta1/proto/search.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xbd\x01\n\x13SearchCatalogResult\x12N\n\x12search_result_type\x18\x01 \x01(\x0e\x32\x32.google.cloud.datacatalog.v1beta1.SearchResultType\x12\x1d\n\x15search_result_subtype\x18\x02 \x01(\t\x12\x1e\n\x16relative_resource_name\x18\x03 \x01(\t\x12\x17\n\x0flinked_resource\x18\x04 \x01(\t*d\n\x10SearchResultType\x12"\n\x1eSEARCH_RESULT_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x45NTRY\x10\x01\x12\x10\n\x0cTAG_TEMPLATE\x10\x02\x12\x0f\n\x0b\x45NTRY_GROUP\x10\x03\x42p\n\x1c\x63om.google.cloud.datacatalogP\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' + '\n3google/cloud/datacatalog_v1beta1/proto/search.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xbd\x01\n\x13SearchCatalogResult\x12N\n\x12search_result_type\x18\x01 \x01(\x0e\x32\x32.google.cloud.datacatalog.v1beta1.SearchResultType\x12\x1d\n\x15search_result_subtype\x18\x02 \x01(\t\x12\x1e\n\x16relative_resource_name\x18\x03 \x01(\t\x12\x17\n\x0flinked_resource\x18\x04 \x01(\t*d\n\x10SearchResultType\x12"\n\x1eSEARCH_RESULT_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x45NTRY\x10\x01\x12\x10\n\x0cTAG_TEMPLATE\x10\x02\x12\x0f\n\x0b\x45NTRY_GROUP\x10\x03\x42x\n$com.google.cloud.datacatalog.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' ), dependencies=[ google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/table_spec_pb2.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/table_spec_pb2.py index 95d06ed5d360..3d1467ce9380 100644 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/table_spec_pb2.py +++ b/datacatalog/google/cloud/datacatalog_v1beta1/proto/table_spec_pb2.py @@ -25,10 +25,10 @@ package="google.cloud.datacatalog.v1beta1", syntax="proto3", serialized_options=_b( - "\n\034com.google.cloud.datacatalogP\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" + "\n$com.google.cloud.datacatalog.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" ), serialized_pb=_b( - '\n7google/cloud/datacatalog_v1beta1/proto/table_spec.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto"\xf7\x01\n\x11\x42igQueryTableSpec\x12Q\n\x11table_source_type\x18\x01 \x01(\x0e\x32\x31.google.cloud.datacatalog.v1beta1.TableSourceTypeB\x03\xe0\x41\x03\x12?\n\tview_spec\x18\x02 \x01(\x0b\x32*.google.cloud.datacatalog.v1beta1.ViewSpecH\x00\x12\x41\n\ntable_spec\x18\x03 \x01(\x0b\x32+.google.cloud.datacatalog.v1beta1.TableSpecH\x00\x42\x0b\n\ttype_spec"#\n\x08ViewSpec\x12\x17\n\nview_query\x18\x01 \x01(\tB\x03\xe0\x41\x03"L\n\tTableSpec\x12?\n\rgrouped_entry\x18\x01 \x01(\tB(\xe0\x41\x03\xfa\x41"\n datacatalog.googleapis.com/Entry"\x89\x01\n\x17\x42igQueryDateShardedSpec\x12\x39\n\x07\x64\x61taset\x18\x01 \x01(\tB(\xe0\x41\x03\xfa\x41"\n datacatalog.googleapis.com/Entry\x12\x19\n\x0ctable_prefix\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bshard_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03*[\n\x0fTableSourceType\x12!\n\x1dTABLE_SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rBIGQUERY_VIEW\x10\x02\x12\x12\n\x0e\x42IGQUERY_TABLE\x10\x05\x42p\n\x1c\x63om.google.cloud.datacatalogP\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' + '\n7google/cloud/datacatalog_v1beta1/proto/table_spec.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto"\xf7\x01\n\x11\x42igQueryTableSpec\x12Q\n\x11table_source_type\x18\x01 \x01(\x0e\x32\x31.google.cloud.datacatalog.v1beta1.TableSourceTypeB\x03\xe0\x41\x03\x12?\n\tview_spec\x18\x02 \x01(\x0b\x32*.google.cloud.datacatalog.v1beta1.ViewSpecH\x00\x12\x41\n\ntable_spec\x18\x03 \x01(\x0b\x32+.google.cloud.datacatalog.v1beta1.TableSpecH\x00\x42\x0b\n\ttype_spec"#\n\x08ViewSpec\x12\x17\n\nview_query\x18\x01 \x01(\tB\x03\xe0\x41\x03"L\n\tTableSpec\x12?\n\rgrouped_entry\x18\x01 \x01(\tB(\xe0\x41\x03\xfa\x41"\n datacatalog.googleapis.com/Entry"\x89\x01\n\x17\x42igQueryDateShardedSpec\x12\x39\n\x07\x64\x61taset\x18\x01 \x01(\tB(\xe0\x41\x03\xfa\x41"\n datacatalog.googleapis.com/Entry\x12\x19\n\x0ctable_prefix\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bshard_count\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03*[\n\x0fTableSourceType\x12!\n\x1dTABLE_SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rBIGQUERY_VIEW\x10\x02\x12\x12\n\x0e\x42IGQUERY_TABLE\x10\x05\x42x\n$com.google.cloud.datacatalog.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' ), dependencies=[ google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/tags_pb2.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/tags_pb2.py index 379a68564735..f69c39b921b3 100644 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/tags_pb2.py +++ b/datacatalog/google/cloud/datacatalog_v1beta1/proto/tags_pb2.py @@ -25,10 +25,10 @@ package="google.cloud.datacatalog.v1beta1", syntax="proto3", serialized_options=_b( - "\n\034com.google.cloud.datacatalogP\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" + "\n$com.google.cloud.datacatalog.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" ), serialized_pb=_b( - '\n1google/cloud/datacatalog_v1beta1/proto/tags.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\x90\x03\n\x03Tag\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\x08template\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12"\n\x15template_display_name\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x06\x63olumn\x18\x04 \x01(\tH\x00\x12\x46\n\x06\x66ields\x18\x03 \x03(\x0b\x32\x31.google.cloud.datacatalog.v1beta1.Tag.FieldsEntryB\x03\xe0\x41\x02\x1aY\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x39\n\x05value\x18\x02 \x01(\x0b\x32*.google.cloud.datacatalog.v1beta1.TagField:\x02\x38\x01:\x81\x01\xea\x41~\n\x1e\x64\x61tacatalog.googleapis.com/Tag\x12\\projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}B\x07\n\x05scope"\x99\x02\n\x08TagField\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x16\n\x0c\x64ouble_value\x18\x02 \x01(\x01H\x00\x12\x16\n\x0cstring_value\x18\x03 \x01(\tH\x00\x12\x14\n\nbool_value\x18\x04 \x01(\x08H\x00\x12\x35\n\x0ftimestamp_value\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12J\n\nenum_value\x18\x06 \x01(\x0b\x32\x34.google.cloud.datacatalog.v1beta1.TagField.EnumValueH\x00\x1a!\n\tEnumValue\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x06\n\x04kind"\xd6\x02\n\x0bTagTemplate\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12N\n\x06\x66ields\x18\x03 \x03(\x0b\x32\x39.google.cloud.datacatalog.v1beta1.TagTemplate.FieldsEntryB\x03\xe0\x41\x02\x1a\x61\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x41\n\x05value\x18\x02 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.TagTemplateField:\x02\x38\x01:p\xea\x41m\n&datacatalog.googleapis.com/TagTemplate\x12\x43projects/{project}/locations/{location}/tagTemplates/{tag_template}"\x83\x02\n\x10TagTemplateField\x12\x11\n\x04name\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12>\n\x04type\x18\x02 \x01(\x0b\x32+.google.cloud.datacatalog.v1beta1.FieldTypeB\x03\xe0\x41\x02:\x85\x01\xea\x41\x81\x01\n+datacatalog.googleapis.com/TagTemplateField\x12Rprojects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}"\xa7\x03\n\tFieldType\x12S\n\x0eprimitive_type\x18\x01 \x01(\x0e\x32\x39.google.cloud.datacatalog.v1beta1.FieldType.PrimitiveTypeH\x00\x12I\n\tenum_type\x18\x02 \x01(\x0b\x32\x34.google.cloud.datacatalog.v1beta1.FieldType.EnumTypeH\x00\x1a\x8a\x01\n\x08\x45numType\x12V\n\x0e\x61llowed_values\x18\x01 \x03(\x0b\x32>.google.cloud.datacatalog.v1beta1.FieldType.EnumType.EnumValue\x1a&\n\tEnumValue\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x02"`\n\rPrimitiveType\x12\x1e\n\x1aPRIMITIVE_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06\x44OUBLE\x10\x01\x12\n\n\x06STRING\x10\x02\x12\x08\n\x04\x42OOL\x10\x03\x12\r\n\tTIMESTAMP\x10\x04\x42\x0b\n\ttype_declBp\n\x1c\x63om.google.cloud.datacatalogP\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' + '\n1google/cloud/datacatalog_v1beta1/proto/tags.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\x90\x03\n\x03Tag\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\x08template\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12"\n\x15template_display_name\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x06\x63olumn\x18\x04 \x01(\tH\x00\x12\x46\n\x06\x66ields\x18\x03 \x03(\x0b\x32\x31.google.cloud.datacatalog.v1beta1.Tag.FieldsEntryB\x03\xe0\x41\x02\x1aY\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x39\n\x05value\x18\x02 \x01(\x0b\x32*.google.cloud.datacatalog.v1beta1.TagField:\x02\x38\x01:\x81\x01\xea\x41~\n\x1e\x64\x61tacatalog.googleapis.com/Tag\x12\\projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}B\x07\n\x05scope"\x99\x02\n\x08TagField\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x16\n\x0c\x64ouble_value\x18\x02 \x01(\x01H\x00\x12\x16\n\x0cstring_value\x18\x03 \x01(\tH\x00\x12\x14\n\nbool_value\x18\x04 \x01(\x08H\x00\x12\x35\n\x0ftimestamp_value\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12J\n\nenum_value\x18\x06 \x01(\x0b\x32\x34.google.cloud.datacatalog.v1beta1.TagField.EnumValueH\x00\x1a!\n\tEnumValue\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x06\n\x04kind"\xd6\x02\n\x0bTagTemplate\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12N\n\x06\x66ields\x18\x03 \x03(\x0b\x32\x39.google.cloud.datacatalog.v1beta1.TagTemplate.FieldsEntryB\x03\xe0\x41\x02\x1a\x61\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x41\n\x05value\x18\x02 \x01(\x0b\x32\x32.google.cloud.datacatalog.v1beta1.TagTemplateField:\x02\x38\x01:p\xea\x41m\n&datacatalog.googleapis.com/TagTemplate\x12\x43projects/{project}/locations/{location}/tagTemplates/{tag_template}"\x83\x02\n\x10TagTemplateField\x12\x11\n\x04name\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12>\n\x04type\x18\x02 \x01(\x0b\x32+.google.cloud.datacatalog.v1beta1.FieldTypeB\x03\xe0\x41\x02:\x85\x01\xea\x41\x81\x01\n+datacatalog.googleapis.com/TagTemplateField\x12Rprojects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}"\xa7\x03\n\tFieldType\x12S\n\x0eprimitive_type\x18\x01 \x01(\x0e\x32\x39.google.cloud.datacatalog.v1beta1.FieldType.PrimitiveTypeH\x00\x12I\n\tenum_type\x18\x02 \x01(\x0b\x32\x34.google.cloud.datacatalog.v1beta1.FieldType.EnumTypeH\x00\x1a\x8a\x01\n\x08\x45numType\x12V\n\x0e\x61llowed_values\x18\x01 \x03(\x0b\x32>.google.cloud.datacatalog.v1beta1.FieldType.EnumType.EnumValue\x1a&\n\tEnumValue\x12\x19\n\x0c\x64isplay_name\x18\x01 \x01(\tB\x03\xe0\x41\x02"`\n\rPrimitiveType\x12\x1e\n\x1aPRIMITIVE_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06\x44OUBLE\x10\x01\x12\n\n\x06STRING\x10\x02\x12\x08\n\x04\x42OOL\x10\x03\x12\r\n\tTIMESTAMP\x10\x04\x42\x0b\n\ttype_declBx\n$com.google.cloud.datacatalog.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' ), dependencies=[ google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, @@ -855,6 +855,9 @@ __doc__="""Tags are used to attach custom metadata to Data Catalog resources. Tags conform to the specifications within their tag template. + See `Data Catalog IAM `__ for + information on the permissions needed to create or view tags. + Attributes: name: diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/proto/timestamps_pb2.py b/datacatalog/google/cloud/datacatalog_v1beta1/proto/timestamps_pb2.py index 4dff9fc23fa7..1134a1192b4c 100644 --- a/datacatalog/google/cloud/datacatalog_v1beta1/proto/timestamps_pb2.py +++ b/datacatalog/google/cloud/datacatalog_v1beta1/proto/timestamps_pb2.py @@ -24,10 +24,10 @@ package="google.cloud.datacatalog.v1beta1", syntax="proto3", serialized_options=_b( - "\n\034com.google.cloud.datacatalogP\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" + "\n$com.google.cloud.datacatalog.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\370\001\001" ), serialized_pb=_b( - '\n7google/cloud/datacatalog_v1beta1/proto/timestamps.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xaa\x01\n\x10SystemTimestamps\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42p\n\x1c\x63om.google.cloud.datacatalogP\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' + '\n7google/cloud/datacatalog_v1beta1/proto/timestamps.proto\x12 google.cloud.datacatalog.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xaa\x01\n\x10SystemTimestamps\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42x\n$com.google.cloud.datacatalog.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/datacatalog/v1beta1;datacatalog\xf8\x01\x01\x62\x06proto3' ), dependencies=[ google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, diff --git a/datacatalog/google/cloud/datacatalog_v1beta1/types.py b/datacatalog/google/cloud/datacatalog_v1beta1/types.py index e72d22d4ec84..e694579a1828 100644 --- a/datacatalog/google/cloud/datacatalog_v1beta1/types.py +++ b/datacatalog/google/cloud/datacatalog_v1beta1/types.py @@ -22,6 +22,8 @@ from google.cloud.datacatalog_v1beta1.proto import datacatalog_pb2 from google.cloud.datacatalog_v1beta1.proto import gcs_fileset_spec_pb2 +from google.cloud.datacatalog_v1beta1.proto import policytagmanager_pb2 +from google.cloud.datacatalog_v1beta1.proto import policytagmanagerserialization_pb2 from google.cloud.datacatalog_v1beta1.proto import schema_pb2 from google.cloud.datacatalog_v1beta1.proto import search_pb2 from google.cloud.datacatalog_v1beta1.proto import table_spec_pb2 @@ -49,6 +51,8 @@ _local_modules = [ datacatalog_pb2, gcs_fileset_spec_pb2, + policytagmanager_pb2, + policytagmanagerserialization_pb2, schema_pb2, search_pb2, table_spec_pb2, diff --git a/datacatalog/synth.metadata b/datacatalog/synth.metadata index 7ad5f5cda1ba..a6c87ee83d10 100644 --- a/datacatalog/synth.metadata +++ b/datacatalog/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-11-12T13:21:51.381239Z", + "updateTime": "2019-11-14T18:45:51.389155Z", "sources": [ { "generator": { @@ -11,16 +11,16 @@ { "git": { "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f69562be0608904932bdcfbc5ad8b9a22d9dceb8", - "internalRef": "279774957" + "remote": "git@github.com:googleapis/googleapis.git", + "sha": "1935fb8889686f5c9d107f11b3c6870fc3aa7cdc", + "internalRef": "280451656" } }, { "template": { "name": "python_library", "origin": "synthtool.gcp", - "version": "2019.10.17" + "version": "2019.5.2" } } ], @@ -32,7 +32,7 @@ "apiVersion": "v1beta1", "language": "python", "generator": "gapic", - "config": "google/cloud/datacatalog/artman_datacatalog_v1beta1.yaml" + "config": "google/cloud/datacatalog/v1beta1/artman_datacatalog_v1beta1.yaml" } } ] diff --git a/datacatalog/synth.py b/datacatalog/synth.py index 5f1436288e14..76bc9c150a39 100644 --- a/datacatalog/synth.py +++ b/datacatalog/synth.py @@ -27,7 +27,7 @@ library = gapic.py_library( 'datacatalog', version, - config_path='/google/cloud/datacatalog/artman_datacatalog_v1beta1.yaml', + config_path='/google/cloud/datacatalog/v1beta1/artman_datacatalog_v1beta1.yaml', artman_output_name='datacatalog-v1beta1', include_protos=True, generator_args=["--dev_samples"], diff --git a/datacatalog/tests/unit/gapic/v1beta1/test_policy_tag_manager_client_v1beta1.py b/datacatalog/tests/unit/gapic/v1beta1/test_policy_tag_manager_client_v1beta1.py new file mode 100644 index 000000000000..fb00475ea153 --- /dev/null +++ b/datacatalog/tests/unit/gapic/v1beta1/test_policy_tag_manager_client_v1beta1.py @@ -0,0 +1,515 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests.""" + +import mock +import pytest + +from google.cloud import datacatalog_v1beta1 +from google.cloud.datacatalog_v1beta1.proto import policytagmanager_pb2 +from google.iam.v1 import iam_policy_pb2 +from google.iam.v1 import policy_pb2 +from google.protobuf import empty_pb2 + + +class MultiCallableStub(object): + """Stub for the grpc.UnaryUnaryMultiCallable interface.""" + + def __init__(self, method, channel_stub): + self.method = method + self.channel_stub = channel_stub + + def __call__(self, request, timeout=None, metadata=None, credentials=None): + self.channel_stub.requests.append((self.method, request)) + + response = None + if self.channel_stub.responses: + response = self.channel_stub.responses.pop() + + if isinstance(response, Exception): + raise response + + if response: + return response + + +class ChannelStub(object): + """Stub for the grpc.Channel interface.""" + + def __init__(self, responses=[]): + self.responses = responses + self.requests = [] + + def unary_unary(self, method, request_serializer=None, response_deserializer=None): + return MultiCallableStub(method, self) + + +class CustomException(Exception): + pass + + +class TestPolicyTagManagerClient(object): + def test_create_taxonomy(self): + # Setup Expected Response + name = "name3373707" + display_name = "displayName1615086568" + description = "description-1724546052" + expected_response = { + "name": name, + "display_name": display_name, + "description": description, + } + expected_response = policytagmanager_pb2.Taxonomy(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + response = client.create_taxonomy() + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = policytagmanager_pb2.CreateTaxonomyRequest() + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_create_taxonomy_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + with pytest.raises(CustomException): + client.create_taxonomy() + + def test_delete_taxonomy(self): + channel = ChannelStub() + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + client.delete_taxonomy() + + assert len(channel.requests) == 1 + expected_request = policytagmanager_pb2.DeleteTaxonomyRequest() + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_delete_taxonomy_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + with pytest.raises(CustomException): + client.delete_taxonomy() + + def test_update_taxonomy(self): + # Setup Expected Response + name = "name3373707" + display_name = "displayName1615086568" + description = "description-1724546052" + expected_response = { + "name": name, + "display_name": display_name, + "description": description, + } + expected_response = policytagmanager_pb2.Taxonomy(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + response = client.update_taxonomy() + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = policytagmanager_pb2.UpdateTaxonomyRequest() + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_update_taxonomy_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + with pytest.raises(CustomException): + client.update_taxonomy() + + def test_list_taxonomies(self): + # Setup Expected Response + next_page_token = "nextPageToken-1530815211" + expected_response = {"next_page_token": next_page_token} + expected_response = policytagmanager_pb2.ListTaxonomiesResponse( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + response = client.list_taxonomies() + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = policytagmanager_pb2.ListTaxonomiesRequest() + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_list_taxonomies_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + with pytest.raises(CustomException): + client.list_taxonomies() + + def test_get_taxonomy(self): + # Setup Expected Response + name = "name3373707" + display_name = "displayName1615086568" + description = "description-1724546052" + expected_response = { + "name": name, + "display_name": display_name, + "description": description, + } + expected_response = policytagmanager_pb2.Taxonomy(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + response = client.get_taxonomy() + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = policytagmanager_pb2.GetTaxonomyRequest() + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_get_taxonomy_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + with pytest.raises(CustomException): + client.get_taxonomy() + + def test_create_policy_tag(self): + # Setup Expected Response + name = "name3373707" + display_name = "displayName1615086568" + description = "description-1724546052" + parent_policy_tag = "parentPolicyTag2071382466" + expected_response = { + "name": name, + "display_name": display_name, + "description": description, + "parent_policy_tag": parent_policy_tag, + } + expected_response = policytagmanager_pb2.PolicyTag(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + response = client.create_policy_tag() + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = policytagmanager_pb2.CreatePolicyTagRequest() + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_create_policy_tag_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + with pytest.raises(CustomException): + client.create_policy_tag() + + def test_delete_policy_tag(self): + channel = ChannelStub() + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + client.delete_policy_tag() + + assert len(channel.requests) == 1 + expected_request = policytagmanager_pb2.DeletePolicyTagRequest() + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_delete_policy_tag_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + with pytest.raises(CustomException): + client.delete_policy_tag() + + def test_update_policy_tag(self): + # Setup Expected Response + name = "name3373707" + display_name = "displayName1615086568" + description = "description-1724546052" + parent_policy_tag = "parentPolicyTag2071382466" + expected_response = { + "name": name, + "display_name": display_name, + "description": description, + "parent_policy_tag": parent_policy_tag, + } + expected_response = policytagmanager_pb2.PolicyTag(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + response = client.update_policy_tag() + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = policytagmanager_pb2.UpdatePolicyTagRequest() + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_update_policy_tag_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + with pytest.raises(CustomException): + client.update_policy_tag() + + def test_list_policy_tags(self): + # Setup Expected Response + next_page_token = "nextPageToken-1530815211" + expected_response = {"next_page_token": next_page_token} + expected_response = policytagmanager_pb2.ListPolicyTagsResponse( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + response = client.list_policy_tags() + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = policytagmanager_pb2.ListPolicyTagsRequest() + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_list_policy_tags_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + with pytest.raises(CustomException): + client.list_policy_tags() + + def test_get_policy_tag(self): + # Setup Expected Response + name = "name3373707" + display_name = "displayName1615086568" + description = "description-1724546052" + parent_policy_tag = "parentPolicyTag2071382466" + expected_response = { + "name": name, + "display_name": display_name, + "description": description, + "parent_policy_tag": parent_policy_tag, + } + expected_response = policytagmanager_pb2.PolicyTag(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + response = client.get_policy_tag() + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = policytagmanager_pb2.GetPolicyTagRequest() + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_get_policy_tag_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + with pytest.raises(CustomException): + client.get_policy_tag() + + def test_get_iam_policy(self): + # Setup Expected Response + version = 351608024 + etag = b"21" + expected_response = {"version": version, "etag": etag} + expected_response = policy_pb2.Policy(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + response = client.get_iam_policy() + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = iam_policy_pb2.GetIamPolicyRequest() + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_get_iam_policy_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + with pytest.raises(CustomException): + client.get_iam_policy() + + def test_set_iam_policy(self): + # Setup Expected Response + version = 351608024 + etag = b"21" + expected_response = {"version": version, "etag": etag} + expected_response = policy_pb2.Policy(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + response = client.set_iam_policy() + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = iam_policy_pb2.SetIamPolicyRequest() + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_set_iam_policy_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + with pytest.raises(CustomException): + client.set_iam_policy() + + def test_test_iam_permissions(self): + # Setup Expected Response + expected_response = {} + expected_response = iam_policy_pb2.TestIamPermissionsResponse( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + response = client.test_iam_permissions() + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = iam_policy_pb2.TestIamPermissionsRequest() + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_test_iam_permissions_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerClient() + + with pytest.raises(CustomException): + client.test_iam_permissions() diff --git a/datacatalog/tests/unit/gapic/v1beta1/test_policy_tag_manager_serialization_client_v1beta1.py b/datacatalog/tests/unit/gapic/v1beta1/test_policy_tag_manager_serialization_client_v1beta1.py new file mode 100644 index 000000000000..907c0e36a761 --- /dev/null +++ b/datacatalog/tests/unit/gapic/v1beta1/test_policy_tag_manager_serialization_client_v1beta1.py @@ -0,0 +1,127 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests.""" + +import mock +import pytest + +from google.cloud import datacatalog_v1beta1 +from google.cloud.datacatalog_v1beta1.proto import policytagmanagerserialization_pb2 + + +class MultiCallableStub(object): + """Stub for the grpc.UnaryUnaryMultiCallable interface.""" + + def __init__(self, method, channel_stub): + self.method = method + self.channel_stub = channel_stub + + def __call__(self, request, timeout=None, metadata=None, credentials=None): + self.channel_stub.requests.append((self.method, request)) + + response = None + if self.channel_stub.responses: + response = self.channel_stub.responses.pop() + + if isinstance(response, Exception): + raise response + + if response: + return response + + +class ChannelStub(object): + """Stub for the grpc.Channel interface.""" + + def __init__(self, responses=[]): + self.responses = responses + self.requests = [] + + def unary_unary(self, method, request_serializer=None, response_deserializer=None): + return MultiCallableStub(method, self) + + +class CustomException(Exception): + pass + + +class TestPolicyTagManagerSerializationClient(object): + def test_import_taxonomies(self): + # Setup Expected Response + expected_response = {} + expected_response = policytagmanagerserialization_pb2.ImportTaxonomiesResponse( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerSerializationClient() + + response = client.import_taxonomies() + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = policytagmanagerserialization_pb2.ImportTaxonomiesRequest() + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_import_taxonomies_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerSerializationClient() + + with pytest.raises(CustomException): + client.import_taxonomies() + + def test_export_taxonomies(self): + # Setup Expected Response + expected_response = {} + expected_response = policytagmanagerserialization_pb2.ExportTaxonomiesResponse( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerSerializationClient() + + response = client.export_taxonomies() + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = policytagmanagerserialization_pb2.ExportTaxonomiesRequest() + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_export_taxonomies_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = datacatalog_v1beta1.PolicyTagManagerSerializationClient() + + with pytest.raises(CustomException): + client.export_taxonomies()