diff --git a/packages/google-cloud-dialogflow/dialogflow/__init__.py b/packages/google-cloud-dialogflow/dialogflow/__init__.py index 7edb8b42d98e..54ec3640553c 100644 --- a/packages/google-cloud-dialogflow/dialogflow/__init__.py +++ b/packages/google-cloud-dialogflow/dialogflow/__init__.py @@ -14,14 +14,14 @@ from __future__ import absolute_import -from dialogflow_v2beta1 import AgentsClient -from dialogflow_v2beta1 import ContextsClient -from dialogflow_v2beta1 import EntityTypesClient -from dialogflow_v2beta1 import IntentsClient -from dialogflow_v2beta1 import SessionEntityTypesClient -from dialogflow_v2beta1 import SessionsClient -from dialogflow_v2beta1 import enums -from dialogflow_v2beta1 import types +from dialogflow_v2 import AgentsClient +from dialogflow_v2 import ContextsClient +from dialogflow_v2 import EntityTypesClient +from dialogflow_v2 import IntentsClient +from dialogflow_v2 import SessionEntityTypesClient +from dialogflow_v2 import SessionsClient +from dialogflow_v2 import enums +from dialogflow_v2 import types __all__ = ( 'enums', diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/__init__.py b/packages/google-cloud-dialogflow/dialogflow_v2/__init__.py new file mode 100755 index 000000000000..c1b68e513a02 --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/__init__.py @@ -0,0 +1,67 @@ +# Copyright 2018 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. + +from __future__ import absolute_import + +from dialogflow_v2 import types +from dialogflow_v2.gapic import agents_client +from dialogflow_v2.gapic import contexts_client +from dialogflow_v2.gapic import entity_types_client +from dialogflow_v2.gapic import enums +from dialogflow_v2.gapic import intents_client +from dialogflow_v2.gapic import session_entity_types_client +from dialogflow_v2.gapic import sessions_client + + +class AgentsClient(agents_client.AgentsClient): + __doc__ = agents_client.AgentsClient.__doc__ + enums = enums + + +class ContextsClient(contexts_client.ContextsClient): + __doc__ = contexts_client.ContextsClient.__doc__ + enums = enums + + +class EntityTypesClient(entity_types_client.EntityTypesClient): + __doc__ = entity_types_client.EntityTypesClient.__doc__ + enums = enums + + +class IntentsClient(intents_client.IntentsClient): + __doc__ = intents_client.IntentsClient.__doc__ + enums = enums + + +class SessionEntityTypesClient( + session_entity_types_client.SessionEntityTypesClient): + __doc__ = session_entity_types_client.SessionEntityTypesClient.__doc__ + enums = enums + + +class SessionsClient(sessions_client.SessionsClient): + __doc__ = sessions_client.SessionsClient.__doc__ + enums = enums + + +__all__ = ( + 'enums', + 'types', + 'AgentsClient', + 'ContextsClient', + 'EntityTypesClient', + 'IntentsClient', + 'SessionEntityTypesClient', + 'SessionsClient', +) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/gapic/__init__.py b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/__init__.py new file mode 100755 index 000000000000..e69de29bb2d1 diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/gapic/agents_client.py b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/agents_client.py new file mode 100755 index 000000000000..605649c17336 --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/agents_client.py @@ -0,0 +1,636 @@ +# Copyright 2018 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 dialogflow.v2 Agents API.""" + +import functools +import pkg_resources + +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.grpc_helpers +import google.api_core.operation +import google.api_core.operations_v1 +import google.api_core.page_iterator +import google.api_core.path_template +import google.api_core.protobuf_helpers + +from google.protobuf import empty_pb2 +from google.protobuf import struct_pb2 + +from dialogflow_v2.gapic import agents_client_config +from dialogflow_v2.gapic import enums +from dialogflow_v2.proto import agent_pb2 + +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( + 'dialogflow', +).version + + +class AgentsClient(object): + """ + Manages conversational agents. + + + Refer to the `Dialogflow documentation `__ + for more details about agents. + # + """ + + SERVICE_ADDRESS = 'dialogflow.googleapis.com:443' + """The default address of the service.""" + + # The scopes needed to make gRPC calls to all of the methods defined in + # this service + _DEFAULT_SCOPES = ('https://www.googleapis.com/auth/cloud-platform', ) + + # The name of the interface for this client. This is the key used to find + # method configuration in the client_config dictionary. + _INTERFACE_NAME = 'google.cloud.dialogflow.v2.Agents' + + @classmethod + def project_path(cls, project): + """Return a fully-qualified project string.""" + return google.api_core.path_template.expand( + 'projects/{project}', + project=project, + ) + + def __init__(self, + channel=None, + credentials=None, + client_config=agents_client_config.config, + client_info=None): + """Constructor. + + 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. + client_config (dict): 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. + """ + # 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 to {} are mutually ' + 'exclusive.'.format(self.__class__.__name__), ) + + # Create the channel. + if channel is None: + channel = google.api_core.grpc_helpers.create_channel( + self.SERVICE_ADDRESS, + credentials=credentials, + scopes=self._DEFAULT_SCOPES, + ) + + # Create the gRPC stubs. + self.agents_stub = (agent_pb2.AgentsStub(channel)) + + # Operations client for methods that return long-running operations + # futures. + self.operations_client = ( + google.api_core.operations_v1.OperationsClient(channel)) + + if client_info is None: + client_info = ( + google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) + client_info.gapic_version = _GAPIC_LIBRARY_VERSION + + # 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.) + method_configs = google.api_core.gapic_v1.config.parse_method_configs( + client_config['interfaces'][self._INTERFACE_NAME], ) + + # Write the "inner API call" methods to the class. + # These are wrapped versions of the gRPC stub methods, with retry and + # timeout configuration applied, called by the public methods on + # this class. + self._get_agent = google.api_core.gapic_v1.method.wrap_method( + self.agents_stub.GetAgent, + default_retry=method_configs['GetAgent'].retry, + default_timeout=method_configs['GetAgent'].timeout, + client_info=client_info, + ) + self._search_agents = google.api_core.gapic_v1.method.wrap_method( + self.agents_stub.SearchAgents, + default_retry=method_configs['SearchAgents'].retry, + default_timeout=method_configs['SearchAgents'].timeout, + client_info=client_info, + ) + self._train_agent = google.api_core.gapic_v1.method.wrap_method( + self.agents_stub.TrainAgent, + default_retry=method_configs['TrainAgent'].retry, + default_timeout=method_configs['TrainAgent'].timeout, + client_info=client_info, + ) + self._export_agent = google.api_core.gapic_v1.method.wrap_method( + self.agents_stub.ExportAgent, + default_retry=method_configs['ExportAgent'].retry, + default_timeout=method_configs['ExportAgent'].timeout, + client_info=client_info, + ) + self._import_agent = google.api_core.gapic_v1.method.wrap_method( + self.agents_stub.ImportAgent, + default_retry=method_configs['ImportAgent'].retry, + default_timeout=method_configs['ImportAgent'].timeout, + client_info=client_info, + ) + self._restore_agent = google.api_core.gapic_v1.method.wrap_method( + self.agents_stub.RestoreAgent, + default_retry=method_configs['RestoreAgent'].retry, + default_timeout=method_configs['RestoreAgent'].timeout, + client_info=client_info, + ) + + # Service calls + def get_agent(self, + parent, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Retrieves the specified agent. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.AgentsClient() + >>> + >>> parent = client.project_path('[PROJECT]') + >>> + >>> response = client.get_agent(parent) + + Args: + parent (str): Required. The project that the agent to fetch is associated with. + Format: ``projects/``. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types.Agent` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = agent_pb2.GetAgentRequest(parent=parent, ) + return self._get_agent( + request, retry=retry, timeout=timeout, metadata=metadata) + + def search_agents(self, + parent, + page_size=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Returns the list of agents. + + Since there is at most one conversational agent per project, this method is + useful primarily for listing all agents across projects the caller has + access to. One can achieve that with a wildcard project collection id \"-\". + Refer to [List + Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.AgentsClient() + >>> + >>> parent = client.project_path('[PROJECT]') + >>> + >>> + >>> # Iterate over all results + >>> for element in client.search_agents(parent): + ... # process element + ... pass + >>> + >>> # Or iterate over results one page at a time + >>> for page in client.search_agents(parent, options=CallOptions(page_token=INITIAL_PAGE)): + ... for element in page: + ... # process element + ... pass + + Args: + parent (str): Required. The project to list agents from. + Format: ``projects/``. + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.gax.PageIterator` instance. By default, this + is an iterable of :class:`~google.cloud.dialogflow_v2.types.Agent` instances. + This object can also be configured to iterate over the pages + of the response through the `options` parameter. + + 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = agent_pb2.SearchAgentsRequest( + parent=parent, + page_size=page_size, + ) + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._search_agents, + retry=retry, + timeout=timeout, + metadata=metadata), + request=request, + items_field='agents', + request_token_field='page_token', + response_token_field='next_page_token', + ) + return iterator + + def train_agent(self, + parent, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Trains the specified agent. + + + Operation + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.AgentsClient() + >>> + >>> parent = client.project_path('[PROJECT]') + >>> + >>> response = client.train_agent(parent) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + parent (str): Required. The project that the agent to train is associated with. + Format: ``projects/``. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types._OperationFuture` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = agent_pb2.TrainAgentRequest(parent=parent, ) + operation = self._train_agent( + request, retry=retry, timeout=timeout, metadata=metadata) + return google.api_core.operation.from_gapic( + operation, + self.operations_client, + empty_pb2.Empty, + metadata_type=struct_pb2.Struct, + ) + + def export_agent(self, + parent, + agent_uri=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Exports the specified agent to a ZIP file. + + + Operation + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.AgentsClient() + >>> + >>> parent = client.project_path('[PROJECT]') + >>> + >>> response = client.export_agent(parent) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + parent (str): Required. The project that the agent to export is associated with. + Format: ``projects/``. + agent_uri (str): Optional. The Google Cloud Storage URI to export the agent to. + Note: The URI must start with + \"gs://\". If left unspecified, the serialized agent is returned inline. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types._OperationFuture` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = agent_pb2.ExportAgentRequest( + parent=parent, + agent_uri=agent_uri, + ) + operation = self._export_agent( + request, retry=retry, timeout=timeout, metadata=metadata) + return google.api_core.operation.from_gapic( + operation, + self.operations_client, + agent_pb2.ExportAgentResponse, + metadata_type=struct_pb2.Struct, + ) + + def import_agent(self, + parent, + agent_uri=None, + agent_content=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Imports the specified agent from a ZIP file. + + Uploads new intents and entity types without deleting the existing ones. + Intents and entity types with the same name are replaced with the new + versions from ImportAgentRequest. + + + Operation + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.AgentsClient() + >>> + >>> parent = client.project_path('[PROJECT]') + >>> + >>> response = client.import_agent(parent) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + parent (str): Required. The project that the agent to import is associated with. + Format: ``projects/``. + agent_uri (str): The URI to a Google Cloud Storage file containing the agent to import. + Note: The URI must start with \"gs://\". + agent_content (bytes): The agent to import. + + Example for how to import an agent via the command line: + + curl \ + 'https://dialogflow.googleapis.com/v2/projects//agent:import\ + -X POST \ + -H 'Authorization: Bearer '$(gcloud auth print-access-token) \ + -H 'Accept: application/json' \ + -H 'Content-Type: application/json' \ + --compressed \ + --data-binary \"{ + :: + + 'agentContent': '$(cat | base64 -w 0)' + }\" + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types._OperationFuture` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + # 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( + agent_uri=agent_uri, + agent_content=agent_content, + ) + + request = agent_pb2.ImportAgentRequest( + parent=parent, + agent_uri=agent_uri, + agent_content=agent_content, + ) + operation = self._import_agent( + request, retry=retry, timeout=timeout, metadata=metadata) + return google.api_core.operation.from_gapic( + operation, + self.operations_client, + empty_pb2.Empty, + metadata_type=struct_pb2.Struct, + ) + + def restore_agent(self, + parent, + agent_uri=None, + agent_content=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Restores the specified agent from a ZIP file. + + Replaces the current agent version with a new one. All the intents and + entity types in the older version are deleted. + + + Operation + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.AgentsClient() + >>> + >>> parent = client.project_path('[PROJECT]') + >>> + >>> response = client.restore_agent(parent) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + parent (str): Required. The project that the agent to restore is associated with. + Format: ``projects/``. + agent_uri (str): The URI to a Google Cloud Storage file containing the agent to restore. + Note: The URI must start with \"gs://\". + agent_content (bytes): The agent to restore. + + Example for how to restore an agent via the command line: + + curl \ + 'https://dialogflow.googleapis.com/v2/projects//agent:restore\ + -X POST \ + -H 'Authorization: Bearer '$(gcloud auth print-access-token) \ + -H 'Accept: application/json' \ + -H 'Content-Type: application/json' \ + --compressed \ + --data-binary \"{ + :: + + 'agentContent': '$(cat | base64 -w 0)' + }\" + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types._OperationFuture` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + # 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( + agent_uri=agent_uri, + agent_content=agent_content, + ) + + request = agent_pb2.RestoreAgentRequest( + parent=parent, + agent_uri=agent_uri, + agent_content=agent_content, + ) + operation = self._restore_agent( + request, retry=retry, timeout=timeout, metadata=metadata) + return google.api_core.operation.from_gapic( + operation, + self.operations_client, + empty_pb2.Empty, + metadata_type=struct_pb2.Struct, + ) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/gapic/agents_client_config.py b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/agents_client_config.py new file mode 100755 index 000000000000..491cc6d72162 --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/agents_client_config.py @@ -0,0 +1,53 @@ +config = { + "interfaces": { + "google.cloud.dialogflow.v2.Agents": { + "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": { + "GetAgent": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SearchAgents": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "TrainAgent": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ExportAgent": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ImportAgent": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestoreAgent": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/gapic/contexts_client.py b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/contexts_client.py new file mode 100755 index 000000000000..0b3bc32d8b5e --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/contexts_client.py @@ -0,0 +1,493 @@ +# Copyright 2018 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 dialogflow.v2 Contexts API.""" + +import functools +import pkg_resources + +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.grpc_helpers +import google.api_core.page_iterator +import google.api_core.path_template + +from google.protobuf import empty_pb2 +from google.protobuf import field_mask_pb2 +from google.protobuf import struct_pb2 + +from dialogflow_v2.gapic import contexts_client_config +from dialogflow_v2.gapic import enums +from dialogflow_v2.proto import agent_pb2 +from dialogflow_v2.proto import context_pb2 + + +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( + 'dialogflow', +).version + +class ContextsClient(object): + """ + Manages contexts. + + + Refer to the `Dialogflow documentation `__ + for more details about contexts. + # + """ + + SERVICE_ADDRESS = 'dialogflow.googleapis.com:443' + """The default address of the service.""" + + # The scopes needed to make gRPC calls to all of the methods defined in + # this service + _DEFAULT_SCOPES = ('https://www.googleapis.com/auth/cloud-platform', ) + + # The name of the interface for this client. This is the key used to find + # method configuration in the client_config dictionary. + _INTERFACE_NAME = 'google.cloud.dialogflow.v2.Contexts' + + @classmethod + def session_path(cls, project, session): + """Return a fully-qualified session string.""" + return google.api_core.path_template.expand( + 'projects/{project}/agent/sessions/{session}', + project=project, + session=session, + ) + + @classmethod + def context_path(cls, project, session, context): + """Return a fully-qualified context string.""" + return google.api_core.path_template.expand( + 'projects/{project}/agent/sessions/{session}/contexts/{context}', + project=project, + session=session, + context=context, + ) + + def __init__(self, + channel=None, + credentials=None, + client_config=contexts_client_config.config, + client_info=None): + """Constructor. + + 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. + client_config (dict): 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. + """ + # 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 to {} are mutually ' + 'exclusive.'.format(self.__class__.__name__), ) + + # Create the channel. + if channel is None: + channel = google.api_core.grpc_helpers.create_channel( + self.SERVICE_ADDRESS, + credentials=credentials, + scopes=self._DEFAULT_SCOPES, + ) + + # Create the gRPC stubs. + self.contexts_stub = (context_pb2.ContextsStub(channel)) + + if client_info is None: + client_info = ( + google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) + client_info.gapic_version = _GAPIC_LIBRARY_VERSION + + # 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.) + method_configs = google.api_core.gapic_v1.config.parse_method_configs( + client_config['interfaces'][self._INTERFACE_NAME], ) + + # Write the "inner API call" methods to the class. + # These are wrapped versions of the gRPC stub methods, with retry and + # timeout configuration applied, called by the public methods on + # this class. + self._list_contexts = google.api_core.gapic_v1.method.wrap_method( + self.contexts_stub.ListContexts, + default_retry=method_configs['ListContexts'].retry, + default_timeout=method_configs['ListContexts'].timeout, + client_info=client_info, + ) + self._get_context = google.api_core.gapic_v1.method.wrap_method( + self.contexts_stub.GetContext, + default_retry=method_configs['GetContext'].retry, + default_timeout=method_configs['GetContext'].timeout, + client_info=client_info, + ) + self._create_context = google.api_core.gapic_v1.method.wrap_method( + self.contexts_stub.CreateContext, + default_retry=method_configs['CreateContext'].retry, + default_timeout=method_configs['CreateContext'].timeout, + client_info=client_info, + ) + self._update_context = google.api_core.gapic_v1.method.wrap_method( + self.contexts_stub.UpdateContext, + default_retry=method_configs['UpdateContext'].retry, + default_timeout=method_configs['UpdateContext'].timeout, + client_info=client_info, + ) + self._delete_context = google.api_core.gapic_v1.method.wrap_method( + self.contexts_stub.DeleteContext, + default_retry=method_configs['DeleteContext'].retry, + default_timeout=method_configs['DeleteContext'].timeout, + client_info=client_info, + ) + self._delete_all_contexts = google.api_core.gapic_v1.method.wrap_method( + self.contexts_stub.DeleteAllContexts, + default_retry=method_configs['DeleteAllContexts'].retry, + default_timeout=method_configs['DeleteAllContexts'].timeout, + client_info=client_info, + ) + + # Service calls + def list_contexts(self, + parent, + page_size=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Returns the list of all contexts in the specified session. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.ContextsClient() + >>> + >>> parent = client.session_path('[PROJECT]', '[SESSION]') + >>> + >>> + >>> # Iterate over all results + >>> for element in client.list_contexts(parent): + ... # process element + ... pass + >>> + >>> # Or iterate over results one page at a time + >>> for page in client.list_contexts(parent, options=CallOptions(page_token=INITIAL_PAGE)): + ... for element in page: + ... # process element + ... pass + + Args: + parent (str): Required. The session to list all contexts from. + Format: ``projects//agent/sessions/``. + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.gax.PageIterator` instance. By default, this + is an iterable of :class:`~google.cloud.dialogflow_v2.types.Context` instances. + This object can also be configured to iterate over the pages + of the response through the `options` parameter. + + 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = context_pb2.ListContextsRequest( + parent=parent, + page_size=page_size, + ) + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._list_contexts, + retry=retry, + timeout=timeout, + metadata=metadata), + request=request, + items_field='contexts', + request_token_field='page_token', + response_token_field='next_page_token', + ) + return iterator + + def get_context(self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Retrieves the specified context. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.ContextsClient() + >>> + >>> name = client.context_path('[PROJECT]', '[SESSION]', '[CONTEXT]') + >>> + >>> response = client.get_context(name) + + Args: + name (str): Required. The name of the context. Format: + ``projects//agent/sessions//contexts/``. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types.Context` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = context_pb2.GetContextRequest(name=name, ) + return self._get_context( + request, retry=retry, timeout=timeout, metadata=metadata) + + def create_context(self, + parent, + context, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Creates a context. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.ContextsClient() + >>> + >>> parent = client.session_path('[PROJECT]', '[SESSION]') + >>> context = {} + >>> + >>> response = client.create_context(parent, context) + + Args: + parent (str): Required. The session to create a context for. + Format: ``projects//agent/sessions/``. + context (Union[dict, ~google.cloud.dialogflow_v2.types.Context]): Required. The context to create. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.Context` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types.Context` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = context_pb2.CreateContextRequest( + parent=parent, + context=context, + ) + return self._create_context( + request, retry=retry, timeout=timeout, metadata=metadata) + + def update_context(self, + context, + update_mask=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Updates the specified context. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.ContextsClient() + >>> + >>> context = {} + >>> + >>> response = client.update_context(context) + + Args: + context (Union[dict, ~google.cloud.dialogflow_v2.types.Context]): Required. The context to update. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.Context` + update_mask (Union[dict, ~google.cloud.dialogflow_v2.types.FieldMask]): Optional. The mask to control which fields get updated. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.FieldMask` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types.Context` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = context_pb2.UpdateContextRequest( + context=context, + update_mask=update_mask, + ) + return self._update_context( + request, retry=retry, timeout=timeout, metadata=metadata) + + def delete_context(self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Deletes the specified context. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.ContextsClient() + >>> + >>> name = client.context_path('[PROJECT]', '[SESSION]', '[CONTEXT]') + >>> + >>> client.delete_context(name) + + Args: + name (str): Required. The name of the context to delete. Format: + ``projects//agent/sessions//contexts/``. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = context_pb2.DeleteContextRequest(name=name, ) + self._delete_context( + request, retry=retry, timeout=timeout, metadata=metadata) + + def delete_all_contexts(self, + parent, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Deletes all active contexts in the specified session. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.ContextsClient() + >>> + >>> parent = client.session_path('[PROJECT]', '[SESSION]') + >>> + >>> client.delete_all_contexts(parent) + + Args: + parent (str): Required. The name of the session to delete all contexts from. Format: + ``projects//agent/sessions/``. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = context_pb2.DeleteAllContextsRequest(parent=parent, ) + self._delete_all_contexts( + request, retry=retry, timeout=timeout, metadata=metadata) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/gapic/contexts_client_config.py b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/contexts_client_config.py new file mode 100755 index 000000000000..7ff40f8aa6aa --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/contexts_client_config.py @@ -0,0 +1,53 @@ +config = { + "interfaces": { + "google.cloud.dialogflow.v2.Contexts": { + "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": { + "ListContexts": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetContext": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateContext": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateContext": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteContext": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteAllContexts": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/gapic/entity_types_client.py b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/entity_types_client.py new file mode 100755 index 000000000000..5a1be54be0ed --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/entity_types_client.py @@ -0,0 +1,925 @@ +# Copyright 2018 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.dialogflow.v2 EntityTypes API.""" + +import functools +import pkg_resources + +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.grpc_helpers +import google.api_core.operation +import google.api_core.operations_v1 +import google.api_core.page_iterator +import google.api_core.path_template +import google.api_core.protobuf_helpers + +from google.protobuf import empty_pb2 +from google.protobuf import field_mask_pb2 +from google.protobuf import struct_pb2 + +from dialogflow_v2.gapic import entity_types_client_config +from dialogflow_v2.gapic import enums +from dialogflow_v2.proto import agent_pb2 +from dialogflow_v2.proto import context_pb2 +from dialogflow_v2.proto import entity_type_pb2 + + +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( + 'dialogflow', +).version + + +class EntityTypesClient(object): + """ + Manages agent entity types. + + + Refer to the `Dialogflow documentation `__ + for more details about entity types. + # + """ + + SERVICE_ADDRESS = 'dialogflow.googleapis.com:443' + """The default address of the service.""" + + # The scopes needed to make gRPC calls to all of the methods defined in + # this service + _DEFAULT_SCOPES = ('https://www.googleapis.com/auth/cloud-platform', ) + + # The name of the interface for this client. This is the key used to find + # method configuration in the client_config dictionary. + _INTERFACE_NAME = 'google.cloud.dialogflow.v2.EntityTypes' + + @classmethod + def project_agent_path(cls, project): + """Return a fully-qualified project_agent string.""" + return google.api_core.path_template.expand( + 'projects/{project}/agent', + project=project, + ) + + @classmethod + def entity_type_path(cls, project, entity_type): + """Return a fully-qualified entity_type string.""" + return google.api_core.path_template.expand( + 'projects/{project}/agent/entityTypes/{entity_type}', + project=project, + entity_type=entity_type, + ) + + def __init__(self, + channel=None, + credentials=None, + client_config=entity_types_client_config.config, + client_info=None): + """Constructor. + + 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. + client_config (dict): 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. + """ + # 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 to {} are mutually ' + 'exclusive.'.format(self.__class__.__name__), ) + + # Create the channel. + if channel is None: + channel = google.api_core.grpc_helpers.create_channel( + self.SERVICE_ADDRESS, + credentials=credentials, + scopes=self._DEFAULT_SCOPES, + ) + + # Create the gRPC stubs. + self.entity_types_stub = (entity_type_pb2.EntityTypesStub(channel)) + + # Operations client for methods that return long-running operations + # futures. + self.operations_client = ( + google.api_core.operations_v1.OperationsClient(channel)) + + if client_info is None: + client_info = ( + google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) + client_info.gapic_version = _GAPIC_LIBRARY_VERSION + + # 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.) + method_configs = google.api_core.gapic_v1.config.parse_method_configs( + client_config['interfaces'][self._INTERFACE_NAME], ) + + # Write the "inner API call" methods to the class. + # These are wrapped versions of the gRPC stub methods, with retry and + # timeout configuration applied, called by the public methods on + # this class. + self._list_entity_types = google.api_core.gapic_v1.method.wrap_method( + self.entity_types_stub.ListEntityTypes, + default_retry=method_configs['ListEntityTypes'].retry, + default_timeout=method_configs['ListEntityTypes'].timeout, + client_info=client_info, + ) + self._get_entity_type = google.api_core.gapic_v1.method.wrap_method( + self.entity_types_stub.GetEntityType, + default_retry=method_configs['GetEntityType'].retry, + default_timeout=method_configs['GetEntityType'].timeout, + client_info=client_info, + ) + self._create_entity_type = google.api_core.gapic_v1.method.wrap_method( + self.entity_types_stub.CreateEntityType, + default_retry=method_configs['CreateEntityType'].retry, + default_timeout=method_configs['CreateEntityType'].timeout, + client_info=client_info, + ) + self._update_entity_type = google.api_core.gapic_v1.method.wrap_method( + self.entity_types_stub.UpdateEntityType, + default_retry=method_configs['UpdateEntityType'].retry, + default_timeout=method_configs['UpdateEntityType'].timeout, + client_info=client_info, + ) + self._delete_entity_type = google.api_core.gapic_v1.method.wrap_method( + self.entity_types_stub.DeleteEntityType, + default_retry=method_configs['DeleteEntityType'].retry, + default_timeout=method_configs['DeleteEntityType'].timeout, + client_info=client_info, + ) + self._batch_update_entity_types = google.api_core.gapic_v1.method.wrap_method( + self.entity_types_stub.BatchUpdateEntityTypes, + default_retry=method_configs['BatchUpdateEntityTypes'].retry, + default_timeout=method_configs['BatchUpdateEntityTypes'].timeout, + client_info=client_info, + ) + self._batch_delete_entity_types = google.api_core.gapic_v1.method.wrap_method( + self.entity_types_stub.BatchDeleteEntityTypes, + default_retry=method_configs['BatchDeleteEntityTypes'].retry, + default_timeout=method_configs['BatchDeleteEntityTypes'].timeout, + client_info=client_info, + ) + self._batch_create_entities = google.api_core.gapic_v1.method.wrap_method( + self.entity_types_stub.BatchCreateEntities, + default_retry=method_configs['BatchCreateEntities'].retry, + default_timeout=method_configs['BatchCreateEntities'].timeout, + client_info=client_info, + ) + self._batch_update_entities = google.api_core.gapic_v1.method.wrap_method( + self.entity_types_stub.BatchUpdateEntities, + default_retry=method_configs['BatchUpdateEntities'].retry, + default_timeout=method_configs['BatchUpdateEntities'].timeout, + client_info=client_info, + ) + self._batch_delete_entities = google.api_core.gapic_v1.method.wrap_method( + self.entity_types_stub.BatchDeleteEntities, + default_retry=method_configs['BatchDeleteEntities'].retry, + default_timeout=method_configs['BatchDeleteEntities'].timeout, + client_info=client_info, + ) + + # Service calls + def list_entity_types(self, + parent, + language_code=None, + page_size=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Returns the list of all entity types in the specified agent. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.EntityTypesClient() + >>> + >>> parent = client.project_agent_path('[PROJECT]') + >>> + >>> + >>> # Iterate over all results + >>> for element in client.list_entity_types(parent): + ... # process element + ... pass + >>> + >>> # Or iterate over results one page at a time + >>> for page in client.list_entity_types(parent, options=CallOptions(page_token=INITIAL_PAGE)): + ... for element in page: + ... # process element + ... pass + + Args: + parent (str): Required. The agent to list all entity types from. + Format: ``projects//agent``. + language_code (str): Optional. The language to list entity synonyms for. If not specified, + the agent's default language is used. + [More than a dozen + languages](https://dialogflow.com/docs/reference/language) are supported. + Note: languages must be enabled in the agent, before they can be used. + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.gax.PageIterator` instance. By default, this + is an iterable of :class:`~google.cloud.dialogflow_v2.types.EntityType` instances. + This object can also be configured to iterate over the pages + of the response through the `options` parameter. + + 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = entity_type_pb2.ListEntityTypesRequest( + parent=parent, + language_code=language_code, + page_size=page_size, + ) + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._list_entity_types, + retry=retry, + timeout=timeout, + metadata=metadata), + request=request, + items_field='entity_types', + request_token_field='page_token', + response_token_field='next_page_token', + ) + return iterator + + def get_entity_type(self, + name, + language_code=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Retrieves the specified entity type. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.EntityTypesClient() + >>> + >>> name = client.entity_type_path('[PROJECT]', '[ENTITY_TYPE]') + >>> + >>> response = client.get_entity_type(name) + + Args: + name (str): Required. The name of the entity type. + Format: ``projects//agent/entityTypes/``. + language_code (str): Optional. The language to retrieve entity synonyms for. If not specified, + the agent's default language is used. + [More than a dozen + languages](https://dialogflow.com/docs/reference/language) are supported. + Note: languages must be enabled in the agent, before they can be used. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types.EntityType` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = entity_type_pb2.GetEntityTypeRequest( + name=name, + language_code=language_code, + ) + return self._get_entity_type( + request, retry=retry, timeout=timeout, metadata=metadata) + + def create_entity_type(self, + parent, + entity_type, + language_code=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Creates an entity type in the specified agent. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.EntityTypesClient() + >>> + >>> parent = client.project_agent_path('[PROJECT]') + >>> entity_type = {} + >>> + >>> response = client.create_entity_type(parent, entity_type) + + Args: + parent (str): Required. The agent to create a entity type for. + Format: ``projects//agent``. + entity_type (Union[dict, ~google.cloud.dialogflow_v2.types.EntityType]): Required. The entity type to create. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.EntityType` + language_code (str): Optional. The language of entity synonyms defined in ``entity_type``. If not + specified, the agent's default language is used. + [More than a dozen + languages](https://dialogflow.com/docs/reference/language) are supported. + Note: languages must be enabled in the agent, before they can be used. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types.EntityType` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = entity_type_pb2.CreateEntityTypeRequest( + parent=parent, + entity_type=entity_type, + language_code=language_code, + ) + return self._create_entity_type( + request, retry=retry, timeout=timeout, metadata=metadata) + + def update_entity_type(self, + entity_type, + language_code=None, + update_mask=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Updates the specified entity type. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.EntityTypesClient() + >>> + >>> entity_type = {} + >>> + >>> response = client.update_entity_type(entity_type) + + Args: + entity_type (Union[dict, ~google.cloud.dialogflow_v2.types.EntityType]): Required. The entity type to update. + Format: ``projects//agent/entityTypes/``. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.EntityType` + language_code (str): Optional. The language of entity synonyms defined in ``entity_type``. If not + specified, the agent's default language is used. + [More than a dozen + languages](https://dialogflow.com/docs/reference/language) are supported. + Note: languages must be enabled in the agent, before they can be used. + update_mask (Union[dict, ~google.cloud.dialogflow_v2.types.FieldMask]): Optional. The mask to control which fields get updated. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.FieldMask` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types.EntityType` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = entity_type_pb2.UpdateEntityTypeRequest( + entity_type=entity_type, + language_code=language_code, + update_mask=update_mask, + ) + return self._update_entity_type( + request, retry=retry, timeout=timeout, metadata=metadata) + + def delete_entity_type(self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Deletes the specified entity type. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.EntityTypesClient() + >>> + >>> name = client.entity_type_path('[PROJECT]', '[ENTITY_TYPE]') + >>> + >>> client.delete_entity_type(name) + + Args: + name (str): Required. The name of the entity type to delete. + Format: ``projects//agent/entityTypes/``. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = entity_type_pb2.DeleteEntityTypeRequest(name=name, ) + self._delete_entity_type( + request, retry=retry, timeout=timeout, metadata=metadata) + + def batch_update_entity_types( + self, + parent, + entity_type_batch_uri=None, + entity_type_batch_inline=None, + language_code=None, + update_mask=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Updates/Creates multiple entity types in the specified agent. + + Operation + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.EntityTypesClient() + >>> + >>> parent = client.project_agent_path('[PROJECT]') + >>> + >>> response = client.batch_update_entity_types(parent) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + parent (str): Required. The name of the agent to update or create entity types in. + Format: ``projects//agent``. + entity_type_batch_uri (str): The URI to a Google Cloud Storage file containing entity types to update + or create. The file format can either be a serialized proto (of + EntityBatch type) or a JSON object. Note: The URI must start with + \"gs://\". + entity_type_batch_inline (Union[dict, ~google.cloud.dialogflow_v2.types.EntityTypeBatch]): The collection of entity type to update or create. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.EntityTypeBatch` + language_code (str): Optional. The language of entity synonyms defined in ``entity_types``. If not + specified, the agent's default language is used. + [More than a dozen + languages](https://dialogflow.com/docs/reference/language) are supported. + Note: languages must be enabled in the agent, before they can be used. + update_mask (Union[dict, ~google.cloud.dialogflow_v2.types.FieldMask]): Optional. The mask to control which fields get updated. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.FieldMask` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types._OperationFuture` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + # 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( + entity_type_batch_uri=entity_type_batch_uri, + entity_type_batch_inline=entity_type_batch_inline, + ) + + request = entity_type_pb2.BatchUpdateEntityTypesRequest( + parent=parent, + entity_type_batch_uri=entity_type_batch_uri, + entity_type_batch_inline=entity_type_batch_inline, + language_code=language_code, + update_mask=update_mask, + ) + operation = self._batch_update_entity_types( + request, retry=retry, timeout=timeout, metadata=metadata) + return google.api_core.operation.from_gapic( + operation, + self.operations_client, + entity_type_pb2.BatchUpdateEntityTypesResponse, + metadata_type=struct_pb2.Struct, + ) + + def batch_delete_entity_types( + self, + parent, + entity_type_names, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Deletes entity types in the specified agent. + + Operation + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.EntityTypesClient() + >>> + >>> parent = client.project_agent_path('[PROJECT]') + >>> entity_type_names = [] + >>> + >>> response = client.batch_delete_entity_types(parent, entity_type_names) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + parent (str): Required. The name of the agent to delete all entities types for. Format: + ``projects//agent``. + entity_type_names (list[str]): Required. The names entity types to delete. All names must point to the + same agent as ``parent``. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types._OperationFuture` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = entity_type_pb2.BatchDeleteEntityTypesRequest( + parent=parent, + entity_type_names=entity_type_names, + ) + operation = self._batch_delete_entity_types( + request, retry=retry, timeout=timeout, metadata=metadata) + return google.api_core.operation.from_gapic( + operation, + self.operations_client, + empty_pb2.Empty, + metadata_type=struct_pb2.Struct, + ) + + def batch_create_entities(self, + parent, + entities, + language_code=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Creates multiple new entities in the specified entity type (extends the + existing collection of entries). + + Operation + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.EntityTypesClient() + >>> + >>> parent = client.entity_type_path('[PROJECT]', '[ENTITY_TYPE]') + >>> entities = [] + >>> + >>> response = client.batch_create_entities(parent, entities) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + parent (str): Required. The name of the entity type to create entities in. Format: + ``projects//agent/entityTypes/``. + entities (list[Union[dict, ~google.cloud.dialogflow_v2.types.Entity]]): Required. The collection of entities to create. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.Entity` + language_code (str): Optional. The language of entity synonyms defined in ``entities``. If not + specified, the agent's default language is used. + [More than a dozen + languages](https://dialogflow.com/docs/reference/language) are supported. + Note: languages must be enabled in the agent, before they can be used. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types._OperationFuture` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = entity_type_pb2.BatchCreateEntitiesRequest( + parent=parent, + entities=entities, + language_code=language_code, + ) + operation = self._batch_create_entities( + request, retry=retry, timeout=timeout, metadata=metadata) + return google.api_core.operation.from_gapic( + operation, + self.operations_client, + empty_pb2.Empty, + metadata_type=struct_pb2.Struct, + ) + + def batch_update_entities(self, + parent, + entities, + language_code=None, + update_mask=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Updates entities in the specified entity type (replaces the existing + collection of entries). + + Operation + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.EntityTypesClient() + >>> + >>> parent = client.entity_type_path('[PROJECT]', '[ENTITY_TYPE]') + >>> entities = [] + >>> + >>> response = client.batch_update_entities(parent, entities) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + parent (str): Required. The name of the entity type to update the entities in. Format: + ``projects//agent/entityTypes/``. + entities (list[Union[dict, ~google.cloud.dialogflow_v2.types.Entity]]): Required. The collection of new entities to replace the existing entities. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.Entity` + language_code (str): Optional. The language of entity synonyms defined in ``entities``. If not + specified, the agent's default language is used. + [More than a dozen + languages](https://dialogflow.com/docs/reference/language) are supported. + Note: languages must be enabled in the agent, before they can be used. + update_mask (Union[dict, ~google.cloud.dialogflow_v2.types.FieldMask]): Optional. The mask to control which fields get updated. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.FieldMask` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types._OperationFuture` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = entity_type_pb2.BatchUpdateEntitiesRequest( + parent=parent, + entities=entities, + language_code=language_code, + update_mask=update_mask, + ) + operation = self._batch_update_entities( + request, retry=retry, timeout=timeout, metadata=metadata) + return google.api_core.operation.from_gapic( + operation, + self.operations_client, + empty_pb2.Empty, + metadata_type=struct_pb2.Struct, + ) + + def batch_delete_entities(self, + parent, + entity_values, + language_code=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Deletes entities in the specified entity type. + + Operation + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.EntityTypesClient() + >>> + >>> parent = client.entity_type_path('[PROJECT]', '[ENTITY_TYPE]') + >>> entity_values = [] + >>> + >>> response = client.batch_delete_entities(parent, entity_values) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + parent (str): Required. The name of the entity type to delete entries for. Format: + ``projects//agent/entityTypes/``. + entity_values (list[str]): Required. The canonical ``values`` of the entities to delete. Note that + these are not fully-qualified names, i.e. they don't start with + ``projects/``. + language_code (str): Optional. The language of entity synonyms defined in ``entities``. If not + specified, the agent's default language is used. + [More than a dozen + languages](https://dialogflow.com/docs/reference/language) are supported. + Note: languages must be enabled in the agent, before they can be used. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types._OperationFuture` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = entity_type_pb2.BatchDeleteEntitiesRequest( + parent=parent, + entity_values=entity_values, + language_code=language_code, + ) + operation = self._batch_delete_entities( + request, retry=retry, timeout=timeout, metadata=metadata) + return google.api_core.operation.from_gapic( + operation, + self.operations_client, + empty_pb2.Empty, + metadata_type=struct_pb2.Struct, + ) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/gapic/entity_types_client_config.py b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/entity_types_client_config.py new file mode 100755 index 000000000000..83648636f4a2 --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/entity_types_client_config.py @@ -0,0 +1,73 @@ +config = { + "interfaces": { + "google.cloud.dialogflow.v2.EntityTypes": { + "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": { + "ListEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "BatchUpdateEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchDeleteEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "BatchCreateEntities": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchUpdateEntities": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchDeleteEntities": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/gapic/enums.py b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/enums.py new file mode 100755 index 000000000000..6f49ba474870 --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/enums.py @@ -0,0 +1,234 @@ +# Copyright 2018 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. +"""Wrappers for protocol buffer enum types.""" + + +class NullValue(object): + """ + ``NullValue`` is a singleton enumeration to represent the null value for the + ``Value`` type union. + + The JSON representation for ``NullValue`` is JSON ``null``. + + Attributes: + NULL_VALUE (int): Null value. + """ + NULL_VALUE = 0 + + +class IntentView(object): + """ + Represents the options for views of an intent. + An intent can be a sizable object. Therefore, we provide a resource view that + does not return training phrases in the response by default. + + Attributes: + INTENT_VIEW_UNSPECIFIED (int): Training phrases field is not populated in the response. + INTENT_VIEW_FULL (int): All fields are populated. + """ + INTENT_VIEW_UNSPECIFIED = 0 + INTENT_VIEW_FULL = 1 + + +class AudioEncoding(object): + """ + Audio encoding of the audio content sent in the conversational query request. + Refer to the `Cloud Speech API documentation `_ for more + details. + + Attributes: + AUDIO_ENCODING_UNSPECIFIED (int): Not specified. + AUDIO_ENCODING_LINEAR_16 (int): Uncompressed 16-bit signed little-endian samples (Linear PCM). + AUDIO_ENCODING_FLAC (int): ```FLAC`` `_ (Free Lossless Audio + Codec) is the recommended encoding because it is lossless (therefore + recognition is not compromised) and requires only about half the + bandwidth of ``LINEAR16``. ``FLAC`` stream encoding supports 16-bit and + 24-bit samples, however, not all fields in ``STREAMINFO`` are supported. + AUDIO_ENCODING_MULAW (int): 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + AUDIO_ENCODING_AMR (int): Adaptive Multi-Rate Narrowband codec. ``sample_rate_hertz`` must be 8000. + AUDIO_ENCODING_AMR_WB (int): Adaptive Multi-Rate Wideband codec. ``sample_rate_hertz`` must be 16000. + AUDIO_ENCODING_OGG_OPUS (int): Opus encoded audio frames in Ogg container + (`OggOpus `_). + ``sample_rate_hertz`` must be 16000. + AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE (int): Although the use of lossy encodings is not recommended, if a very low + bitrate encoding is required, ``OGG_OPUS`` is highly preferred over + Speex encoding. The `Speex `_ encoding supported by + Dialogflow API has a header byte in each block, as in MIME type + ``audio/x-speex-with-header-byte``. + It is a variant of the RTP Speex encoding defined in + `RFC 5574 `_. + The stream is a sequence of blocks, one block per RTP packet. Each block + starts with a byte containing the length of the block, in bytes, followed + by one or more frames of Speex data, padded to an integral number of + bytes (octets) as specified in RFC 5574. In other words, each RTP header + is replaced with a single byte containing the block length. Only Speex + wideband is supported. ``sample_rate_hertz`` must be 16000. + """ + AUDIO_ENCODING_UNSPECIFIED = 0 + AUDIO_ENCODING_LINEAR_16 = 1 + AUDIO_ENCODING_FLAC = 2 + AUDIO_ENCODING_MULAW = 3 + AUDIO_ENCODING_AMR = 4 + AUDIO_ENCODING_AMR_WB = 5 + AUDIO_ENCODING_OGG_OPUS = 6 + AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7 + + +class Intent(object): + class WebhookState(object): + """ + Represents the different states that webhooks can be in. + + Attributes: + WEBHOOK_STATE_UNSPECIFIED (int): Webhook is disabled in the agent and in the intent. + WEBHOOK_STATE_ENABLED (int): Webhook is enabled in the agent and in the intent. + WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING (int): Webhook is enabled in the agent and in the intent. Also, each slot + filling prompt is forwarded to the webhook. + """ + WEBHOOK_STATE_UNSPECIFIED = 0 + WEBHOOK_STATE_ENABLED = 1 + WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2 + + class TrainingPhrase(object): + class Type(object): + """ + Represents different types of training phrases. + + Attributes: + TYPE_UNSPECIFIED (int): Not specified. This value should never be used. + EXAMPLE (int): Examples do not contain @-prefixed entity type names, but example parts + can be annotated with entity types. + TEMPLATE (int): Templates are not annotated with entity types, but they can contain + @-prefixed entity type names as substrings. + """ + TYPE_UNSPECIFIED = 0 + EXAMPLE = 1 + TEMPLATE = 2 + + class Message(object): + class Platform(object): + """ + Represents different platforms that a rich message can be intended for. + + Attributes: + PLATFORM_UNSPECIFIED (int): Not specified. + FACEBOOK (int): Facebook. + SLACK (int): Slack. + TELEGRAM (int): Telegram. + KIK (int): Kik. + SKYPE (int): Skype. + LINE (int): Line. + VIBER (int): Viber. + ACTIONS_ON_GOOGLE (int): Actions on Google. + """ + PLATFORM_UNSPECIFIED = 0 + FACEBOOK = 1 + SLACK = 2 + TELEGRAM = 3 + KIK = 4 + SKYPE = 5 + LINE = 6 + VIBER = 7 + ACTIONS_ON_GOOGLE = 8 + + +class EntityType(object): + class Kind(object): + """ + Represents kinds of entities. + + Attributes: + KIND_UNSPECIFIED (int): Not specified. This value should be never used. + KIND_MAP (int): Map entity types allow mapping of a group of synonyms to a canonical + value. + KIND_LIST (int): List entity types contain a set of entries that do not map to canonical + values. However, list entity types can contain references to other entity + types (with or without aliases). + """ + KIND_UNSPECIFIED = 0 + KIND_MAP = 1 + KIND_LIST = 2 + + class AutoExpansionMode(object): + """ + Represents different entity type expansion modes. Automated expansion + allows an agent to recognize values that have not been explicitly listed in + the entity (for example, new kinds of shopping list items). + + Attributes: + AUTO_EXPANSION_MODE_UNSPECIFIED (int): Auto expansion disabled for the entity. + AUTO_EXPANSION_MODE_DEFAULT (int): Allows an agent to recognize values that have not been explicitly + listed in the entity. + """ + AUTO_EXPANSION_MODE_UNSPECIFIED = 0 + AUTO_EXPANSION_MODE_DEFAULT = 1 + + +class SessionEntityType(object): + class EntityOverrideMode(object): + """ + The types of modifications for a session entity type. + + Attributes: + ENTITY_OVERRIDE_MODE_UNSPECIFIED (int): Not specified. This value should be never used. + ENTITY_OVERRIDE_MODE_OVERRIDE (int): The collection of session entities overrides the collection of entities + in the corresponding developer entity type. + ENTITY_OVERRIDE_MODE_SUPPLEMENT (int): The collection of session entities extends the collection of entities in + the corresponding developer entity type. + Calls to ``ListSessionEntityTypes``, ``GetSessionEntityType``, + ``CreateSessionEntityType`` and ``UpdateSessionEntityType`` return the full + collection of entities from the developer entity type in the agent's + default language and the session entity type. + """ + ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0 + ENTITY_OVERRIDE_MODE_OVERRIDE = 1 + ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2 + + +class StreamingRecognitionResult(object): + class MessageType(object): + """ + Type of the response message. + + Attributes: + MESSAGE_TYPE_UNSPECIFIED (int): Not specified. Should never be used. + TRANSCRIPT (int): Message contains a (possibly partial) transcript. + END_OF_SINGLE_UTTERANCE (int): Event indicates that the server has detected the end of the user's speech + utterance and expects no additional speech. Therefore, the server will + not process additional audio (although it may subsequently return + additional results). The client should stop sending additional audio + data, half-close the gRPC connection, and wait for any additional results + until the server closes the gRPC connection. This message is only sent if + ``single_utterance`` was set to ``true``, and is not used otherwise. + """ + MESSAGE_TYPE_UNSPECIFIED = 0 + TRANSCRIPT = 1 + END_OF_SINGLE_UTTERANCE = 2 + + +class Agent(object): + class MatchMode(object): + """ + Match mode determines how intents are detected from user queries. + + Attributes: + MATCH_MODE_UNSPECIFIED (int): Not specified. + MATCH_MODE_HYBRID (int): Best for agents with a small number of examples in intents and/or wide + use of templates syntax and composite entities. + MATCH_MODE_ML_ONLY (int): Can be used for agents with a large number of examples in intents, + especially the ones using @sys.any or very large developer entities. + """ + MATCH_MODE_UNSPECIFIED = 0 + MATCH_MODE_HYBRID = 1 + MATCH_MODE_ML_ONLY = 2 diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/gapic/intents_client.py b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/intents_client.py new file mode 100755 index 000000000000..ccc51b68eb3e --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/intents_client.py @@ -0,0 +1,687 @@ +# Copyright 2018 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.dialogflow.v2 Intents API.""" + +import functools +import pkg_resources + +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.grpc_helpers +import google.api_core.operation +import google.api_core.operations_v1 +import google.api_core.page_iterator +import google.api_core.path_template +import google.api_core.protobuf_helpers + +from google.protobuf import empty_pb2 +from google.protobuf import field_mask_pb2 +from google.protobuf import struct_pb2 + +from dialogflow_v2.gapic import enums +from dialogflow_v2.gapic import intents_client_config +from dialogflow_v2.proto import agent_pb2 +from dialogflow_v2.proto import context_pb2 +from dialogflow_v2.proto import entity_type_pb2 +from dialogflow_v2.proto import intent_pb2 + +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( + 'dialogflow', +).version + + +class IntentsClient(object): + """ + Manages agent intents. + + + Refer to the `Dialogflow documentation `__ + for more details about agent intents. + # + """ + + SERVICE_ADDRESS = 'dialogflow.googleapis.com:443' + """The default address of the service.""" + + # The scopes needed to make gRPC calls to all of the methods defined in + # this service + _DEFAULT_SCOPES = ('https://www.googleapis.com/auth/cloud-platform', ) + + # The name of the interface for this client. This is the key used to find + # method configuration in the client_config dictionary. + _INTERFACE_NAME = 'google.cloud.dialogflow.v2.Intents' + + @classmethod + def project_agent_path(cls, project): + """Return a fully-qualified project_agent string.""" + return google.api_core.path_template.expand( + 'projects/{project}/agent', + project=project, + ) + + @classmethod + def intent_path(cls, project, intent): + """Return a fully-qualified intent string.""" + return google.api_core.path_template.expand( + 'projects/{project}/agent/intents/{intent}', + project=project, + intent=intent, + ) + + @classmethod + def agent_path(cls, project, agent): + """Return a fully-qualified agent string.""" + return google.api_core.path_template.expand( + 'projects/{project}/agents/{agent}', + project=project, + agent=agent, + ) + + def __init__(self, + channel=None, + credentials=None, + client_config=intents_client_config.config, + client_info=None): + """Constructor. + + 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. + client_config (dict): 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. + """ + # 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 to {} are mutually ' + 'exclusive.'.format(self.__class__.__name__), ) + + # Create the channel. + if channel is None: + channel = google.api_core.grpc_helpers.create_channel( + self.SERVICE_ADDRESS, + credentials=credentials, + scopes=self._DEFAULT_SCOPES, + ) + + # Create the gRPC stubs. + self.intents_stub = (intent_pb2.IntentsStub(channel)) + + # Operations client for methods that return long-running operations + # futures. + self.operations_client = ( + google.api_core.operations_v1.OperationsClient(channel)) + + if client_info is None: + client_info = ( + google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) + client_info.gapic_version = _GAPIC_LIBRARY_VERSION + + # 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.) + method_configs = google.api_core.gapic_v1.config.parse_method_configs( + client_config['interfaces'][self._INTERFACE_NAME], ) + + # Write the "inner API call" methods to the class. + # These are wrapped versions of the gRPC stub methods, with retry and + # timeout configuration applied, called by the public methods on + # this class. + self._list_intents = google.api_core.gapic_v1.method.wrap_method( + self.intents_stub.ListIntents, + default_retry=method_configs['ListIntents'].retry, + default_timeout=method_configs['ListIntents'].timeout, + client_info=client_info, + ) + self._get_intent = google.api_core.gapic_v1.method.wrap_method( + self.intents_stub.GetIntent, + default_retry=method_configs['GetIntent'].retry, + default_timeout=method_configs['GetIntent'].timeout, + client_info=client_info, + ) + self._create_intent = google.api_core.gapic_v1.method.wrap_method( + self.intents_stub.CreateIntent, + default_retry=method_configs['CreateIntent'].retry, + default_timeout=method_configs['CreateIntent'].timeout, + client_info=client_info, + ) + self._update_intent = google.api_core.gapic_v1.method.wrap_method( + self.intents_stub.UpdateIntent, + default_retry=method_configs['UpdateIntent'].retry, + default_timeout=method_configs['UpdateIntent'].timeout, + client_info=client_info, + ) + self._delete_intent = google.api_core.gapic_v1.method.wrap_method( + self.intents_stub.DeleteIntent, + default_retry=method_configs['DeleteIntent'].retry, + default_timeout=method_configs['DeleteIntent'].timeout, + client_info=client_info, + ) + self._batch_update_intents = google.api_core.gapic_v1.method.wrap_method( + self.intents_stub.BatchUpdateIntents, + default_retry=method_configs['BatchUpdateIntents'].retry, + default_timeout=method_configs['BatchUpdateIntents'].timeout, + client_info=client_info, + ) + self._batch_delete_intents = google.api_core.gapic_v1.method.wrap_method( + self.intents_stub.BatchDeleteIntents, + default_retry=method_configs['BatchDeleteIntents'].retry, + default_timeout=method_configs['BatchDeleteIntents'].timeout, + client_info=client_info, + ) + + # Service calls + def list_intents(self, + parent, + language_code=None, + intent_view=None, + page_size=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Returns the list of all intents in the specified agent. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.IntentsClient() + >>> + >>> parent = client.project_agent_path('[PROJECT]') + >>> + >>> + >>> # Iterate over all results + >>> for element in client.list_intents(parent): + ... # process element + ... pass + >>> + >>> # Or iterate over results one page at a time + >>> for page in client.list_intents(parent, options=CallOptions(page_token=INITIAL_PAGE)): + ... for element in page: + ... # process element + ... pass + + Args: + parent (str): Required. The agent to list all intents from. + Format: ``projects//agent``. + language_code (str): Optional. The language to list training phrases, parameters and rich + messages for. If not specified, the agent's default language is used. + [More than a dozen + languages](https://dialogflow.com/docs/reference/language) are supported. + Note: languages must be enabled in the agent before they can be used. + intent_view (~google.cloud.dialogflow_v2.types.IntentView): Optional. The resource view to apply to the returned intent. + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.gax.PageIterator` instance. By default, this + is an iterable of :class:`~google.cloud.dialogflow_v2.types.Intent` instances. + This object can also be configured to iterate over the pages + of the response through the `options` parameter. + + 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = intent_pb2.ListIntentsRequest( + parent=parent, + language_code=language_code, + intent_view=intent_view, + page_size=page_size, + ) + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._list_intents, + retry=retry, + timeout=timeout, + metadata=metadata), + request=request, + items_field='intents', + request_token_field='page_token', + response_token_field='next_page_token', + ) + return iterator + + def get_intent(self, + name, + language_code=None, + intent_view=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Retrieves the specified intent. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.IntentsClient() + >>> + >>> name = client.intent_path('[PROJECT]', '[INTENT]') + >>> + >>> response = client.get_intent(name) + + Args: + name (str): Required. The name of the intent. + Format: ``projects//agent/intents/``. + language_code (str): Optional. The language to retrieve training phrases, parameters and rich + messages for. If not specified, the agent's default language is used. + [More than a dozen + languages](https://dialogflow.com/docs/reference/language) are supported. + Note: languages must be enabled in the agent, before they can be used. + intent_view (~google.cloud.dialogflow_v2.types.IntentView): Optional. The resource view to apply to the returned intent. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types.Intent` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = intent_pb2.GetIntentRequest( + name=name, + language_code=language_code, + intent_view=intent_view, + ) + return self._get_intent( + request, retry=retry, timeout=timeout, metadata=metadata) + + def create_intent(self, + parent, + intent, + language_code=None, + intent_view=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Creates an intent in the specified agent. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.IntentsClient() + >>> + >>> parent = client.project_agent_path('[PROJECT]') + >>> intent = {} + >>> + >>> response = client.create_intent(parent, intent) + + Args: + parent (str): Required. The agent to create a intent for. + Format: ``projects//agent``. + intent (Union[dict, ~google.cloud.dialogflow_v2.types.Intent]): Required. The intent to create. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.Intent` + language_code (str): Optional. The language of training phrases, parameters and rich messages + defined in ``intent``. If not specified, the agent's default language is + used. [More than a dozen + languages](https://dialogflow.com/docs/reference/language) are supported. + Note: languages must be enabled in the agent, before they can be used. + intent_view (~google.cloud.dialogflow_v2.types.IntentView): Optional. The resource view to apply to the returned intent. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types.Intent` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = intent_pb2.CreateIntentRequest( + parent=parent, + intent=intent, + language_code=language_code, + intent_view=intent_view, + ) + return self._create_intent( + request, retry=retry, timeout=timeout, metadata=metadata) + + def update_intent(self, + intent, + language_code, + update_mask=None, + intent_view=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Updates the specified intent. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.IntentsClient() + >>> + >>> intent = {} + >>> language_code = '' + >>> + >>> response = client.update_intent(intent, language_code) + + Args: + intent (Union[dict, ~google.cloud.dialogflow_v2.types.Intent]): Required. The intent to update. + Format: ``projects//agent/intents/``. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.Intent` + language_code (str): Optional. The language of training phrases, parameters and rich messages + defined in ``intent``. If not specified, the agent's default language is + used. [More than a dozen + languages](https://dialogflow.com/docs/reference/language) are supported. + Note: languages must be enabled in the agent, before they can be used. + update_mask (Union[dict, ~google.cloud.dialogflow_v2.types.FieldMask]): Optional. The mask to control which fields get updated. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.FieldMask` + intent_view (~google.cloud.dialogflow_v2.types.IntentView): Optional. The resource view to apply to the returned intent. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types.Intent` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = intent_pb2.UpdateIntentRequest( + intent=intent, + language_code=language_code, + update_mask=update_mask, + intent_view=intent_view, + ) + return self._update_intent( + request, retry=retry, timeout=timeout, metadata=metadata) + + def delete_intent(self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Deletes the specified intent. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.IntentsClient() + >>> + >>> name = client.intent_path('[PROJECT]', '[INTENT]') + >>> + >>> client.delete_intent(name) + + Args: + name (str): Required. The name of the intent to delete. + Format: ``projects//agent/intents/``. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = intent_pb2.DeleteIntentRequest(name=name, ) + self._delete_intent( + request, retry=retry, timeout=timeout, metadata=metadata) + + def batch_update_intents(self, + parent, + language_code, + intent_batch_uri=None, + intent_batch_inline=None, + update_mask=None, + intent_view=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Updates/Creates multiple intents in the specified agent. + + Operation + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.IntentsClient() + >>> + >>> parent = client.agent_path('[PROJECT]', '[AGENT]') + >>> language_code = '' + >>> + >>> response = client.batch_update_intents(parent, language_code) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + parent (str): Required. The name of the agent to update or create intents in. + Format: ``projects//agent``. + language_code (str): Optional. The language of training phrases, parameters and rich messages + defined in ``intents``. If not specified, the agent's default language is + used. [More than a dozen + languages](https://dialogflow.com/docs/reference/language) are supported. + Note: languages must be enabled in the agent, before they can be used. + intent_batch_uri (str): The URI to a Google Cloud Storage file containing intents to update or + create. The file format can either be a serialized proto (of IntentBatch + type) or JSON object. Note: The URI must start with \"gs://\". + intent_batch_inline (Union[dict, ~google.cloud.dialogflow_v2.types.IntentBatch]): The collection of intents to update or create. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.IntentBatch` + update_mask (Union[dict, ~google.cloud.dialogflow_v2.types.FieldMask]): Optional. The mask to control which fields get updated. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.FieldMask` + intent_view (~google.cloud.dialogflow_v2.types.IntentView): Optional. The resource view to apply to the returned intent. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types._OperationFuture` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + # 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( + intent_batch_uri=intent_batch_uri, + intent_batch_inline=intent_batch_inline, + ) + + request = intent_pb2.BatchUpdateIntentsRequest( + parent=parent, + language_code=language_code, + intent_batch_uri=intent_batch_uri, + intent_batch_inline=intent_batch_inline, + update_mask=update_mask, + intent_view=intent_view, + ) + operation = self._batch_update_intents( + request, retry=retry, timeout=timeout, metadata=metadata) + return google.api_core.operation.from_gapic( + operation, + self.operations_client, + intent_pb2.BatchUpdateIntentsResponse, + metadata_type=struct_pb2.Struct, + ) + + def batch_delete_intents(self, + parent, + intents, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Deletes intents in the specified agent. + + Operation + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.IntentsClient() + >>> + >>> parent = client.project_path('[PROJECT]') + >>> intents = [] + >>> + >>> response = client.batch_delete_intents(parent, intents) + >>> + >>> def callback(operation_future): + ... # Handle result. + ... result = operation_future.result() + >>> + >>> response.add_done_callback(callback) + >>> + >>> # Handle metadata. + >>> metadata = response.metadata() + + Args: + parent (str): Required. The name of the agent to delete all entities types for. Format: + ``projects//agent``. + intents (list[Union[dict, ~google.cloud.dialogflow_v2.types.Intent]]): Required. The collection of intents to delete. Only intent ``name`` must be + filled in. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.Intent` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types._OperationFuture` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = intent_pb2.BatchDeleteIntentsRequest( + parent=parent, + intents=intents, + ) + operation = self._batch_delete_intents( + request, retry=retry, timeout=timeout, metadata=metadata) + return google.api_core.operation.from_gapic( + operation, + self.operations_client, + empty_pb2.Empty, + metadata_type=struct_pb2.Struct, + ) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/gapic/intents_client_config.py b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/intents_client_config.py new file mode 100755 index 000000000000..5d47092f5ef8 --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/intents_client_config.py @@ -0,0 +1,58 @@ +config = { + "interfaces": { + "google.cloud.dialogflow.v2.Intents": { + "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": { + "ListIntents": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetIntent": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateIntent": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateIntent": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteIntent": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "BatchUpdateIntents": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchDeleteIntents": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/gapic/session_entity_types_client.py b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/session_entity_types_client.py new file mode 100755 index 000000000000..a6e94f6d8747 --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/session_entity_types_client.py @@ -0,0 +1,459 @@ +# Copyright 2018 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.dialogflow.v2 SessionEntityTypes API.""" + +import functools +import pkg_resources + +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.grpc_helpers +import google.api_core.page_iterator +import google.api_core.path_template + +from google.protobuf import empty_pb2 +from google.protobuf import field_mask_pb2 +from google.protobuf import struct_pb2 + +from dialogflow_v2.gapic import enums +from dialogflow_v2.gapic import session_entity_types_client_config +from dialogflow_v2.proto import agent_pb2 +from dialogflow_v2.proto import context_pb2 +from dialogflow_v2.proto import entity_type_pb2 +from dialogflow_v2.proto import intent_pb2 +from dialogflow_v2.proto import session_entity_type_pb2 + +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( + 'dialogflow', +).version + + +class SessionEntityTypesClient(object): + """ + Manages session entity types. + + Session entity types can be redefined on a session level, allowing for + specific concepts, like a user's playlists. + + # + """ + + SERVICE_ADDRESS = 'dialogflow.googleapis.com:443' + """The default address of the service.""" + + # The scopes needed to make gRPC calls to all of the methods defined in + # this service + _DEFAULT_SCOPES = ('https://www.googleapis.com/auth/cloud-platform', ) + + # The name of the interface for this client. This is the key used to find + # method configuration in the client_config dictionary. + _INTERFACE_NAME = 'google.cloud.dialogflow.v2.SessionEntityTypes' + + @classmethod + def session_path(cls, project, session): + """Return a fully-qualified session string.""" + return google.api_core.path_template.expand( + 'projects/{project}/agent/sessions/{session}', + project=project, + session=session, + ) + + @classmethod + def session_entity_type_path(cls, project, session, entity_type): + """Return a fully-qualified session_entity_type string.""" + return google.api_core.path_template.expand( + 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}', + project=project, + session=session, + entity_type=entity_type, + ) + + def __init__(self, + channel=None, + credentials=None, + client_config=session_entity_types_client_config.config, + client_info=None): + """Constructor. + + 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. + client_config (dict): 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. + """ + # 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 to {} are mutually ' + 'exclusive.'.format(self.__class__.__name__), ) + + # Create the channel. + if channel is None: + channel = google.api_core.grpc_helpers.create_channel( + self.SERVICE_ADDRESS, + credentials=credentials, + scopes=self._DEFAULT_SCOPES, + ) + + # Create the gRPC stubs. + self.session_entity_types_stub = ( + session_entity_type_pb2.SessionEntityTypesStub(channel)) + + if client_info is None: + client_info = ( + google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) + client_info.gapic_version = _GAPIC_LIBRARY_VERSION + + # 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.) + method_configs = google.api_core.gapic_v1.config.parse_method_configs( + client_config['interfaces'][self._INTERFACE_NAME], ) + + # Write the "inner API call" methods to the class. + # These are wrapped versions of the gRPC stub methods, with retry and + # timeout configuration applied, called by the public methods on + # this class. + self._list_session_entity_types = google.api_core.gapic_v1.method.wrap_method( + self.session_entity_types_stub.ListSessionEntityTypes, + default_retry=method_configs['ListSessionEntityTypes'].retry, + default_timeout=method_configs['ListSessionEntityTypes'].timeout, + client_info=client_info, + ) + self._get_session_entity_type = google.api_core.gapic_v1.method.wrap_method( + self.session_entity_types_stub.GetSessionEntityType, + default_retry=method_configs['GetSessionEntityType'].retry, + default_timeout=method_configs['GetSessionEntityType'].timeout, + client_info=client_info, + ) + self._create_session_entity_type = google.api_core.gapic_v1.method.wrap_method( + self.session_entity_types_stub.CreateSessionEntityType, + default_retry=method_configs['CreateSessionEntityType'].retry, + default_timeout=method_configs['CreateSessionEntityType'].timeout, + client_info=client_info, + ) + self._update_session_entity_type = google.api_core.gapic_v1.method.wrap_method( + self.session_entity_types_stub.UpdateSessionEntityType, + default_retry=method_configs['UpdateSessionEntityType'].retry, + default_timeout=method_configs['UpdateSessionEntityType'].timeout, + client_info=client_info, + ) + self._delete_session_entity_type = google.api_core.gapic_v1.method.wrap_method( + self.session_entity_types_stub.DeleteSessionEntityType, + default_retry=method_configs['DeleteSessionEntityType'].retry, + default_timeout=method_configs['DeleteSessionEntityType'].timeout, + client_info=client_info, + ) + + # Service calls + def list_session_entity_types( + self, + parent, + page_size=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Returns the list of all session entity types in the specified session. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.SessionEntityTypesClient() + >>> + >>> parent = client.session_path('[PROJECT]', '[SESSION]') + >>> + >>> + >>> # Iterate over all results + >>> for element in client.list_session_entity_types(parent): + ... # process element + ... pass + >>> + >>> # Or iterate over results one page at a time + >>> for page in client.list_session_entity_types(parent, options=CallOptions(page_token=INITIAL_PAGE)): + ... for element in page: + ... # process element + ... pass + + Args: + parent (str): Required. The session to list all session entity types from. + Format: ``projects//agent/sessions/``. + page_size (int): The maximum number of resources contained in the + underlying API response. If page streaming is performed per- + resource, this parameter does not affect the return value. If page + streaming is performed per-page, this determines the maximum number + of resources in a page. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.gax.PageIterator` instance. By default, this + is an iterable of :class:`~google.cloud.dialogflow_v2.types.SessionEntityType` instances. + This object can also be configured to iterate over the pages + of the response through the `options` parameter. + + 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = session_entity_type_pb2.ListSessionEntityTypesRequest( + parent=parent, + page_size=page_size, + ) + iterator = google.api_core.page_iterator.GRPCIterator( + client=None, + method=functools.partial( + self._list_session_entity_types, + retry=retry, + timeout=timeout, + metadata=metadata), + request=request, + items_field='session_entity_types', + request_token_field='page_token', + response_token_field='next_page_token', + ) + return iterator + + def get_session_entity_type( + self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Retrieves the specified session entity type. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.SessionEntityTypesClient() + >>> + >>> name = client.session_entity_type_path('[PROJECT]', '[SESSION]', '[ENTITY_TYPE]') + >>> + >>> response = client.get_session_entity_type(name) + + Args: + name (str): Required. The name of the session entity type. Format: + ``projects//agent/sessions//entityTypes/``. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types.SessionEntityType` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = session_entity_type_pb2.GetSessionEntityTypeRequest( + name=name, ) + return self._get_session_entity_type( + request, retry=retry, timeout=timeout, metadata=metadata) + + def create_session_entity_type( + self, + parent, + session_entity_type, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Creates a session entity type. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.SessionEntityTypesClient() + >>> + >>> parent = client.session_path('[PROJECT]', '[SESSION]') + >>> session_entity_type = {} + >>> + >>> response = client.create_session_entity_type(parent, session_entity_type) + + Args: + parent (str): Required. The session to create a session entity type for. + Format: ``projects//agent/sessions/``. + session_entity_type (Union[dict, ~google.cloud.dialogflow_v2.types.SessionEntityType]): Required. The session entity type to create. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.SessionEntityType` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types.SessionEntityType` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = session_entity_type_pb2.CreateSessionEntityTypeRequest( + parent=parent, + session_entity_type=session_entity_type, + ) + return self._create_session_entity_type( + request, retry=retry, timeout=timeout, metadata=metadata) + + def update_session_entity_type( + self, + session_entity_type, + update_mask=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Updates the specified session entity type. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.SessionEntityTypesClient() + >>> + >>> session_entity_type = {} + >>> + >>> response = client.update_session_entity_type(session_entity_type) + + Args: + session_entity_type (Union[dict, ~google.cloud.dialogflow_v2.types.SessionEntityType]): Required. The entity type to update. Format: + ``projects//agent/sessions//entityTypes/``. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.SessionEntityType` + update_mask (Union[dict, ~google.cloud.dialogflow_v2.types.FieldMask]): Optional. The mask to control which fields get updated. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.FieldMask` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types.SessionEntityType` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = session_entity_type_pb2.UpdateSessionEntityTypeRequest( + session_entity_type=session_entity_type, + update_mask=update_mask, + ) + return self._update_session_entity_type( + request, retry=retry, timeout=timeout, metadata=metadata) + + def delete_session_entity_type( + self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Deletes the specified session entity type. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.SessionEntityTypesClient() + >>> + >>> name = client.session_entity_type_path('[PROJECT]', '[SESSION]', '[ENTITY_TYPE]') + >>> + >>> client.delete_session_entity_type(name) + + Args: + name (str): Required. The name of the entity type to delete. Format: + ``projects//agent/sessions//entityTypes/``. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = session_entity_type_pb2.DeleteSessionEntityTypeRequest( + name=name, ) + self._delete_session_entity_type( + request, retry=retry, timeout=timeout, metadata=metadata) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/gapic/session_entity_types_client_config.py b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/session_entity_types_client_config.py new file mode 100755 index 000000000000..2a98f374b8cd --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/session_entity_types_client_config.py @@ -0,0 +1,48 @@ +config = { + "interfaces": { + "google.cloud.dialogflow.v2.SessionEntityTypes": { + "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": { + "ListSessionEntityTypes": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSessionEntityType": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/gapic/sessions_client.py b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/sessions_client.py new file mode 100755 index 000000000000..5c502738dbee --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/sessions_client.py @@ -0,0 +1,273 @@ +# Copyright 2018 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.dialogflow.v2 Sessions API.""" + +import pkg_resources + +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.grpc_helpers +import google.api_core.path_template + +from google.protobuf import empty_pb2 +from google.protobuf import field_mask_pb2 +from google.protobuf import struct_pb2 + +from dialogflow_v2.gapic import enums +from dialogflow_v2.gapic import sessions_client_config +from dialogflow_v2.proto import agent_pb2 +from dialogflow_v2.proto import context_pb2 +from dialogflow_v2.proto import entity_type_pb2 +from dialogflow_v2.proto import intent_pb2 +from dialogflow_v2.proto import session_entity_type_pb2 +from dialogflow_v2.proto import session_pb2 + +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( + 'dialogflow', +).version + + +class SessionsClient(object): + """ + Manages user sessions. + + # + """ + + SERVICE_ADDRESS = 'dialogflow.googleapis.com:443' + """The default address of the service.""" + + # The scopes needed to make gRPC calls to all of the methods defined in + # this service + _DEFAULT_SCOPES = ('https://www.googleapis.com/auth/cloud-platform', ) + + # The name of the interface for this client. This is the key used to find + # method configuration in the client_config dictionary. + _INTERFACE_NAME = 'google.cloud.dialogflow.v2.Sessions' + + @classmethod + def session_path(cls, project, session): + """Return a fully-qualified session string.""" + return google.api_core.path_template.expand( + 'projects/{project}/agent/sessions/{session}', + project=project, + session=session, + ) + + def __init__(self, + channel=None, + credentials=None, + client_config=sessions_client_config.config, + client_info=None): + """Constructor. + + 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. + client_config (dict): 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. + """ + # 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 to {} are mutually ' + 'exclusive.'.format(self.__class__.__name__), ) + + # Create the channel. + if channel is None: + channel = google.api_core.grpc_helpers.create_channel( + self.SERVICE_ADDRESS, + credentials=credentials, + scopes=self._DEFAULT_SCOPES, + ) + + # Create the gRPC stubs. + self.sessions_stub = (session_pb2.SessionsStub(channel)) + + if client_info is None: + client_info = ( + google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO) + client_info.gapic_version = _GAPIC_LIBRARY_VERSION + + # 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.) + method_configs = google.api_core.gapic_v1.config.parse_method_configs( + client_config['interfaces'][self._INTERFACE_NAME], ) + + # Write the "inner API call" methods to the class. + # These are wrapped versions of the gRPC stub methods, with retry and + # timeout configuration applied, called by the public methods on + # this class. + self._detect_intent = google.api_core.gapic_v1.method.wrap_method( + self.sessions_stub.DetectIntent, + default_retry=method_configs['DetectIntent'].retry, + default_timeout=method_configs['DetectIntent'].timeout, + client_info=client_info, + ) + self._streaming_detect_intent = google.api_core.gapic_v1.method.wrap_method( + self.sessions_stub.StreamingDetectIntent, + default_retry=method_configs['StreamingDetectIntent'].retry, + default_timeout=method_configs['StreamingDetectIntent'].timeout, + client_info=client_info, + ) + + # Service calls + def detect_intent(self, + session, + query_input, + query_params=None, + input_audio=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Processes a natural language query and returns structured, actionable data + as a result. This method is not idempotent, because it may cause contexts + and session entity types to be updated, which in turn might affect + results of future queries. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.SessionsClient() + >>> + >>> session = client.session_path('[PROJECT]', '[SESSION]') + >>> query_input = {} + >>> + >>> response = client.detect_intent(session, query_input) + + Args: + session (str): Required. The name of the session this query is sent to. Format: + ``projects//agent/sessions/``. + It's up to the API caller to choose an appropriate session ID. It can be + a random number or some type of user identifier (preferably hashed). + The length of the session ID must not exceed 36 bytes. + query_input (Union[dict, ~google.cloud.dialogflow_v2.types.QueryInput]): Required. The input specification. It can be set to: + + 1. an audio config + :: + + which instructs the speech recognizer how to process the speech audio, + + 2. a conversational query in the form of text, or + + 3. an event that specifies which intent to trigger. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.QueryInput` + query_params (Union[dict, ~google.cloud.dialogflow_v2.types.QueryParameters]): Optional. The parameters of this query. + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.dialogflow_v2.types.QueryParameters` + input_audio (bytes): Optional. The natural language speech audio to be processed. This field + should be populated iff ``query_input`` is set to an input audio config. + A single request can contain up to 1 minute of speech audio data. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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.dialogflow_v2.types.DetectIntentResponse` 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + request = session_pb2.DetectIntentRequest( + session=session, + query_input=query_input, + query_params=query_params, + input_audio=input_audio, + ) + return self._detect_intent( + request, retry=retry, timeout=timeout, metadata=metadata) + + def streaming_detect_intent( + self, + requests, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None): + """ + Processes a natural language query in audio format in a streaming fashion + and returns structured, actionable data as a result. This method is only + available via the gRPC API (not REST). + + EXPERIMENTAL: This method interface might change in the future. + + Example: + >>> from google.cloud import dialogflow_v2 + >>> + >>> client = dialogflow_v2.SessionsClient() + >>> + >>> session = '' + >>> query_input = {} + >>> request = {'session': session, 'query_input': query_input} + >>> + >>> requests = [request] + >>> for element in client.streaming_detect_intent(requests): + ... # process element + ... pass + + Args: + requests (iterator[dict|google.cloud.dialogflow_v2.proto.session_pb2.StreamingDetectIntentRequest]): The input objects. If a dict is provided, it must be of the + same form as the protobuf message :class:`~google.cloud.dialogflow_v2.types.StreamingDetectIntentRequest` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will not + be retried. + 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: + Iterable[~google.cloud.dialogflow_v2.types.StreamingDetectIntentResponse]. + + 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. + """ + if metadata is None: + metadata = [] + metadata = list(metadata) + return self._streaming_detect_intent( + requests, retry=retry, timeout=timeout, metadata=metadata) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/gapic/sessions_client_config.py b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/sessions_client_config.py new file mode 100755 index 000000000000..942de29efb0f --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/gapic/sessions_client_config.py @@ -0,0 +1,33 @@ +config = { + "interfaces": { + "google.cloud.dialogflow.v2.Sessions": { + "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": { + "DetectIntent": { + "timeout_millis": 220000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StreamingDetectIntent": { + "timeout_millis": 220000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/proto/__init__.py b/packages/google-cloud-dialogflow/dialogflow_v2/proto/__init__.py new file mode 100755 index 000000000000..e69de29bb2d1 diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/proto/agent_pb2.py b/packages/google-cloud-dialogflow/dialogflow_v2/proto/agent_pb2.py new file mode 100755 index 000000000000..5c69ffe55c1a --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/proto/agent_pb2.py @@ -0,0 +1,1129 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow_v2/proto/agent.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 +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.longrunning import operations_pb2 as google_dot_longrunning_dot_operations__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 +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='google/cloud/dialogflow_v2/proto/agent.proto', + package='google.cloud.dialogflow.v2', + syntax='proto3', + serialized_pb=_b('\n,google/cloud/dialogflow_v2/proto/agent.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xfd\x02\n\x05\x41gent\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x1d\n\x15\x64\x65\x66\x61ult_language_code\x18\x03 \x01(\t\x12 \n\x18supported_language_codes\x18\x04 \x03(\t\x12\x11\n\ttime_zone\x18\x05 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x12\n\navatar_uri\x18\x07 \x01(\t\x12\x16\n\x0e\x65nable_logging\x18\x08 \x01(\x08\x12?\n\nmatch_mode\x18\t \x01(\x0e\x32+.google.cloud.dialogflow.v2.Agent.MatchMode\x12 \n\x18\x63lassification_threshold\x18\n \x01(\x02\"V\n\tMatchMode\x12\x1a\n\x16MATCH_MODE_UNSPECIFIED\x10\x00\x12\x15\n\x11MATCH_MODE_HYBRID\x10\x01\x12\x16\n\x12MATCH_MODE_ML_ONLY\x10\x02\"!\n\x0fGetAgentRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\"L\n\x13SearchAgentsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"b\n\x14SearchAgentsResponse\x12\x31\n\x06\x61gents\x18\x01 \x03(\x0b\x32!.google.cloud.dialogflow.v2.Agent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"#\n\x11TrainAgentRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\"7\n\x12\x45xportAgentRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x11\n\tagent_uri\x18\x02 \x01(\t\"L\n\x13\x45xportAgentResponse\x12\x13\n\tagent_uri\x18\x01 \x01(\tH\x00\x12\x17\n\ragent_content\x18\x02 \x01(\x0cH\x00\x42\x07\n\x05\x61gent\"[\n\x12ImportAgentRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x13\n\tagent_uri\x18\x02 \x01(\tH\x00\x12\x17\n\ragent_content\x18\x03 \x01(\x0cH\x00\x42\x07\n\x05\x61gent\"\\\n\x13RestoreAgentRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x13\n\tagent_uri\x18\x02 \x01(\tH\x00\x12\x17\n\ragent_content\x18\x03 \x01(\x0cH\x00\x42\x07\n\x05\x61gent2\xee\x06\n\x06\x41gents\x12\x81\x01\n\x08GetAgent\x12+.google.cloud.dialogflow.v2.GetAgentRequest\x1a!.google.cloud.dialogflow.v2.Agent\"%\x82\xd3\xe4\x93\x02\x1f\x12\x1d/v2/{parent=projects/*}/agent\x12\x9f\x01\n\x0cSearchAgents\x12/.google.cloud.dialogflow.v2.SearchAgentsRequest\x1a\x30.google.cloud.dialogflow.v2.SearchAgentsResponse\",\x82\xd3\xe4\x93\x02&\x12$/v2/{parent=projects/*}/agent:search\x12\x8a\x01\n\nTrainAgent\x12-.google.cloud.dialogflow.v2.TrainAgentRequest\x1a\x1d.google.longrunning.Operation\".\x82\xd3\xe4\x93\x02(\"#/v2/{parent=projects/*}/agent:train:\x01*\x12\x8d\x01\n\x0b\x45xportAgent\x12..google.cloud.dialogflow.v2.ExportAgentRequest\x1a\x1d.google.longrunning.Operation\"/\x82\xd3\xe4\x93\x02)\"$/v2/{parent=projects/*}/agent:export:\x01*\x12\x8d\x01\n\x0bImportAgent\x12..google.cloud.dialogflow.v2.ImportAgentRequest\x1a\x1d.google.longrunning.Operation\"/\x82\xd3\xe4\x93\x02)\"$/v2/{parent=projects/*}/agent:import:\x01*\x12\x90\x01\n\x0cRestoreAgent\x12/.google.cloud.dialogflow.v2.RestoreAgentRequest\x1a\x1d.google.longrunning.Operation\"0\x82\xd3\xe4\x93\x02*\"%/v2/{parent=projects/*}/agent:restore:\x01*B\x99\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\nAgentProtoP\x01ZDgoogle.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow\xf8\x01\x01\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3') + , + dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR,google_dot_longrunning_dot_operations__pb2.DESCRIPTOR,google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR,google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,]) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + +_AGENT_MATCHMODE = _descriptor.EnumDescriptor( + name='MatchMode', + full_name='google.cloud.dialogflow.v2.Agent.MatchMode', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='MATCH_MODE_UNSPECIFIED', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='MATCH_MODE_HYBRID', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='MATCH_MODE_ML_ONLY', index=2, number=2, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=532, + serialized_end=618, +) +_sym_db.RegisterEnumDescriptor(_AGENT_MATCHMODE) + + +_AGENT = _descriptor.Descriptor( + name='Agent', + full_name='google.cloud.dialogflow.v2.Agent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.Agent.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, + options=None), + _descriptor.FieldDescriptor( + name='display_name', full_name='google.cloud.dialogflow.v2.Agent.display_name', 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, + options=None), + _descriptor.FieldDescriptor( + name='default_language_code', full_name='google.cloud.dialogflow.v2.Agent.default_language_code', index=2, + 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, + options=None), + _descriptor.FieldDescriptor( + name='supported_language_codes', full_name='google.cloud.dialogflow.v2.Agent.supported_language_codes', index=3, + number=4, 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, + options=None), + _descriptor.FieldDescriptor( + name='time_zone', full_name='google.cloud.dialogflow.v2.Agent.time_zone', index=4, + number=5, 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, + options=None), + _descriptor.FieldDescriptor( + name='description', full_name='google.cloud.dialogflow.v2.Agent.description', index=5, + number=6, 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, + options=None), + _descriptor.FieldDescriptor( + name='avatar_uri', full_name='google.cloud.dialogflow.v2.Agent.avatar_uri', index=6, + number=7, 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, + options=None), + _descriptor.FieldDescriptor( + name='enable_logging', full_name='google.cloud.dialogflow.v2.Agent.enable_logging', index=7, + number=8, 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, + options=None), + _descriptor.FieldDescriptor( + name='match_mode', full_name='google.cloud.dialogflow.v2.Agent.match_mode', index=8, + number=9, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='classification_threshold', full_name='google.cloud.dialogflow.v2.Agent.classification_threshold', index=9, + number=10, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _AGENT_MATCHMODE, + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=237, + serialized_end=618, +) + + +_GETAGENTREQUEST = _descriptor.Descriptor( + name='GetAgentRequest', + full_name='google.cloud.dialogflow.v2.GetAgentRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.GetAgentRequest.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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=620, + serialized_end=653, +) + + +_SEARCHAGENTSREQUEST = _descriptor.Descriptor( + name='SearchAgentsRequest', + full_name='google.cloud.dialogflow.v2.SearchAgentsRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.SearchAgentsRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='page_size', full_name='google.cloud.dialogflow.v2.SearchAgentsRequest.page_size', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='page_token', full_name='google.cloud.dialogflow.v2.SearchAgentsRequest.page_token', index=2, + 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=655, + serialized_end=731, +) + + +_SEARCHAGENTSRESPONSE = _descriptor.Descriptor( + name='SearchAgentsResponse', + full_name='google.cloud.dialogflow.v2.SearchAgentsResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='agents', full_name='google.cloud.dialogflow.v2.SearchAgentsResponse.agents', 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, + options=None), + _descriptor.FieldDescriptor( + name='next_page_token', full_name='google.cloud.dialogflow.v2.SearchAgentsResponse.next_page_token', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=733, + serialized_end=831, +) + + +_TRAINAGENTREQUEST = _descriptor.Descriptor( + name='TrainAgentRequest', + full_name='google.cloud.dialogflow.v2.TrainAgentRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.TrainAgentRequest.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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=833, + serialized_end=868, +) + + +_EXPORTAGENTREQUEST = _descriptor.Descriptor( + name='ExportAgentRequest', + full_name='google.cloud.dialogflow.v2.ExportAgentRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.ExportAgentRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='agent_uri', full_name='google.cloud.dialogflow.v2.ExportAgentRequest.agent_uri', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=870, + serialized_end=925, +) + + +_EXPORTAGENTRESPONSE = _descriptor.Descriptor( + name='ExportAgentResponse', + full_name='google.cloud.dialogflow.v2.ExportAgentResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='agent_uri', full_name='google.cloud.dialogflow.v2.ExportAgentResponse.agent_uri', 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, + options=None), + _descriptor.FieldDescriptor( + name='agent_content', full_name='google.cloud.dialogflow.v2.ExportAgentResponse.agent_content', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='agent', full_name='google.cloud.dialogflow.v2.ExportAgentResponse.agent', + index=0, containing_type=None, fields=[]), + ], + serialized_start=927, + serialized_end=1003, +) + + +_IMPORTAGENTREQUEST = _descriptor.Descriptor( + name='ImportAgentRequest', + full_name='google.cloud.dialogflow.v2.ImportAgentRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.ImportAgentRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='agent_uri', full_name='google.cloud.dialogflow.v2.ImportAgentRequest.agent_uri', 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, + options=None), + _descriptor.FieldDescriptor( + name='agent_content', full_name='google.cloud.dialogflow.v2.ImportAgentRequest.agent_content', index=2, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='agent', full_name='google.cloud.dialogflow.v2.ImportAgentRequest.agent', + index=0, containing_type=None, fields=[]), + ], + serialized_start=1005, + serialized_end=1096, +) + + +_RESTOREAGENTREQUEST = _descriptor.Descriptor( + name='RestoreAgentRequest', + full_name='google.cloud.dialogflow.v2.RestoreAgentRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.RestoreAgentRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='agent_uri', full_name='google.cloud.dialogflow.v2.RestoreAgentRequest.agent_uri', 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, + options=None), + _descriptor.FieldDescriptor( + name='agent_content', full_name='google.cloud.dialogflow.v2.RestoreAgentRequest.agent_content', index=2, + number=3, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='agent', full_name='google.cloud.dialogflow.v2.RestoreAgentRequest.agent', + index=0, containing_type=None, fields=[]), + ], + serialized_start=1098, + serialized_end=1190, +) + +_AGENT.fields_by_name['match_mode'].enum_type = _AGENT_MATCHMODE +_AGENT_MATCHMODE.containing_type = _AGENT +_SEARCHAGENTSRESPONSE.fields_by_name['agents'].message_type = _AGENT +_EXPORTAGENTRESPONSE.oneofs_by_name['agent'].fields.append( + _EXPORTAGENTRESPONSE.fields_by_name['agent_uri']) +_EXPORTAGENTRESPONSE.fields_by_name['agent_uri'].containing_oneof = _EXPORTAGENTRESPONSE.oneofs_by_name['agent'] +_EXPORTAGENTRESPONSE.oneofs_by_name['agent'].fields.append( + _EXPORTAGENTRESPONSE.fields_by_name['agent_content']) +_EXPORTAGENTRESPONSE.fields_by_name['agent_content'].containing_oneof = _EXPORTAGENTRESPONSE.oneofs_by_name['agent'] +_IMPORTAGENTREQUEST.oneofs_by_name['agent'].fields.append( + _IMPORTAGENTREQUEST.fields_by_name['agent_uri']) +_IMPORTAGENTREQUEST.fields_by_name['agent_uri'].containing_oneof = _IMPORTAGENTREQUEST.oneofs_by_name['agent'] +_IMPORTAGENTREQUEST.oneofs_by_name['agent'].fields.append( + _IMPORTAGENTREQUEST.fields_by_name['agent_content']) +_IMPORTAGENTREQUEST.fields_by_name['agent_content'].containing_oneof = _IMPORTAGENTREQUEST.oneofs_by_name['agent'] +_RESTOREAGENTREQUEST.oneofs_by_name['agent'].fields.append( + _RESTOREAGENTREQUEST.fields_by_name['agent_uri']) +_RESTOREAGENTREQUEST.fields_by_name['agent_uri'].containing_oneof = _RESTOREAGENTREQUEST.oneofs_by_name['agent'] +_RESTOREAGENTREQUEST.oneofs_by_name['agent'].fields.append( + _RESTOREAGENTREQUEST.fields_by_name['agent_content']) +_RESTOREAGENTREQUEST.fields_by_name['agent_content'].containing_oneof = _RESTOREAGENTREQUEST.oneofs_by_name['agent'] +DESCRIPTOR.message_types_by_name['Agent'] = _AGENT +DESCRIPTOR.message_types_by_name['GetAgentRequest'] = _GETAGENTREQUEST +DESCRIPTOR.message_types_by_name['SearchAgentsRequest'] = _SEARCHAGENTSREQUEST +DESCRIPTOR.message_types_by_name['SearchAgentsResponse'] = _SEARCHAGENTSRESPONSE +DESCRIPTOR.message_types_by_name['TrainAgentRequest'] = _TRAINAGENTREQUEST +DESCRIPTOR.message_types_by_name['ExportAgentRequest'] = _EXPORTAGENTREQUEST +DESCRIPTOR.message_types_by_name['ExportAgentResponse'] = _EXPORTAGENTRESPONSE +DESCRIPTOR.message_types_by_name['ImportAgentRequest'] = _IMPORTAGENTREQUEST +DESCRIPTOR.message_types_by_name['RestoreAgentRequest'] = _RESTOREAGENTREQUEST + +Agent = _reflection.GeneratedProtocolMessageType('Agent', (_message.Message,), dict( + DESCRIPTOR = _AGENT, + __module__ = 'google.cloud.dialogflow_v2.proto.agent_pb2' + , + __doc__ = """Represents a conversational agent. + + + Attributes: + parent: + Required. The project of this agent. Format: + ``projects/``. + display_name: + Required. The name of this agent. + default_language_code: + Required. The default language of the agent as a language tag. + See `Language Support + `__ for a list + of the currently supported language codes. This field cannot + be set by the ``Update`` method. + supported_language_codes: + Optional. The list of all languages supported by this agent + (except for the ``default_language_code``). + time_zone: + Required. The time zone of this agent from the `time zone + database `__, e.g., + America/New\_York, Europe/Paris. + description: + Optional. The description of this agent. The maximum length is + 500 characters. If exceeded, the request is rejected. + avatar_uri: + Optional. The URI of the agent's avatar. Avatars are used + throughout API.AI console and in the self-hosted `Web Demo + `__ + integration. + enable_logging: + Optional. Determines whether this agent should log + conversation queries. + match_mode: + Optional. Determines how intents are detected from user + queries. + classification_threshold: + Optional. To filter out false positive results and still get + variety in matched natural language inputs for your agent, you + can tune the machine learning classification threshold. If the + returned score value is less than the threshold value, then a + fallback intent is be triggered or, if there are no fallback + intents defined, no intent will be triggered. The score values + range from 0.0 (completely uncertain) to 1.0 (completely + certain). If set to 0.0, the default of 0.3 is used. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Agent) + )) +_sym_db.RegisterMessage(Agent) + +GetAgentRequest = _reflection.GeneratedProtocolMessageType('GetAgentRequest', (_message.Message,), dict( + DESCRIPTOR = _GETAGENTREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.agent_pb2' + , + __doc__ = """The request message for + [Agents.GetAgent][google.cloud.dialogflow.v2.Agents.GetAgent]. + + + Attributes: + parent: + Required. The project that the agent to fetch is associated + with. Format: ``projects/``. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.GetAgentRequest) + )) +_sym_db.RegisterMessage(GetAgentRequest) + +SearchAgentsRequest = _reflection.GeneratedProtocolMessageType('SearchAgentsRequest', (_message.Message,), dict( + DESCRIPTOR = _SEARCHAGENTSREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.agent_pb2' + , + __doc__ = """The request message for + [Agents.SearchAgents][google.cloud.dialogflow.v2.Agents.SearchAgents]. + + + Attributes: + parent: + Required. The project to list agents from. Format: + ``projects/``. + page_size: + Optional. The maximum number of items to return in a single + page. By default 100 and at most 1000. + page_token: + Optional. The next\_page\_token value returned from a previous + list request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.SearchAgentsRequest) + )) +_sym_db.RegisterMessage(SearchAgentsRequest) + +SearchAgentsResponse = _reflection.GeneratedProtocolMessageType('SearchAgentsResponse', (_message.Message,), dict( + DESCRIPTOR = _SEARCHAGENTSRESPONSE, + __module__ = 'google.cloud.dialogflow_v2.proto.agent_pb2' + , + __doc__ = """The response message for + [Agents.SearchAgents][google.cloud.dialogflow.v2.Agents.SearchAgents]. + + + Attributes: + agents: + The list of agents. There will be a maximum number of items + returned based on the page\_size field in the request. + next_page_token: + Token to retrieve the next page of results, or empty if there + are no more results in the list. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.SearchAgentsResponse) + )) +_sym_db.RegisterMessage(SearchAgentsResponse) + +TrainAgentRequest = _reflection.GeneratedProtocolMessageType('TrainAgentRequest', (_message.Message,), dict( + DESCRIPTOR = _TRAINAGENTREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.agent_pb2' + , + __doc__ = """The request message for + [Agents.TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent]. + + + Attributes: + parent: + Required. The project that the agent to train is associated + with. Format: ``projects/``. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.TrainAgentRequest) + )) +_sym_db.RegisterMessage(TrainAgentRequest) + +ExportAgentRequest = _reflection.GeneratedProtocolMessageType('ExportAgentRequest', (_message.Message,), dict( + DESCRIPTOR = _EXPORTAGENTREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.agent_pb2' + , + __doc__ = """The request message for + [Agents.ExportAgent][google.cloud.dialogflow.v2.Agents.ExportAgent]. + + + Attributes: + parent: + Required. The project that the agent to export is associated + with. Format: ``projects/``. + agent_uri: + Optional. The Google Cloud Storage URI to export the agent to. + Note: The URI must start with "gs://". If left unspecified, + the serialized agent is returned inline. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ExportAgentRequest) + )) +_sym_db.RegisterMessage(ExportAgentRequest) + +ExportAgentResponse = _reflection.GeneratedProtocolMessageType('ExportAgentResponse', (_message.Message,), dict( + DESCRIPTOR = _EXPORTAGENTRESPONSE, + __module__ = 'google.cloud.dialogflow_v2.proto.agent_pb2' + , + __doc__ = """The response message for + [Agents.ExportAgent][google.cloud.dialogflow.v2.Agents.ExportAgent]. + + + Attributes: + agent: + Required. The exported agent. + agent_uri: + The URI to a file containing the exported agent. This field is + populated only if ``agent_uri`` is specified in + ``ExportAgentRequest``. + agent_content: + The exported agent. Example for how to export an agent to a + zip file via a command line:: + + curl 'https://dialogflow.googleapis.com/v2/projects//agent:export' + -X POST + -H 'Authorization: Bearer '$(gcloud auth print-access-token) + -H 'Accept: application/json' + -H 'Content-Type: application/json' + --compressed + --data-binary '{}' + \| grep agentContent + \| sed -e 's/.*"agentContent":"([^"]*)".\*/:raw-latex:`\1`/' + \| base64 --decode > + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ExportAgentResponse) + )) +_sym_db.RegisterMessage(ExportAgentResponse) + +ImportAgentRequest = _reflection.GeneratedProtocolMessageType('ImportAgentRequest', (_message.Message,), dict( + DESCRIPTOR = _IMPORTAGENTREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.agent_pb2' + , + __doc__ = """The request message for + [Agents.ImportAgent][google.cloud.dialogflow.v2.Agents.ImportAgent]. + + + Attributes: + parent: + Required. The project that the agent to import is associated + with. Format: ``projects/``. + agent: + Required. The agent to import. + agent_uri: + The URI to a Google Cloud Storage file containing the agent to + import. Note: The URI must start with "gs://". + agent_content: + The agent to import. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ImportAgentRequest) + )) +_sym_db.RegisterMessage(ImportAgentRequest) + +RestoreAgentRequest = _reflection.GeneratedProtocolMessageType('RestoreAgentRequest', (_message.Message,), dict( + DESCRIPTOR = _RESTOREAGENTREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.agent_pb2' + , + __doc__ = """The request message for + [Agents.RestoreAgent][google.cloud.dialogflow.v2.Agents.RestoreAgent]. + + + Attributes: + parent: + Required. The project that the agent to restore is associated + with. Format: ``projects/``. + agent: + Required. The agent to restore. + agent_uri: + The URI to a Google Cloud Storage file containing the agent to + restore. Note: The URI must start with "gs://". + agent_content: + The agent to restore. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.RestoreAgentRequest) + )) +_sym_db.RegisterMessage(RestoreAgentRequest) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\036com.google.cloud.dialogflow.v2B\nAgentProtoP\001ZDgoogle.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow\370\001\001\242\002\002DF\252\002\032Google.Cloud.Dialogflow.V2')) +try: + # THESE ELEMENTS WILL BE DEPRECATED. + # Please use the generated *_pb2_grpc.py files instead. + import grpc + from grpc.beta import implementations as beta_implementations + from grpc.beta import interfaces as beta_interfaces + from grpc.framework.common import cardinality + from grpc.framework.interfaces.face import utilities as face_utilities + + + class AgentsStub(object): + """Manages conversational agents. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/agents) + for more details about agents. + # + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.GetAgent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Agents/GetAgent', + request_serializer=GetAgentRequest.SerializeToString, + response_deserializer=Agent.FromString, + ) + self.SearchAgents = channel.unary_unary( + '/google.cloud.dialogflow.v2.Agents/SearchAgents', + request_serializer=SearchAgentsRequest.SerializeToString, + response_deserializer=SearchAgentsResponse.FromString, + ) + self.TrainAgent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Agents/TrainAgent', + request_serializer=TrainAgentRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.ExportAgent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Agents/ExportAgent', + request_serializer=ExportAgentRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.ImportAgent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Agents/ImportAgent', + request_serializer=ImportAgentRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.RestoreAgent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Agents/RestoreAgent', + request_serializer=RestoreAgentRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + + + class AgentsServicer(object): + """Manages conversational agents. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/agents) + for more details about agents. + # + """ + + def GetAgent(self, request, context): + """Retrieves the specified agent. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SearchAgents(self, request, context): + """Returns the list of agents. + + Since there is at most one conversational agent per project, this method is + useful primarily for listing all agents across projects the caller has + access to. One can achieve that with a wildcard project collection id "-". + Refer to [List + Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def TrainAgent(self, request, context): + """Trains the specified agent. + + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ExportAgent(self, request, context): + """Exports the specified agent to a ZIP file. + + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ImportAgent(self, request, context): + """Imports the specified agent from a ZIP file. + + Uploads new intents and entity types without deleting the existing ones. + Intents and entity types with the same name are replaced with the new + versions from ImportAgentRequest. + + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def RestoreAgent(self, request, context): + """Restores the specified agent from a ZIP file. + + Replaces the current agent version with a new one. All the intents and + entity types in the older version are deleted. + + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + + def add_AgentsServicer_to_server(servicer, server): + rpc_method_handlers = { + 'GetAgent': grpc.unary_unary_rpc_method_handler( + servicer.GetAgent, + request_deserializer=GetAgentRequest.FromString, + response_serializer=Agent.SerializeToString, + ), + 'SearchAgents': grpc.unary_unary_rpc_method_handler( + servicer.SearchAgents, + request_deserializer=SearchAgentsRequest.FromString, + response_serializer=SearchAgentsResponse.SerializeToString, + ), + 'TrainAgent': grpc.unary_unary_rpc_method_handler( + servicer.TrainAgent, + request_deserializer=TrainAgentRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + 'ExportAgent': grpc.unary_unary_rpc_method_handler( + servicer.ExportAgent, + request_deserializer=ExportAgentRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + 'ImportAgent': grpc.unary_unary_rpc_method_handler( + servicer.ImportAgent, + request_deserializer=ImportAgentRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + 'RestoreAgent': grpc.unary_unary_rpc_method_handler( + servicer.RestoreAgent, + request_deserializer=RestoreAgentRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'google.cloud.dialogflow.v2.Agents', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + class BetaAgentsServicer(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Manages conversational agents. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/agents) + for more details about agents. + # + """ + def GetAgent(self, request, context): + """Retrieves the specified agent. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def SearchAgents(self, request, context): + """Returns the list of agents. + + Since there is at most one conversational agent per project, this method is + useful primarily for listing all agents across projects the caller has + access to. One can achieve that with a wildcard project collection id "-". + Refer to [List + Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def TrainAgent(self, request, context): + """Trains the specified agent. + + + Operation + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def ExportAgent(self, request, context): + """Exports the specified agent to a ZIP file. + + + Operation + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def ImportAgent(self, request, context): + """Imports the specified agent from a ZIP file. + + Uploads new intents and entity types without deleting the existing ones. + Intents and entity types with the same name are replaced with the new + versions from ImportAgentRequest. + + + Operation + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def RestoreAgent(self, request, context): + """Restores the specified agent from a ZIP file. + + Replaces the current agent version with a new one. All the intents and + entity types in the older version are deleted. + + + Operation + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + + + class BetaAgentsStub(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Manages conversational agents. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/agents) + for more details about agents. + # + """ + def GetAgent(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Retrieves the specified agent. + """ + raise NotImplementedError() + GetAgent.future = None + def SearchAgents(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Returns the list of agents. + + Since there is at most one conversational agent per project, this method is + useful primarily for listing all agents across projects the caller has + access to. One can achieve that with a wildcard project collection id "-". + Refer to [List + Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + """ + raise NotImplementedError() + SearchAgents.future = None + def TrainAgent(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Trains the specified agent. + + + Operation + """ + raise NotImplementedError() + TrainAgent.future = None + def ExportAgent(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Exports the specified agent to a ZIP file. + + + Operation + """ + raise NotImplementedError() + ExportAgent.future = None + def ImportAgent(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Imports the specified agent from a ZIP file. + + Uploads new intents and entity types without deleting the existing ones. + Intents and entity types with the same name are replaced with the new + versions from ImportAgentRequest. + + + Operation + """ + raise NotImplementedError() + ImportAgent.future = None + def RestoreAgent(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Restores the specified agent from a ZIP file. + + Replaces the current agent version with a new one. All the intents and + entity types in the older version are deleted. + + + Operation + """ + raise NotImplementedError() + RestoreAgent.future = None + + + def beta_create_Agents_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_deserializers = { + ('google.cloud.dialogflow.v2.Agents', 'ExportAgent'): ExportAgentRequest.FromString, + ('google.cloud.dialogflow.v2.Agents', 'GetAgent'): GetAgentRequest.FromString, + ('google.cloud.dialogflow.v2.Agents', 'ImportAgent'): ImportAgentRequest.FromString, + ('google.cloud.dialogflow.v2.Agents', 'RestoreAgent'): RestoreAgentRequest.FromString, + ('google.cloud.dialogflow.v2.Agents', 'SearchAgents'): SearchAgentsRequest.FromString, + ('google.cloud.dialogflow.v2.Agents', 'TrainAgent'): TrainAgentRequest.FromString, + } + response_serializers = { + ('google.cloud.dialogflow.v2.Agents', 'ExportAgent'): google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ('google.cloud.dialogflow.v2.Agents', 'GetAgent'): Agent.SerializeToString, + ('google.cloud.dialogflow.v2.Agents', 'ImportAgent'): google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ('google.cloud.dialogflow.v2.Agents', 'RestoreAgent'): google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ('google.cloud.dialogflow.v2.Agents', 'SearchAgents'): SearchAgentsResponse.SerializeToString, + ('google.cloud.dialogflow.v2.Agents', 'TrainAgent'): google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + } + method_implementations = { + ('google.cloud.dialogflow.v2.Agents', 'ExportAgent'): face_utilities.unary_unary_inline(servicer.ExportAgent), + ('google.cloud.dialogflow.v2.Agents', 'GetAgent'): face_utilities.unary_unary_inline(servicer.GetAgent), + ('google.cloud.dialogflow.v2.Agents', 'ImportAgent'): face_utilities.unary_unary_inline(servicer.ImportAgent), + ('google.cloud.dialogflow.v2.Agents', 'RestoreAgent'): face_utilities.unary_unary_inline(servicer.RestoreAgent), + ('google.cloud.dialogflow.v2.Agents', 'SearchAgents'): face_utilities.unary_unary_inline(servicer.SearchAgents), + ('google.cloud.dialogflow.v2.Agents', 'TrainAgent'): face_utilities.unary_unary_inline(servicer.TrainAgent), + } + server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) + return beta_implementations.server(method_implementations, options=server_options) + + + def beta_create_Agents_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_serializers = { + ('google.cloud.dialogflow.v2.Agents', 'ExportAgent'): ExportAgentRequest.SerializeToString, + ('google.cloud.dialogflow.v2.Agents', 'GetAgent'): GetAgentRequest.SerializeToString, + ('google.cloud.dialogflow.v2.Agents', 'ImportAgent'): ImportAgentRequest.SerializeToString, + ('google.cloud.dialogflow.v2.Agents', 'RestoreAgent'): RestoreAgentRequest.SerializeToString, + ('google.cloud.dialogflow.v2.Agents', 'SearchAgents'): SearchAgentsRequest.SerializeToString, + ('google.cloud.dialogflow.v2.Agents', 'TrainAgent'): TrainAgentRequest.SerializeToString, + } + response_deserializers = { + ('google.cloud.dialogflow.v2.Agents', 'ExportAgent'): google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ('google.cloud.dialogflow.v2.Agents', 'GetAgent'): Agent.FromString, + ('google.cloud.dialogflow.v2.Agents', 'ImportAgent'): google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ('google.cloud.dialogflow.v2.Agents', 'RestoreAgent'): google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ('google.cloud.dialogflow.v2.Agents', 'SearchAgents'): SearchAgentsResponse.FromString, + ('google.cloud.dialogflow.v2.Agents', 'TrainAgent'): google_dot_longrunning_dot_operations__pb2.Operation.FromString, + } + cardinalities = { + 'ExportAgent': cardinality.Cardinality.UNARY_UNARY, + 'GetAgent': cardinality.Cardinality.UNARY_UNARY, + 'ImportAgent': cardinality.Cardinality.UNARY_UNARY, + 'RestoreAgent': cardinality.Cardinality.UNARY_UNARY, + 'SearchAgents': cardinality.Cardinality.UNARY_UNARY, + 'TrainAgent': cardinality.Cardinality.UNARY_UNARY, + } + stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) + return beta_implementations.dynamic_stub(channel, 'google.cloud.dialogflow.v2.Agents', cardinalities, options=stub_options) +except ImportError: + pass +# @@protoc_insertion_point(module_scope) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/proto/agent_pb2_grpc.py b/packages/google-cloud-dialogflow/dialogflow_v2/proto/agent_pb2_grpc.py new file mode 100755 index 000000000000..3fb193827d13 --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/proto/agent_pb2_grpc.py @@ -0,0 +1,171 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + +import dialogflow_v2.proto.agent_pb2 as google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_agent__pb2 +import google.longrunning.operations_pb2 as google_dot_longrunning_dot_operations__pb2 + + +class AgentsStub(object): + """Manages conversational agents. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/agents) + for more details about agents. + # + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.GetAgent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Agents/GetAgent', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_agent__pb2.GetAgentRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_agent__pb2.Agent.FromString, + ) + self.SearchAgents = channel.unary_unary( + '/google.cloud.dialogflow.v2.Agents/SearchAgents', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_agent__pb2.SearchAgentsRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_agent__pb2.SearchAgentsResponse.FromString, + ) + self.TrainAgent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Agents/TrainAgent', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_agent__pb2.TrainAgentRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.ExportAgent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Agents/ExportAgent', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_agent__pb2.ExportAgentRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.ImportAgent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Agents/ImportAgent', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_agent__pb2.ImportAgentRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.RestoreAgent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Agents/RestoreAgent', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_agent__pb2.RestoreAgentRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + + +class AgentsServicer(object): + """Manages conversational agents. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/agents) + for more details about agents. + # + """ + + def GetAgent(self, request, context): + """Retrieves the specified agent. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SearchAgents(self, request, context): + """Returns the list of agents. + + Since there is at most one conversational agent per project, this method is + useful primarily for listing all agents across projects the caller has + access to. One can achieve that with a wildcard project collection id "-". + Refer to [List + Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def TrainAgent(self, request, context): + """Trains the specified agent. + + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ExportAgent(self, request, context): + """Exports the specified agent to a ZIP file. + + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ImportAgent(self, request, context): + """Imports the specified agent from a ZIP file. + + Uploads new intents and entity types without deleting the existing ones. + Intents and entity types with the same name are replaced with the new + versions from ImportAgentRequest. + + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def RestoreAgent(self, request, context): + """Restores the specified agent from a ZIP file. + + Replaces the current agent version with a new one. All the intents and + entity types in the older version are deleted. + + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_AgentsServicer_to_server(servicer, server): + rpc_method_handlers = { + 'GetAgent': grpc.unary_unary_rpc_method_handler( + servicer.GetAgent, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_agent__pb2.GetAgentRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_agent__pb2.Agent.SerializeToString, + ), + 'SearchAgents': grpc.unary_unary_rpc_method_handler( + servicer.SearchAgents, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_agent__pb2.SearchAgentsRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_agent__pb2.SearchAgentsResponse.SerializeToString, + ), + 'TrainAgent': grpc.unary_unary_rpc_method_handler( + servicer.TrainAgent, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_agent__pb2.TrainAgentRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + 'ExportAgent': grpc.unary_unary_rpc_method_handler( + servicer.ExportAgent, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_agent__pb2.ExportAgentRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + 'ImportAgent': grpc.unary_unary_rpc_method_handler( + servicer.ImportAgent, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_agent__pb2.ImportAgentRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + 'RestoreAgent': grpc.unary_unary_rpc_method_handler( + servicer.RestoreAgent, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_agent__pb2.RestoreAgentRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'google.cloud.dialogflow.v2.Agents', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/proto/context_pb2.py b/packages/google-cloud-dialogflow/dialogflow_v2/proto/context_pb2.py new file mode 100755 index 000000000000..f9e5ea483d64 --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/proto/context_pb2.py @@ -0,0 +1,806 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow_v2/proto/context.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 +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__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 +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='google/cloud/dialogflow_v2/proto/context.proto', + package='google.cloud.dialogflow.v2', + syntax='proto3', + serialized_pb=_b('\n.google/cloud/dialogflow_v2/proto/context.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\\\n\x07\x43ontext\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x16\n\x0elifespan_count\x18\x02 \x01(\x05\x12+\n\nparameters\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\"L\n\x13ListContextsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"f\n\x14ListContextsResponse\x12\x35\n\x08\x63ontexts\x18\x01 \x03(\x0b\x32#.google.cloud.dialogflow.v2.Context\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"!\n\x11GetContextRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"\\\n\x14\x43reateContextRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x34\n\x07\x63ontext\x18\x02 \x01(\x0b\x32#.google.cloud.dialogflow.v2.Context\"}\n\x14UpdateContextRequest\x12\x34\n\x07\x63ontext\x18\x01 \x01(\x0b\x32#.google.cloud.dialogflow.v2.Context\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"$\n\x14\x44\x65leteContextRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"*\n\x18\x44\x65leteAllContextsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t2\xef\x07\n\x08\x43ontexts\x12\xac\x01\n\x0cListContexts\x12/.google.cloud.dialogflow.v2.ListContextsRequest\x1a\x30.google.cloud.dialogflow.v2.ListContextsResponse\"9\x82\xd3\xe4\x93\x02\x33\x12\x31/v2/{parent=projects/*/agent/sessions/*}/contexts\x12\x9b\x01\n\nGetContext\x12-.google.cloud.dialogflow.v2.GetContextRequest\x1a#.google.cloud.dialogflow.v2.Context\"9\x82\xd3\xe4\x93\x02\x33\x12\x31/v2/{name=projects/*/agent/sessions/*/contexts/*}\x12\xaa\x01\n\rCreateContext\x12\x30.google.cloud.dialogflow.v2.CreateContextRequest\x1a#.google.cloud.dialogflow.v2.Context\"B\x82\xd3\xe4\x93\x02<\"1/v2/{parent=projects/*/agent/sessions/*}/contexts:\x07\x63ontext\x12\xb2\x01\n\rUpdateContext\x12\x30.google.cloud.dialogflow.v2.UpdateContextRequest\x1a#.google.cloud.dialogflow.v2.Context\"J\x82\xd3\xe4\x93\x02\x44\x32\x39/v2/{context.name=projects/*/agent/sessions/*/contexts/*}:\x07\x63ontext\x12\x94\x01\n\rDeleteContext\x12\x30.google.cloud.dialogflow.v2.DeleteContextRequest\x1a\x16.google.protobuf.Empty\"9\x82\xd3\xe4\x93\x02\x33*1/v2/{name=projects/*/agent/sessions/*/contexts/*}\x12\x9c\x01\n\x11\x44\x65leteAllContexts\x12\x34.google.cloud.dialogflow.v2.DeleteAllContextsRequest\x1a\x16.google.protobuf.Empty\"9\x82\xd3\xe4\x93\x02\x33*1/v2/{parent=projects/*/agent/sessions/*}/contextsB\x9b\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0c\x43ontextProtoP\x01ZDgoogle.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow\xf8\x01\x01\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3') + , + dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR,google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR,google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,]) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + + +_CONTEXT = _descriptor.Descriptor( + name='Context', + full_name='google.cloud.dialogflow.v2.Context', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='google.cloud.dialogflow.v2.Context.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, + options=None), + _descriptor.FieldDescriptor( + name='lifespan_count', full_name='google.cloud.dialogflow.v2.Context.lifespan_count', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='parameters', full_name='google.cloud.dialogflow.v2.Context.parameters', index=2, + number=3, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=201, + serialized_end=293, +) + + +_LISTCONTEXTSREQUEST = _descriptor.Descriptor( + name='ListContextsRequest', + full_name='google.cloud.dialogflow.v2.ListContextsRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.ListContextsRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='page_size', full_name='google.cloud.dialogflow.v2.ListContextsRequest.page_size', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='page_token', full_name='google.cloud.dialogflow.v2.ListContextsRequest.page_token', index=2, + 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=295, + serialized_end=371, +) + + +_LISTCONTEXTSRESPONSE = _descriptor.Descriptor( + name='ListContextsResponse', + full_name='google.cloud.dialogflow.v2.ListContextsResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='contexts', full_name='google.cloud.dialogflow.v2.ListContextsResponse.contexts', 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, + options=None), + _descriptor.FieldDescriptor( + name='next_page_token', full_name='google.cloud.dialogflow.v2.ListContextsResponse.next_page_token', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=373, + serialized_end=475, +) + + +_GETCONTEXTREQUEST = _descriptor.Descriptor( + name='GetContextRequest', + full_name='google.cloud.dialogflow.v2.GetContextRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='google.cloud.dialogflow.v2.GetContextRequest.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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=477, + serialized_end=510, +) + + +_CREATECONTEXTREQUEST = _descriptor.Descriptor( + name='CreateContextRequest', + full_name='google.cloud.dialogflow.v2.CreateContextRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.CreateContextRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='context', full_name='google.cloud.dialogflow.v2.CreateContextRequest.context', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=512, + serialized_end=604, +) + + +_UPDATECONTEXTREQUEST = _descriptor.Descriptor( + name='UpdateContextRequest', + full_name='google.cloud.dialogflow.v2.UpdateContextRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='context', full_name='google.cloud.dialogflow.v2.UpdateContextRequest.context', index=0, + number=1, 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, + options=None), + _descriptor.FieldDescriptor( + name='update_mask', full_name='google.cloud.dialogflow.v2.UpdateContextRequest.update_mask', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=606, + serialized_end=731, +) + + +_DELETECONTEXTREQUEST = _descriptor.Descriptor( + name='DeleteContextRequest', + full_name='google.cloud.dialogflow.v2.DeleteContextRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='google.cloud.dialogflow.v2.DeleteContextRequest.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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=733, + serialized_end=769, +) + + +_DELETEALLCONTEXTSREQUEST = _descriptor.Descriptor( + name='DeleteAllContextsRequest', + full_name='google.cloud.dialogflow.v2.DeleteAllContextsRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.DeleteAllContextsRequest.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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=771, + serialized_end=813, +) + +_CONTEXT.fields_by_name['parameters'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_LISTCONTEXTSRESPONSE.fields_by_name['contexts'].message_type = _CONTEXT +_CREATECONTEXTREQUEST.fields_by_name['context'].message_type = _CONTEXT +_UPDATECONTEXTREQUEST.fields_by_name['context'].message_type = _CONTEXT +_UPDATECONTEXTREQUEST.fields_by_name['update_mask'].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK +DESCRIPTOR.message_types_by_name['Context'] = _CONTEXT +DESCRIPTOR.message_types_by_name['ListContextsRequest'] = _LISTCONTEXTSREQUEST +DESCRIPTOR.message_types_by_name['ListContextsResponse'] = _LISTCONTEXTSRESPONSE +DESCRIPTOR.message_types_by_name['GetContextRequest'] = _GETCONTEXTREQUEST +DESCRIPTOR.message_types_by_name['CreateContextRequest'] = _CREATECONTEXTREQUEST +DESCRIPTOR.message_types_by_name['UpdateContextRequest'] = _UPDATECONTEXTREQUEST +DESCRIPTOR.message_types_by_name['DeleteContextRequest'] = _DELETECONTEXTREQUEST +DESCRIPTOR.message_types_by_name['DeleteAllContextsRequest'] = _DELETEALLCONTEXTSREQUEST + +Context = _reflection.GeneratedProtocolMessageType('Context', (_message.Message,), dict( + DESCRIPTOR = _CONTEXT, + __module__ = 'google.cloud.dialogflow_v2.proto.context_pb2' + , + __doc__ = """Represents a context. + + + Attributes: + name: + Required. The unique identifier of the context. Format: + ``projects//agent/sessions//contexts/``. Note: The Context ID is always + converted to lowercase. + lifespan_count: + Optional. The number of conversational query requests after + which the context expires. If set to ``0`` (the default) the + context expires immediately. Contexts expire automatically + after 10 minutes even if there are no matching queries. + parameters: + Optional. The collection of parameters associated with this + context. Refer to `this doc + `__ for + syntax. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Context) + )) +_sym_db.RegisterMessage(Context) + +ListContextsRequest = _reflection.GeneratedProtocolMessageType('ListContextsRequest', (_message.Message,), dict( + DESCRIPTOR = _LISTCONTEXTSREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.context_pb2' + , + __doc__ = """The request message for + [Contexts.ListContexts][google.cloud.dialogflow.v2.Contexts.ListContexts]. + + + Attributes: + parent: + Required. The session to list all contexts from. Format: + ``projects//agent/sessions/``. + page_size: + Optional. The maximum number of items to return in a single + page. By default 100 and at most 1000. + page_token: + Optional. The next\_page\_token value returned from a previous + list request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ListContextsRequest) + )) +_sym_db.RegisterMessage(ListContextsRequest) + +ListContextsResponse = _reflection.GeneratedProtocolMessageType('ListContextsResponse', (_message.Message,), dict( + DESCRIPTOR = _LISTCONTEXTSRESPONSE, + __module__ = 'google.cloud.dialogflow_v2.proto.context_pb2' + , + __doc__ = """The response message for + [Contexts.ListContexts][google.cloud.dialogflow.v2.Contexts.ListContexts]. + + + Attributes: + contexts: + The list of contexts. There will be a maximum number of items + returned based on the page\_size field in the request. + next_page_token: + Token to retrieve the next page of results, or empty if there + are no more results in the list. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ListContextsResponse) + )) +_sym_db.RegisterMessage(ListContextsResponse) + +GetContextRequest = _reflection.GeneratedProtocolMessageType('GetContextRequest', (_message.Message,), dict( + DESCRIPTOR = _GETCONTEXTREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.context_pb2' + , + __doc__ = """The request message for + [Contexts.GetContext][google.cloud.dialogflow.v2.Contexts.GetContext]. + + + Attributes: + name: + Required. The name of the context. Format: ``projects//agent/sessions//contexts/``. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.GetContextRequest) + )) +_sym_db.RegisterMessage(GetContextRequest) + +CreateContextRequest = _reflection.GeneratedProtocolMessageType('CreateContextRequest', (_message.Message,), dict( + DESCRIPTOR = _CREATECONTEXTREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.context_pb2' + , + __doc__ = """The request message for + [Contexts.CreateContext][google.cloud.dialogflow.v2.Contexts.CreateContext]. + + + Attributes: + parent: + Required. The session to create a context for. Format: + ``projects//agent/sessions/``. + context: + Required. The context to create. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.CreateContextRequest) + )) +_sym_db.RegisterMessage(CreateContextRequest) + +UpdateContextRequest = _reflection.GeneratedProtocolMessageType('UpdateContextRequest', (_message.Message,), dict( + DESCRIPTOR = _UPDATECONTEXTREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.context_pb2' + , + __doc__ = """The request message for + [Contexts.UpdateContext][google.cloud.dialogflow.v2.Contexts.UpdateContext]. + + + Attributes: + context: + Required. The context to update. + update_mask: + Optional. The mask to control which fields get updated. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.UpdateContextRequest) + )) +_sym_db.RegisterMessage(UpdateContextRequest) + +DeleteContextRequest = _reflection.GeneratedProtocolMessageType('DeleteContextRequest', (_message.Message,), dict( + DESCRIPTOR = _DELETECONTEXTREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.context_pb2' + , + __doc__ = """The request message for + [Contexts.DeleteContext][google.cloud.dialogflow.v2.Contexts.DeleteContext]. + + + Attributes: + name: + Required. The name of the context to delete. Format: + ``projects//agent/sessions//contexts/``. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.DeleteContextRequest) + )) +_sym_db.RegisterMessage(DeleteContextRequest) + +DeleteAllContextsRequest = _reflection.GeneratedProtocolMessageType('DeleteAllContextsRequest', (_message.Message,), dict( + DESCRIPTOR = _DELETEALLCONTEXTSREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.context_pb2' + , + __doc__ = """The request message for + [Contexts.DeleteAllContexts][google.cloud.dialogflow.v2.Contexts.DeleteAllContexts]. + + + Attributes: + parent: + Required. The name of the session to delete all contexts from. + Format: ``projects//agent/sessions/``. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.DeleteAllContextsRequest) + )) +_sym_db.RegisterMessage(DeleteAllContextsRequest) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\036com.google.cloud.dialogflow.v2B\014ContextProtoP\001ZDgoogle.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow\370\001\001\242\002\002DF\252\002\032Google.Cloud.Dialogflow.V2')) +try: + # THESE ELEMENTS WILL BE DEPRECATED. + # Please use the generated *_pb2_grpc.py files instead. + import grpc + from grpc.beta import implementations as beta_implementations + from grpc.beta import interfaces as beta_interfaces + from grpc.framework.common import cardinality + from grpc.framework.interfaces.face import utilities as face_utilities + + + class ContextsStub(object): + """Manages contexts. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/contexts) + for more details about contexts. + # + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListContexts = channel.unary_unary( + '/google.cloud.dialogflow.v2.Contexts/ListContexts', + request_serializer=ListContextsRequest.SerializeToString, + response_deserializer=ListContextsResponse.FromString, + ) + self.GetContext = channel.unary_unary( + '/google.cloud.dialogflow.v2.Contexts/GetContext', + request_serializer=GetContextRequest.SerializeToString, + response_deserializer=Context.FromString, + ) + self.CreateContext = channel.unary_unary( + '/google.cloud.dialogflow.v2.Contexts/CreateContext', + request_serializer=CreateContextRequest.SerializeToString, + response_deserializer=Context.FromString, + ) + self.UpdateContext = channel.unary_unary( + '/google.cloud.dialogflow.v2.Contexts/UpdateContext', + request_serializer=UpdateContextRequest.SerializeToString, + response_deserializer=Context.FromString, + ) + self.DeleteContext = channel.unary_unary( + '/google.cloud.dialogflow.v2.Contexts/DeleteContext', + request_serializer=DeleteContextRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + self.DeleteAllContexts = channel.unary_unary( + '/google.cloud.dialogflow.v2.Contexts/DeleteAllContexts', + request_serializer=DeleteAllContextsRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + + + class ContextsServicer(object): + """Manages contexts. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/contexts) + for more details about contexts. + # + """ + + def ListContexts(self, request, context): + """Returns the list of all contexts in the specified session. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetContext(self, request, context): + """Retrieves the specified context. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateContext(self, request, context): + """Creates a context. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateContext(self, request, context): + """Updates the specified context. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteContext(self, request, context): + """Deletes the specified context. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteAllContexts(self, request, context): + """Deletes all active contexts in the specified session. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + + def add_ContextsServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListContexts': grpc.unary_unary_rpc_method_handler( + servicer.ListContexts, + request_deserializer=ListContextsRequest.FromString, + response_serializer=ListContextsResponse.SerializeToString, + ), + 'GetContext': grpc.unary_unary_rpc_method_handler( + servicer.GetContext, + request_deserializer=GetContextRequest.FromString, + response_serializer=Context.SerializeToString, + ), + 'CreateContext': grpc.unary_unary_rpc_method_handler( + servicer.CreateContext, + request_deserializer=CreateContextRequest.FromString, + response_serializer=Context.SerializeToString, + ), + 'UpdateContext': grpc.unary_unary_rpc_method_handler( + servicer.UpdateContext, + request_deserializer=UpdateContextRequest.FromString, + response_serializer=Context.SerializeToString, + ), + 'DeleteContext': grpc.unary_unary_rpc_method_handler( + servicer.DeleteContext, + request_deserializer=DeleteContextRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'DeleteAllContexts': grpc.unary_unary_rpc_method_handler( + servicer.DeleteAllContexts, + request_deserializer=DeleteAllContextsRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'google.cloud.dialogflow.v2.Contexts', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + class BetaContextsServicer(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Manages contexts. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/contexts) + for more details about contexts. + # + """ + def ListContexts(self, request, context): + """Returns the list of all contexts in the specified session. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def GetContext(self, request, context): + """Retrieves the specified context. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def CreateContext(self, request, context): + """Creates a context. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def UpdateContext(self, request, context): + """Updates the specified context. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def DeleteContext(self, request, context): + """Deletes the specified context. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def DeleteAllContexts(self, request, context): + """Deletes all active contexts in the specified session. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + + + class BetaContextsStub(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Manages contexts. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/contexts) + for more details about contexts. + # + """ + def ListContexts(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Returns the list of all contexts in the specified session. + """ + raise NotImplementedError() + ListContexts.future = None + def GetContext(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Retrieves the specified context. + """ + raise NotImplementedError() + GetContext.future = None + def CreateContext(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Creates a context. + """ + raise NotImplementedError() + CreateContext.future = None + def UpdateContext(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Updates the specified context. + """ + raise NotImplementedError() + UpdateContext.future = None + def DeleteContext(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Deletes the specified context. + """ + raise NotImplementedError() + DeleteContext.future = None + def DeleteAllContexts(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Deletes all active contexts in the specified session. + """ + raise NotImplementedError() + DeleteAllContexts.future = None + + + def beta_create_Contexts_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_deserializers = { + ('google.cloud.dialogflow.v2.Contexts', 'CreateContext'): CreateContextRequest.FromString, + ('google.cloud.dialogflow.v2.Contexts', 'DeleteAllContexts'): DeleteAllContextsRequest.FromString, + ('google.cloud.dialogflow.v2.Contexts', 'DeleteContext'): DeleteContextRequest.FromString, + ('google.cloud.dialogflow.v2.Contexts', 'GetContext'): GetContextRequest.FromString, + ('google.cloud.dialogflow.v2.Contexts', 'ListContexts'): ListContextsRequest.FromString, + ('google.cloud.dialogflow.v2.Contexts', 'UpdateContext'): UpdateContextRequest.FromString, + } + response_serializers = { + ('google.cloud.dialogflow.v2.Contexts', 'CreateContext'): Context.SerializeToString, + ('google.cloud.dialogflow.v2.Contexts', 'DeleteAllContexts'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ('google.cloud.dialogflow.v2.Contexts', 'DeleteContext'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ('google.cloud.dialogflow.v2.Contexts', 'GetContext'): Context.SerializeToString, + ('google.cloud.dialogflow.v2.Contexts', 'ListContexts'): ListContextsResponse.SerializeToString, + ('google.cloud.dialogflow.v2.Contexts', 'UpdateContext'): Context.SerializeToString, + } + method_implementations = { + ('google.cloud.dialogflow.v2.Contexts', 'CreateContext'): face_utilities.unary_unary_inline(servicer.CreateContext), + ('google.cloud.dialogflow.v2.Contexts', 'DeleteAllContexts'): face_utilities.unary_unary_inline(servicer.DeleteAllContexts), + ('google.cloud.dialogflow.v2.Contexts', 'DeleteContext'): face_utilities.unary_unary_inline(servicer.DeleteContext), + ('google.cloud.dialogflow.v2.Contexts', 'GetContext'): face_utilities.unary_unary_inline(servicer.GetContext), + ('google.cloud.dialogflow.v2.Contexts', 'ListContexts'): face_utilities.unary_unary_inline(servicer.ListContexts), + ('google.cloud.dialogflow.v2.Contexts', 'UpdateContext'): face_utilities.unary_unary_inline(servicer.UpdateContext), + } + server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) + return beta_implementations.server(method_implementations, options=server_options) + + + def beta_create_Contexts_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_serializers = { + ('google.cloud.dialogflow.v2.Contexts', 'CreateContext'): CreateContextRequest.SerializeToString, + ('google.cloud.dialogflow.v2.Contexts', 'DeleteAllContexts'): DeleteAllContextsRequest.SerializeToString, + ('google.cloud.dialogflow.v2.Contexts', 'DeleteContext'): DeleteContextRequest.SerializeToString, + ('google.cloud.dialogflow.v2.Contexts', 'GetContext'): GetContextRequest.SerializeToString, + ('google.cloud.dialogflow.v2.Contexts', 'ListContexts'): ListContextsRequest.SerializeToString, + ('google.cloud.dialogflow.v2.Contexts', 'UpdateContext'): UpdateContextRequest.SerializeToString, + } + response_deserializers = { + ('google.cloud.dialogflow.v2.Contexts', 'CreateContext'): Context.FromString, + ('google.cloud.dialogflow.v2.Contexts', 'DeleteAllContexts'): google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ('google.cloud.dialogflow.v2.Contexts', 'DeleteContext'): google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ('google.cloud.dialogflow.v2.Contexts', 'GetContext'): Context.FromString, + ('google.cloud.dialogflow.v2.Contexts', 'ListContexts'): ListContextsResponse.FromString, + ('google.cloud.dialogflow.v2.Contexts', 'UpdateContext'): Context.FromString, + } + cardinalities = { + 'CreateContext': cardinality.Cardinality.UNARY_UNARY, + 'DeleteAllContexts': cardinality.Cardinality.UNARY_UNARY, + 'DeleteContext': cardinality.Cardinality.UNARY_UNARY, + 'GetContext': cardinality.Cardinality.UNARY_UNARY, + 'ListContexts': cardinality.Cardinality.UNARY_UNARY, + 'UpdateContext': cardinality.Cardinality.UNARY_UNARY, + } + stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) + return beta_implementations.dynamic_stub(channel, 'google.cloud.dialogflow.v2.Contexts', cardinalities, options=stub_options) +except ImportError: + pass +# @@protoc_insertion_point(module_scope) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/proto/context_pb2_grpc.py b/packages/google-cloud-dialogflow/dialogflow_v2/proto/context_pb2_grpc.py new file mode 100755 index 000000000000..1853ecbac7f7 --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/proto/context_pb2_grpc.py @@ -0,0 +1,142 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + +import dialogflow_v2.proto.context_pb2 as google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2 +import google.protobuf.empty_pb2 as google_dot_protobuf_dot_empty__pb2 + + +class ContextsStub(object): + """Manages contexts. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/contexts) + for more details about contexts. + # + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListContexts = channel.unary_unary( + '/google.cloud.dialogflow.v2.Contexts/ListContexts', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.ListContextsRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.ListContextsResponse.FromString, + ) + self.GetContext = channel.unary_unary( + '/google.cloud.dialogflow.v2.Contexts/GetContext', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.GetContextRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.Context.FromString, + ) + self.CreateContext = channel.unary_unary( + '/google.cloud.dialogflow.v2.Contexts/CreateContext', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.CreateContextRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.Context.FromString, + ) + self.UpdateContext = channel.unary_unary( + '/google.cloud.dialogflow.v2.Contexts/UpdateContext', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.UpdateContextRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.Context.FromString, + ) + self.DeleteContext = channel.unary_unary( + '/google.cloud.dialogflow.v2.Contexts/DeleteContext', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.DeleteContextRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + self.DeleteAllContexts = channel.unary_unary( + '/google.cloud.dialogflow.v2.Contexts/DeleteAllContexts', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.DeleteAllContextsRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + + +class ContextsServicer(object): + """Manages contexts. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/contexts) + for more details about contexts. + # + """ + + def ListContexts(self, request, context): + """Returns the list of all contexts in the specified session. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetContext(self, request, context): + """Retrieves the specified context. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateContext(self, request, context): + """Creates a context. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateContext(self, request, context): + """Updates the specified context. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteContext(self, request, context): + """Deletes the specified context. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteAllContexts(self, request, context): + """Deletes all active contexts in the specified session. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_ContextsServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListContexts': grpc.unary_unary_rpc_method_handler( + servicer.ListContexts, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.ListContextsRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.ListContextsResponse.SerializeToString, + ), + 'GetContext': grpc.unary_unary_rpc_method_handler( + servicer.GetContext, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.GetContextRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.Context.SerializeToString, + ), + 'CreateContext': grpc.unary_unary_rpc_method_handler( + servicer.CreateContext, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.CreateContextRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.Context.SerializeToString, + ), + 'UpdateContext': grpc.unary_unary_rpc_method_handler( + servicer.UpdateContext, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.UpdateContextRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.Context.SerializeToString, + ), + 'DeleteContext': grpc.unary_unary_rpc_method_handler( + servicer.DeleteContext, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.DeleteContextRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'DeleteAllContexts': grpc.unary_unary_rpc_method_handler( + servicer.DeleteAllContexts, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.DeleteAllContextsRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'google.cloud.dialogflow.v2.Contexts', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/proto/entity_type_pb2.py b/packages/google-cloud-dialogflow/dialogflow_v2/proto/entity_type_pb2.py new file mode 100755 index 000000000000..1b147aa1da16 --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/proto/entity_type_pb2.py @@ -0,0 +1,1620 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow_v2/proto/entity_type.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 +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.longrunning import operations_pb2 as google_dot_longrunning_dot_operations__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 +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='google/cloud/dialogflow_v2/proto/entity_type.proto', + package='google.cloud.dialogflow.v2', + syntax='proto3', + serialized_pb=_b('\n2google/cloud/dialogflow_v2/proto/entity_type.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xc4\x03\n\nEntityType\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x39\n\x04kind\x18\x03 \x01(\x0e\x32+.google.cloud.dialogflow.v2.EntityType.Kind\x12U\n\x13\x61uto_expansion_mode\x18\x04 \x01(\x0e\x32\x38.google.cloud.dialogflow.v2.EntityType.AutoExpansionMode\x12?\n\x08\x65ntities\x18\x06 \x03(\x0b\x32-.google.cloud.dialogflow.v2.EntityType.Entity\x1a)\n\x06\x45ntity\x12\r\n\x05value\x18\x01 \x01(\t\x12\x10\n\x08synonyms\x18\x02 \x03(\t\"9\n\x04Kind\x12\x14\n\x10KIND_UNSPECIFIED\x10\x00\x12\x0c\n\x08KIND_MAP\x10\x01\x12\r\n\tKIND_LIST\x10\x02\"Y\n\x11\x41utoExpansionMode\x12#\n\x1f\x41UTO_EXPANSION_MODE_UNSPECIFIED\x10\x00\x12\x1f\n\x1b\x41UTO_EXPANSION_MODE_DEFAULT\x10\x01\"f\n\x16ListEntityTypesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"p\n\x17ListEntityTypesResponse\x12<\n\x0c\x65ntity_types\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.v2.EntityType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\";\n\x14GetEntityTypeRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"}\n\x17\x43reateEntityTypeRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12;\n\x0b\x65ntity_type\x18\x02 \x01(\x0b\x32&.google.cloud.dialogflow.v2.EntityType\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\x9e\x01\n\x17UpdateEntityTypeRequest\x12;\n\x0b\x65ntity_type\x18\x01 \x01(\x0b\x32&.google.cloud.dialogflow.v2.EntityType\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\'\n\x17\x44\x65leteEntityTypeRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"\xfe\x01\n\x1d\x42\x61tchUpdateEntityTypesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x1f\n\x15\x65ntity_type_batch_uri\x18\x02 \x01(\tH\x00\x12O\n\x18\x65ntity_type_batch_inline\x18\x03 \x01(\x0b\x32+.google.cloud.dialogflow.v2.EntityTypeBatchH\x00\x12\x15\n\rlanguage_code\x18\x04 \x01(\t\x12/\n\x0bupdate_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x13\n\x11\x65ntity_type_batch\"^\n\x1e\x42\x61tchUpdateEntityTypesResponse\x12<\n\x0c\x65ntity_types\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.v2.EntityType\"J\n\x1d\x42\x61tchDeleteEntityTypesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x19\n\x11\x65ntity_type_names\x18\x02 \x03(\t\"\x84\x01\n\x1a\x42\x61tchCreateEntitiesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12?\n\x08\x65ntities\x18\x02 \x03(\x0b\x32-.google.cloud.dialogflow.v2.EntityType.Entity\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\xb5\x01\n\x1a\x42\x61tchUpdateEntitiesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12?\n\x08\x65ntities\x18\x02 \x03(\x0b\x32-.google.cloud.dialogflow.v2.EntityType.Entity\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\x12/\n\x0bupdate_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"Z\n\x1a\x42\x61tchDeleteEntitiesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x15\n\rentity_values\x18\x02 \x03(\t\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"O\n\x0f\x45ntityTypeBatch\x12<\n\x0c\x65ntity_types\x18\x01 \x03(\x0b\x32&.google.cloud.dialogflow.v2.EntityType2\x83\x0e\n\x0b\x45ntityTypes\x12\xad\x01\n\x0fListEntityTypes\x12\x32.google.cloud.dialogflow.v2.ListEntityTypesRequest\x1a\x33.google.cloud.dialogflow.v2.ListEntityTypesResponse\"1\x82\xd3\xe4\x93\x02+\x12)/v2/{parent=projects/*/agent}/entityTypes\x12\x9c\x01\n\rGetEntityType\x12\x30.google.cloud.dialogflow.v2.GetEntityTypeRequest\x1a&.google.cloud.dialogflow.v2.EntityType\"1\x82\xd3\xe4\x93\x02+\x12)/v2/{name=projects/*/agent/entityTypes/*}\x12\xaf\x01\n\x10\x43reateEntityType\x12\x33.google.cloud.dialogflow.v2.CreateEntityTypeRequest\x1a&.google.cloud.dialogflow.v2.EntityType\">\x82\xd3\xe4\x93\x02\x38\")/v2/{parent=projects/*/agent}/entityTypes:\x0b\x65ntity_type\x12\xbb\x01\n\x10UpdateEntityType\x12\x33.google.cloud.dialogflow.v2.UpdateEntityTypeRequest\x1a&.google.cloud.dialogflow.v2.EntityType\"J\x82\xd3\xe4\x93\x02\x44\x32\x35/v2/{entity_type.name=projects/*/agent/entityTypes/*}:\x0b\x65ntity_type\x12\x92\x01\n\x10\x44\x65leteEntityType\x12\x33.google.cloud.dialogflow.v2.DeleteEntityTypeRequest\x1a\x16.google.protobuf.Empty\"1\x82\xd3\xe4\x93\x02+*)/v2/{name=projects/*/agent/entityTypes/*}\x12\xb4\x01\n\x16\x42\x61tchUpdateEntityTypes\x12\x39.google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest\x1a\x1d.google.longrunning.Operation\"@\x82\xd3\xe4\x93\x02:\"5/v2/{parent=projects/*/agent}/entityTypes:batchUpdate:\x01*\x12\xb4\x01\n\x16\x42\x61tchDeleteEntityTypes\x12\x39.google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest\x1a\x1d.google.longrunning.Operation\"@\x82\xd3\xe4\x93\x02:\"5/v2/{parent=projects/*/agent}/entityTypes:batchDelete:\x01*\x12\xb9\x01\n\x13\x42\x61tchCreateEntities\x12\x36.google.cloud.dialogflow.v2.BatchCreateEntitiesRequest\x1a\x1d.google.longrunning.Operation\"K\x82\xd3\xe4\x93\x02\x45\"@/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate:\x01*\x12\xb9\x01\n\x13\x42\x61tchUpdateEntities\x12\x36.google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest\x1a\x1d.google.longrunning.Operation\"K\x82\xd3\xe4\x93\x02\x45\"@/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate:\x01*\x12\xb9\x01\n\x13\x42\x61tchDeleteEntities\x12\x36.google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest\x1a\x1d.google.longrunning.Operation\"K\x82\xd3\xe4\x93\x02\x45\"@/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete:\x01*B\x9e\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0f\x45ntityTypeProtoP\x01ZDgoogle.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow\xf8\x01\x01\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3') + , + dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR,google_dot_longrunning_dot_operations__pb2.DESCRIPTOR,google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR,google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,]) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + +_ENTITYTYPE_KIND = _descriptor.EnumDescriptor( + name='Kind', + full_name='google.cloud.dialogflow.v2.EntityType.Kind', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='KIND_UNSPECIFIED', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='KIND_MAP', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='KIND_LIST', index=2, number=2, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=547, + serialized_end=604, +) +_sym_db.RegisterEnumDescriptor(_ENTITYTYPE_KIND) + +_ENTITYTYPE_AUTOEXPANSIONMODE = _descriptor.EnumDescriptor( + name='AutoExpansionMode', + full_name='google.cloud.dialogflow.v2.EntityType.AutoExpansionMode', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='AUTO_EXPANSION_MODE_UNSPECIFIED', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='AUTO_EXPANSION_MODE_DEFAULT', index=1, number=1, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=606, + serialized_end=695, +) +_sym_db.RegisterEnumDescriptor(_ENTITYTYPE_AUTOEXPANSIONMODE) + + +_ENTITYTYPE_ENTITY = _descriptor.Descriptor( + name='Entity', + full_name='google.cloud.dialogflow.v2.EntityType.Entity', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='google.cloud.dialogflow.v2.EntityType.Entity.value', 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, + options=None), + _descriptor.FieldDescriptor( + name='synonyms', full_name='google.cloud.dialogflow.v2.EntityType.Entity.synonyms', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=504, + serialized_end=545, +) + +_ENTITYTYPE = _descriptor.Descriptor( + name='EntityType', + full_name='google.cloud.dialogflow.v2.EntityType', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='google.cloud.dialogflow.v2.EntityType.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, + options=None), + _descriptor.FieldDescriptor( + name='display_name', full_name='google.cloud.dialogflow.v2.EntityType.display_name', 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, + options=None), + _descriptor.FieldDescriptor( + name='kind', full_name='google.cloud.dialogflow.v2.EntityType.kind', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='auto_expansion_mode', full_name='google.cloud.dialogflow.v2.EntityType.auto_expansion_mode', index=3, + number=4, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='entities', full_name='google.cloud.dialogflow.v2.EntityType.entities', index=4, + number=6, 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, + options=None), + ], + extensions=[ + ], + nested_types=[_ENTITYTYPE_ENTITY, ], + enum_types=[ + _ENTITYTYPE_KIND, + _ENTITYTYPE_AUTOEXPANSIONMODE, + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=243, + serialized_end=695, +) + + +_LISTENTITYTYPESREQUEST = _descriptor.Descriptor( + name='ListEntityTypesRequest', + full_name='google.cloud.dialogflow.v2.ListEntityTypesRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.ListEntityTypesRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.dialogflow.v2.ListEntityTypesRequest.language_code', 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, + options=None), + _descriptor.FieldDescriptor( + name='page_size', full_name='google.cloud.dialogflow.v2.ListEntityTypesRequest.page_size', index=2, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='page_token', full_name='google.cloud.dialogflow.v2.ListEntityTypesRequest.page_token', index=3, + number=4, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=697, + serialized_end=799, +) + + +_LISTENTITYTYPESRESPONSE = _descriptor.Descriptor( + name='ListEntityTypesResponse', + full_name='google.cloud.dialogflow.v2.ListEntityTypesResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='entity_types', full_name='google.cloud.dialogflow.v2.ListEntityTypesResponse.entity_types', 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, + options=None), + _descriptor.FieldDescriptor( + name='next_page_token', full_name='google.cloud.dialogflow.v2.ListEntityTypesResponse.next_page_token', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=801, + serialized_end=913, +) + + +_GETENTITYTYPEREQUEST = _descriptor.Descriptor( + name='GetEntityTypeRequest', + full_name='google.cloud.dialogflow.v2.GetEntityTypeRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='google.cloud.dialogflow.v2.GetEntityTypeRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.dialogflow.v2.GetEntityTypeRequest.language_code', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=915, + serialized_end=974, +) + + +_CREATEENTITYTYPEREQUEST = _descriptor.Descriptor( + name='CreateEntityTypeRequest', + full_name='google.cloud.dialogflow.v2.CreateEntityTypeRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.CreateEntityTypeRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='entity_type', full_name='google.cloud.dialogflow.v2.CreateEntityTypeRequest.entity_type', 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, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.dialogflow.v2.CreateEntityTypeRequest.language_code', index=2, + 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=976, + serialized_end=1101, +) + + +_UPDATEENTITYTYPEREQUEST = _descriptor.Descriptor( + name='UpdateEntityTypeRequest', + full_name='google.cloud.dialogflow.v2.UpdateEntityTypeRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='entity_type', full_name='google.cloud.dialogflow.v2.UpdateEntityTypeRequest.entity_type', index=0, + number=1, 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, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.dialogflow.v2.UpdateEntityTypeRequest.language_code', 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, + options=None), + _descriptor.FieldDescriptor( + name='update_mask', full_name='google.cloud.dialogflow.v2.UpdateEntityTypeRequest.update_mask', index=2, + number=3, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1104, + serialized_end=1262, +) + + +_DELETEENTITYTYPEREQUEST = _descriptor.Descriptor( + name='DeleteEntityTypeRequest', + full_name='google.cloud.dialogflow.v2.DeleteEntityTypeRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='google.cloud.dialogflow.v2.DeleteEntityTypeRequest.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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1264, + serialized_end=1303, +) + + +_BATCHUPDATEENTITYTYPESREQUEST = _descriptor.Descriptor( + name='BatchUpdateEntityTypesRequest', + full_name='google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='entity_type_batch_uri', full_name='google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.entity_type_batch_uri', 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, + options=None), + _descriptor.FieldDescriptor( + name='entity_type_batch_inline', full_name='google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.entity_type_batch_inline', index=2, + number=3, 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, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.language_code', index=3, + number=4, 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, + options=None), + _descriptor.FieldDescriptor( + name='update_mask', full_name='google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.update_mask', index=4, + number=5, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='entity_type_batch', full_name='google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.entity_type_batch', + index=0, containing_type=None, fields=[]), + ], + serialized_start=1306, + serialized_end=1560, +) + + +_BATCHUPDATEENTITYTYPESRESPONSE = _descriptor.Descriptor( + name='BatchUpdateEntityTypesResponse', + full_name='google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='entity_types', full_name='google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse.entity_types', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1562, + serialized_end=1656, +) + + +_BATCHDELETEENTITYTYPESREQUEST = _descriptor.Descriptor( + name='BatchDeleteEntityTypesRequest', + full_name='google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='entity_type_names', full_name='google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest.entity_type_names', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1658, + serialized_end=1732, +) + + +_BATCHCREATEENTITIESREQUEST = _descriptor.Descriptor( + name='BatchCreateEntitiesRequest', + full_name='google.cloud.dialogflow.v2.BatchCreateEntitiesRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.BatchCreateEntitiesRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='entities', full_name='google.cloud.dialogflow.v2.BatchCreateEntitiesRequest.entities', index=1, + number=2, 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, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.dialogflow.v2.BatchCreateEntitiesRequest.language_code', index=2, + 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1735, + serialized_end=1867, +) + + +_BATCHUPDATEENTITIESREQUEST = _descriptor.Descriptor( + name='BatchUpdateEntitiesRequest', + full_name='google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='entities', full_name='google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.entities', index=1, + number=2, 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, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.language_code', index=2, + 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, + options=None), + _descriptor.FieldDescriptor( + name='update_mask', full_name='google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.update_mask', index=3, + number=4, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1870, + serialized_end=2051, +) + + +_BATCHDELETEENTITIESREQUEST = _descriptor.Descriptor( + name='BatchDeleteEntitiesRequest', + full_name='google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='entity_values', full_name='google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest.entity_values', 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, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest.language_code', index=2, + 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2053, + serialized_end=2143, +) + + +_ENTITYTYPEBATCH = _descriptor.Descriptor( + name='EntityTypeBatch', + full_name='google.cloud.dialogflow.v2.EntityTypeBatch', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='entity_types', full_name='google.cloud.dialogflow.v2.EntityTypeBatch.entity_types', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2145, + serialized_end=2224, +) + +_ENTITYTYPE_ENTITY.containing_type = _ENTITYTYPE +_ENTITYTYPE.fields_by_name['kind'].enum_type = _ENTITYTYPE_KIND +_ENTITYTYPE.fields_by_name['auto_expansion_mode'].enum_type = _ENTITYTYPE_AUTOEXPANSIONMODE +_ENTITYTYPE.fields_by_name['entities'].message_type = _ENTITYTYPE_ENTITY +_ENTITYTYPE_KIND.containing_type = _ENTITYTYPE +_ENTITYTYPE_AUTOEXPANSIONMODE.containing_type = _ENTITYTYPE +_LISTENTITYTYPESRESPONSE.fields_by_name['entity_types'].message_type = _ENTITYTYPE +_CREATEENTITYTYPEREQUEST.fields_by_name['entity_type'].message_type = _ENTITYTYPE +_UPDATEENTITYTYPEREQUEST.fields_by_name['entity_type'].message_type = _ENTITYTYPE +_UPDATEENTITYTYPEREQUEST.fields_by_name['update_mask'].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK +_BATCHUPDATEENTITYTYPESREQUEST.fields_by_name['entity_type_batch_inline'].message_type = _ENTITYTYPEBATCH +_BATCHUPDATEENTITYTYPESREQUEST.fields_by_name['update_mask'].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK +_BATCHUPDATEENTITYTYPESREQUEST.oneofs_by_name['entity_type_batch'].fields.append( + _BATCHUPDATEENTITYTYPESREQUEST.fields_by_name['entity_type_batch_uri']) +_BATCHUPDATEENTITYTYPESREQUEST.fields_by_name['entity_type_batch_uri'].containing_oneof = _BATCHUPDATEENTITYTYPESREQUEST.oneofs_by_name['entity_type_batch'] +_BATCHUPDATEENTITYTYPESREQUEST.oneofs_by_name['entity_type_batch'].fields.append( + _BATCHUPDATEENTITYTYPESREQUEST.fields_by_name['entity_type_batch_inline']) +_BATCHUPDATEENTITYTYPESREQUEST.fields_by_name['entity_type_batch_inline'].containing_oneof = _BATCHUPDATEENTITYTYPESREQUEST.oneofs_by_name['entity_type_batch'] +_BATCHUPDATEENTITYTYPESRESPONSE.fields_by_name['entity_types'].message_type = _ENTITYTYPE +_BATCHCREATEENTITIESREQUEST.fields_by_name['entities'].message_type = _ENTITYTYPE_ENTITY +_BATCHUPDATEENTITIESREQUEST.fields_by_name['entities'].message_type = _ENTITYTYPE_ENTITY +_BATCHUPDATEENTITIESREQUEST.fields_by_name['update_mask'].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK +_ENTITYTYPEBATCH.fields_by_name['entity_types'].message_type = _ENTITYTYPE +DESCRIPTOR.message_types_by_name['EntityType'] = _ENTITYTYPE +DESCRIPTOR.message_types_by_name['ListEntityTypesRequest'] = _LISTENTITYTYPESREQUEST +DESCRIPTOR.message_types_by_name['ListEntityTypesResponse'] = _LISTENTITYTYPESRESPONSE +DESCRIPTOR.message_types_by_name['GetEntityTypeRequest'] = _GETENTITYTYPEREQUEST +DESCRIPTOR.message_types_by_name['CreateEntityTypeRequest'] = _CREATEENTITYTYPEREQUEST +DESCRIPTOR.message_types_by_name['UpdateEntityTypeRequest'] = _UPDATEENTITYTYPEREQUEST +DESCRIPTOR.message_types_by_name['DeleteEntityTypeRequest'] = _DELETEENTITYTYPEREQUEST +DESCRIPTOR.message_types_by_name['BatchUpdateEntityTypesRequest'] = _BATCHUPDATEENTITYTYPESREQUEST +DESCRIPTOR.message_types_by_name['BatchUpdateEntityTypesResponse'] = _BATCHUPDATEENTITYTYPESRESPONSE +DESCRIPTOR.message_types_by_name['BatchDeleteEntityTypesRequest'] = _BATCHDELETEENTITYTYPESREQUEST +DESCRIPTOR.message_types_by_name['BatchCreateEntitiesRequest'] = _BATCHCREATEENTITIESREQUEST +DESCRIPTOR.message_types_by_name['BatchUpdateEntitiesRequest'] = _BATCHUPDATEENTITIESREQUEST +DESCRIPTOR.message_types_by_name['BatchDeleteEntitiesRequest'] = _BATCHDELETEENTITIESREQUEST +DESCRIPTOR.message_types_by_name['EntityTypeBatch'] = _ENTITYTYPEBATCH + +EntityType = _reflection.GeneratedProtocolMessageType('EntityType', (_message.Message,), dict( + + Entity = _reflection.GeneratedProtocolMessageType('Entity', (_message.Message,), dict( + DESCRIPTOR = _ENTITYTYPE_ENTITY, + __module__ = 'google.cloud.dialogflow_v2.proto.entity_type_pb2' + , + __doc__ = """Optional. Represents an entity. + + + Attributes: + value: + Required. For ``KIND_MAP`` entity types: A canonical name to + be used in place of synonyms. For ``KIND_LIST`` entity types: + A string that can contain references to other entity types + (with or without aliases). + synonyms: + Required. A collection of synonyms. For ``KIND_LIST`` entity + types this must contain exactly one synonym equal to + ``value``. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.EntityType.Entity) + )) + , + DESCRIPTOR = _ENTITYTYPE, + __module__ = 'google.cloud.dialogflow_v2.proto.entity_type_pb2' + , + __doc__ = """Represents an entity type. Entity types serve as a tool for extracting + parameter values from natural language queries. + + + Attributes: + name: + Required for all methods except ``create`` (``create`` + populates the name automatically. The unique identifier of the + entity type. Format: ``projects//agent/entityTypes/``. + display_name: + Required. The name of the entity. + kind: + Required. Indicates the kind of entity type. + auto_expansion_mode: + Optional. Indicates whether the entity type can be + automatically expanded. + entities: + Optional. The collection of entities associated with the + entity type. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.EntityType) + )) +_sym_db.RegisterMessage(EntityType) +_sym_db.RegisterMessage(EntityType.Entity) + +ListEntityTypesRequest = _reflection.GeneratedProtocolMessageType('ListEntityTypesRequest', (_message.Message,), dict( + DESCRIPTOR = _LISTENTITYTYPESREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.entity_type_pb2' + , + __doc__ = """The request message for + [EntityTypes.ListEntityTypes][google.cloud.dialogflow.v2.EntityTypes.ListEntityTypes]. + + + Attributes: + parent: + Required. The agent to list all entity types from. Format: + ``projects//agent``. + language_code: + Optional. The language to list entity synonyms for. If not + specified, the agent's default language is used. `More than a + dozen languages + `__ are + supported. Note: languages must be enabled in the agent, + before they can be used. + page_size: + Optional. The maximum number of items to return in a single + page. By default 100 and at most 1000. + page_token: + Optional. The next\_page\_token value returned from a previous + list request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ListEntityTypesRequest) + )) +_sym_db.RegisterMessage(ListEntityTypesRequest) + +ListEntityTypesResponse = _reflection.GeneratedProtocolMessageType('ListEntityTypesResponse', (_message.Message,), dict( + DESCRIPTOR = _LISTENTITYTYPESRESPONSE, + __module__ = 'google.cloud.dialogflow_v2.proto.entity_type_pb2' + , + __doc__ = """The response message for + [EntityTypes.ListEntityTypes][google.cloud.dialogflow.v2.EntityTypes.ListEntityTypes]. + + + Attributes: + entity_types: + The list of agent entity types. There will be a maximum number + of items returned based on the page\_size field in the + request. + next_page_token: + Token to retrieve the next page of results, or empty if there + are no more results in the list. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ListEntityTypesResponse) + )) +_sym_db.RegisterMessage(ListEntityTypesResponse) + +GetEntityTypeRequest = _reflection.GeneratedProtocolMessageType('GetEntityTypeRequest', (_message.Message,), dict( + DESCRIPTOR = _GETENTITYTYPEREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.entity_type_pb2' + , + __doc__ = """The request message for + [EntityTypes.GetEntityType][google.cloud.dialogflow.v2.EntityTypes.GetEntityType]. + + + Attributes: + name: + Required. The name of the entity type. Format: + ``projects//agent/entityTypes/``. + language_code: + Optional. The language to retrieve entity synonyms for. If not + specified, the agent's default language is used. `More than a + dozen languages + `__ are + supported. Note: languages must be enabled in the agent, + before they can be used. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.GetEntityTypeRequest) + )) +_sym_db.RegisterMessage(GetEntityTypeRequest) + +CreateEntityTypeRequest = _reflection.GeneratedProtocolMessageType('CreateEntityTypeRequest', (_message.Message,), dict( + DESCRIPTOR = _CREATEENTITYTYPEREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.entity_type_pb2' + , + __doc__ = """The request message for + [EntityTypes.CreateEntityType][google.cloud.dialogflow.v2.EntityTypes.CreateEntityType]. + + + Attributes: + parent: + Required. The agent to create a entity type for. Format: + ``projects//agent``. + entity_type: + Required. The entity type to create. + language_code: + Optional. The language of entity synonyms defined in + ``entity_type``. If not specified, the agent's default + language is used. `More than a dozen languages + `__ are + supported. Note: languages must be enabled in the agent, + before they can be used. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.CreateEntityTypeRequest) + )) +_sym_db.RegisterMessage(CreateEntityTypeRequest) + +UpdateEntityTypeRequest = _reflection.GeneratedProtocolMessageType('UpdateEntityTypeRequest', (_message.Message,), dict( + DESCRIPTOR = _UPDATEENTITYTYPEREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.entity_type_pb2' + , + __doc__ = """The request message for + [EntityTypes.UpdateEntityType][google.cloud.dialogflow.v2.EntityTypes.UpdateEntityType]. + + + Attributes: + entity_type: + Required. The entity type to update. Format: + ``projects//agent/entityTypes/``. + language_code: + Optional. The language of entity synonyms defined in + ``entity_type``. If not specified, the agent's default + language is used. `More than a dozen languages + `__ are + supported. Note: languages must be enabled in the agent, + before they can be used. + update_mask: + Optional. The mask to control which fields get updated. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.UpdateEntityTypeRequest) + )) +_sym_db.RegisterMessage(UpdateEntityTypeRequest) + +DeleteEntityTypeRequest = _reflection.GeneratedProtocolMessageType('DeleteEntityTypeRequest', (_message.Message,), dict( + DESCRIPTOR = _DELETEENTITYTYPEREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.entity_type_pb2' + , + __doc__ = """The request message for + [EntityTypes.DeleteEntityType][google.cloud.dialogflow.v2.EntityTypes.DeleteEntityType]. + + + Attributes: + name: + Required. The name of the entity type to delete. Format: + ``projects//agent/entityTypes/``. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.DeleteEntityTypeRequest) + )) +_sym_db.RegisterMessage(DeleteEntityTypeRequest) + +BatchUpdateEntityTypesRequest = _reflection.GeneratedProtocolMessageType('BatchUpdateEntityTypesRequest', (_message.Message,), dict( + DESCRIPTOR = _BATCHUPDATEENTITYTYPESREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.entity_type_pb2' + , + __doc__ = """The request message for + [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes]. + + + Attributes: + parent: + Required. The name of the agent to update or create entity + types in. Format: ``projects//agent``. + entity_type_batch: + Required. The source of the entity type batch. For each + entity type in the batch: \* If ``name`` is specified, we + update an existing entity type. \* If ``name`` is not + specified, we create a new entity type. + entity_type_batch_uri: + The URI to a Google Cloud Storage file containing entity types + to update or create. The file format can either be a + serialized proto (of EntityBatch type) or a JSON object. Note: + The URI must start with "gs://". + entity_type_batch_inline: + The collection of entity type to update or create. + language_code: + Optional. The language of entity synonyms defined in + ``entity_types``. If not specified, the agent's default + language is used. `More than a dozen languages + `__ are + supported. Note: languages must be enabled in the agent, + before they can be used. + update_mask: + Optional. The mask to control which fields get updated. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest) + )) +_sym_db.RegisterMessage(BatchUpdateEntityTypesRequest) + +BatchUpdateEntityTypesResponse = _reflection.GeneratedProtocolMessageType('BatchUpdateEntityTypesResponse', (_message.Message,), dict( + DESCRIPTOR = _BATCHUPDATEENTITYTYPESRESPONSE, + __module__ = 'google.cloud.dialogflow_v2.proto.entity_type_pb2' + , + __doc__ = """The response message for + [EntityTypes.BatchUpdateEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypes]. + + + Attributes: + entity_types: + The collection of updated or created entity types. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse) + )) +_sym_db.RegisterMessage(BatchUpdateEntityTypesResponse) + +BatchDeleteEntityTypesRequest = _reflection.GeneratedProtocolMessageType('BatchDeleteEntityTypesRequest', (_message.Message,), dict( + DESCRIPTOR = _BATCHDELETEENTITYTYPESREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.entity_type_pb2' + , + __doc__ = """The request message for + [EntityTypes.BatchDeleteEntityTypes][google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntityTypes]. + + + Attributes: + parent: + Required. The name of the agent to delete all entities types + for. Format: ``projects//agent``. + entity_type_names: + Required. The names entity types to delete. All names must + point to the same agent as ``parent``. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest) + )) +_sym_db.RegisterMessage(BatchDeleteEntityTypesRequest) + +BatchCreateEntitiesRequest = _reflection.GeneratedProtocolMessageType('BatchCreateEntitiesRequest', (_message.Message,), dict( + DESCRIPTOR = _BATCHCREATEENTITIESREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.entity_type_pb2' + , + __doc__ = """The request message for + [EntityTypes.BatchCreateEntities][google.cloud.dialogflow.v2.EntityTypes.BatchCreateEntities]. + + + Attributes: + parent: + Required. The name of the entity type to create entities in. + Format: ``projects//agent/entityTypes/``. + entities: + Required. The collection of entities to create. + language_code: + Optional. The language of entity synonyms defined in + ``entities``. If not specified, the agent's default language + is used. `More than a dozen languages + `__ are + supported. Note: languages must be enabled in the agent, + before they can be used. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.BatchCreateEntitiesRequest) + )) +_sym_db.RegisterMessage(BatchCreateEntitiesRequest) + +BatchUpdateEntitiesRequest = _reflection.GeneratedProtocolMessageType('BatchUpdateEntitiesRequest', (_message.Message,), dict( + DESCRIPTOR = _BATCHUPDATEENTITIESREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.entity_type_pb2' + , + __doc__ = """The response message for + [EntityTypes.BatchCreateEntities][google.cloud.dialogflow.v2.EntityTypes.BatchCreateEntities]. + + + Attributes: + parent: + Required. The name of the entity type to update the entities + in. Format: ``projects//agent/entityTypes/``. + entities: + Required. The collection of new entities to replace the + existing entities. + language_code: + Optional. The language of entity synonyms defined in + ``entities``. If not specified, the agent's default language + is used. `More than a dozen languages + `__ are + supported. Note: languages must be enabled in the agent, + before they can be used. + update_mask: + Optional. The mask to control which fields get updated. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest) + )) +_sym_db.RegisterMessage(BatchUpdateEntitiesRequest) + +BatchDeleteEntitiesRequest = _reflection.GeneratedProtocolMessageType('BatchDeleteEntitiesRequest', (_message.Message,), dict( + DESCRIPTOR = _BATCHDELETEENTITIESREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.entity_type_pb2' + , + __doc__ = """The request message for + [EntityTypes.BatchDeleteEntities][google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntities]. + + + Attributes: + parent: + Required. The name of the entity type to delete entries for. + Format: ``projects//agent/entityTypes/``. + entity_values: + Required. The canonical ``values`` of the entities to delete. + Note that these are not fully-qualified names, i.e. they don't + start with ``projects/``. + language_code: + Optional. The language of entity synonyms defined in + ``entities``. If not specified, the agent's default language + is used. `More than a dozen languages + `__ are + supported. Note: languages must be enabled in the agent, + before they can be used. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest) + )) +_sym_db.RegisterMessage(BatchDeleteEntitiesRequest) + +EntityTypeBatch = _reflection.GeneratedProtocolMessageType('EntityTypeBatch', (_message.Message,), dict( + DESCRIPTOR = _ENTITYTYPEBATCH, + __module__ = 'google.cloud.dialogflow_v2.proto.entity_type_pb2' + , + __doc__ = """This message is a wrapper around a collection of entity types. + + + Attributes: + entity_types: + A collection of entity types. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.EntityTypeBatch) + )) +_sym_db.RegisterMessage(EntityTypeBatch) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\036com.google.cloud.dialogflow.v2B\017EntityTypeProtoP\001ZDgoogle.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow\370\001\001\242\002\002DF\252\002\032Google.Cloud.Dialogflow.V2')) +try: + # THESE ELEMENTS WILL BE DEPRECATED. + # Please use the generated *_pb2_grpc.py files instead. + import grpc + from grpc.beta import implementations as beta_implementations + from grpc.beta import interfaces as beta_interfaces + from grpc.framework.common import cardinality + from grpc.framework.interfaces.face import utilities as face_utilities + + + class EntityTypesStub(object): + """Manages agent entity types. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/entities) + for more details about entity types. + # + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListEntityTypes = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/ListEntityTypes', + request_serializer=ListEntityTypesRequest.SerializeToString, + response_deserializer=ListEntityTypesResponse.FromString, + ) + self.GetEntityType = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/GetEntityType', + request_serializer=GetEntityTypeRequest.SerializeToString, + response_deserializer=EntityType.FromString, + ) + self.CreateEntityType = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/CreateEntityType', + request_serializer=CreateEntityTypeRequest.SerializeToString, + response_deserializer=EntityType.FromString, + ) + self.UpdateEntityType = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/UpdateEntityType', + request_serializer=UpdateEntityTypeRequest.SerializeToString, + response_deserializer=EntityType.FromString, + ) + self.DeleteEntityType = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/DeleteEntityType', + request_serializer=DeleteEntityTypeRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + self.BatchUpdateEntityTypes = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/BatchUpdateEntityTypes', + request_serializer=BatchUpdateEntityTypesRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.BatchDeleteEntityTypes = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/BatchDeleteEntityTypes', + request_serializer=BatchDeleteEntityTypesRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.BatchCreateEntities = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/BatchCreateEntities', + request_serializer=BatchCreateEntitiesRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.BatchUpdateEntities = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/BatchUpdateEntities', + request_serializer=BatchUpdateEntitiesRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.BatchDeleteEntities = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/BatchDeleteEntities', + request_serializer=BatchDeleteEntitiesRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + + + class EntityTypesServicer(object): + """Manages agent entity types. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/entities) + for more details about entity types. + # + """ + + def ListEntityTypes(self, request, context): + """Returns the list of all entity types in the specified agent. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetEntityType(self, request, context): + """Retrieves the specified entity type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateEntityType(self, request, context): + """Creates an entity type in the specified agent. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateEntityType(self, request, context): + """Updates the specified entity type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteEntityType(self, request, context): + """Deletes the specified entity type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BatchUpdateEntityTypes(self, request, context): + """Updates/Creates multiple entity types in the specified agent. + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BatchDeleteEntityTypes(self, request, context): + """Deletes entity types in the specified agent. + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BatchCreateEntities(self, request, context): + """Creates multiple new entities in the specified entity type (extends the + existing collection of entries). + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BatchUpdateEntities(self, request, context): + """Updates entities in the specified entity type (replaces the existing + collection of entries). + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BatchDeleteEntities(self, request, context): + """Deletes entities in the specified entity type. + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + + def add_EntityTypesServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListEntityTypes': grpc.unary_unary_rpc_method_handler( + servicer.ListEntityTypes, + request_deserializer=ListEntityTypesRequest.FromString, + response_serializer=ListEntityTypesResponse.SerializeToString, + ), + 'GetEntityType': grpc.unary_unary_rpc_method_handler( + servicer.GetEntityType, + request_deserializer=GetEntityTypeRequest.FromString, + response_serializer=EntityType.SerializeToString, + ), + 'CreateEntityType': grpc.unary_unary_rpc_method_handler( + servicer.CreateEntityType, + request_deserializer=CreateEntityTypeRequest.FromString, + response_serializer=EntityType.SerializeToString, + ), + 'UpdateEntityType': grpc.unary_unary_rpc_method_handler( + servicer.UpdateEntityType, + request_deserializer=UpdateEntityTypeRequest.FromString, + response_serializer=EntityType.SerializeToString, + ), + 'DeleteEntityType': grpc.unary_unary_rpc_method_handler( + servicer.DeleteEntityType, + request_deserializer=DeleteEntityTypeRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'BatchUpdateEntityTypes': grpc.unary_unary_rpc_method_handler( + servicer.BatchUpdateEntityTypes, + request_deserializer=BatchUpdateEntityTypesRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + 'BatchDeleteEntityTypes': grpc.unary_unary_rpc_method_handler( + servicer.BatchDeleteEntityTypes, + request_deserializer=BatchDeleteEntityTypesRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + 'BatchCreateEntities': grpc.unary_unary_rpc_method_handler( + servicer.BatchCreateEntities, + request_deserializer=BatchCreateEntitiesRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + 'BatchUpdateEntities': grpc.unary_unary_rpc_method_handler( + servicer.BatchUpdateEntities, + request_deserializer=BatchUpdateEntitiesRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + 'BatchDeleteEntities': grpc.unary_unary_rpc_method_handler( + servicer.BatchDeleteEntities, + request_deserializer=BatchDeleteEntitiesRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'google.cloud.dialogflow.v2.EntityTypes', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + class BetaEntityTypesServicer(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Manages agent entity types. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/entities) + for more details about entity types. + # + """ + def ListEntityTypes(self, request, context): + """Returns the list of all entity types in the specified agent. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def GetEntityType(self, request, context): + """Retrieves the specified entity type. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def CreateEntityType(self, request, context): + """Creates an entity type in the specified agent. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def UpdateEntityType(self, request, context): + """Updates the specified entity type. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def DeleteEntityType(self, request, context): + """Deletes the specified entity type. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def BatchUpdateEntityTypes(self, request, context): + """Updates/Creates multiple entity types in the specified agent. + + Operation + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def BatchDeleteEntityTypes(self, request, context): + """Deletes entity types in the specified agent. + + Operation + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def BatchCreateEntities(self, request, context): + """Creates multiple new entities in the specified entity type (extends the + existing collection of entries). + + Operation + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def BatchUpdateEntities(self, request, context): + """Updates entities in the specified entity type (replaces the existing + collection of entries). + + Operation + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def BatchDeleteEntities(self, request, context): + """Deletes entities in the specified entity type. + + Operation + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + + + class BetaEntityTypesStub(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Manages agent entity types. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/entities) + for more details about entity types. + # + """ + def ListEntityTypes(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Returns the list of all entity types in the specified agent. + """ + raise NotImplementedError() + ListEntityTypes.future = None + def GetEntityType(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Retrieves the specified entity type. + """ + raise NotImplementedError() + GetEntityType.future = None + def CreateEntityType(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Creates an entity type in the specified agent. + """ + raise NotImplementedError() + CreateEntityType.future = None + def UpdateEntityType(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Updates the specified entity type. + """ + raise NotImplementedError() + UpdateEntityType.future = None + def DeleteEntityType(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Deletes the specified entity type. + """ + raise NotImplementedError() + DeleteEntityType.future = None + def BatchUpdateEntityTypes(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Updates/Creates multiple entity types in the specified agent. + + Operation + """ + raise NotImplementedError() + BatchUpdateEntityTypes.future = None + def BatchDeleteEntityTypes(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Deletes entity types in the specified agent. + + Operation + """ + raise NotImplementedError() + BatchDeleteEntityTypes.future = None + def BatchCreateEntities(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Creates multiple new entities in the specified entity type (extends the + existing collection of entries). + + Operation + """ + raise NotImplementedError() + BatchCreateEntities.future = None + def BatchUpdateEntities(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Updates entities in the specified entity type (replaces the existing + collection of entries). + + Operation + """ + raise NotImplementedError() + BatchUpdateEntities.future = None + def BatchDeleteEntities(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Deletes entities in the specified entity type. + + Operation + """ + raise NotImplementedError() + BatchDeleteEntities.future = None + + + def beta_create_EntityTypes_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_deserializers = { + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchCreateEntities'): BatchCreateEntitiesRequest.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchDeleteEntities'): BatchDeleteEntitiesRequest.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchDeleteEntityTypes'): BatchDeleteEntityTypesRequest.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchUpdateEntities'): BatchUpdateEntitiesRequest.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchUpdateEntityTypes'): BatchUpdateEntityTypesRequest.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'CreateEntityType'): CreateEntityTypeRequest.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'DeleteEntityType'): DeleteEntityTypeRequest.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'GetEntityType'): GetEntityTypeRequest.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'ListEntityTypes'): ListEntityTypesRequest.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'UpdateEntityType'): UpdateEntityTypeRequest.FromString, + } + response_serializers = { + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchCreateEntities'): google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchDeleteEntities'): google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchDeleteEntityTypes'): google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchUpdateEntities'): google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchUpdateEntityTypes'): google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'CreateEntityType'): EntityType.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'DeleteEntityType'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'GetEntityType'): EntityType.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'ListEntityTypes'): ListEntityTypesResponse.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'UpdateEntityType'): EntityType.SerializeToString, + } + method_implementations = { + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchCreateEntities'): face_utilities.unary_unary_inline(servicer.BatchCreateEntities), + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchDeleteEntities'): face_utilities.unary_unary_inline(servicer.BatchDeleteEntities), + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchDeleteEntityTypes'): face_utilities.unary_unary_inline(servicer.BatchDeleteEntityTypes), + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchUpdateEntities'): face_utilities.unary_unary_inline(servicer.BatchUpdateEntities), + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchUpdateEntityTypes'): face_utilities.unary_unary_inline(servicer.BatchUpdateEntityTypes), + ('google.cloud.dialogflow.v2.EntityTypes', 'CreateEntityType'): face_utilities.unary_unary_inline(servicer.CreateEntityType), + ('google.cloud.dialogflow.v2.EntityTypes', 'DeleteEntityType'): face_utilities.unary_unary_inline(servicer.DeleteEntityType), + ('google.cloud.dialogflow.v2.EntityTypes', 'GetEntityType'): face_utilities.unary_unary_inline(servicer.GetEntityType), + ('google.cloud.dialogflow.v2.EntityTypes', 'ListEntityTypes'): face_utilities.unary_unary_inline(servicer.ListEntityTypes), + ('google.cloud.dialogflow.v2.EntityTypes', 'UpdateEntityType'): face_utilities.unary_unary_inline(servicer.UpdateEntityType), + } + server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) + return beta_implementations.server(method_implementations, options=server_options) + + + def beta_create_EntityTypes_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_serializers = { + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchCreateEntities'): BatchCreateEntitiesRequest.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchDeleteEntities'): BatchDeleteEntitiesRequest.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchDeleteEntityTypes'): BatchDeleteEntityTypesRequest.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchUpdateEntities'): BatchUpdateEntitiesRequest.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchUpdateEntityTypes'): BatchUpdateEntityTypesRequest.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'CreateEntityType'): CreateEntityTypeRequest.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'DeleteEntityType'): DeleteEntityTypeRequest.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'GetEntityType'): GetEntityTypeRequest.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'ListEntityTypes'): ListEntityTypesRequest.SerializeToString, + ('google.cloud.dialogflow.v2.EntityTypes', 'UpdateEntityType'): UpdateEntityTypeRequest.SerializeToString, + } + response_deserializers = { + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchCreateEntities'): google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchDeleteEntities'): google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchDeleteEntityTypes'): google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchUpdateEntities'): google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'BatchUpdateEntityTypes'): google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'CreateEntityType'): EntityType.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'DeleteEntityType'): google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'GetEntityType'): EntityType.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'ListEntityTypes'): ListEntityTypesResponse.FromString, + ('google.cloud.dialogflow.v2.EntityTypes', 'UpdateEntityType'): EntityType.FromString, + } + cardinalities = { + 'BatchCreateEntities': cardinality.Cardinality.UNARY_UNARY, + 'BatchDeleteEntities': cardinality.Cardinality.UNARY_UNARY, + 'BatchDeleteEntityTypes': cardinality.Cardinality.UNARY_UNARY, + 'BatchUpdateEntities': cardinality.Cardinality.UNARY_UNARY, + 'BatchUpdateEntityTypes': cardinality.Cardinality.UNARY_UNARY, + 'CreateEntityType': cardinality.Cardinality.UNARY_UNARY, + 'DeleteEntityType': cardinality.Cardinality.UNARY_UNARY, + 'GetEntityType': cardinality.Cardinality.UNARY_UNARY, + 'ListEntityTypes': cardinality.Cardinality.UNARY_UNARY, + 'UpdateEntityType': cardinality.Cardinality.UNARY_UNARY, + } + stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) + return beta_implementations.dynamic_stub(channel, 'google.cloud.dialogflow.v2.EntityTypes', cardinalities, options=stub_options) +except ImportError: + pass +# @@protoc_insertion_point(module_scope) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/proto/entity_type_pb2_grpc.py b/packages/google-cloud-dialogflow/dialogflow_v2/proto/entity_type_pb2_grpc.py new file mode 100755 index 000000000000..4c46d29a4d7b --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/proto/entity_type_pb2_grpc.py @@ -0,0 +1,227 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + +import dialogflow_v2.proto.entity_type_pb2 as google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2 +import google.longrunning.operations_pb2 as google_dot_longrunning_dot_operations__pb2 +import google.protobuf.empty_pb2 as google_dot_protobuf_dot_empty__pb2 + + +class EntityTypesStub(object): + """Manages agent entity types. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/entities) + for more details about entity types. + # + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListEntityTypes = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/ListEntityTypes', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.ListEntityTypesRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.ListEntityTypesResponse.FromString, + ) + self.GetEntityType = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/GetEntityType', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.GetEntityTypeRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.EntityType.FromString, + ) + self.CreateEntityType = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/CreateEntityType', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.CreateEntityTypeRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.EntityType.FromString, + ) + self.UpdateEntityType = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/UpdateEntityType', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.UpdateEntityTypeRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.EntityType.FromString, + ) + self.DeleteEntityType = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/DeleteEntityType', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.DeleteEntityTypeRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + self.BatchUpdateEntityTypes = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/BatchUpdateEntityTypes', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.BatchUpdateEntityTypesRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.BatchDeleteEntityTypes = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/BatchDeleteEntityTypes', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.BatchDeleteEntityTypesRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.BatchCreateEntities = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/BatchCreateEntities', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.BatchCreateEntitiesRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.BatchUpdateEntities = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/BatchUpdateEntities', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.BatchUpdateEntitiesRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.BatchDeleteEntities = channel.unary_unary( + '/google.cloud.dialogflow.v2.EntityTypes/BatchDeleteEntities', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.BatchDeleteEntitiesRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + + +class EntityTypesServicer(object): + """Manages agent entity types. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/entities) + for more details about entity types. + # + """ + + def ListEntityTypes(self, request, context): + """Returns the list of all entity types in the specified agent. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetEntityType(self, request, context): + """Retrieves the specified entity type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateEntityType(self, request, context): + """Creates an entity type in the specified agent. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateEntityType(self, request, context): + """Updates the specified entity type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteEntityType(self, request, context): + """Deletes the specified entity type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BatchUpdateEntityTypes(self, request, context): + """Updates/Creates multiple entity types in the specified agent. + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BatchDeleteEntityTypes(self, request, context): + """Deletes entity types in the specified agent. + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BatchCreateEntities(self, request, context): + """Creates multiple new entities in the specified entity type (extends the + existing collection of entries). + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BatchUpdateEntities(self, request, context): + """Updates entities in the specified entity type (replaces the existing + collection of entries). + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BatchDeleteEntities(self, request, context): + """Deletes entities in the specified entity type. + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_EntityTypesServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListEntityTypes': grpc.unary_unary_rpc_method_handler( + servicer.ListEntityTypes, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.ListEntityTypesRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.ListEntityTypesResponse.SerializeToString, + ), + 'GetEntityType': grpc.unary_unary_rpc_method_handler( + servicer.GetEntityType, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.GetEntityTypeRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.EntityType.SerializeToString, + ), + 'CreateEntityType': grpc.unary_unary_rpc_method_handler( + servicer.CreateEntityType, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.CreateEntityTypeRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.EntityType.SerializeToString, + ), + 'UpdateEntityType': grpc.unary_unary_rpc_method_handler( + servicer.UpdateEntityType, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.UpdateEntityTypeRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.EntityType.SerializeToString, + ), + 'DeleteEntityType': grpc.unary_unary_rpc_method_handler( + servicer.DeleteEntityType, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.DeleteEntityTypeRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'BatchUpdateEntityTypes': grpc.unary_unary_rpc_method_handler( + servicer.BatchUpdateEntityTypes, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.BatchUpdateEntityTypesRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + 'BatchDeleteEntityTypes': grpc.unary_unary_rpc_method_handler( + servicer.BatchDeleteEntityTypes, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.BatchDeleteEntityTypesRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + 'BatchCreateEntities': grpc.unary_unary_rpc_method_handler( + servicer.BatchCreateEntities, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.BatchCreateEntitiesRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + 'BatchUpdateEntities': grpc.unary_unary_rpc_method_handler( + servicer.BatchUpdateEntities, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.BatchUpdateEntitiesRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + 'BatchDeleteEntities': grpc.unary_unary_rpc_method_handler( + servicer.BatchDeleteEntities, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.BatchDeleteEntitiesRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'google.cloud.dialogflow.v2.EntityTypes', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/proto/intent_pb2.py b/packages/google-cloud-dialogflow/dialogflow_v2/proto/intent_pb2.py new file mode 100755 index 000000000000..916033d5351d --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/proto/intent_pb2.py @@ -0,0 +1,3082 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow_v2/proto/intent.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf.internal import enum_type_wrapper +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 +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from dialogflow_v2.proto import context_pb2 as google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2 +from google.longrunning import operations_pb2 as google_dot_longrunning_dot_operations__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 +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='google/cloud/dialogflow_v2/proto/intent.proto', + package='google.cloud.dialogflow.v2', + syntax='proto3', + serialized_pb=_b('\n-google/cloud/dialogflow_v2/proto/intent.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a.google/cloud/dialogflow_v2/proto/context.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xf3 \n\x06Intent\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x46\n\rwebhook_state\x18\x06 \x01(\x0e\x32/.google.cloud.dialogflow.v2.Intent.WebhookState\x12\x10\n\x08priority\x18\x03 \x01(\x05\x12\x13\n\x0bis_fallback\x18\x04 \x01(\x08\x12\x13\n\x0bml_disabled\x18\x05 \x01(\x08\x12\x1b\n\x13input_context_names\x18\x07 \x03(\t\x12\x0e\n\x06\x65vents\x18\x08 \x03(\t\x12K\n\x10training_phrases\x18\t \x03(\x0b\x32\x31.google.cloud.dialogflow.v2.Intent.TrainingPhrase\x12\x0e\n\x06\x61\x63tion\x18\n \x01(\t\x12<\n\x0foutput_contexts\x18\x0b \x03(\x0b\x32#.google.cloud.dialogflow.v2.Context\x12\x16\n\x0ereset_contexts\x18\x0c \x01(\x08\x12@\n\nparameters\x18\r \x03(\x0b\x32,.google.cloud.dialogflow.v2.Intent.Parameter\x12<\n\x08messages\x18\x0e \x03(\x0b\x32*.google.cloud.dialogflow.v2.Intent.Message\x12W\n\x1a\x64\x65\x66\x61ult_response_platforms\x18\x0f \x03(\x0e\x32\x33.google.cloud.dialogflow.v2.Intent.Message.Platform\x12!\n\x19root_followup_intent_name\x18\x10 \x01(\t\x12#\n\x1bparent_followup_intent_name\x18\x11 \x01(\t\x12S\n\x14\x66ollowup_intent_info\x18\x12 \x03(\x0b\x32\x35.google.cloud.dialogflow.v2.Intent.FollowupIntentInfo\x1a\xcf\x02\n\x0eTrainingPhrase\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x44\n\x04type\x18\x02 \x01(\x0e\x32\x36.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type\x12\x45\n\x05parts\x18\x03 \x03(\x0b\x32\x36.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part\x12\x19\n\x11times_added_count\x18\x04 \x01(\x05\x1aN\n\x04Part\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x13\n\x0b\x65ntity_type\x18\x02 \x01(\t\x12\r\n\x05\x61lias\x18\x03 \x01(\t\x12\x14\n\x0cuser_defined\x18\x04 \x01(\x08\"7\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45XAMPLE\x10\x01\x12\x0c\n\x08TEMPLATE\x10\x02\x1a\xac\x01\n\tParameter\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\r\n\x05value\x18\x03 \x01(\t\x12\x15\n\rdefault_value\x18\x04 \x01(\t\x12 \n\x18\x65ntity_type_display_name\x18\x05 \x01(\t\x12\x11\n\tmandatory\x18\x06 \x01(\x08\x12\x0f\n\x07prompts\x18\x07 \x03(\t\x12\x0f\n\x07is_list\x18\x08 \x01(\x08\x1a\x9a\x15\n\x07Message\x12?\n\x04text\x18\x01 \x01(\x0b\x32/.google.cloud.dialogflow.v2.Intent.Message.TextH\x00\x12\x41\n\x05image\x18\x02 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.ImageH\x00\x12P\n\rquick_replies\x18\x03 \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.Intent.Message.QuickRepliesH\x00\x12?\n\x04\x63\x61rd\x18\x04 \x01(\x0b\x32/.google.cloud.dialogflow.v2.Intent.Message.CardH\x00\x12*\n\x07payload\x18\x05 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12V\n\x10simple_responses\x18\x07 \x01(\x0b\x32:.google.cloud.dialogflow.v2.Intent.Message.SimpleResponsesH\x00\x12J\n\nbasic_card\x18\x08 \x01(\x0b\x32\x34.google.cloud.dialogflow.v2.Intent.Message.BasicCardH\x00\x12M\n\x0bsuggestions\x18\t \x01(\x0b\x32\x36.google.cloud.dialogflow.v2.Intent.Message.SuggestionsH\x00\x12[\n\x13link_out_suggestion\x18\n \x01(\x0b\x32<.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestionH\x00\x12L\n\x0blist_select\x18\x0b \x01(\x0b\x32\x35.google.cloud.dialogflow.v2.Intent.Message.ListSelectH\x00\x12T\n\x0f\x63\x61rousel_select\x18\x0c \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Intent.Message.CarouselSelectH\x00\x12\x45\n\x08platform\x18\x06 \x01(\x0e\x32\x33.google.cloud.dialogflow.v2.Intent.Message.Platform\x1a\x14\n\x04Text\x12\x0c\n\x04text\x18\x01 \x03(\t\x1a\x36\n\x05Image\x12\x11\n\timage_uri\x18\x01 \x01(\t\x12\x1a\n\x12\x61\x63\x63\x65ssibility_text\x18\x02 \x01(\t\x1a\x34\n\x0cQuickReplies\x12\r\n\x05title\x18\x01 \x01(\t\x12\x15\n\rquick_replies\x18\x02 \x03(\t\x1a\xad\x01\n\x04\x43\x61rd\x12\r\n\x05title\x18\x01 \x01(\t\x12\x10\n\x08subtitle\x18\x02 \x01(\t\x12\x11\n\timage_uri\x18\x03 \x01(\t\x12G\n\x07\x62uttons\x18\x04 \x03(\x0b\x32\x36.google.cloud.dialogflow.v2.Intent.Message.Card.Button\x1a(\n\x06\x42utton\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x10\n\x08postback\x18\x02 \x01(\t\x1aL\n\x0eSimpleResponse\x12\x16\n\x0etext_to_speech\x18\x01 \x01(\t\x12\x0c\n\x04ssml\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_text\x18\x03 \x01(\t\x1a\x66\n\x0fSimpleResponses\x12S\n\x10simple_responses\x18\x01 \x03(\x0b\x32\x39.google.cloud.dialogflow.v2.Intent.Message.SimpleResponse\x1a\xef\x02\n\tBasicCard\x12\r\n\x05title\x18\x01 \x01(\t\x12\x10\n\x08subtitle\x18\x02 \x01(\t\x12\x16\n\x0e\x66ormatted_text\x18\x03 \x01(\t\x12?\n\x05image\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.Image\x12L\n\x07\x62uttons\x18\x05 \x03(\x0b\x32;.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button\x1a\x99\x01\n\x06\x42utton\x12\r\n\x05title\x18\x01 \x01(\t\x12\x62\n\x0fopen_uri_action\x18\x02 \x01(\x0b\x32I.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction\x1a\x1c\n\rOpenUriAction\x12\x0b\n\x03uri\x18\x01 \x01(\t\x1a\x1b\n\nSuggestion\x12\r\n\x05title\x18\x01 \x01(\t\x1aY\n\x0bSuggestions\x12J\n\x0bsuggestions\x18\x01 \x03(\x0b\x32\x35.google.cloud.dialogflow.v2.Intent.Message.Suggestion\x1a:\n\x11LinkOutSuggestion\x12\x18\n\x10\x64\x65stination_name\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x1a\x9d\x02\n\nListSelect\x12\r\n\x05title\x18\x01 \x01(\t\x12I\n\x05items\x18\x02 \x03(\x0b\x32:.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item\x1a\xb4\x01\n\x04Item\x12G\n\x04info\x18\x01 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo\x12\r\n\x05title\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12?\n\x05image\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.Image\x1a\x96\x02\n\x0e\x43\x61rouselSelect\x12M\n\x05items\x18\x01 \x03(\x0b\x32>.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item\x1a\xb4\x01\n\x04Item\x12G\n\x04info\x18\x01 \x01(\x0b\x32\x39.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo\x12\r\n\x05title\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12?\n\x05image\x18\x04 \x01(\x0b\x32\x30.google.cloud.dialogflow.v2.Intent.Message.Image\x1a/\n\x0eSelectItemInfo\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x10\n\x08synonyms\x18\x02 \x03(\t\"\x8b\x01\n\x08Platform\x12\x18\n\x14PLATFORM_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x46\x41\x43\x45\x42OOK\x10\x01\x12\t\n\x05SLACK\x10\x02\x12\x0c\n\x08TELEGRAM\x10\x03\x12\x07\n\x03KIK\x10\x04\x12\t\n\x05SKYPE\x10\x05\x12\x08\n\x04LINE\x10\x06\x12\t\n\x05VIBER\x10\x07\x12\x15\n\x11\x41\x43TIONS_ON_GOOGLE\x10\x08\x42\t\n\x07message\x1aW\n\x12\x46ollowupIntentInfo\x12\x1c\n\x14\x66ollowup_intent_name\x18\x01 \x01(\t\x12#\n\x1bparent_followup_intent_name\x18\x02 \x01(\t\"t\n\x0cWebhookState\x12\x1d\n\x19WEBHOOK_STATE_UNSPECIFIED\x10\x00\x12\x19\n\x15WEBHOOK_STATE_ENABLED\x10\x01\x12*\n&WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING\x10\x02\"\x9f\x01\n\x12ListIntentsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12;\n\x0bintent_view\x18\x03 \x01(\x0e\x32&.google.cloud.dialogflow.v2.IntentView\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\"c\n\x13ListIntentsResponse\x12\x33\n\x07intents\x18\x01 \x03(\x0b\x32\".google.cloud.dialogflow.v2.Intent\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"t\n\x10GetIntentRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12;\n\x0bintent_view\x18\x03 \x01(\x0e\x32&.google.cloud.dialogflow.v2.IntentView\"\xad\x01\n\x13\x43reateIntentRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x32\n\x06intent\x18\x02 \x01(\x0b\x32\".google.cloud.dialogflow.v2.Intent\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\x12;\n\x0bintent_view\x18\x04 \x01(\x0e\x32&.google.cloud.dialogflow.v2.IntentView\"\xce\x01\n\x13UpdateIntentRequest\x12\x32\n\x06intent\x18\x01 \x01(\x0b\x32\".google.cloud.dialogflow.v2.Intent\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12;\n\x0bintent_view\x18\x04 \x01(\x0e\x32&.google.cloud.dialogflow.v2.IntentView\"#\n\x13\x44\x65leteIntentRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"\xa4\x02\n\x19\x42\x61tchUpdateIntentsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x1a\n\x10intent_batch_uri\x18\x02 \x01(\tH\x00\x12\x46\n\x13intent_batch_inline\x18\x03 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.IntentBatchH\x00\x12\x15\n\rlanguage_code\x18\x04 \x01(\t\x12/\n\x0bupdate_mask\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12;\n\x0bintent_view\x18\x06 \x01(\x0e\x32&.google.cloud.dialogflow.v2.IntentViewB\x0e\n\x0cintent_batch\"Q\n\x1a\x42\x61tchUpdateIntentsResponse\x12\x33\n\x07intents\x18\x01 \x03(\x0b\x32\".google.cloud.dialogflow.v2.Intent\"`\n\x19\x42\x61tchDeleteIntentsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x33\n\x07intents\x18\x02 \x03(\x0b\x32\".google.cloud.dialogflow.v2.Intent\"B\n\x0bIntentBatch\x12\x33\n\x07intents\x18\x01 \x03(\x0b\x32\".google.cloud.dialogflow.v2.Intent*?\n\nIntentView\x12\x1b\n\x17INTENT_VIEW_UNSPECIFIED\x10\x00\x12\x14\n\x10INTENT_VIEW_FULL\x10\x01\x32\xd8\x08\n\x07Intents\x12\x9d\x01\n\x0bListIntents\x12..google.cloud.dialogflow.v2.ListIntentsRequest\x1a/.google.cloud.dialogflow.v2.ListIntentsResponse\"-\x82\xd3\xe4\x93\x02\'\x12%/v2/{parent=projects/*/agent}/intents\x12\x8c\x01\n\tGetIntent\x12,.google.cloud.dialogflow.v2.GetIntentRequest\x1a\".google.cloud.dialogflow.v2.Intent\"-\x82\xd3\xe4\x93\x02\'\x12%/v2/{name=projects/*/agent/intents/*}\x12\x9a\x01\n\x0c\x43reateIntent\x12/.google.cloud.dialogflow.v2.CreateIntentRequest\x1a\".google.cloud.dialogflow.v2.Intent\"5\x82\xd3\xe4\x93\x02/\"%/v2/{parent=projects/*/agent}/intents:\x06intent\x12\xa1\x01\n\x0cUpdateIntent\x12/.google.cloud.dialogflow.v2.UpdateIntentRequest\x1a\".google.cloud.dialogflow.v2.Intent\"<\x82\xd3\xe4\x93\x02\x36\x32,/v2/{intent.name=projects/*/agent/intents/*}:\x06intent\x12\x86\x01\n\x0c\x44\x65leteIntent\x12/.google.cloud.dialogflow.v2.DeleteIntentRequest\x1a\x16.google.protobuf.Empty\"-\x82\xd3\xe4\x93\x02\'*%/v2/{name=projects/*/agent/intents/*}\x12\xa8\x01\n\x12\x42\x61tchUpdateIntents\x12\x35.google.cloud.dialogflow.v2.BatchUpdateIntentsRequest\x1a\x1d.google.longrunning.Operation\"<\x82\xd3\xe4\x93\x02\x36\"1/v2/{parent=projects/*/agent}/intents:batchUpdate:\x01*\x12\xa8\x01\n\x12\x42\x61tchDeleteIntents\x12\x35.google.cloud.dialogflow.v2.BatchDeleteIntentsRequest\x1a\x1d.google.longrunning.Operation\"<\x82\xd3\xe4\x93\x02\x36\"1/v2/{parent=projects/*/agent}/intents:batchDelete:\x01*B\x9a\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0bIntentProtoP\x01ZDgoogle.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow\xf8\x01\x01\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3') + , + dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR,google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.DESCRIPTOR,google_dot_longrunning_dot_operations__pb2.DESCRIPTOR,google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR,google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,]) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +_INTENTVIEW = _descriptor.EnumDescriptor( + name='IntentView', + full_name='google.cloud.dialogflow.v2.IntentView', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='INTENT_VIEW_UNSPECIFIED', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='INTENT_VIEW_FULL', index=1, number=1, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=5846, + serialized_end=5909, +) +_sym_db.RegisterEnumDescriptor(_INTENTVIEW) + +IntentView = enum_type_wrapper.EnumTypeWrapper(_INTENTVIEW) +INTENT_VIEW_UNSPECIFIED = 0 +INTENT_VIEW_FULL = 1 + + +_INTENT_TRAININGPHRASE_TYPE = _descriptor.EnumDescriptor( + name='Type', + full_name='google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='TYPE_UNSPECIFIED', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='EXAMPLE', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TEMPLATE', index=2, number=2, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=1343, + serialized_end=1398, +) +_sym_db.RegisterEnumDescriptor(_INTENT_TRAININGPHRASE_TYPE) + +_INTENT_MESSAGE_PLATFORM = _descriptor.EnumDescriptor( + name='Platform', + full_name='google.cloud.dialogflow.v2.Intent.Message.Platform', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='PLATFORM_UNSPECIFIED', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='FACEBOOK', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SLACK', index=2, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TELEGRAM', index=3, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='KIK', index=4, number=4, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='SKYPE', index=5, number=5, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='LINE', index=6, number=6, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='VIBER', index=7, number=7, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ACTIONS_ON_GOOGLE', index=8, number=8, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=4140, + serialized_end=4279, +) +_sym_db.RegisterEnumDescriptor(_INTENT_MESSAGE_PLATFORM) + +_INTENT_WEBHOOKSTATE = _descriptor.EnumDescriptor( + name='WebhookState', + full_name='google.cloud.dialogflow.v2.Intent.WebhookState', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='WEBHOOK_STATE_UNSPECIFIED', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='WEBHOOK_STATE_ENABLED', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING', index=2, number=2, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=4381, + serialized_end=4497, +) +_sym_db.RegisterEnumDescriptor(_INTENT_WEBHOOKSTATE) + + +_INTENT_TRAININGPHRASE_PART = _descriptor.Descriptor( + name='Part', + full_name='google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='text', full_name='google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.text', 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, + options=None), + _descriptor.FieldDescriptor( + name='entity_type', full_name='google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.entity_type', 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, + options=None), + _descriptor.FieldDescriptor( + name='alias', full_name='google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.alias', index=2, + 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, + options=None), + _descriptor.FieldDescriptor( + name='user_defined', full_name='google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.user_defined', index=3, + number=4, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1263, + serialized_end=1341, +) + +_INTENT_TRAININGPHRASE = _descriptor.Descriptor( + name='TrainingPhrase', + full_name='google.cloud.dialogflow.v2.Intent.TrainingPhrase', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='google.cloud.dialogflow.v2.Intent.TrainingPhrase.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, + options=None), + _descriptor.FieldDescriptor( + name='type', full_name='google.cloud.dialogflow.v2.Intent.TrainingPhrase.type', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='parts', full_name='google.cloud.dialogflow.v2.Intent.TrainingPhrase.parts', 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, + options=None), + _descriptor.FieldDescriptor( + name='times_added_count', full_name='google.cloud.dialogflow.v2.Intent.TrainingPhrase.times_added_count', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[_INTENT_TRAININGPHRASE_PART, ], + enum_types=[ + _INTENT_TRAININGPHRASE_TYPE, + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1063, + serialized_end=1398, +) + +_INTENT_PARAMETER = _descriptor.Descriptor( + name='Parameter', + full_name='google.cloud.dialogflow.v2.Intent.Parameter', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='google.cloud.dialogflow.v2.Intent.Parameter.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, + options=None), + _descriptor.FieldDescriptor( + name='display_name', full_name='google.cloud.dialogflow.v2.Intent.Parameter.display_name', 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, + options=None), + _descriptor.FieldDescriptor( + name='value', full_name='google.cloud.dialogflow.v2.Intent.Parameter.value', index=2, + 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, + options=None), + _descriptor.FieldDescriptor( + name='default_value', full_name='google.cloud.dialogflow.v2.Intent.Parameter.default_value', index=3, + number=4, 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, + options=None), + _descriptor.FieldDescriptor( + name='entity_type_display_name', full_name='google.cloud.dialogflow.v2.Intent.Parameter.entity_type_display_name', index=4, + number=5, 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, + options=None), + _descriptor.FieldDescriptor( + name='mandatory', full_name='google.cloud.dialogflow.v2.Intent.Parameter.mandatory', index=5, + number=6, 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, + options=None), + _descriptor.FieldDescriptor( + name='prompts', full_name='google.cloud.dialogflow.v2.Intent.Parameter.prompts', index=6, + number=7, 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, + options=None), + _descriptor.FieldDescriptor( + name='is_list', full_name='google.cloud.dialogflow.v2.Intent.Parameter.is_list', index=7, + number=8, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1401, + serialized_end=1573, +) + +_INTENT_MESSAGE_TEXT = _descriptor.Descriptor( + name='Text', + full_name='google.cloud.dialogflow.v2.Intent.Message.Text', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='text', full_name='google.cloud.dialogflow.v2.Intent.Message.Text.text', index=0, + number=1, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2481, + serialized_end=2501, +) + +_INTENT_MESSAGE_IMAGE = _descriptor.Descriptor( + name='Image', + full_name='google.cloud.dialogflow.v2.Intent.Message.Image', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='image_uri', full_name='google.cloud.dialogflow.v2.Intent.Message.Image.image_uri', 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, + options=None), + _descriptor.FieldDescriptor( + name='accessibility_text', full_name='google.cloud.dialogflow.v2.Intent.Message.Image.accessibility_text', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2503, + serialized_end=2557, +) + +_INTENT_MESSAGE_QUICKREPLIES = _descriptor.Descriptor( + name='QuickReplies', + full_name='google.cloud.dialogflow.v2.Intent.Message.QuickReplies', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='title', full_name='google.cloud.dialogflow.v2.Intent.Message.QuickReplies.title', 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, + options=None), + _descriptor.FieldDescriptor( + name='quick_replies', full_name='google.cloud.dialogflow.v2.Intent.Message.QuickReplies.quick_replies', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2559, + serialized_end=2611, +) + +_INTENT_MESSAGE_CARD_BUTTON = _descriptor.Descriptor( + name='Button', + full_name='google.cloud.dialogflow.v2.Intent.Message.Card.Button', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='text', full_name='google.cloud.dialogflow.v2.Intent.Message.Card.Button.text', 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, + options=None), + _descriptor.FieldDescriptor( + name='postback', full_name='google.cloud.dialogflow.v2.Intent.Message.Card.Button.postback', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2747, + serialized_end=2787, +) + +_INTENT_MESSAGE_CARD = _descriptor.Descriptor( + name='Card', + full_name='google.cloud.dialogflow.v2.Intent.Message.Card', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='title', full_name='google.cloud.dialogflow.v2.Intent.Message.Card.title', 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, + options=None), + _descriptor.FieldDescriptor( + name='subtitle', full_name='google.cloud.dialogflow.v2.Intent.Message.Card.subtitle', 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, + options=None), + _descriptor.FieldDescriptor( + name='image_uri', full_name='google.cloud.dialogflow.v2.Intent.Message.Card.image_uri', index=2, + 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, + options=None), + _descriptor.FieldDescriptor( + name='buttons', full_name='google.cloud.dialogflow.v2.Intent.Message.Card.buttons', index=3, + 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, + options=None), + ], + extensions=[ + ], + nested_types=[_INTENT_MESSAGE_CARD_BUTTON, ], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2614, + serialized_end=2787, +) + +_INTENT_MESSAGE_SIMPLERESPONSE = _descriptor.Descriptor( + name='SimpleResponse', + full_name='google.cloud.dialogflow.v2.Intent.Message.SimpleResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='text_to_speech', full_name='google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.text_to_speech', 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, + options=None), + _descriptor.FieldDescriptor( + name='ssml', full_name='google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.ssml', 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, + options=None), + _descriptor.FieldDescriptor( + name='display_text', full_name='google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.display_text', index=2, + 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2789, + serialized_end=2865, +) + +_INTENT_MESSAGE_SIMPLERESPONSES = _descriptor.Descriptor( + name='SimpleResponses', + full_name='google.cloud.dialogflow.v2.Intent.Message.SimpleResponses', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='simple_responses', full_name='google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.simple_responses', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2867, + serialized_end=2969, +) + +_INTENT_MESSAGE_BASICCARD_BUTTON_OPENURIACTION = _descriptor.Descriptor( + name='OpenUriAction', + full_name='google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='uri', full_name='google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.uri', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3311, + serialized_end=3339, +) + +_INTENT_MESSAGE_BASICCARD_BUTTON = _descriptor.Descriptor( + name='Button', + full_name='google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='title', full_name='google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.title', 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, + options=None), + _descriptor.FieldDescriptor( + name='open_uri_action', full_name='google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.open_uri_action', 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, + options=None), + ], + extensions=[ + ], + nested_types=[_INTENT_MESSAGE_BASICCARD_BUTTON_OPENURIACTION, ], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3186, + serialized_end=3339, +) + +_INTENT_MESSAGE_BASICCARD = _descriptor.Descriptor( + name='BasicCard', + full_name='google.cloud.dialogflow.v2.Intent.Message.BasicCard', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='title', full_name='google.cloud.dialogflow.v2.Intent.Message.BasicCard.title', 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, + options=None), + _descriptor.FieldDescriptor( + name='subtitle', full_name='google.cloud.dialogflow.v2.Intent.Message.BasicCard.subtitle', 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, + options=None), + _descriptor.FieldDescriptor( + name='formatted_text', full_name='google.cloud.dialogflow.v2.Intent.Message.BasicCard.formatted_text', index=2, + 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, + options=None), + _descriptor.FieldDescriptor( + name='image', full_name='google.cloud.dialogflow.v2.Intent.Message.BasicCard.image', index=3, + number=4, 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, + options=None), + _descriptor.FieldDescriptor( + name='buttons', full_name='google.cloud.dialogflow.v2.Intent.Message.BasicCard.buttons', index=4, + number=5, 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, + options=None), + ], + extensions=[ + ], + nested_types=[_INTENT_MESSAGE_BASICCARD_BUTTON, ], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2972, + serialized_end=3339, +) + +_INTENT_MESSAGE_SUGGESTION = _descriptor.Descriptor( + name='Suggestion', + full_name='google.cloud.dialogflow.v2.Intent.Message.Suggestion', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='title', full_name='google.cloud.dialogflow.v2.Intent.Message.Suggestion.title', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3341, + serialized_end=3368, +) + +_INTENT_MESSAGE_SUGGESTIONS = _descriptor.Descriptor( + name='Suggestions', + full_name='google.cloud.dialogflow.v2.Intent.Message.Suggestions', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='suggestions', full_name='google.cloud.dialogflow.v2.Intent.Message.Suggestions.suggestions', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3370, + serialized_end=3459, +) + +_INTENT_MESSAGE_LINKOUTSUGGESTION = _descriptor.Descriptor( + name='LinkOutSuggestion', + full_name='google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='destination_name', full_name='google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.destination_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, + options=None), + _descriptor.FieldDescriptor( + name='uri', full_name='google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.uri', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3461, + serialized_end=3519, +) + +_INTENT_MESSAGE_LISTSELECT_ITEM = _descriptor.Descriptor( + name='Item', + full_name='google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='info', full_name='google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.info', index=0, + number=1, 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, + options=None), + _descriptor.FieldDescriptor( + name='title', full_name='google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.title', 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, + options=None), + _descriptor.FieldDescriptor( + name='description', full_name='google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.description', index=2, + 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, + options=None), + _descriptor.FieldDescriptor( + name='image', full_name='google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.image', index=3, + number=4, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3627, + serialized_end=3807, +) + +_INTENT_MESSAGE_LISTSELECT = _descriptor.Descriptor( + name='ListSelect', + full_name='google.cloud.dialogflow.v2.Intent.Message.ListSelect', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='title', full_name='google.cloud.dialogflow.v2.Intent.Message.ListSelect.title', 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, + options=None), + _descriptor.FieldDescriptor( + name='items', full_name='google.cloud.dialogflow.v2.Intent.Message.ListSelect.items', index=1, + number=2, 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, + options=None), + ], + extensions=[ + ], + nested_types=[_INTENT_MESSAGE_LISTSELECT_ITEM, ], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3522, + serialized_end=3807, +) + +_INTENT_MESSAGE_CAROUSELSELECT_ITEM = _descriptor.Descriptor( + name='Item', + full_name='google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='info', full_name='google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.info', index=0, + number=1, 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, + options=None), + _descriptor.FieldDescriptor( + name='title', full_name='google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.title', 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, + options=None), + _descriptor.FieldDescriptor( + name='description', full_name='google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.description', index=2, + 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, + options=None), + _descriptor.FieldDescriptor( + name='image', full_name='google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.image', index=3, + number=4, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3627, + serialized_end=3807, +) + +_INTENT_MESSAGE_CAROUSELSELECT = _descriptor.Descriptor( + name='CarouselSelect', + full_name='google.cloud.dialogflow.v2.Intent.Message.CarouselSelect', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='items', full_name='google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.items', 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, + options=None), + ], + extensions=[ + ], + nested_types=[_INTENT_MESSAGE_CAROUSELSELECT_ITEM, ], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3810, + serialized_end=4088, +) + +_INTENT_MESSAGE_SELECTITEMINFO = _descriptor.Descriptor( + name='SelectItemInfo', + full_name='google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.key', 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, + options=None), + _descriptor.FieldDescriptor( + name='synonyms', full_name='google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.synonyms', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4090, + serialized_end=4137, +) + +_INTENT_MESSAGE = _descriptor.Descriptor( + name='Message', + full_name='google.cloud.dialogflow.v2.Intent.Message', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='text', full_name='google.cloud.dialogflow.v2.Intent.Message.text', index=0, + number=1, 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, + options=None), + _descriptor.FieldDescriptor( + name='image', full_name='google.cloud.dialogflow.v2.Intent.Message.image', 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, + options=None), + _descriptor.FieldDescriptor( + name='quick_replies', full_name='google.cloud.dialogflow.v2.Intent.Message.quick_replies', index=2, + number=3, 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, + options=None), + _descriptor.FieldDescriptor( + name='card', full_name='google.cloud.dialogflow.v2.Intent.Message.card', index=3, + number=4, 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, + options=None), + _descriptor.FieldDescriptor( + name='payload', full_name='google.cloud.dialogflow.v2.Intent.Message.payload', index=4, + number=5, 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, + options=None), + _descriptor.FieldDescriptor( + name='simple_responses', full_name='google.cloud.dialogflow.v2.Intent.Message.simple_responses', index=5, + number=7, 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, + options=None), + _descriptor.FieldDescriptor( + name='basic_card', full_name='google.cloud.dialogflow.v2.Intent.Message.basic_card', index=6, + number=8, 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, + options=None), + _descriptor.FieldDescriptor( + name='suggestions', full_name='google.cloud.dialogflow.v2.Intent.Message.suggestions', index=7, + number=9, 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, + options=None), + _descriptor.FieldDescriptor( + name='link_out_suggestion', full_name='google.cloud.dialogflow.v2.Intent.Message.link_out_suggestion', index=8, + number=10, 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, + options=None), + _descriptor.FieldDescriptor( + name='list_select', full_name='google.cloud.dialogflow.v2.Intent.Message.list_select', index=9, + number=11, 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, + options=None), + _descriptor.FieldDescriptor( + name='carousel_select', full_name='google.cloud.dialogflow.v2.Intent.Message.carousel_select', index=10, + number=12, 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, + options=None), + _descriptor.FieldDescriptor( + name='platform', full_name='google.cloud.dialogflow.v2.Intent.Message.platform', index=11, + number=6, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[_INTENT_MESSAGE_TEXT, _INTENT_MESSAGE_IMAGE, _INTENT_MESSAGE_QUICKREPLIES, _INTENT_MESSAGE_CARD, _INTENT_MESSAGE_SIMPLERESPONSE, _INTENT_MESSAGE_SIMPLERESPONSES, _INTENT_MESSAGE_BASICCARD, _INTENT_MESSAGE_SUGGESTION, _INTENT_MESSAGE_SUGGESTIONS, _INTENT_MESSAGE_LINKOUTSUGGESTION, _INTENT_MESSAGE_LISTSELECT, _INTENT_MESSAGE_CAROUSELSELECT, _INTENT_MESSAGE_SELECTITEMINFO, ], + enum_types=[ + _INTENT_MESSAGE_PLATFORM, + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='message', full_name='google.cloud.dialogflow.v2.Intent.Message.message', + index=0, containing_type=None, fields=[]), + ], + serialized_start=1576, + serialized_end=4290, +) + +_INTENT_FOLLOWUPINTENTINFO = _descriptor.Descriptor( + name='FollowupIntentInfo', + full_name='google.cloud.dialogflow.v2.Intent.FollowupIntentInfo', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='followup_intent_name', full_name='google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.followup_intent_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, + options=None), + _descriptor.FieldDescriptor( + name='parent_followup_intent_name', full_name='google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.parent_followup_intent_name', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4292, + serialized_end=4379, +) + +_INTENT = _descriptor.Descriptor( + name='Intent', + full_name='google.cloud.dialogflow.v2.Intent', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='google.cloud.dialogflow.v2.Intent.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, + options=None), + _descriptor.FieldDescriptor( + name='display_name', full_name='google.cloud.dialogflow.v2.Intent.display_name', 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, + options=None), + _descriptor.FieldDescriptor( + name='webhook_state', full_name='google.cloud.dialogflow.v2.Intent.webhook_state', index=2, + number=6, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='priority', full_name='google.cloud.dialogflow.v2.Intent.priority', index=3, + number=3, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='is_fallback', full_name='google.cloud.dialogflow.v2.Intent.is_fallback', index=4, + number=4, 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, + options=None), + _descriptor.FieldDescriptor( + name='ml_disabled', full_name='google.cloud.dialogflow.v2.Intent.ml_disabled', index=5, + number=5, 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, + options=None), + _descriptor.FieldDescriptor( + name='input_context_names', full_name='google.cloud.dialogflow.v2.Intent.input_context_names', index=6, + number=7, 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, + options=None), + _descriptor.FieldDescriptor( + name='events', full_name='google.cloud.dialogflow.v2.Intent.events', index=7, + number=8, 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, + options=None), + _descriptor.FieldDescriptor( + name='training_phrases', full_name='google.cloud.dialogflow.v2.Intent.training_phrases', index=8, + number=9, 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, + options=None), + _descriptor.FieldDescriptor( + name='action', full_name='google.cloud.dialogflow.v2.Intent.action', index=9, + number=10, 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, + options=None), + _descriptor.FieldDescriptor( + name='output_contexts', full_name='google.cloud.dialogflow.v2.Intent.output_contexts', index=10, + number=11, 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, + options=None), + _descriptor.FieldDescriptor( + name='reset_contexts', full_name='google.cloud.dialogflow.v2.Intent.reset_contexts', index=11, + number=12, 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, + options=None), + _descriptor.FieldDescriptor( + name='parameters', full_name='google.cloud.dialogflow.v2.Intent.parameters', index=12, + number=13, 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, + options=None), + _descriptor.FieldDescriptor( + name='messages', full_name='google.cloud.dialogflow.v2.Intent.messages', index=13, + number=14, 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, + options=None), + _descriptor.FieldDescriptor( + name='default_response_platforms', full_name='google.cloud.dialogflow.v2.Intent.default_response_platforms', index=14, + number=15, type=14, cpp_type=8, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='root_followup_intent_name', full_name='google.cloud.dialogflow.v2.Intent.root_followup_intent_name', index=15, + number=16, 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, + options=None), + _descriptor.FieldDescriptor( + name='parent_followup_intent_name', full_name='google.cloud.dialogflow.v2.Intent.parent_followup_intent_name', index=16, + number=17, 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, + options=None), + _descriptor.FieldDescriptor( + name='followup_intent_info', full_name='google.cloud.dialogflow.v2.Intent.followup_intent_info', index=17, + number=18, 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, + options=None), + ], + extensions=[ + ], + nested_types=[_INTENT_TRAININGPHRASE, _INTENT_PARAMETER, _INTENT_MESSAGE, _INTENT_FOLLOWUPINTENTINFO, ], + enum_types=[ + _INTENT_WEBHOOKSTATE, + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=286, + serialized_end=4497, +) + + +_LISTINTENTSREQUEST = _descriptor.Descriptor( + name='ListIntentsRequest', + full_name='google.cloud.dialogflow.v2.ListIntentsRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.ListIntentsRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.dialogflow.v2.ListIntentsRequest.language_code', 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, + options=None), + _descriptor.FieldDescriptor( + name='intent_view', full_name='google.cloud.dialogflow.v2.ListIntentsRequest.intent_view', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='page_size', full_name='google.cloud.dialogflow.v2.ListIntentsRequest.page_size', index=3, + number=4, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='page_token', full_name='google.cloud.dialogflow.v2.ListIntentsRequest.page_token', index=4, + number=5, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4500, + serialized_end=4659, +) + + +_LISTINTENTSRESPONSE = _descriptor.Descriptor( + name='ListIntentsResponse', + full_name='google.cloud.dialogflow.v2.ListIntentsResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='intents', full_name='google.cloud.dialogflow.v2.ListIntentsResponse.intents', 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, + options=None), + _descriptor.FieldDescriptor( + name='next_page_token', full_name='google.cloud.dialogflow.v2.ListIntentsResponse.next_page_token', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4661, + serialized_end=4760, +) + + +_GETINTENTREQUEST = _descriptor.Descriptor( + name='GetIntentRequest', + full_name='google.cloud.dialogflow.v2.GetIntentRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='google.cloud.dialogflow.v2.GetIntentRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.dialogflow.v2.GetIntentRequest.language_code', 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, + options=None), + _descriptor.FieldDescriptor( + name='intent_view', full_name='google.cloud.dialogflow.v2.GetIntentRequest.intent_view', index=2, + number=3, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4762, + serialized_end=4878, +) + + +_CREATEINTENTREQUEST = _descriptor.Descriptor( + name='CreateIntentRequest', + full_name='google.cloud.dialogflow.v2.CreateIntentRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.CreateIntentRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='intent', full_name='google.cloud.dialogflow.v2.CreateIntentRequest.intent', 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, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.dialogflow.v2.CreateIntentRequest.language_code', index=2, + 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, + options=None), + _descriptor.FieldDescriptor( + name='intent_view', full_name='google.cloud.dialogflow.v2.CreateIntentRequest.intent_view', index=3, + number=4, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4881, + serialized_end=5054, +) + + +_UPDATEINTENTREQUEST = _descriptor.Descriptor( + name='UpdateIntentRequest', + full_name='google.cloud.dialogflow.v2.UpdateIntentRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='intent', full_name='google.cloud.dialogflow.v2.UpdateIntentRequest.intent', index=0, + number=1, 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, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.dialogflow.v2.UpdateIntentRequest.language_code', 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, + options=None), + _descriptor.FieldDescriptor( + name='update_mask', full_name='google.cloud.dialogflow.v2.UpdateIntentRequest.update_mask', index=2, + number=3, 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, + options=None), + _descriptor.FieldDescriptor( + name='intent_view', full_name='google.cloud.dialogflow.v2.UpdateIntentRequest.intent_view', index=3, + number=4, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=5057, + serialized_end=5263, +) + + +_DELETEINTENTREQUEST = _descriptor.Descriptor( + name='DeleteIntentRequest', + full_name='google.cloud.dialogflow.v2.DeleteIntentRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='google.cloud.dialogflow.v2.DeleteIntentRequest.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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=5265, + serialized_end=5300, +) + + +_BATCHUPDATEINTENTSREQUEST = _descriptor.Descriptor( + name='BatchUpdateIntentsRequest', + full_name='google.cloud.dialogflow.v2.BatchUpdateIntentsRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='intent_batch_uri', full_name='google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.intent_batch_uri', 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, + options=None), + _descriptor.FieldDescriptor( + name='intent_batch_inline', full_name='google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.intent_batch_inline', index=2, + number=3, 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, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.language_code', index=3, + number=4, 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, + options=None), + _descriptor.FieldDescriptor( + name='update_mask', full_name='google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.update_mask', index=4, + number=5, 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, + options=None), + _descriptor.FieldDescriptor( + name='intent_view', full_name='google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.intent_view', index=5, + number=6, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='intent_batch', full_name='google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.intent_batch', + index=0, containing_type=None, fields=[]), + ], + serialized_start=5303, + serialized_end=5595, +) + + +_BATCHUPDATEINTENTSRESPONSE = _descriptor.Descriptor( + name='BatchUpdateIntentsResponse', + full_name='google.cloud.dialogflow.v2.BatchUpdateIntentsResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='intents', full_name='google.cloud.dialogflow.v2.BatchUpdateIntentsResponse.intents', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=5597, + serialized_end=5678, +) + + +_BATCHDELETEINTENTSREQUEST = _descriptor.Descriptor( + name='BatchDeleteIntentsRequest', + full_name='google.cloud.dialogflow.v2.BatchDeleteIntentsRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.BatchDeleteIntentsRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='intents', full_name='google.cloud.dialogflow.v2.BatchDeleteIntentsRequest.intents', index=1, + number=2, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=5680, + serialized_end=5776, +) + + +_INTENTBATCH = _descriptor.Descriptor( + name='IntentBatch', + full_name='google.cloud.dialogflow.v2.IntentBatch', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='intents', full_name='google.cloud.dialogflow.v2.IntentBatch.intents', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=5778, + serialized_end=5844, +) + +_INTENT_TRAININGPHRASE_PART.containing_type = _INTENT_TRAININGPHRASE +_INTENT_TRAININGPHRASE.fields_by_name['type'].enum_type = _INTENT_TRAININGPHRASE_TYPE +_INTENT_TRAININGPHRASE.fields_by_name['parts'].message_type = _INTENT_TRAININGPHRASE_PART +_INTENT_TRAININGPHRASE.containing_type = _INTENT +_INTENT_TRAININGPHRASE_TYPE.containing_type = _INTENT_TRAININGPHRASE +_INTENT_PARAMETER.containing_type = _INTENT +_INTENT_MESSAGE_TEXT.containing_type = _INTENT_MESSAGE +_INTENT_MESSAGE_IMAGE.containing_type = _INTENT_MESSAGE +_INTENT_MESSAGE_QUICKREPLIES.containing_type = _INTENT_MESSAGE +_INTENT_MESSAGE_CARD_BUTTON.containing_type = _INTENT_MESSAGE_CARD +_INTENT_MESSAGE_CARD.fields_by_name['buttons'].message_type = _INTENT_MESSAGE_CARD_BUTTON +_INTENT_MESSAGE_CARD.containing_type = _INTENT_MESSAGE +_INTENT_MESSAGE_SIMPLERESPONSE.containing_type = _INTENT_MESSAGE +_INTENT_MESSAGE_SIMPLERESPONSES.fields_by_name['simple_responses'].message_type = _INTENT_MESSAGE_SIMPLERESPONSE +_INTENT_MESSAGE_SIMPLERESPONSES.containing_type = _INTENT_MESSAGE +_INTENT_MESSAGE_BASICCARD_BUTTON_OPENURIACTION.containing_type = _INTENT_MESSAGE_BASICCARD_BUTTON +_INTENT_MESSAGE_BASICCARD_BUTTON.fields_by_name['open_uri_action'].message_type = _INTENT_MESSAGE_BASICCARD_BUTTON_OPENURIACTION +_INTENT_MESSAGE_BASICCARD_BUTTON.containing_type = _INTENT_MESSAGE_BASICCARD +_INTENT_MESSAGE_BASICCARD.fields_by_name['image'].message_type = _INTENT_MESSAGE_IMAGE +_INTENT_MESSAGE_BASICCARD.fields_by_name['buttons'].message_type = _INTENT_MESSAGE_BASICCARD_BUTTON +_INTENT_MESSAGE_BASICCARD.containing_type = _INTENT_MESSAGE +_INTENT_MESSAGE_SUGGESTION.containing_type = _INTENT_MESSAGE +_INTENT_MESSAGE_SUGGESTIONS.fields_by_name['suggestions'].message_type = _INTENT_MESSAGE_SUGGESTION +_INTENT_MESSAGE_SUGGESTIONS.containing_type = _INTENT_MESSAGE +_INTENT_MESSAGE_LINKOUTSUGGESTION.containing_type = _INTENT_MESSAGE +_INTENT_MESSAGE_LISTSELECT_ITEM.fields_by_name['info'].message_type = _INTENT_MESSAGE_SELECTITEMINFO +_INTENT_MESSAGE_LISTSELECT_ITEM.fields_by_name['image'].message_type = _INTENT_MESSAGE_IMAGE +_INTENT_MESSAGE_LISTSELECT_ITEM.containing_type = _INTENT_MESSAGE_LISTSELECT +_INTENT_MESSAGE_LISTSELECT.fields_by_name['items'].message_type = _INTENT_MESSAGE_LISTSELECT_ITEM +_INTENT_MESSAGE_LISTSELECT.containing_type = _INTENT_MESSAGE +_INTENT_MESSAGE_CAROUSELSELECT_ITEM.fields_by_name['info'].message_type = _INTENT_MESSAGE_SELECTITEMINFO +_INTENT_MESSAGE_CAROUSELSELECT_ITEM.fields_by_name['image'].message_type = _INTENT_MESSAGE_IMAGE +_INTENT_MESSAGE_CAROUSELSELECT_ITEM.containing_type = _INTENT_MESSAGE_CAROUSELSELECT +_INTENT_MESSAGE_CAROUSELSELECT.fields_by_name['items'].message_type = _INTENT_MESSAGE_CAROUSELSELECT_ITEM +_INTENT_MESSAGE_CAROUSELSELECT.containing_type = _INTENT_MESSAGE +_INTENT_MESSAGE_SELECTITEMINFO.containing_type = _INTENT_MESSAGE +_INTENT_MESSAGE.fields_by_name['text'].message_type = _INTENT_MESSAGE_TEXT +_INTENT_MESSAGE.fields_by_name['image'].message_type = _INTENT_MESSAGE_IMAGE +_INTENT_MESSAGE.fields_by_name['quick_replies'].message_type = _INTENT_MESSAGE_QUICKREPLIES +_INTENT_MESSAGE.fields_by_name['card'].message_type = _INTENT_MESSAGE_CARD +_INTENT_MESSAGE.fields_by_name['payload'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_INTENT_MESSAGE.fields_by_name['simple_responses'].message_type = _INTENT_MESSAGE_SIMPLERESPONSES +_INTENT_MESSAGE.fields_by_name['basic_card'].message_type = _INTENT_MESSAGE_BASICCARD +_INTENT_MESSAGE.fields_by_name['suggestions'].message_type = _INTENT_MESSAGE_SUGGESTIONS +_INTENT_MESSAGE.fields_by_name['link_out_suggestion'].message_type = _INTENT_MESSAGE_LINKOUTSUGGESTION +_INTENT_MESSAGE.fields_by_name['list_select'].message_type = _INTENT_MESSAGE_LISTSELECT +_INTENT_MESSAGE.fields_by_name['carousel_select'].message_type = _INTENT_MESSAGE_CAROUSELSELECT +_INTENT_MESSAGE.fields_by_name['platform'].enum_type = _INTENT_MESSAGE_PLATFORM +_INTENT_MESSAGE.containing_type = _INTENT +_INTENT_MESSAGE_PLATFORM.containing_type = _INTENT_MESSAGE +_INTENT_MESSAGE.oneofs_by_name['message'].fields.append( + _INTENT_MESSAGE.fields_by_name['text']) +_INTENT_MESSAGE.fields_by_name['text'].containing_oneof = _INTENT_MESSAGE.oneofs_by_name['message'] +_INTENT_MESSAGE.oneofs_by_name['message'].fields.append( + _INTENT_MESSAGE.fields_by_name['image']) +_INTENT_MESSAGE.fields_by_name['image'].containing_oneof = _INTENT_MESSAGE.oneofs_by_name['message'] +_INTENT_MESSAGE.oneofs_by_name['message'].fields.append( + _INTENT_MESSAGE.fields_by_name['quick_replies']) +_INTENT_MESSAGE.fields_by_name['quick_replies'].containing_oneof = _INTENT_MESSAGE.oneofs_by_name['message'] +_INTENT_MESSAGE.oneofs_by_name['message'].fields.append( + _INTENT_MESSAGE.fields_by_name['card']) +_INTENT_MESSAGE.fields_by_name['card'].containing_oneof = _INTENT_MESSAGE.oneofs_by_name['message'] +_INTENT_MESSAGE.oneofs_by_name['message'].fields.append( + _INTENT_MESSAGE.fields_by_name['payload']) +_INTENT_MESSAGE.fields_by_name['payload'].containing_oneof = _INTENT_MESSAGE.oneofs_by_name['message'] +_INTENT_MESSAGE.oneofs_by_name['message'].fields.append( + _INTENT_MESSAGE.fields_by_name['simple_responses']) +_INTENT_MESSAGE.fields_by_name['simple_responses'].containing_oneof = _INTENT_MESSAGE.oneofs_by_name['message'] +_INTENT_MESSAGE.oneofs_by_name['message'].fields.append( + _INTENT_MESSAGE.fields_by_name['basic_card']) +_INTENT_MESSAGE.fields_by_name['basic_card'].containing_oneof = _INTENT_MESSAGE.oneofs_by_name['message'] +_INTENT_MESSAGE.oneofs_by_name['message'].fields.append( + _INTENT_MESSAGE.fields_by_name['suggestions']) +_INTENT_MESSAGE.fields_by_name['suggestions'].containing_oneof = _INTENT_MESSAGE.oneofs_by_name['message'] +_INTENT_MESSAGE.oneofs_by_name['message'].fields.append( + _INTENT_MESSAGE.fields_by_name['link_out_suggestion']) +_INTENT_MESSAGE.fields_by_name['link_out_suggestion'].containing_oneof = _INTENT_MESSAGE.oneofs_by_name['message'] +_INTENT_MESSAGE.oneofs_by_name['message'].fields.append( + _INTENT_MESSAGE.fields_by_name['list_select']) +_INTENT_MESSAGE.fields_by_name['list_select'].containing_oneof = _INTENT_MESSAGE.oneofs_by_name['message'] +_INTENT_MESSAGE.oneofs_by_name['message'].fields.append( + _INTENT_MESSAGE.fields_by_name['carousel_select']) +_INTENT_MESSAGE.fields_by_name['carousel_select'].containing_oneof = _INTENT_MESSAGE.oneofs_by_name['message'] +_INTENT_FOLLOWUPINTENTINFO.containing_type = _INTENT +_INTENT.fields_by_name['webhook_state'].enum_type = _INTENT_WEBHOOKSTATE +_INTENT.fields_by_name['training_phrases'].message_type = _INTENT_TRAININGPHRASE +_INTENT.fields_by_name['output_contexts'].message_type = google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2._CONTEXT +_INTENT.fields_by_name['parameters'].message_type = _INTENT_PARAMETER +_INTENT.fields_by_name['messages'].message_type = _INTENT_MESSAGE +_INTENT.fields_by_name['default_response_platforms'].enum_type = _INTENT_MESSAGE_PLATFORM +_INTENT.fields_by_name['followup_intent_info'].message_type = _INTENT_FOLLOWUPINTENTINFO +_INTENT_WEBHOOKSTATE.containing_type = _INTENT +_LISTINTENTSREQUEST.fields_by_name['intent_view'].enum_type = _INTENTVIEW +_LISTINTENTSRESPONSE.fields_by_name['intents'].message_type = _INTENT +_GETINTENTREQUEST.fields_by_name['intent_view'].enum_type = _INTENTVIEW +_CREATEINTENTREQUEST.fields_by_name['intent'].message_type = _INTENT +_CREATEINTENTREQUEST.fields_by_name['intent_view'].enum_type = _INTENTVIEW +_UPDATEINTENTREQUEST.fields_by_name['intent'].message_type = _INTENT +_UPDATEINTENTREQUEST.fields_by_name['update_mask'].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK +_UPDATEINTENTREQUEST.fields_by_name['intent_view'].enum_type = _INTENTVIEW +_BATCHUPDATEINTENTSREQUEST.fields_by_name['intent_batch_inline'].message_type = _INTENTBATCH +_BATCHUPDATEINTENTSREQUEST.fields_by_name['update_mask'].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK +_BATCHUPDATEINTENTSREQUEST.fields_by_name['intent_view'].enum_type = _INTENTVIEW +_BATCHUPDATEINTENTSREQUEST.oneofs_by_name['intent_batch'].fields.append( + _BATCHUPDATEINTENTSREQUEST.fields_by_name['intent_batch_uri']) +_BATCHUPDATEINTENTSREQUEST.fields_by_name['intent_batch_uri'].containing_oneof = _BATCHUPDATEINTENTSREQUEST.oneofs_by_name['intent_batch'] +_BATCHUPDATEINTENTSREQUEST.oneofs_by_name['intent_batch'].fields.append( + _BATCHUPDATEINTENTSREQUEST.fields_by_name['intent_batch_inline']) +_BATCHUPDATEINTENTSREQUEST.fields_by_name['intent_batch_inline'].containing_oneof = _BATCHUPDATEINTENTSREQUEST.oneofs_by_name['intent_batch'] +_BATCHUPDATEINTENTSRESPONSE.fields_by_name['intents'].message_type = _INTENT +_BATCHDELETEINTENTSREQUEST.fields_by_name['intents'].message_type = _INTENT +_INTENTBATCH.fields_by_name['intents'].message_type = _INTENT +DESCRIPTOR.message_types_by_name['Intent'] = _INTENT +DESCRIPTOR.message_types_by_name['ListIntentsRequest'] = _LISTINTENTSREQUEST +DESCRIPTOR.message_types_by_name['ListIntentsResponse'] = _LISTINTENTSRESPONSE +DESCRIPTOR.message_types_by_name['GetIntentRequest'] = _GETINTENTREQUEST +DESCRIPTOR.message_types_by_name['CreateIntentRequest'] = _CREATEINTENTREQUEST +DESCRIPTOR.message_types_by_name['UpdateIntentRequest'] = _UPDATEINTENTREQUEST +DESCRIPTOR.message_types_by_name['DeleteIntentRequest'] = _DELETEINTENTREQUEST +DESCRIPTOR.message_types_by_name['BatchUpdateIntentsRequest'] = _BATCHUPDATEINTENTSREQUEST +DESCRIPTOR.message_types_by_name['BatchUpdateIntentsResponse'] = _BATCHUPDATEINTENTSRESPONSE +DESCRIPTOR.message_types_by_name['BatchDeleteIntentsRequest'] = _BATCHDELETEINTENTSREQUEST +DESCRIPTOR.message_types_by_name['IntentBatch'] = _INTENTBATCH +DESCRIPTOR.enum_types_by_name['IntentView'] = _INTENTVIEW + +Intent = _reflection.GeneratedProtocolMessageType('Intent', (_message.Message,), dict( + + TrainingPhrase = _reflection.GeneratedProtocolMessageType('TrainingPhrase', (_message.Message,), dict( + + Part = _reflection.GeneratedProtocolMessageType('Part', (_message.Message,), dict( + DESCRIPTOR = _INTENT_TRAININGPHRASE_PART, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """Represents a part of a training phrase. + + + Attributes: + text: + Required. The text corresponding to the example or template, + if there are no annotations. For annotated examples, it is the + text for one of the example's parts. + entity_type: + Optional. The entity type name prefixed with ``@``. This field + is required for the annotated part of the text and applies + only to examples. + alias: + Optional. The parameter name for the value extracted from the + annotated part of the example. + user_defined: + Optional. Indicates whether the text was manually annotated by + the developer. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part) + )) + , + DESCRIPTOR = _INTENT_TRAININGPHRASE, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """Represents an example or template that the agent is trained on. + + + Attributes: + name: + Required. The unique identifier of this training phrase. + type: + Required. The type of the training phrase. + parts: + Required. The collection of training phrase parts (can be + annotated). Fields: ``entity_type``, ``alias`` and + ``user_defined`` should be populated only for the annotated + parts of the training phrase. + times_added_count: + Optional. Indicates how many times this example or template + was added to the intent. Each time a developer adds an + existing sample by editing an intent or training, this counter + is increased. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.TrainingPhrase) + )) + , + + Parameter = _reflection.GeneratedProtocolMessageType('Parameter', (_message.Message,), dict( + DESCRIPTOR = _INTENT_PARAMETER, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """Represents intent parameters. + + + Attributes: + name: + The unique identifier of this parameter. + display_name: + Required. The name of the parameter. + value: + Optional. The definition of the parameter value. It can be: - + a constant string, - a parameter value defined as + ``$parameter_name``, - an original parameter value defined as + ``$parameter_name.original``, - a parameter value from some + context defined as ``#context_name.parameter_name``. + default_value: + Optional. The default value to use when the ``value`` yields + an empty result. Default values can be extracted from contexts + by using the following syntax: + ``#context_name.parameter_name``. + entity_type_display_name: + Optional. The name of the entity type, prefixed with ``@``, + that describes values of the parameter. If the parameter is + required, this must be provided. + mandatory: + Optional. Indicates whether the parameter is required. That + is, whether the intent cannot be completed without collecting + the parameter value. + prompts: + Optional. The collection of prompts that the agent can present + to the user in order to collect value for the parameter. + is_list: + Optional. Indicates whether the parameter represents a list of + values. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Parameter) + )) + , + + Message = _reflection.GeneratedProtocolMessageType('Message', (_message.Message,), dict( + + Text = _reflection.GeneratedProtocolMessageType('Text', (_message.Message,), dict( + DESCRIPTOR = _INTENT_MESSAGE_TEXT, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The text response message. + + + Attributes: + text: + Optional. The collection of the agent's responses. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.Text) + )) + , + + Image = _reflection.GeneratedProtocolMessageType('Image', (_message.Message,), dict( + DESCRIPTOR = _INTENT_MESSAGE_IMAGE, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The image response message. + + + Attributes: + image_uri: + Optional. The public URI to an image file. + accessibility_text: + Optional. A text description of the image to be used for + accessibility, e.g., screen readers. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.Image) + )) + , + + QuickReplies = _reflection.GeneratedProtocolMessageType('QuickReplies', (_message.Message,), dict( + DESCRIPTOR = _INTENT_MESSAGE_QUICKREPLIES, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The quick replies response message. + + + Attributes: + title: + Optional. The title of the collection of quick replies. + quick_replies: + Optional. The collection of quick replies. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.QuickReplies) + )) + , + + Card = _reflection.GeneratedProtocolMessageType('Card', (_message.Message,), dict( + + Button = _reflection.GeneratedProtocolMessageType('Button', (_message.Message,), dict( + DESCRIPTOR = _INTENT_MESSAGE_CARD_BUTTON, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """Optional. Contains information about a button. + + + Attributes: + text: + Optional. The text to show on the button. + postback: + Optional. The text to send back to the Dialogflow API or a URI + to open. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.Card.Button) + )) + , + DESCRIPTOR = _INTENT_MESSAGE_CARD, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The card response message. + + + Attributes: + title: + Optional. The title of the card. + subtitle: + Optional. The subtitle of the card. + image_uri: + Optional. The public URI to an image file for the card. + buttons: + Optional. The collection of card buttons. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.Card) + )) + , + + SimpleResponse = _reflection.GeneratedProtocolMessageType('SimpleResponse', (_message.Message,), dict( + DESCRIPTOR = _INTENT_MESSAGE_SIMPLERESPONSE, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The simple response message containing speech or text. + + + Attributes: + text_to_speech: + One of text\_to\_speech or ssml must be provided. The plain + text of the speech output. Mutually exclusive with ssml. + ssml: + One of text\_to\_speech or ssml must be provided. Structured + spoken response to the user in the SSML format. Mutually + exclusive with text\_to\_speech. + display_text: + Optional. The text to display. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.SimpleResponse) + )) + , + + SimpleResponses = _reflection.GeneratedProtocolMessageType('SimpleResponses', (_message.Message,), dict( + DESCRIPTOR = _INTENT_MESSAGE_SIMPLERESPONSES, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The collection of simple response candidates. This message in + ``QueryResult.fulfillment_messages`` and + ``WebhookResponse.fulfillment_messages`` should contain only one + ``SimpleResponse``. + + + Attributes: + simple_responses: + Required. The list of simple responses. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.SimpleResponses) + )) + , + + BasicCard = _reflection.GeneratedProtocolMessageType('BasicCard', (_message.Message,), dict( + + Button = _reflection.GeneratedProtocolMessageType('Button', (_message.Message,), dict( + + OpenUriAction = _reflection.GeneratedProtocolMessageType('OpenUriAction', (_message.Message,), dict( + DESCRIPTOR = _INTENT_MESSAGE_BASICCARD_BUTTON_OPENURIACTION, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """Opens the given URI. + + + Attributes: + uri: + Required. The HTTP or HTTPS scheme URI. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction) + )) + , + DESCRIPTOR = _INTENT_MESSAGE_BASICCARD_BUTTON, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The button object that appears at the bottom of a card. + + + Attributes: + title: + Required. The title of the button. + open_uri_action: + Required. Action to take when a user taps on the button. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button) + )) + , + DESCRIPTOR = _INTENT_MESSAGE_BASICCARD, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The basic card message. Useful for displaying information. + + + Attributes: + title: + Optional. The title of the card. + subtitle: + Optional. The subtitle of the card. + formatted_text: + Required, unless image is present. The body text of the card. + image: + Optional. The image for the card. + buttons: + Optional. The collection of card buttons. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.BasicCard) + )) + , + + Suggestion = _reflection.GeneratedProtocolMessageType('Suggestion', (_message.Message,), dict( + DESCRIPTOR = _INTENT_MESSAGE_SUGGESTION, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The suggestion chip message that the user can tap to quickly post a + reply to the conversation. + + + Attributes: + title: + Required. The text shown the in the suggestion chip. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.Suggestion) + )) + , + + Suggestions = _reflection.GeneratedProtocolMessageType('Suggestions', (_message.Message,), dict( + DESCRIPTOR = _INTENT_MESSAGE_SUGGESTIONS, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The collection of suggestions. + + + Attributes: + suggestions: + Required. The list of suggested replies. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.Suggestions) + )) + , + + LinkOutSuggestion = _reflection.GeneratedProtocolMessageType('LinkOutSuggestion', (_message.Message,), dict( + DESCRIPTOR = _INTENT_MESSAGE_LINKOUTSUGGESTION, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The suggestion chip message that allows the user to jump out to the app + or website associated with this agent. + + + Attributes: + destination_name: + Required. The name of the app or site this chip is linking to. + uri: + Required. The URI of the app or site to open when the user + taps the suggestion chip. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion) + )) + , + + ListSelect = _reflection.GeneratedProtocolMessageType('ListSelect', (_message.Message,), dict( + + Item = _reflection.GeneratedProtocolMessageType('Item', (_message.Message,), dict( + DESCRIPTOR = _INTENT_MESSAGE_LISTSELECT_ITEM, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """An item in the list. + + + Attributes: + info: + Required. Additional information about this option. + title: + Required. The title of the list item. + description: + Optional. The main text describing the item. + image: + Optional. The image to display. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item) + )) + , + DESCRIPTOR = _INTENT_MESSAGE_LISTSELECT, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The card for presenting a list of options to select from. + + + Attributes: + title: + Optional. The overall title of the list. + items: + Required. List items. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.ListSelect) + )) + , + + CarouselSelect = _reflection.GeneratedProtocolMessageType('CarouselSelect', (_message.Message,), dict( + + Item = _reflection.GeneratedProtocolMessageType('Item', (_message.Message,), dict( + DESCRIPTOR = _INTENT_MESSAGE_CAROUSELSELECT_ITEM, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """An item in the carousel. + + + Attributes: + info: + Required. Additional info about the option item. + title: + Required. Title of the carousel item. + description: + Optional. The body text of the card. + image: + Optional. The image to display. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item) + )) + , + DESCRIPTOR = _INTENT_MESSAGE_CAROUSELSELECT, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The card for presenting a carousel of options to select from. + + + Attributes: + items: + Required. Carousel items. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.CarouselSelect) + )) + , + + SelectItemInfo = _reflection.GeneratedProtocolMessageType('SelectItemInfo', (_message.Message,), dict( + DESCRIPTOR = _INTENT_MESSAGE_SELECTITEMINFO, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """Additional info about the select item for when it is triggered in a + dialog. + + + Attributes: + key: + Required. A unique key that will be sent back to the agent if + this response is given. + synonyms: + Optional. A list of synonyms that can also be used to trigger + this item in dialog. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo) + )) + , + DESCRIPTOR = _INTENT_MESSAGE, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """Corresponds to the ``Response`` field in API.AI console. + + + Attributes: + message: + Required. The rich response message. + text: + The text response. + image: + The image response. + quick_replies: + The quick replies response. + card: + The card response. + payload: + The response containing a custom payload. + simple_responses: + The voice and text-only responses for Actions on Google. + basic_card: + The basic card response for Actions on Google. + suggestions: + The suggestion chips for Actions on Google. + link_out_suggestion: + The link out suggestion chip for Actions on Google. + list_select: + The list card response for Actions on Google. + carousel_select: + The carousel card response for Actions on Google. + platform: + Optional. The platform that this message is intended for. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.Message) + )) + , + + FollowupIntentInfo = _reflection.GeneratedProtocolMessageType('FollowupIntentInfo', (_message.Message,), dict( + DESCRIPTOR = _INTENT_FOLLOWUPINTENTINFO, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """Represents a single followup intent in the chain. + + + Attributes: + followup_intent_name: + The unique identifier of the followup intent. Format: + ``projects//agent/intents/``. + parent_followup_intent_name: + The unique identifier of the followup intent parent. Format: + ``projects//agent/intents/``. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent.FollowupIntentInfo) + )) + , + DESCRIPTOR = _INTENT, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """Represents an intent. Intents convert a number of user expressions or + patterns into an action. An action is an extraction of a user command or + sentence semantics. + + + Attributes: + name: + Required for all methods except ``create`` (``create`` + populates the name automatically. The unique identifier of + this intent. Format: ``projects//agent/intents/``. + display_name: + Required. The name of this intent. + webhook_state: + Required. Indicates whether webhooks are enabled for the + intent. + priority: + Optional. The priority of this intent. Higher numbers + represent higher priorities. Zero or negative numbers mean + that the intent is disabled. + is_fallback: + Optional. Indicates whether this is a fallback intent. + ml_disabled: + Optional. Indicates whether Machine Learning is disabled for + the intent. Note: If ``ml_diabled`` setting is set to false, + then this intent is not taken into account during inference in + ``ML ONLY`` match mode. Also, auto-markup in the UI is turned + off. + input_context_names: + Optional. The list of context names required for this intent + to be triggered. Format: ``projects//agent/sessions/-/contexts/``. + events: + Optional. The collection of event names that trigger the + intent. If the collection of input contexts is not empty, all + of the contexts must be present in the active user session for + an event to trigger this intent. + training_phrases: + Optional. The collection of examples/templates that the agent + is trained on. + action: + Optional. The name of the action associated with the intent. + output_contexts: + Optional. The collection of contexts that are activated when + the intent is matched. Context messages in this collection + should not set the parameters field. Setting the + ``lifespan_count`` to 0 will reset the context when the intent + is matched. Format: ``projects//agent/sessions/-/contexts/``. + reset_contexts: + Optional. Indicates whether to delete all contexts in the + current session when this intent is matched. + parameters: + Optional. The collection of parameters associated with the + intent. + messages: + Optional. The collection of rich messages corresponding to the + ``Response`` field in API.AI console. + default_response_platforms: + Optional. The list of platforms for which the first response + will be taken from among the messages assigned to the + DEFAULT\_PLATFORM. + root_followup_intent_name: + The unique identifier of the root intent in the chain of + followup intents. It identifies the correct followup intents + chain for this intent. Format: ``projects//agent/intents/``. + parent_followup_intent_name: + The unique identifier of the parent intent in the chain of + followup intents. It identifies the parent followup intent. + Format: ``projects//agent/intents/``. + followup_intent_info: + Optional. Collection of information about all followup intents + that have name of this intent as a root\_name. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Intent) + )) +_sym_db.RegisterMessage(Intent) +_sym_db.RegisterMessage(Intent.TrainingPhrase) +_sym_db.RegisterMessage(Intent.TrainingPhrase.Part) +_sym_db.RegisterMessage(Intent.Parameter) +_sym_db.RegisterMessage(Intent.Message) +_sym_db.RegisterMessage(Intent.Message.Text) +_sym_db.RegisterMessage(Intent.Message.Image) +_sym_db.RegisterMessage(Intent.Message.QuickReplies) +_sym_db.RegisterMessage(Intent.Message.Card) +_sym_db.RegisterMessage(Intent.Message.Card.Button) +_sym_db.RegisterMessage(Intent.Message.SimpleResponse) +_sym_db.RegisterMessage(Intent.Message.SimpleResponses) +_sym_db.RegisterMessage(Intent.Message.BasicCard) +_sym_db.RegisterMessage(Intent.Message.BasicCard.Button) +_sym_db.RegisterMessage(Intent.Message.BasicCard.Button.OpenUriAction) +_sym_db.RegisterMessage(Intent.Message.Suggestion) +_sym_db.RegisterMessage(Intent.Message.Suggestions) +_sym_db.RegisterMessage(Intent.Message.LinkOutSuggestion) +_sym_db.RegisterMessage(Intent.Message.ListSelect) +_sym_db.RegisterMessage(Intent.Message.ListSelect.Item) +_sym_db.RegisterMessage(Intent.Message.CarouselSelect) +_sym_db.RegisterMessage(Intent.Message.CarouselSelect.Item) +_sym_db.RegisterMessage(Intent.Message.SelectItemInfo) +_sym_db.RegisterMessage(Intent.FollowupIntentInfo) + +ListIntentsRequest = _reflection.GeneratedProtocolMessageType('ListIntentsRequest', (_message.Message,), dict( + DESCRIPTOR = _LISTINTENTSREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The request message for + [Intents.ListIntents][google.cloud.dialogflow.v2.Intents.ListIntents]. + + + Attributes: + parent: + Required. The agent to list all intents from. Format: + ``projects//agent``. + language_code: + Optional. The language to list training phrases, parameters + and rich messages for. If not specified, the agent's default + language is used. `More than a dozen languages + `__ are + supported. Note: languages must be enabled in the agent before + they can be used. + intent_view: + Optional. The resource view to apply to the returned intent. + page_size: + Optional. The maximum number of items to return in a single + page. By default 100 and at most 1000. + page_token: + Optional. The next\_page\_token value returned from a previous + list request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ListIntentsRequest) + )) +_sym_db.RegisterMessage(ListIntentsRequest) + +ListIntentsResponse = _reflection.GeneratedProtocolMessageType('ListIntentsResponse', (_message.Message,), dict( + DESCRIPTOR = _LISTINTENTSRESPONSE, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The response message for + [Intents.ListIntents][google.cloud.dialogflow.v2.Intents.ListIntents]. + + + Attributes: + intents: + The list of agent intents. There will be a maximum number of + items returned based on the page\_size field in the request. + next_page_token: + Token to retrieve the next page of results, or empty if there + are no more results in the list. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ListIntentsResponse) + )) +_sym_db.RegisterMessage(ListIntentsResponse) + +GetIntentRequest = _reflection.GeneratedProtocolMessageType('GetIntentRequest', (_message.Message,), dict( + DESCRIPTOR = _GETINTENTREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The request message for + [Intents.GetIntent][google.cloud.dialogflow.v2.Intents.GetIntent]. + + + Attributes: + name: + Required. The name of the intent. Format: ``projects//agent/intents/``. + language_code: + Optional. The language to retrieve training phrases, + parameters and rich messages for. If not specified, the + agent's default language is used. `More than a dozen languages + `__ are + supported. Note: languages must be enabled in the agent, + before they can be used. + intent_view: + Optional. The resource view to apply to the returned intent. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.GetIntentRequest) + )) +_sym_db.RegisterMessage(GetIntentRequest) + +CreateIntentRequest = _reflection.GeneratedProtocolMessageType('CreateIntentRequest', (_message.Message,), dict( + DESCRIPTOR = _CREATEINTENTREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The request message for + [Intents.CreateIntent][google.cloud.dialogflow.v2.Intents.CreateIntent]. + + + Attributes: + parent: + Required. The agent to create a intent for. Format: + ``projects//agent``. + intent: + Required. The intent to create. + language_code: + Optional. The language of training phrases, parameters and + rich messages defined in ``intent``. If not specified, the + agent's default language is used. `More than a dozen languages + `__ are + supported. Note: languages must be enabled in the agent, + before they can be used. + intent_view: + Optional. The resource view to apply to the returned intent. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.CreateIntentRequest) + )) +_sym_db.RegisterMessage(CreateIntentRequest) + +UpdateIntentRequest = _reflection.GeneratedProtocolMessageType('UpdateIntentRequest', (_message.Message,), dict( + DESCRIPTOR = _UPDATEINTENTREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The request message for + [Intents.UpdateIntent][google.cloud.dialogflow.v2.Intents.UpdateIntent]. + + + Attributes: + intent: + Required. The intent to update. Format: ``projects//agent/intents/``. + language_code: + Optional. The language of training phrases, parameters and + rich messages defined in ``intent``. If not specified, the + agent's default language is used. `More than a dozen languages + `__ are + supported. Note: languages must be enabled in the agent, + before they can be used. + update_mask: + Optional. The mask to control which fields get updated. + intent_view: + Optional. The resource view to apply to the returned intent. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.UpdateIntentRequest) + )) +_sym_db.RegisterMessage(UpdateIntentRequest) + +DeleteIntentRequest = _reflection.GeneratedProtocolMessageType('DeleteIntentRequest', (_message.Message,), dict( + DESCRIPTOR = _DELETEINTENTREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The request message for + [Intents.DeleteIntent][google.cloud.dialogflow.v2.Intents.DeleteIntent]. + + + Attributes: + name: + Required. The name of the intent to delete. Format: + ``projects//agent/intents/``. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.DeleteIntentRequest) + )) +_sym_db.RegisterMessage(DeleteIntentRequest) + +BatchUpdateIntentsRequest = _reflection.GeneratedProtocolMessageType('BatchUpdateIntentsRequest', (_message.Message,), dict( + DESCRIPTOR = _BATCHUPDATEINTENTSREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The request message for + [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents]. + + + Attributes: + parent: + Required. The name of the agent to update or create intents + in. Format: ``projects//agent``. + intent_batch: + Required. The source of the intent batch. + intent_batch_uri: + The URI to a Google Cloud Storage file containing intents to + update or create. The file format can either be a serialized + proto (of IntentBatch type) or JSON object. Note: The URI must + start with "gs://". + intent_batch_inline: + The collection of intents to update or create. + language_code: + Optional. The language of training phrases, parameters and + rich messages defined in ``intents``. If not specified, the + agent's default language is used. `More than a dozen languages + `__ are + supported. Note: languages must be enabled in the agent, + before they can be used. + update_mask: + Optional. The mask to control which fields get updated. + intent_view: + Optional. The resource view to apply to the returned intent. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.BatchUpdateIntentsRequest) + )) +_sym_db.RegisterMessage(BatchUpdateIntentsRequest) + +BatchUpdateIntentsResponse = _reflection.GeneratedProtocolMessageType('BatchUpdateIntentsResponse', (_message.Message,), dict( + DESCRIPTOR = _BATCHUPDATEINTENTSRESPONSE, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The response message for + [Intents.BatchUpdateIntents][google.cloud.dialogflow.v2.Intents.BatchUpdateIntents]. + + + Attributes: + intents: + The collection of updated or created intents. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.BatchUpdateIntentsResponse) + )) +_sym_db.RegisterMessage(BatchUpdateIntentsResponse) + +BatchDeleteIntentsRequest = _reflection.GeneratedProtocolMessageType('BatchDeleteIntentsRequest', (_message.Message,), dict( + DESCRIPTOR = _BATCHDELETEINTENTSREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """The request message for + [Intents.BatchDeleteIntents][google.cloud.dialogflow.v2.Intents.BatchDeleteIntents]. + + + Attributes: + parent: + Required. The name of the agent to delete all entities types + for. Format: ``projects//agent``. + intents: + Required. The collection of intents to delete. Only intent + ``name`` must be filled in. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.BatchDeleteIntentsRequest) + )) +_sym_db.RegisterMessage(BatchDeleteIntentsRequest) + +IntentBatch = _reflection.GeneratedProtocolMessageType('IntentBatch', (_message.Message,), dict( + DESCRIPTOR = _INTENTBATCH, + __module__ = 'google.cloud.dialogflow_v2.proto.intent_pb2' + , + __doc__ = """This message is a wrapper around a collection of intents. + + + Attributes: + intents: + A collection of intents. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.IntentBatch) + )) +_sym_db.RegisterMessage(IntentBatch) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\036com.google.cloud.dialogflow.v2B\013IntentProtoP\001ZDgoogle.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow\370\001\001\242\002\002DF\252\002\032Google.Cloud.Dialogflow.V2')) +try: + # THESE ELEMENTS WILL BE DEPRECATED. + # Please use the generated *_pb2_grpc.py files instead. + import grpc + from grpc.beta import implementations as beta_implementations + from grpc.beta import interfaces as beta_interfaces + from grpc.framework.common import cardinality + from grpc.framework.interfaces.face import utilities as face_utilities + + + class IntentsStub(object): + """Manages agent intents. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/intents) + for more details about agent intents. + # + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListIntents = channel.unary_unary( + '/google.cloud.dialogflow.v2.Intents/ListIntents', + request_serializer=ListIntentsRequest.SerializeToString, + response_deserializer=ListIntentsResponse.FromString, + ) + self.GetIntent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Intents/GetIntent', + request_serializer=GetIntentRequest.SerializeToString, + response_deserializer=Intent.FromString, + ) + self.CreateIntent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Intents/CreateIntent', + request_serializer=CreateIntentRequest.SerializeToString, + response_deserializer=Intent.FromString, + ) + self.UpdateIntent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Intents/UpdateIntent', + request_serializer=UpdateIntentRequest.SerializeToString, + response_deserializer=Intent.FromString, + ) + self.DeleteIntent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Intents/DeleteIntent', + request_serializer=DeleteIntentRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + self.BatchUpdateIntents = channel.unary_unary( + '/google.cloud.dialogflow.v2.Intents/BatchUpdateIntents', + request_serializer=BatchUpdateIntentsRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.BatchDeleteIntents = channel.unary_unary( + '/google.cloud.dialogflow.v2.Intents/BatchDeleteIntents', + request_serializer=BatchDeleteIntentsRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + + + class IntentsServicer(object): + """Manages agent intents. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/intents) + for more details about agent intents. + # + """ + + def ListIntents(self, request, context): + """Returns the list of all intents in the specified agent. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetIntent(self, request, context): + """Retrieves the specified intent. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateIntent(self, request, context): + """Creates an intent in the specified agent. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateIntent(self, request, context): + """Updates the specified intent. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteIntent(self, request, context): + """Deletes the specified intent. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BatchUpdateIntents(self, request, context): + """Updates/Creates multiple intents in the specified agent. + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BatchDeleteIntents(self, request, context): + """Deletes intents in the specified agent. + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + + def add_IntentsServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListIntents': grpc.unary_unary_rpc_method_handler( + servicer.ListIntents, + request_deserializer=ListIntentsRequest.FromString, + response_serializer=ListIntentsResponse.SerializeToString, + ), + 'GetIntent': grpc.unary_unary_rpc_method_handler( + servicer.GetIntent, + request_deserializer=GetIntentRequest.FromString, + response_serializer=Intent.SerializeToString, + ), + 'CreateIntent': grpc.unary_unary_rpc_method_handler( + servicer.CreateIntent, + request_deserializer=CreateIntentRequest.FromString, + response_serializer=Intent.SerializeToString, + ), + 'UpdateIntent': grpc.unary_unary_rpc_method_handler( + servicer.UpdateIntent, + request_deserializer=UpdateIntentRequest.FromString, + response_serializer=Intent.SerializeToString, + ), + 'DeleteIntent': grpc.unary_unary_rpc_method_handler( + servicer.DeleteIntent, + request_deserializer=DeleteIntentRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'BatchUpdateIntents': grpc.unary_unary_rpc_method_handler( + servicer.BatchUpdateIntents, + request_deserializer=BatchUpdateIntentsRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + 'BatchDeleteIntents': grpc.unary_unary_rpc_method_handler( + servicer.BatchDeleteIntents, + request_deserializer=BatchDeleteIntentsRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'google.cloud.dialogflow.v2.Intents', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + class BetaIntentsServicer(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Manages agent intents. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/intents) + for more details about agent intents. + # + """ + def ListIntents(self, request, context): + """Returns the list of all intents in the specified agent. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def GetIntent(self, request, context): + """Retrieves the specified intent. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def CreateIntent(self, request, context): + """Creates an intent in the specified agent. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def UpdateIntent(self, request, context): + """Updates the specified intent. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def DeleteIntent(self, request, context): + """Deletes the specified intent. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def BatchUpdateIntents(self, request, context): + """Updates/Creates multiple intents in the specified agent. + + Operation + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def BatchDeleteIntents(self, request, context): + """Deletes intents in the specified agent. + + Operation + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + + + class BetaIntentsStub(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Manages agent intents. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/intents) + for more details about agent intents. + # + """ + def ListIntents(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Returns the list of all intents in the specified agent. + """ + raise NotImplementedError() + ListIntents.future = None + def GetIntent(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Retrieves the specified intent. + """ + raise NotImplementedError() + GetIntent.future = None + def CreateIntent(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Creates an intent in the specified agent. + """ + raise NotImplementedError() + CreateIntent.future = None + def UpdateIntent(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Updates the specified intent. + """ + raise NotImplementedError() + UpdateIntent.future = None + def DeleteIntent(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Deletes the specified intent. + """ + raise NotImplementedError() + DeleteIntent.future = None + def BatchUpdateIntents(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Updates/Creates multiple intents in the specified agent. + + Operation + """ + raise NotImplementedError() + BatchUpdateIntents.future = None + def BatchDeleteIntents(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Deletes intents in the specified agent. + + Operation + """ + raise NotImplementedError() + BatchDeleteIntents.future = None + + + def beta_create_Intents_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_deserializers = { + ('google.cloud.dialogflow.v2.Intents', 'BatchDeleteIntents'): BatchDeleteIntentsRequest.FromString, + ('google.cloud.dialogflow.v2.Intents', 'BatchUpdateIntents'): BatchUpdateIntentsRequest.FromString, + ('google.cloud.dialogflow.v2.Intents', 'CreateIntent'): CreateIntentRequest.FromString, + ('google.cloud.dialogflow.v2.Intents', 'DeleteIntent'): DeleteIntentRequest.FromString, + ('google.cloud.dialogflow.v2.Intents', 'GetIntent'): GetIntentRequest.FromString, + ('google.cloud.dialogflow.v2.Intents', 'ListIntents'): ListIntentsRequest.FromString, + ('google.cloud.dialogflow.v2.Intents', 'UpdateIntent'): UpdateIntentRequest.FromString, + } + response_serializers = { + ('google.cloud.dialogflow.v2.Intents', 'BatchDeleteIntents'): google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ('google.cloud.dialogflow.v2.Intents', 'BatchUpdateIntents'): google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ('google.cloud.dialogflow.v2.Intents', 'CreateIntent'): Intent.SerializeToString, + ('google.cloud.dialogflow.v2.Intents', 'DeleteIntent'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ('google.cloud.dialogflow.v2.Intents', 'GetIntent'): Intent.SerializeToString, + ('google.cloud.dialogflow.v2.Intents', 'ListIntents'): ListIntentsResponse.SerializeToString, + ('google.cloud.dialogflow.v2.Intents', 'UpdateIntent'): Intent.SerializeToString, + } + method_implementations = { + ('google.cloud.dialogflow.v2.Intents', 'BatchDeleteIntents'): face_utilities.unary_unary_inline(servicer.BatchDeleteIntents), + ('google.cloud.dialogflow.v2.Intents', 'BatchUpdateIntents'): face_utilities.unary_unary_inline(servicer.BatchUpdateIntents), + ('google.cloud.dialogflow.v2.Intents', 'CreateIntent'): face_utilities.unary_unary_inline(servicer.CreateIntent), + ('google.cloud.dialogflow.v2.Intents', 'DeleteIntent'): face_utilities.unary_unary_inline(servicer.DeleteIntent), + ('google.cloud.dialogflow.v2.Intents', 'GetIntent'): face_utilities.unary_unary_inline(servicer.GetIntent), + ('google.cloud.dialogflow.v2.Intents', 'ListIntents'): face_utilities.unary_unary_inline(servicer.ListIntents), + ('google.cloud.dialogflow.v2.Intents', 'UpdateIntent'): face_utilities.unary_unary_inline(servicer.UpdateIntent), + } + server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) + return beta_implementations.server(method_implementations, options=server_options) + + + def beta_create_Intents_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_serializers = { + ('google.cloud.dialogflow.v2.Intents', 'BatchDeleteIntents'): BatchDeleteIntentsRequest.SerializeToString, + ('google.cloud.dialogflow.v2.Intents', 'BatchUpdateIntents'): BatchUpdateIntentsRequest.SerializeToString, + ('google.cloud.dialogflow.v2.Intents', 'CreateIntent'): CreateIntentRequest.SerializeToString, + ('google.cloud.dialogflow.v2.Intents', 'DeleteIntent'): DeleteIntentRequest.SerializeToString, + ('google.cloud.dialogflow.v2.Intents', 'GetIntent'): GetIntentRequest.SerializeToString, + ('google.cloud.dialogflow.v2.Intents', 'ListIntents'): ListIntentsRequest.SerializeToString, + ('google.cloud.dialogflow.v2.Intents', 'UpdateIntent'): UpdateIntentRequest.SerializeToString, + } + response_deserializers = { + ('google.cloud.dialogflow.v2.Intents', 'BatchDeleteIntents'): google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ('google.cloud.dialogflow.v2.Intents', 'BatchUpdateIntents'): google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ('google.cloud.dialogflow.v2.Intents', 'CreateIntent'): Intent.FromString, + ('google.cloud.dialogflow.v2.Intents', 'DeleteIntent'): google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ('google.cloud.dialogflow.v2.Intents', 'GetIntent'): Intent.FromString, + ('google.cloud.dialogflow.v2.Intents', 'ListIntents'): ListIntentsResponse.FromString, + ('google.cloud.dialogflow.v2.Intents', 'UpdateIntent'): Intent.FromString, + } + cardinalities = { + 'BatchDeleteIntents': cardinality.Cardinality.UNARY_UNARY, + 'BatchUpdateIntents': cardinality.Cardinality.UNARY_UNARY, + 'CreateIntent': cardinality.Cardinality.UNARY_UNARY, + 'DeleteIntent': cardinality.Cardinality.UNARY_UNARY, + 'GetIntent': cardinality.Cardinality.UNARY_UNARY, + 'ListIntents': cardinality.Cardinality.UNARY_UNARY, + 'UpdateIntent': cardinality.Cardinality.UNARY_UNARY, + } + stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) + return beta_implementations.dynamic_stub(channel, 'google.cloud.dialogflow.v2.Intents', cardinalities, options=stub_options) +except ImportError: + pass +# @@protoc_insertion_point(module_scope) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/proto/intent_pb2_grpc.py b/packages/google-cloud-dialogflow/dialogflow_v2/proto/intent_pb2_grpc.py new file mode 100755 index 000000000000..2fbf870362f3 --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/proto/intent_pb2_grpc.py @@ -0,0 +1,164 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + +import dialogflow_v2.proto.intent_pb2 as google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2 +import google.longrunning.operations_pb2 as google_dot_longrunning_dot_operations__pb2 +import google.protobuf.empty_pb2 as google_dot_protobuf_dot_empty__pb2 + + +class IntentsStub(object): + """Manages agent intents. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/intents) + for more details about agent intents. + # + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListIntents = channel.unary_unary( + '/google.cloud.dialogflow.v2.Intents/ListIntents', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.ListIntentsRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.ListIntentsResponse.FromString, + ) + self.GetIntent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Intents/GetIntent', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.GetIntentRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.Intent.FromString, + ) + self.CreateIntent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Intents/CreateIntent', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.CreateIntentRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.Intent.FromString, + ) + self.UpdateIntent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Intents/UpdateIntent', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.UpdateIntentRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.Intent.FromString, + ) + self.DeleteIntent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Intents/DeleteIntent', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.DeleteIntentRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + self.BatchUpdateIntents = channel.unary_unary( + '/google.cloud.dialogflow.v2.Intents/BatchUpdateIntents', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.BatchUpdateIntentsRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + self.BatchDeleteIntents = channel.unary_unary( + '/google.cloud.dialogflow.v2.Intents/BatchDeleteIntents', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.BatchDeleteIntentsRequest.SerializeToString, + response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, + ) + + +class IntentsServicer(object): + """Manages agent intents. + + + Refer to the [Dialogflow documentation](https://dialogflow.com/docs/intents) + for more details about agent intents. + # + """ + + def ListIntents(self, request, context): + """Returns the list of all intents in the specified agent. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetIntent(self, request, context): + """Retrieves the specified intent. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateIntent(self, request, context): + """Creates an intent in the specified agent. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateIntent(self, request, context): + """Updates the specified intent. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteIntent(self, request, context): + """Deletes the specified intent. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BatchUpdateIntents(self, request, context): + """Updates/Creates multiple intents in the specified agent. + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def BatchDeleteIntents(self, request, context): + """Deletes intents in the specified agent. + + Operation + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_IntentsServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListIntents': grpc.unary_unary_rpc_method_handler( + servicer.ListIntents, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.ListIntentsRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.ListIntentsResponse.SerializeToString, + ), + 'GetIntent': grpc.unary_unary_rpc_method_handler( + servicer.GetIntent, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.GetIntentRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.Intent.SerializeToString, + ), + 'CreateIntent': grpc.unary_unary_rpc_method_handler( + servicer.CreateIntent, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.CreateIntentRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.Intent.SerializeToString, + ), + 'UpdateIntent': grpc.unary_unary_rpc_method_handler( + servicer.UpdateIntent, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.UpdateIntentRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.Intent.SerializeToString, + ), + 'DeleteIntent': grpc.unary_unary_rpc_method_handler( + servicer.DeleteIntent, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.DeleteIntentRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + 'BatchUpdateIntents': grpc.unary_unary_rpc_method_handler( + servicer.BatchUpdateIntents, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.BatchUpdateIntentsRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + 'BatchDeleteIntents': grpc.unary_unary_rpc_method_handler( + servicer.BatchDeleteIntents, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.BatchDeleteIntentsRequest.FromString, + response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'google.cloud.dialogflow.v2.Intents', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/proto/session_entity_type_pb2.py b/packages/google-cloud-dialogflow/dialogflow_v2/proto/session_entity_type_pb2.py new file mode 100755 index 000000000000..ac7cb8fc95a4 --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/proto/session_entity_type_pb2.py @@ -0,0 +1,760 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow_v2/proto/session_entity_type.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 +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from dialogflow_v2.proto import entity_type_pb2 as google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__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/dialogflow_v2/proto/session_entity_type.proto', + package='google.cloud.dialogflow.v2', + syntax='proto3', + serialized_pb=_b('\n:google/cloud/dialogflow_v2/proto/session_entity_type.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x32google/cloud/dialogflow_v2/proto/entity_type.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xc7\x02\n\x11SessionEntityType\x12\x0c\n\x04name\x18\x01 \x01(\t\x12^\n\x14\x65ntity_override_mode\x18\x02 \x01(\x0e\x32@.google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode\x12?\n\x08\x65ntities\x18\x03 \x03(\x0b\x32-.google.cloud.dialogflow.v2.EntityType.Entity\"\x82\x01\n\x12\x45ntityOverrideMode\x12$\n ENTITY_OVERRIDE_MODE_UNSPECIFIED\x10\x00\x12!\n\x1d\x45NTITY_OVERRIDE_MODE_OVERRIDE\x10\x01\x12#\n\x1f\x45NTITY_OVERRIDE_MODE_SUPPLEMENT\x10\x02\"V\n\x1dListSessionEntityTypesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x86\x01\n\x1eListSessionEntityTypesResponse\x12K\n\x14session_entity_types\x18\x01 \x03(\x0b\x32-.google.cloud.dialogflow.v2.SessionEntityType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"+\n\x1bGetSessionEntityTypeRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"|\n\x1e\x43reateSessionEntityTypeRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12J\n\x13session_entity_type\x18\x02 \x01(\x0b\x32-.google.cloud.dialogflow.v2.SessionEntityType\"\x9d\x01\n\x1eUpdateSessionEntityTypeRequest\x12J\n\x13session_entity_type\x18\x01 \x01(\x0b\x32-.google.cloud.dialogflow.v2.SessionEntityType\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\".\n\x1e\x44\x65leteSessionEntityTypeRequest\x12\x0c\n\x04name\x18\x01 \x01(\t2\x99\x08\n\x12SessionEntityTypes\x12\xcd\x01\n\x16ListSessionEntityTypes\x12\x39.google.cloud.dialogflow.v2.ListSessionEntityTypesRequest\x1a:.google.cloud.dialogflow.v2.ListSessionEntityTypesResponse\"<\x82\xd3\xe4\x93\x02\x36\x12\x34/v2/{parent=projects/*/agent/sessions/*}/entityTypes\x12\xbc\x01\n\x14GetSessionEntityType\x12\x37.google.cloud.dialogflow.v2.GetSessionEntityTypeRequest\x1a-.google.cloud.dialogflow.v2.SessionEntityType\"<\x82\xd3\xe4\x93\x02\x36\x12\x34/v2/{name=projects/*/agent/sessions/*/entityTypes/*}\x12\xd7\x01\n\x17\x43reateSessionEntityType\x12:.google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest\x1a-.google.cloud.dialogflow.v2.SessionEntityType\"Q\x82\xd3\xe4\x93\x02K\"4/v2/{parent=projects/*/agent/sessions/*}/entityTypes:\x13session_entity_type\x12\xeb\x01\n\x17UpdateSessionEntityType\x12:.google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest\x1a-.google.cloud.dialogflow.v2.SessionEntityType\"e\x82\xd3\xe4\x93\x02_2H/v2/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}:\x13session_entity_type\x12\xab\x01\n\x17\x44\x65leteSessionEntityType\x12:.google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest\x1a\x16.google.protobuf.Empty\"<\x82\xd3\xe4\x93\x02\x36*4/v2/{name=projects/*/agent/sessions/*/entityTypes/*}B\xa5\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x16SessionEntityTypeProtoP\x01ZDgoogle.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow\xf8\x01\x01\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3') + , + dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR,google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2.DESCRIPTOR,google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR,]) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + +_SESSIONENTITYTYPE_ENTITYOVERRIDEMODE = _descriptor.EnumDescriptor( + name='EntityOverrideMode', + full_name='google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='ENTITY_OVERRIDE_MODE_UNSPECIFIED', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ENTITY_OVERRIDE_MODE_OVERRIDE', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='ENTITY_OVERRIDE_MODE_SUPPLEMENT', index=2, number=2, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=433, + serialized_end=563, +) +_sym_db.RegisterEnumDescriptor(_SESSIONENTITYTYPE_ENTITYOVERRIDEMODE) + + +_SESSIONENTITYTYPE = _descriptor.Descriptor( + name='SessionEntityType', + full_name='google.cloud.dialogflow.v2.SessionEntityType', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='google.cloud.dialogflow.v2.SessionEntityType.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, + options=None), + _descriptor.FieldDescriptor( + name='entity_override_mode', full_name='google.cloud.dialogflow.v2.SessionEntityType.entity_override_mode', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='entities', full_name='google.cloud.dialogflow.v2.SessionEntityType.entities', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _SESSIONENTITYTYPE_ENTITYOVERRIDEMODE, + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=236, + serialized_end=563, +) + + +_LISTSESSIONENTITYTYPESREQUEST = _descriptor.Descriptor( + name='ListSessionEntityTypesRequest', + full_name='google.cloud.dialogflow.v2.ListSessionEntityTypesRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.ListSessionEntityTypesRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='page_size', full_name='google.cloud.dialogflow.v2.ListSessionEntityTypesRequest.page_size', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='page_token', full_name='google.cloud.dialogflow.v2.ListSessionEntityTypesRequest.page_token', index=2, + 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=565, + serialized_end=651, +) + + +_LISTSESSIONENTITYTYPESRESPONSE = _descriptor.Descriptor( + name='ListSessionEntityTypesResponse', + full_name='google.cloud.dialogflow.v2.ListSessionEntityTypesResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='session_entity_types', full_name='google.cloud.dialogflow.v2.ListSessionEntityTypesResponse.session_entity_types', 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, + options=None), + _descriptor.FieldDescriptor( + name='next_page_token', full_name='google.cloud.dialogflow.v2.ListSessionEntityTypesResponse.next_page_token', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=654, + serialized_end=788, +) + + +_GETSESSIONENTITYTYPEREQUEST = _descriptor.Descriptor( + name='GetSessionEntityTypeRequest', + full_name='google.cloud.dialogflow.v2.GetSessionEntityTypeRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='google.cloud.dialogflow.v2.GetSessionEntityTypeRequest.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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=790, + serialized_end=833, +) + + +_CREATESESSIONENTITYTYPEREQUEST = _descriptor.Descriptor( + name='CreateSessionEntityTypeRequest', + full_name='google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='parent', full_name='google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest.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, + options=None), + _descriptor.FieldDescriptor( + name='session_entity_type', full_name='google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest.session_entity_type', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=835, + serialized_end=959, +) + + +_UPDATESESSIONENTITYTYPEREQUEST = _descriptor.Descriptor( + name='UpdateSessionEntityTypeRequest', + full_name='google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='session_entity_type', full_name='google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest.session_entity_type', index=0, + number=1, 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, + options=None), + _descriptor.FieldDescriptor( + name='update_mask', full_name='google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest.update_mask', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=962, + serialized_end=1119, +) + + +_DELETESESSIONENTITYTYPEREQUEST = _descriptor.Descriptor( + name='DeleteSessionEntityTypeRequest', + full_name='google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest.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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1121, + serialized_end=1167, +) + +_SESSIONENTITYTYPE.fields_by_name['entity_override_mode'].enum_type = _SESSIONENTITYTYPE_ENTITYOVERRIDEMODE +_SESSIONENTITYTYPE.fields_by_name['entities'].message_type = google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_entity__type__pb2._ENTITYTYPE_ENTITY +_SESSIONENTITYTYPE_ENTITYOVERRIDEMODE.containing_type = _SESSIONENTITYTYPE +_LISTSESSIONENTITYTYPESRESPONSE.fields_by_name['session_entity_types'].message_type = _SESSIONENTITYTYPE +_CREATESESSIONENTITYTYPEREQUEST.fields_by_name['session_entity_type'].message_type = _SESSIONENTITYTYPE +_UPDATESESSIONENTITYTYPEREQUEST.fields_by_name['session_entity_type'].message_type = _SESSIONENTITYTYPE +_UPDATESESSIONENTITYTYPEREQUEST.fields_by_name['update_mask'].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK +DESCRIPTOR.message_types_by_name['SessionEntityType'] = _SESSIONENTITYTYPE +DESCRIPTOR.message_types_by_name['ListSessionEntityTypesRequest'] = _LISTSESSIONENTITYTYPESREQUEST +DESCRIPTOR.message_types_by_name['ListSessionEntityTypesResponse'] = _LISTSESSIONENTITYTYPESRESPONSE +DESCRIPTOR.message_types_by_name['GetSessionEntityTypeRequest'] = _GETSESSIONENTITYTYPEREQUEST +DESCRIPTOR.message_types_by_name['CreateSessionEntityTypeRequest'] = _CREATESESSIONENTITYTYPEREQUEST +DESCRIPTOR.message_types_by_name['UpdateSessionEntityTypeRequest'] = _UPDATESESSIONENTITYTYPEREQUEST +DESCRIPTOR.message_types_by_name['DeleteSessionEntityTypeRequest'] = _DELETESESSIONENTITYTYPEREQUEST + +SessionEntityType = _reflection.GeneratedProtocolMessageType('SessionEntityType', (_message.Message,), dict( + DESCRIPTOR = _SESSIONENTITYTYPE, + __module__ = 'google.cloud.dialogflow_v2.proto.session_entity_type_pb2' + , + __doc__ = """Represents a session entity type. + + Extends or replaces a developer entity type at the user session level + (we refer to the entity types defined at the agent level as "developer + entity types"). + + Note: session entity types apply to all queries, regardless of the + language. + + + Attributes: + name: + Required. The unique identifier of this session entity type. + Format: ``projects//agent/sessions//entityTypes/``. + entity_override_mode: + Required. Indicates whether the additional data should + override or supplement the developer entity type definition. + entities: + Required. The collection of entities associated with this + session entity type. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.SessionEntityType) + )) +_sym_db.RegisterMessage(SessionEntityType) + +ListSessionEntityTypesRequest = _reflection.GeneratedProtocolMessageType('ListSessionEntityTypesRequest', (_message.Message,), dict( + DESCRIPTOR = _LISTSESSIONENTITYTYPESREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.session_entity_type_pb2' + , + __doc__ = """The request message for + [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.v2.SessionEntityTypes.ListSessionEntityTypes]. + + + Attributes: + parent: + Required. The session to list all session entity types from. + Format: ``projects//agent/sessions/``. + page_size: + Optional. The maximum number of items to return in a single + page. By default 100 and at most 1000. + page_token: + Optional. The next\_page\_token value returned from a previous + list request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ListSessionEntityTypesRequest) + )) +_sym_db.RegisterMessage(ListSessionEntityTypesRequest) + +ListSessionEntityTypesResponse = _reflection.GeneratedProtocolMessageType('ListSessionEntityTypesResponse', (_message.Message,), dict( + DESCRIPTOR = _LISTSESSIONENTITYTYPESRESPONSE, + __module__ = 'google.cloud.dialogflow_v2.proto.session_entity_type_pb2' + , + __doc__ = """The response message for + [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.v2.SessionEntityTypes.ListSessionEntityTypes]. + + + Attributes: + session_entity_types: + The list of session entity types. There will be a maximum + number of items returned based on the page\_size field in the + request. + next_page_token: + Token to retrieve the next page of results, or empty if there + are no more results in the list. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ListSessionEntityTypesResponse) + )) +_sym_db.RegisterMessage(ListSessionEntityTypesResponse) + +GetSessionEntityTypeRequest = _reflection.GeneratedProtocolMessageType('GetSessionEntityTypeRequest', (_message.Message,), dict( + DESCRIPTOR = _GETSESSIONENTITYTYPEREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.session_entity_type_pb2' + , + __doc__ = """The request message for + [SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.v2.SessionEntityTypes.GetSessionEntityType]. + + + Attributes: + name: + Required. The name of the session entity type. Format: + ``projects//agent/sessions//entityTypes/``. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.GetSessionEntityTypeRequest) + )) +_sym_db.RegisterMessage(GetSessionEntityTypeRequest) + +CreateSessionEntityTypeRequest = _reflection.GeneratedProtocolMessageType('CreateSessionEntityTypeRequest', (_message.Message,), dict( + DESCRIPTOR = _CREATESESSIONENTITYTYPEREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.session_entity_type_pb2' + , + __doc__ = """The request message for + [SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.v2.SessionEntityTypes.CreateSessionEntityType]. + + + Attributes: + parent: + Required. The session to create a session entity type for. + Format: ``projects//agent/sessions/``. + session_entity_type: + Required. The session entity type to create. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest) + )) +_sym_db.RegisterMessage(CreateSessionEntityTypeRequest) + +UpdateSessionEntityTypeRequest = _reflection.GeneratedProtocolMessageType('UpdateSessionEntityTypeRequest', (_message.Message,), dict( + DESCRIPTOR = _UPDATESESSIONENTITYTYPEREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.session_entity_type_pb2' + , + __doc__ = """The request message for + [SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.v2.SessionEntityTypes.UpdateSessionEntityType]. + + + Attributes: + session_entity_type: + Required. The entity type to update. Format: + ``projects//agent/sessions//entityTypes/``. + update_mask: + Optional. The mask to control which fields get updated. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest) + )) +_sym_db.RegisterMessage(UpdateSessionEntityTypeRequest) + +DeleteSessionEntityTypeRequest = _reflection.GeneratedProtocolMessageType('DeleteSessionEntityTypeRequest', (_message.Message,), dict( + DESCRIPTOR = _DELETESESSIONENTITYTYPEREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.session_entity_type_pb2' + , + __doc__ = """The request message for + [SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.v2.SessionEntityTypes.DeleteSessionEntityType]. + + + Attributes: + name: + Required. The name of the entity type to delete. Format: + ``projects//agent/sessions//entityTypes/``. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest) + )) +_sym_db.RegisterMessage(DeleteSessionEntityTypeRequest) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\036com.google.cloud.dialogflow.v2B\026SessionEntityTypeProtoP\001ZDgoogle.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow\370\001\001\242\002\002DF\252\002\032Google.Cloud.Dialogflow.V2')) +try: + # THESE ELEMENTS WILL BE DEPRECATED. + # Please use the generated *_pb2_grpc.py files instead. + import grpc + from grpc.beta import implementations as beta_implementations + from grpc.beta import interfaces as beta_interfaces + from grpc.framework.common import cardinality + from grpc.framework.interfaces.face import utilities as face_utilities + + + class SessionEntityTypesStub(object): + """Manages session entity types. + + Session entity types can be redefined on a session level, allowing for + specific concepts, like a user's playlists. + + # + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListSessionEntityTypes = channel.unary_unary( + '/google.cloud.dialogflow.v2.SessionEntityTypes/ListSessionEntityTypes', + request_serializer=ListSessionEntityTypesRequest.SerializeToString, + response_deserializer=ListSessionEntityTypesResponse.FromString, + ) + self.GetSessionEntityType = channel.unary_unary( + '/google.cloud.dialogflow.v2.SessionEntityTypes/GetSessionEntityType', + request_serializer=GetSessionEntityTypeRequest.SerializeToString, + response_deserializer=SessionEntityType.FromString, + ) + self.CreateSessionEntityType = channel.unary_unary( + '/google.cloud.dialogflow.v2.SessionEntityTypes/CreateSessionEntityType', + request_serializer=CreateSessionEntityTypeRequest.SerializeToString, + response_deserializer=SessionEntityType.FromString, + ) + self.UpdateSessionEntityType = channel.unary_unary( + '/google.cloud.dialogflow.v2.SessionEntityTypes/UpdateSessionEntityType', + request_serializer=UpdateSessionEntityTypeRequest.SerializeToString, + response_deserializer=SessionEntityType.FromString, + ) + self.DeleteSessionEntityType = channel.unary_unary( + '/google.cloud.dialogflow.v2.SessionEntityTypes/DeleteSessionEntityType', + request_serializer=DeleteSessionEntityTypeRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + + + class SessionEntityTypesServicer(object): + """Manages session entity types. + + Session entity types can be redefined on a session level, allowing for + specific concepts, like a user's playlists. + + # + """ + + def ListSessionEntityTypes(self, request, context): + """Returns the list of all session entity types in the specified session. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetSessionEntityType(self, request, context): + """Retrieves the specified session entity type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateSessionEntityType(self, request, context): + """Creates a session entity type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateSessionEntityType(self, request, context): + """Updates the specified session entity type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteSessionEntityType(self, request, context): + """Deletes the specified session entity type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + + def add_SessionEntityTypesServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListSessionEntityTypes': grpc.unary_unary_rpc_method_handler( + servicer.ListSessionEntityTypes, + request_deserializer=ListSessionEntityTypesRequest.FromString, + response_serializer=ListSessionEntityTypesResponse.SerializeToString, + ), + 'GetSessionEntityType': grpc.unary_unary_rpc_method_handler( + servicer.GetSessionEntityType, + request_deserializer=GetSessionEntityTypeRequest.FromString, + response_serializer=SessionEntityType.SerializeToString, + ), + 'CreateSessionEntityType': grpc.unary_unary_rpc_method_handler( + servicer.CreateSessionEntityType, + request_deserializer=CreateSessionEntityTypeRequest.FromString, + response_serializer=SessionEntityType.SerializeToString, + ), + 'UpdateSessionEntityType': grpc.unary_unary_rpc_method_handler( + servicer.UpdateSessionEntityType, + request_deserializer=UpdateSessionEntityTypeRequest.FromString, + response_serializer=SessionEntityType.SerializeToString, + ), + 'DeleteSessionEntityType': grpc.unary_unary_rpc_method_handler( + servicer.DeleteSessionEntityType, + request_deserializer=DeleteSessionEntityTypeRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'google.cloud.dialogflow.v2.SessionEntityTypes', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + class BetaSessionEntityTypesServicer(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Manages session entity types. + + Session entity types can be redefined on a session level, allowing for + specific concepts, like a user's playlists. + + # + """ + def ListSessionEntityTypes(self, request, context): + """Returns the list of all session entity types in the specified session. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def GetSessionEntityType(self, request, context): + """Retrieves the specified session entity type. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def CreateSessionEntityType(self, request, context): + """Creates a session entity type. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def UpdateSessionEntityType(self, request, context): + """Updates the specified session entity type. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def DeleteSessionEntityType(self, request, context): + """Deletes the specified session entity type. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + + + class BetaSessionEntityTypesStub(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Manages session entity types. + + Session entity types can be redefined on a session level, allowing for + specific concepts, like a user's playlists. + + # + """ + def ListSessionEntityTypes(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Returns the list of all session entity types in the specified session. + """ + raise NotImplementedError() + ListSessionEntityTypes.future = None + def GetSessionEntityType(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Retrieves the specified session entity type. + """ + raise NotImplementedError() + GetSessionEntityType.future = None + def CreateSessionEntityType(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Creates a session entity type. + """ + raise NotImplementedError() + CreateSessionEntityType.future = None + def UpdateSessionEntityType(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Updates the specified session entity type. + """ + raise NotImplementedError() + UpdateSessionEntityType.future = None + def DeleteSessionEntityType(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Deletes the specified session entity type. + """ + raise NotImplementedError() + DeleteSessionEntityType.future = None + + + def beta_create_SessionEntityTypes_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_deserializers = { + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'CreateSessionEntityType'): CreateSessionEntityTypeRequest.FromString, + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'DeleteSessionEntityType'): DeleteSessionEntityTypeRequest.FromString, + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'GetSessionEntityType'): GetSessionEntityTypeRequest.FromString, + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'ListSessionEntityTypes'): ListSessionEntityTypesRequest.FromString, + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'UpdateSessionEntityType'): UpdateSessionEntityTypeRequest.FromString, + } + response_serializers = { + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'CreateSessionEntityType'): SessionEntityType.SerializeToString, + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'DeleteSessionEntityType'): google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'GetSessionEntityType'): SessionEntityType.SerializeToString, + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'ListSessionEntityTypes'): ListSessionEntityTypesResponse.SerializeToString, + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'UpdateSessionEntityType'): SessionEntityType.SerializeToString, + } + method_implementations = { + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'CreateSessionEntityType'): face_utilities.unary_unary_inline(servicer.CreateSessionEntityType), + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'DeleteSessionEntityType'): face_utilities.unary_unary_inline(servicer.DeleteSessionEntityType), + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'GetSessionEntityType'): face_utilities.unary_unary_inline(servicer.GetSessionEntityType), + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'ListSessionEntityTypes'): face_utilities.unary_unary_inline(servicer.ListSessionEntityTypes), + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'UpdateSessionEntityType'): face_utilities.unary_unary_inline(servicer.UpdateSessionEntityType), + } + server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) + return beta_implementations.server(method_implementations, options=server_options) + + + def beta_create_SessionEntityTypes_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_serializers = { + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'CreateSessionEntityType'): CreateSessionEntityTypeRequest.SerializeToString, + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'DeleteSessionEntityType'): DeleteSessionEntityTypeRequest.SerializeToString, + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'GetSessionEntityType'): GetSessionEntityTypeRequest.SerializeToString, + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'ListSessionEntityTypes'): ListSessionEntityTypesRequest.SerializeToString, + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'UpdateSessionEntityType'): UpdateSessionEntityTypeRequest.SerializeToString, + } + response_deserializers = { + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'CreateSessionEntityType'): SessionEntityType.FromString, + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'DeleteSessionEntityType'): google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'GetSessionEntityType'): SessionEntityType.FromString, + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'ListSessionEntityTypes'): ListSessionEntityTypesResponse.FromString, + ('google.cloud.dialogflow.v2.SessionEntityTypes', 'UpdateSessionEntityType'): SessionEntityType.FromString, + } + cardinalities = { + 'CreateSessionEntityType': cardinality.Cardinality.UNARY_UNARY, + 'DeleteSessionEntityType': cardinality.Cardinality.UNARY_UNARY, + 'GetSessionEntityType': cardinality.Cardinality.UNARY_UNARY, + 'ListSessionEntityTypes': cardinality.Cardinality.UNARY_UNARY, + 'UpdateSessionEntityType': cardinality.Cardinality.UNARY_UNARY, + } + stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) + return beta_implementations.dynamic_stub(channel, 'google.cloud.dialogflow.v2.SessionEntityTypes', cardinalities, options=stub_options) +except ImportError: + pass +# @@protoc_insertion_point(module_scope) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/proto/session_entity_type_pb2_grpc.py b/packages/google-cloud-dialogflow/dialogflow_v2/proto/session_entity_type_pb2_grpc.py new file mode 100755 index 000000000000..0ca177383f10 --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/proto/session_entity_type_pb2_grpc.py @@ -0,0 +1,125 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + +import dialogflow_v2.proto.session_entity_type_pb2 as google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2 +import google.protobuf.empty_pb2 as google_dot_protobuf_dot_empty__pb2 + + +class SessionEntityTypesStub(object): + """Manages session entity types. + + Session entity types can be redefined on a session level, allowing for + specific concepts, like a user's playlists. + + # + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ListSessionEntityTypes = channel.unary_unary( + '/google.cloud.dialogflow.v2.SessionEntityTypes/ListSessionEntityTypes', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.ListSessionEntityTypesRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.ListSessionEntityTypesResponse.FromString, + ) + self.GetSessionEntityType = channel.unary_unary( + '/google.cloud.dialogflow.v2.SessionEntityTypes/GetSessionEntityType', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.GetSessionEntityTypeRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.SessionEntityType.FromString, + ) + self.CreateSessionEntityType = channel.unary_unary( + '/google.cloud.dialogflow.v2.SessionEntityTypes/CreateSessionEntityType', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.CreateSessionEntityTypeRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.SessionEntityType.FromString, + ) + self.UpdateSessionEntityType = channel.unary_unary( + '/google.cloud.dialogflow.v2.SessionEntityTypes/UpdateSessionEntityType', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.UpdateSessionEntityTypeRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.SessionEntityType.FromString, + ) + self.DeleteSessionEntityType = channel.unary_unary( + '/google.cloud.dialogflow.v2.SessionEntityTypes/DeleteSessionEntityType', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.DeleteSessionEntityTypeRequest.SerializeToString, + response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + ) + + +class SessionEntityTypesServicer(object): + """Manages session entity types. + + Session entity types can be redefined on a session level, allowing for + specific concepts, like a user's playlists. + + # + """ + + def ListSessionEntityTypes(self, request, context): + """Returns the list of all session entity types in the specified session. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def GetSessionEntityType(self, request, context): + """Retrieves the specified session entity type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateSessionEntityType(self, request, context): + """Creates a session entity type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateSessionEntityType(self, request, context): + """Updates the specified session entity type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteSessionEntityType(self, request, context): + """Deletes the specified session entity type. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_SessionEntityTypesServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ListSessionEntityTypes': grpc.unary_unary_rpc_method_handler( + servicer.ListSessionEntityTypes, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.ListSessionEntityTypesRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.ListSessionEntityTypesResponse.SerializeToString, + ), + 'GetSessionEntityType': grpc.unary_unary_rpc_method_handler( + servicer.GetSessionEntityType, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.GetSessionEntityTypeRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.SessionEntityType.SerializeToString, + ), + 'CreateSessionEntityType': grpc.unary_unary_rpc_method_handler( + servicer.CreateSessionEntityType, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.CreateSessionEntityTypeRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.SessionEntityType.SerializeToString, + ), + 'UpdateSessionEntityType': grpc.unary_unary_rpc_method_handler( + servicer.UpdateSessionEntityType, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.UpdateSessionEntityTypeRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.SessionEntityType.SerializeToString, + ), + 'DeleteSessionEntityType': grpc.unary_unary_rpc_method_handler( + servicer.DeleteSessionEntityType, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.DeleteSessionEntityTypeRequest.FromString, + response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'google.cloud.dialogflow.v2.SessionEntityTypes', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/proto/session_pb2.py b/packages/google-cloud-dialogflow/dialogflow_v2/proto/session_pb2.py new file mode 100755 index 000000000000..b6058f566331 --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/proto/session_pb2.py @@ -0,0 +1,1399 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow_v2/proto/session.proto + +import sys +_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) +from google.protobuf.internal import enum_type_wrapper +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 +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from dialogflow_v2.proto import context_pb2 as google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2 +from dialogflow_v2.proto import intent_pb2 as google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2 +from dialogflow_v2.proto import session_entity_type_pb2 as google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2 +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 +from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 +from google.type import latlng_pb2 as google_dot_type_dot_latlng__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='google/cloud/dialogflow_v2/proto/session.proto', + package='google.cloud.dialogflow.v2', + syntax='proto3', + serialized_pb=_b('\n.google/cloud/dialogflow_v2/proto/session.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a.google/cloud/dialogflow_v2/proto/context.proto\x1a-google/cloud/dialogflow_v2/proto/intent.proto\x1a:google/cloud/dialogflow_v2/proto/session_entity_type.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17google/rpc/status.proto\x1a\x18google/type/latlng.proto\"\xbb\x01\n\x13\x44\x65tectIntentRequest\x12\x0f\n\x07session\x18\x01 \x01(\t\x12\x41\n\x0cquery_params\x18\x02 \x01(\x0b\x32+.google.cloud.dialogflow.v2.QueryParameters\x12;\n\x0bquery_input\x18\x03 \x01(\x0b\x32&.google.cloud.dialogflow.v2.QueryInput\x12\x13\n\x0binput_audio\x18\x05 \x01(\x0c\"\x96\x01\n\x14\x44\x65tectIntentResponse\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\x12=\n\x0cquery_result\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.QueryResult\x12*\n\x0ewebhook_status\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\"\x95\x02\n\x0fQueryParameters\x12\x11\n\ttime_zone\x18\x01 \x01(\t\x12)\n\x0cgeo_location\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng\x12\x35\n\x08\x63ontexts\x18\x03 \x03(\x0b\x32#.google.cloud.dialogflow.v2.Context\x12\x16\n\x0ereset_contexts\x18\x04 \x01(\x08\x12K\n\x14session_entity_types\x18\x05 \x03(\x0b\x32-.google.cloud.dialogflow.v2.SessionEntityType\x12(\n\x07payload\x18\x06 \x01(\x0b\x32\x17.google.protobuf.Struct\"\xcb\x01\n\nQueryInput\x12\x44\n\x0c\x61udio_config\x18\x01 \x01(\x0b\x32,.google.cloud.dialogflow.v2.InputAudioConfigH\x00\x12\x35\n\x04text\x18\x02 \x01(\x0b\x32%.google.cloud.dialogflow.v2.TextInputH\x00\x12\x37\n\x05\x65vent\x18\x03 \x01(\x0b\x32&.google.cloud.dialogflow.v2.EventInputH\x00\x42\x07\n\x05input\"\xb8\x04\n\x0bQueryResult\x12\x12\n\nquery_text\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x0f \x01(\t\x12%\n\x1dspeech_recognition_confidence\x18\x02 \x01(\x02\x12\x0e\n\x06\x61\x63tion\x18\x03 \x01(\t\x12+\n\nparameters\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12#\n\x1b\x61ll_required_params_present\x18\x05 \x01(\x08\x12\x18\n\x10\x66ulfillment_text\x18\x06 \x01(\t\x12H\n\x14\x66ulfillment_messages\x18\x07 \x03(\x0b\x32*.google.cloud.dialogflow.v2.Intent.Message\x12\x16\n\x0ewebhook_source\x18\x08 \x01(\t\x12\x30\n\x0fwebhook_payload\x18\t \x01(\x0b\x32\x17.google.protobuf.Struct\x12<\n\x0foutput_contexts\x18\n \x03(\x0b\x32#.google.cloud.dialogflow.v2.Context\x12\x32\n\x06intent\x18\x0b \x01(\x0b\x32\".google.cloud.dialogflow.v2.Intent\x12#\n\x1bintent_detection_confidence\x18\x0c \x01(\x02\x12\x30\n\x0f\x64iagnostic_info\x18\x0e \x01(\x0b\x32\x17.google.protobuf.Struct\"\xde\x01\n\x1cStreamingDetectIntentRequest\x12\x0f\n\x07session\x18\x01 \x01(\t\x12\x41\n\x0cquery_params\x18\x02 \x01(\x0b\x32+.google.cloud.dialogflow.v2.QueryParameters\x12;\n\x0bquery_input\x18\x03 \x01(\x0b\x32&.google.cloud.dialogflow.v2.QueryInput\x12\x18\n\x10single_utterance\x18\x04 \x01(\x08\x12\x13\n\x0binput_audio\x18\x06 \x01(\x0c\"\xf3\x01\n\x1dStreamingDetectIntentResponse\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\x12R\n\x12recognition_result\x18\x02 \x01(\x0b\x32\x36.google.cloud.dialogflow.v2.StreamingRecognitionResult\x12=\n\x0cquery_result\x18\x03 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.QueryResult\x12*\n\x0ewebhook_status\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\"\x8a\x02\n\x1aStreamingRecognitionResult\x12X\n\x0cmessage_type\x18\x01 \x01(\x0e\x32\x42.google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType\x12\x12\n\ntranscript\x18\x02 \x01(\t\x12\x10\n\x08is_final\x18\x03 \x01(\x08\x12\x12\n\nconfidence\x18\x04 \x01(\x02\"X\n\x0bMessageType\x12\x1c\n\x18MESSAGE_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nTRANSCRIPT\x10\x01\x12\x1b\n\x17\x45ND_OF_SINGLE_UTTERANCE\x10\x02\"\x9d\x01\n\x10InputAudioConfig\x12\x41\n\x0e\x61udio_encoding\x18\x01 \x01(\x0e\x32).google.cloud.dialogflow.v2.AudioEncoding\x12\x19\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\x12\x14\n\x0cphrase_hints\x18\x04 \x03(\t\"0\n\tTextInput\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"^\n\nEventInput\x12\x0c\n\x04name\x18\x01 \x01(\t\x12+\n\nparameters\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x15\n\rlanguage_code\x18\x03 \x01(\t*\xfb\x01\n\rAudioEncoding\x12\x1e\n\x1a\x41UDIO_ENCODING_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x41UDIO_ENCODING_LINEAR_16\x10\x01\x12\x17\n\x13\x41UDIO_ENCODING_FLAC\x10\x02\x12\x18\n\x14\x41UDIO_ENCODING_MULAW\x10\x03\x12\x16\n\x12\x41UDIO_ENCODING_AMR\x10\x04\x12\x19\n\x15\x41UDIO_ENCODING_AMR_WB\x10\x05\x12\x1b\n\x17\x41UDIO_ENCODING_OGG_OPUS\x10\x06\x12)\n%AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE\x10\x07\x32\xd4\x02\n\x08Sessions\x12\xb4\x01\n\x0c\x44\x65tectIntent\x12/.google.cloud.dialogflow.v2.DetectIntentRequest\x1a\x30.google.cloud.dialogflow.v2.DetectIntentResponse\"A\x82\xd3\xe4\x93\x02;\"6/v2/{session=projects/*/agent/sessions/*}:detectIntent:\x01*\x12\x90\x01\n\x15StreamingDetectIntent\x12\x38.google.cloud.dialogflow.v2.StreamingDetectIntentRequest\x1a\x39.google.cloud.dialogflow.v2.StreamingDetectIntentResponse(\x01\x30\x01\x42\x9b\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0cSessionProtoP\x01ZDgoogle.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow\xf8\x01\x01\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3') + , + dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR,google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.DESCRIPTOR,google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.DESCRIPTOR,google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2.DESCRIPTOR,google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,google_dot_rpc_dot_status__pb2.DESCRIPTOR,google_dot_type_dot_latlng__pb2.DESCRIPTOR,]) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + +_AUDIOENCODING = _descriptor.EnumDescriptor( + name='AudioEncoding', + full_name='google.cloud.dialogflow.v2.AudioEncoding', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='AUDIO_ENCODING_UNSPECIFIED', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='AUDIO_ENCODING_LINEAR_16', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='AUDIO_ENCODING_FLAC', index=2, number=2, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='AUDIO_ENCODING_MULAW', index=3, number=3, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='AUDIO_ENCODING_AMR', index=4, number=4, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='AUDIO_ENCODING_AMR_WB', index=5, number=5, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='AUDIO_ENCODING_OGG_OPUS', index=6, number=6, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE', index=7, number=7, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=2791, + serialized_end=3042, +) +_sym_db.RegisterEnumDescriptor(_AUDIOENCODING) + +AudioEncoding = enum_type_wrapper.EnumTypeWrapper(_AUDIOENCODING) +AUDIO_ENCODING_UNSPECIFIED = 0 +AUDIO_ENCODING_LINEAR_16 = 1 +AUDIO_ENCODING_FLAC = 2 +AUDIO_ENCODING_MULAW = 3 +AUDIO_ENCODING_AMR = 4 +AUDIO_ENCODING_AMR_WB = 5 +AUDIO_ENCODING_OGG_OPUS = 6 +AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7 + + +_STREAMINGRECOGNITIONRESULT_MESSAGETYPE = _descriptor.EnumDescriptor( + name='MessageType', + full_name='google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType', + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name='MESSAGE_TYPE_UNSPECIFIED', index=0, number=0, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='TRANSCRIPT', index=1, number=1, + options=None, + type=None), + _descriptor.EnumValueDescriptor( + name='END_OF_SINGLE_UTTERANCE', index=2, number=2, + options=None, + type=None), + ], + containing_type=None, + options=None, + serialized_start=2394, + serialized_end=2482, +) +_sym_db.RegisterEnumDescriptor(_STREAMINGRECOGNITIONRESULT_MESSAGETYPE) + + +_DETECTINTENTREQUEST = _descriptor.Descriptor( + name='DetectIntentRequest', + full_name='google.cloud.dialogflow.v2.DetectIntentRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='session', full_name='google.cloud.dialogflow.v2.DetectIntentRequest.session', 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, + options=None), + _descriptor.FieldDescriptor( + name='query_params', full_name='google.cloud.dialogflow.v2.DetectIntentRequest.query_params', 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, + options=None), + _descriptor.FieldDescriptor( + name='query_input', full_name='google.cloud.dialogflow.v2.DetectIntentRequest.query_input', index=2, + number=3, 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, + options=None), + _descriptor.FieldDescriptor( + name='input_audio', full_name='google.cloud.dialogflow.v2.DetectIntentRequest.input_audio', index=3, + number=5, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=345, + serialized_end=532, +) + + +_DETECTINTENTRESPONSE = _descriptor.Descriptor( + name='DetectIntentResponse', + full_name='google.cloud.dialogflow.v2.DetectIntentResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='response_id', full_name='google.cloud.dialogflow.v2.DetectIntentResponse.response_id', 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, + options=None), + _descriptor.FieldDescriptor( + name='query_result', full_name='google.cloud.dialogflow.v2.DetectIntentResponse.query_result', 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, + options=None), + _descriptor.FieldDescriptor( + name='webhook_status', full_name='google.cloud.dialogflow.v2.DetectIntentResponse.webhook_status', index=2, + number=3, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=535, + serialized_end=685, +) + + +_QUERYPARAMETERS = _descriptor.Descriptor( + name='QueryParameters', + full_name='google.cloud.dialogflow.v2.QueryParameters', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='time_zone', full_name='google.cloud.dialogflow.v2.QueryParameters.time_zone', 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, + options=None), + _descriptor.FieldDescriptor( + name='geo_location', full_name='google.cloud.dialogflow.v2.QueryParameters.geo_location', 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, + options=None), + _descriptor.FieldDescriptor( + name='contexts', full_name='google.cloud.dialogflow.v2.QueryParameters.contexts', 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, + options=None), + _descriptor.FieldDescriptor( + name='reset_contexts', full_name='google.cloud.dialogflow.v2.QueryParameters.reset_contexts', index=3, + number=4, 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, + options=None), + _descriptor.FieldDescriptor( + name='session_entity_types', full_name='google.cloud.dialogflow.v2.QueryParameters.session_entity_types', index=4, + number=5, 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, + options=None), + _descriptor.FieldDescriptor( + name='payload', full_name='google.cloud.dialogflow.v2.QueryParameters.payload', index=5, + number=6, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=688, + serialized_end=965, +) + + +_QUERYINPUT = _descriptor.Descriptor( + name='QueryInput', + full_name='google.cloud.dialogflow.v2.QueryInput', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='audio_config', full_name='google.cloud.dialogflow.v2.QueryInput.audio_config', index=0, + number=1, 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, + options=None), + _descriptor.FieldDescriptor( + name='text', full_name='google.cloud.dialogflow.v2.QueryInput.text', 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, + options=None), + _descriptor.FieldDescriptor( + name='event', full_name='google.cloud.dialogflow.v2.QueryInput.event', index=2, + number=3, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='input', full_name='google.cloud.dialogflow.v2.QueryInput.input', + index=0, containing_type=None, fields=[]), + ], + serialized_start=968, + serialized_end=1171, +) + + +_QUERYRESULT = _descriptor.Descriptor( + name='QueryResult', + full_name='google.cloud.dialogflow.v2.QueryResult', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='query_text', full_name='google.cloud.dialogflow.v2.QueryResult.query_text', 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, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.dialogflow.v2.QueryResult.language_code', index=1, + number=15, 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, + options=None), + _descriptor.FieldDescriptor( + name='speech_recognition_confidence', full_name='google.cloud.dialogflow.v2.QueryResult.speech_recognition_confidence', index=2, + number=2, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='action', full_name='google.cloud.dialogflow.v2.QueryResult.action', index=3, + 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, + options=None), + _descriptor.FieldDescriptor( + name='parameters', full_name='google.cloud.dialogflow.v2.QueryResult.parameters', index=4, + number=4, 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, + options=None), + _descriptor.FieldDescriptor( + name='all_required_params_present', full_name='google.cloud.dialogflow.v2.QueryResult.all_required_params_present', index=5, + number=5, 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, + options=None), + _descriptor.FieldDescriptor( + name='fulfillment_text', full_name='google.cloud.dialogflow.v2.QueryResult.fulfillment_text', index=6, + number=6, 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, + options=None), + _descriptor.FieldDescriptor( + name='fulfillment_messages', full_name='google.cloud.dialogflow.v2.QueryResult.fulfillment_messages', index=7, + number=7, 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, + options=None), + _descriptor.FieldDescriptor( + name='webhook_source', full_name='google.cloud.dialogflow.v2.QueryResult.webhook_source', index=8, + number=8, 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, + options=None), + _descriptor.FieldDescriptor( + name='webhook_payload', full_name='google.cloud.dialogflow.v2.QueryResult.webhook_payload', index=9, + number=9, 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, + options=None), + _descriptor.FieldDescriptor( + name='output_contexts', full_name='google.cloud.dialogflow.v2.QueryResult.output_contexts', index=10, + number=10, 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, + options=None), + _descriptor.FieldDescriptor( + name='intent', full_name='google.cloud.dialogflow.v2.QueryResult.intent', index=11, + number=11, 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, + options=None), + _descriptor.FieldDescriptor( + name='intent_detection_confidence', full_name='google.cloud.dialogflow.v2.QueryResult.intent_detection_confidence', index=12, + number=12, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='diagnostic_info', full_name='google.cloud.dialogflow.v2.QueryResult.diagnostic_info', index=13, + number=14, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1174, + serialized_end=1742, +) + + +_STREAMINGDETECTINTENTREQUEST = _descriptor.Descriptor( + name='StreamingDetectIntentRequest', + full_name='google.cloud.dialogflow.v2.StreamingDetectIntentRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='session', full_name='google.cloud.dialogflow.v2.StreamingDetectIntentRequest.session', 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, + options=None), + _descriptor.FieldDescriptor( + name='query_params', full_name='google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_params', 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, + options=None), + _descriptor.FieldDescriptor( + name='query_input', full_name='google.cloud.dialogflow.v2.StreamingDetectIntentRequest.query_input', index=2, + number=3, 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, + options=None), + _descriptor.FieldDescriptor( + name='single_utterance', full_name='google.cloud.dialogflow.v2.StreamingDetectIntentRequest.single_utterance', index=3, + number=4, 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, + options=None), + _descriptor.FieldDescriptor( + name='input_audio', full_name='google.cloud.dialogflow.v2.StreamingDetectIntentRequest.input_audio', index=4, + number=6, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=_b(""), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1745, + serialized_end=1967, +) + + +_STREAMINGDETECTINTENTRESPONSE = _descriptor.Descriptor( + name='StreamingDetectIntentResponse', + full_name='google.cloud.dialogflow.v2.StreamingDetectIntentResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='response_id', full_name='google.cloud.dialogflow.v2.StreamingDetectIntentResponse.response_id', 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, + options=None), + _descriptor.FieldDescriptor( + name='recognition_result', full_name='google.cloud.dialogflow.v2.StreamingDetectIntentResponse.recognition_result', 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, + options=None), + _descriptor.FieldDescriptor( + name='query_result', full_name='google.cloud.dialogflow.v2.StreamingDetectIntentResponse.query_result', index=2, + number=3, 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, + options=None), + _descriptor.FieldDescriptor( + name='webhook_status', full_name='google.cloud.dialogflow.v2.StreamingDetectIntentResponse.webhook_status', index=3, + number=4, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1970, + serialized_end=2213, +) + + +_STREAMINGRECOGNITIONRESULT = _descriptor.Descriptor( + name='StreamingRecognitionResult', + full_name='google.cloud.dialogflow.v2.StreamingRecognitionResult', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='message_type', full_name='google.cloud.dialogflow.v2.StreamingRecognitionResult.message_type', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='transcript', full_name='google.cloud.dialogflow.v2.StreamingRecognitionResult.transcript', 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, + options=None), + _descriptor.FieldDescriptor( + name='is_final', full_name='google.cloud.dialogflow.v2.StreamingRecognitionResult.is_final', 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, + options=None), + _descriptor.FieldDescriptor( + name='confidence', full_name='google.cloud.dialogflow.v2.StreamingRecognitionResult.confidence', index=3, + number=4, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _STREAMINGRECOGNITIONRESULT_MESSAGETYPE, + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2216, + serialized_end=2482, +) + + +_INPUTAUDIOCONFIG = _descriptor.Descriptor( + name='InputAudioConfig', + full_name='google.cloud.dialogflow.v2.InputAudioConfig', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='audio_encoding', full_name='google.cloud.dialogflow.v2.InputAudioConfig.audio_encoding', index=0, + number=1, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='sample_rate_hertz', full_name='google.cloud.dialogflow.v2.InputAudioConfig.sample_rate_hertz', index=1, + number=2, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.dialogflow.v2.InputAudioConfig.language_code', index=2, + 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, + options=None), + _descriptor.FieldDescriptor( + name='phrase_hints', full_name='google.cloud.dialogflow.v2.InputAudioConfig.phrase_hints', index=3, + number=4, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2485, + serialized_end=2642, +) + + +_TEXTINPUT = _descriptor.Descriptor( + name='TextInput', + full_name='google.cloud.dialogflow.v2.TextInput', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='text', full_name='google.cloud.dialogflow.v2.TextInput.text', 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, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.dialogflow.v2.TextInput.language_code', 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2644, + serialized_end=2692, +) + + +_EVENTINPUT = _descriptor.Descriptor( + name='EventInput', + full_name='google.cloud.dialogflow.v2.EventInput', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='name', full_name='google.cloud.dialogflow.v2.EventInput.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, + options=None), + _descriptor.FieldDescriptor( + name='parameters', full_name='google.cloud.dialogflow.v2.EventInput.parameters', 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, + options=None), + _descriptor.FieldDescriptor( + name='language_code', full_name='google.cloud.dialogflow.v2.EventInput.language_code', index=2, + 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2694, + serialized_end=2788, +) + +_DETECTINTENTREQUEST.fields_by_name['query_params'].message_type = _QUERYPARAMETERS +_DETECTINTENTREQUEST.fields_by_name['query_input'].message_type = _QUERYINPUT +_DETECTINTENTRESPONSE.fields_by_name['query_result'].message_type = _QUERYRESULT +_DETECTINTENTRESPONSE.fields_by_name['webhook_status'].message_type = google_dot_rpc_dot_status__pb2._STATUS +_QUERYPARAMETERS.fields_by_name['geo_location'].message_type = google_dot_type_dot_latlng__pb2._LATLNG +_QUERYPARAMETERS.fields_by_name['contexts'].message_type = google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2._CONTEXT +_QUERYPARAMETERS.fields_by_name['session_entity_types'].message_type = google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__entity__type__pb2._SESSIONENTITYTYPE +_QUERYPARAMETERS.fields_by_name['payload'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_QUERYINPUT.fields_by_name['audio_config'].message_type = _INPUTAUDIOCONFIG +_QUERYINPUT.fields_by_name['text'].message_type = _TEXTINPUT +_QUERYINPUT.fields_by_name['event'].message_type = _EVENTINPUT +_QUERYINPUT.oneofs_by_name['input'].fields.append( + _QUERYINPUT.fields_by_name['audio_config']) +_QUERYINPUT.fields_by_name['audio_config'].containing_oneof = _QUERYINPUT.oneofs_by_name['input'] +_QUERYINPUT.oneofs_by_name['input'].fields.append( + _QUERYINPUT.fields_by_name['text']) +_QUERYINPUT.fields_by_name['text'].containing_oneof = _QUERYINPUT.oneofs_by_name['input'] +_QUERYINPUT.oneofs_by_name['input'].fields.append( + _QUERYINPUT.fields_by_name['event']) +_QUERYINPUT.fields_by_name['event'].containing_oneof = _QUERYINPUT.oneofs_by_name['input'] +_QUERYRESULT.fields_by_name['parameters'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_QUERYRESULT.fields_by_name['fulfillment_messages'].message_type = google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2._INTENT_MESSAGE +_QUERYRESULT.fields_by_name['webhook_payload'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_QUERYRESULT.fields_by_name['output_contexts'].message_type = google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2._CONTEXT +_QUERYRESULT.fields_by_name['intent'].message_type = google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2._INTENT +_QUERYRESULT.fields_by_name['diagnostic_info'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_STREAMINGDETECTINTENTREQUEST.fields_by_name['query_params'].message_type = _QUERYPARAMETERS +_STREAMINGDETECTINTENTREQUEST.fields_by_name['query_input'].message_type = _QUERYINPUT +_STREAMINGDETECTINTENTRESPONSE.fields_by_name['recognition_result'].message_type = _STREAMINGRECOGNITIONRESULT +_STREAMINGDETECTINTENTRESPONSE.fields_by_name['query_result'].message_type = _QUERYRESULT +_STREAMINGDETECTINTENTRESPONSE.fields_by_name['webhook_status'].message_type = google_dot_rpc_dot_status__pb2._STATUS +_STREAMINGRECOGNITIONRESULT.fields_by_name['message_type'].enum_type = _STREAMINGRECOGNITIONRESULT_MESSAGETYPE +_STREAMINGRECOGNITIONRESULT_MESSAGETYPE.containing_type = _STREAMINGRECOGNITIONRESULT +_INPUTAUDIOCONFIG.fields_by_name['audio_encoding'].enum_type = _AUDIOENCODING +_EVENTINPUT.fields_by_name['parameters'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +DESCRIPTOR.message_types_by_name['DetectIntentRequest'] = _DETECTINTENTREQUEST +DESCRIPTOR.message_types_by_name['DetectIntentResponse'] = _DETECTINTENTRESPONSE +DESCRIPTOR.message_types_by_name['QueryParameters'] = _QUERYPARAMETERS +DESCRIPTOR.message_types_by_name['QueryInput'] = _QUERYINPUT +DESCRIPTOR.message_types_by_name['QueryResult'] = _QUERYRESULT +DESCRIPTOR.message_types_by_name['StreamingDetectIntentRequest'] = _STREAMINGDETECTINTENTREQUEST +DESCRIPTOR.message_types_by_name['StreamingDetectIntentResponse'] = _STREAMINGDETECTINTENTRESPONSE +DESCRIPTOR.message_types_by_name['StreamingRecognitionResult'] = _STREAMINGRECOGNITIONRESULT +DESCRIPTOR.message_types_by_name['InputAudioConfig'] = _INPUTAUDIOCONFIG +DESCRIPTOR.message_types_by_name['TextInput'] = _TEXTINPUT +DESCRIPTOR.message_types_by_name['EventInput'] = _EVENTINPUT +DESCRIPTOR.enum_types_by_name['AudioEncoding'] = _AUDIOENCODING + +DetectIntentRequest = _reflection.GeneratedProtocolMessageType('DetectIntentRequest', (_message.Message,), dict( + DESCRIPTOR = _DETECTINTENTREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.session_pb2' + , + __doc__ = """The request to detect user's intent. + + + Attributes: + session: + Required. The name of the session this query is sent to. + Format: ``projects//agent/sessions/``. + It's up to the API caller to choose an appropriate session ID. + It can be a random number or some type of user identifier + (preferably hashed). The length of the session ID must not + exceed 36 bytes. + query_params: + Optional. The parameters of this query. + query_input: + Required. The input specification. It can be set to: 1. an + audio config which instructs the speech recognizer how to + process the speech audio, 2. a conversational query in the + form of text, or 3. an event that specifies which intent to + trigger. + input_audio: + Optional. The natural language speech audio to be processed. + This field should be populated iff ``query_input`` is set to + an input audio config. A single request can contain up to 1 + minute of speech audio data. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.DetectIntentRequest) + )) +_sym_db.RegisterMessage(DetectIntentRequest) + +DetectIntentResponse = _reflection.GeneratedProtocolMessageType('DetectIntentResponse', (_message.Message,), dict( + DESCRIPTOR = _DETECTINTENTRESPONSE, + __module__ = 'google.cloud.dialogflow_v2.proto.session_pb2' + , + __doc__ = """The message returned from the DetectIntent method. + + + Attributes: + response_id: + The unique identifier of the response. It can be used to + locate a response in the training example set or for reporting + issues. + query_result: + The results of the conversational query or event processing. + webhook_status: + Specifies the status of the webhook request. + ``webhook_status`` is never populated in webhook requests. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.DetectIntentResponse) + )) +_sym_db.RegisterMessage(DetectIntentResponse) + +QueryParameters = _reflection.GeneratedProtocolMessageType('QueryParameters', (_message.Message,), dict( + DESCRIPTOR = _QUERYPARAMETERS, + __module__ = 'google.cloud.dialogflow_v2.proto.session_pb2' + , + __doc__ = """Represents the parameters of the conversational query. + + + Attributes: + time_zone: + Optional. The time zone of this conversational query from the + `time zone database `__, + e.g., America/New\_York, Europe/Paris. If not provided, the + time zone specified in agent settings is used. + geo_location: + Optional. The geo location of this conversational query. + contexts: + Optional. The collection of contexts to be activated before + this query is executed. + reset_contexts: + Optional. Specifies whether to delete all contexts in the + current session before the new ones are activated. + session_entity_types: + Optional. The collection of session entity types to replace or + extend developer entities with for this query only. The entity + synonyms apply to all languages. + payload: + Optional. This field can be used to pass custom data into the + webhook associated with the agent. Arbitrary JSON objects are + supported. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.QueryParameters) + )) +_sym_db.RegisterMessage(QueryParameters) + +QueryInput = _reflection.GeneratedProtocolMessageType('QueryInput', (_message.Message,), dict( + DESCRIPTOR = _QUERYINPUT, + __module__ = 'google.cloud.dialogflow_v2.proto.session_pb2' + , + __doc__ = """Represents the query input. It can contain either: + + 1. An audio config which instructs the speech recognizer how to process + the speech audio. + + 2. A conversational query in the form of text,. + + 3. An event that specifies which intent to trigger. + + + Attributes: + input: + Required. The input specification. + audio_config: + Instructs the speech recognizer how to process the speech + audio. + text: + The natural language text to be processed. + event: + The event to be processed. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.QueryInput) + )) +_sym_db.RegisterMessage(QueryInput) + +QueryResult = _reflection.GeneratedProtocolMessageType('QueryResult', (_message.Message,), dict( + DESCRIPTOR = _QUERYRESULT, + __module__ = 'google.cloud.dialogflow_v2.proto.session_pb2' + , + __doc__ = """Represents the result of conversational query or event processing. + + + Attributes: + query_text: + The original conversational query text: - If natural language + text was provided as input, ``query_text`` contains a copy of + the input. - If natural language speech audio was provided as + input, ``query_text`` contains the speech recognition result. + If speech recognizer produced multiple alternatives, a + particular one is picked. - If an event was provided as input, + ``query_text`` is not set. + language_code: + The language that was triggered during intent detection. See + `Language Support + `__ for a list + of the currently supported language codes. + speech_recognition_confidence: + The Speech recognition confidence between 0.0 and 1.0. A + higher number indicates an estimated greater likelihood that + the recognized words are correct. The default of 0.0 is a + sentinel value indicating that confidence was not set. You + should not rely on this field as it isn't guaranteed to be + accurate, or even set. In particular this field isn't set in + Webhook calls and for StreamingDetectIntent since the + streaming endpoint has separate confidence estimates per + portion of the audio in StreamingRecognitionResult. + action: + The action name from the matched intent. + parameters: + The collection of extracted parameters. + all_required_params_present: + This field is set to: - ``false`` if the matched intent has + required parameters and not all of the required parameter + values have been collected. - ``true`` if all required + parameter values have been collected, or if the matched intent + doesn't contain any required parameters. + fulfillment_text: + The text to be pronounced to the user or shown on the screen. + fulfillment_messages: + The collection of rich messages to present to the user. + webhook_source: + If the query was fulfilled by a webhook call, this field is + set to the value of the ``source`` field returned in the + webhook response. + webhook_payload: + If the query was fulfilled by a webhook call, this field is + set to the value of the ``payload`` field returned in the + webhook response. + output_contexts: + The collection of output contexts. If applicable, + ``output_contexts.parameters`` contains entries with name + ``.original`` containing the original + parameter values before the query. + intent: + The intent that matched the conversational query. Some, not + all fields are filled in this message, including but not + limited to: ``name``, ``display_name`` and ``webhook_state``. + intent_detection_confidence: + The intent detection confidence. Values range from 0.0 + (completely uncertain) to 1.0 (completely certain). + diagnostic_info: + The free-form diagnostic info. For example, this field could + contain webhook call latency. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.QueryResult) + )) +_sym_db.RegisterMessage(QueryResult) + +StreamingDetectIntentRequest = _reflection.GeneratedProtocolMessageType('StreamingDetectIntentRequest', (_message.Message,), dict( + DESCRIPTOR = _STREAMINGDETECTINTENTREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.session_pb2' + , + __doc__ = """The top-level message sent by the client to the + ``StreamingDetectIntent`` method. + + Multiple request messages should be sent in order: + + 1. The first message must contain ``session``, ``query_input`` plus + optionally ``query_params`` and/or ``single_utterance``. The message + must not contain ``input_audio``. + + 2. If ``query_input`` was set to a streaming input audio config, all + subsequent messages must contain only ``input_audio``. Otherwise, + finish the request stream. + + + Attributes: + session: + Required. The name of the session the query is sent to. Format + of the session name: ``projects//agent/sessions/``. It’s up to the API caller + to choose an appropriate. It can be a random number or some + type of user identifier (preferably hashed). The length of the + session ID must not exceed 36 characters. + query_params: + Optional. The parameters of this query. + query_input: + Required. The input specification. It can be set to: 1. an + audio config which instructs the speech recognizer how to + process the speech audio, 2. a conversational query in the + form of text, or 3. an event that specifies which intent to + trigger. + single_utterance: + Optional. If ``true``, the recognizer will detect a single + spoken utterance in input audio. When it detects that the user + has paused or stopped speaking, it will cease recognition. + This setting is ignored when ``query_input`` is a piece of + text or an event. + input_audio: + Optional. The input audio content to be recognized. Must be + sent if ``query_input`` was set to a streaming input audio + config. The complete audio over all streaming messages must + not exceed 1 minute. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.StreamingDetectIntentRequest) + )) +_sym_db.RegisterMessage(StreamingDetectIntentRequest) + +StreamingDetectIntentResponse = _reflection.GeneratedProtocolMessageType('StreamingDetectIntentResponse', (_message.Message,), dict( + DESCRIPTOR = _STREAMINGDETECTINTENTRESPONSE, + __module__ = 'google.cloud.dialogflow_v2.proto.session_pb2' + , + __doc__ = """The top-level message returned from the ``StreamingDetectIntent`` + method. + + Multiple response messages can be returned in order: + + 1. If the input was set to streaming audio, the first one or more + messages contain ``recognition_result``. Each ``recognition_result`` + represents a more complete transcript of what the user said. The last + ``recognition_result`` has ``is_final`` set to ``true``. + + 2. The next message contains ``response_id``, ``query_result`` and + optionally ``webhook_status`` if a WebHook was called. + + + Attributes: + response_id: + The unique identifier of the response. It can be used to + locate a response in the training example set or for reporting + issues. + recognition_result: + The result of speech recognition. + query_result: + The result of the conversational query or event processing. + webhook_status: + Specifies the status of the webhook request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.StreamingDetectIntentResponse) + )) +_sym_db.RegisterMessage(StreamingDetectIntentResponse) + +StreamingRecognitionResult = _reflection.GeneratedProtocolMessageType('StreamingRecognitionResult', (_message.Message,), dict( + DESCRIPTOR = _STREAMINGRECOGNITIONRESULT, + __module__ = 'google.cloud.dialogflow_v2.proto.session_pb2' + , + __doc__ = """Contains a speech recognition result corresponding to a portion of the + audio that is currently being processed or an indication that this is + the end of the single requested utterance. + + Example: + + 1. transcript: "tube" + + 2. transcript: "to be a" + + 3. transcript: "to be" + + 4. transcript: "to be or not to be" is\_final: true + + 5. transcript: " that's" + + 6. transcript: " that is" + + 7. recognition\_event\_type: + ``RECOGNITION_EVENT_END_OF_SINGLE_UTTERANCE`` + + 8. transcript: " that is the question" is\_final: true + + Only two of the responses contain final results (#4 and #8 indicated by + ``is_final: true``). Concatenating these generates the full transcript: + "to be or not to be that is the question". + + In each response we populate: + + - for ``MESSAGE_TYPE_TRANSCRIPT``: ``transcript`` and possibly + ``is_final``. + + - for ``MESSAGE_TYPE_END_OF_SINGLE_UTTERANCE``: only ``event_type``. + + + Attributes: + message_type: + Type of the result message. + transcript: + Transcript text representing the words that the user spoke. + Populated if and only if ``event_type`` = + ``RECOGNITION_EVENT_TRANSCRIPT``. + is_final: + The default of 0.0 is a sentinel value indicating + ``confidence`` was not set. If ``false``, the + ``StreamingRecognitionResult`` represents an interim result + that may change. If ``true``, the recognizer will not return + any further hypotheses about this piece of the audio. May only + be populated for ``event_type`` = + ``RECOGNITION_EVENT_TRANSCRIPT``. + confidence: + The Speech confidence between 0.0 and 1.0 for the current + portion of audio. A higher number indicates an estimated + greater likelihood that the recognized words are correct. The + default of 0.0 is a sentinel value indicating that confidence + was not set. This field is typically only provided if + ``is_final`` is true and you should not rely on it being + accurate or even set. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.StreamingRecognitionResult) + )) +_sym_db.RegisterMessage(StreamingRecognitionResult) + +InputAudioConfig = _reflection.GeneratedProtocolMessageType('InputAudioConfig', (_message.Message,), dict( + DESCRIPTOR = _INPUTAUDIOCONFIG, + __module__ = 'google.cloud.dialogflow_v2.proto.session_pb2' + , + __doc__ = """Instructs the speech recognizer how to process the audio content. + + + Attributes: + audio_encoding: + Required. Audio encoding of the audio content to process. + sample_rate_hertz: + Required. Sample rate (in Hertz) of the audio content sent in + the query. Refer to `Cloud Speech API documentation + `__ for more details. + language_code: + Required. The language of the supplied audio. Dialogflow does + not do translations. See `Language Support + `__ for a list of the + currently supported language codes. Note that queries in the + same session do not necessarily need to specify the same + language. + phrase_hints: + Optional. The collection of phrase hints which are used to + boost accuracy of speech recognition. Refer to `Cloud Speech + API documentation `__ for + more details. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.InputAudioConfig) + )) +_sym_db.RegisterMessage(InputAudioConfig) + +TextInput = _reflection.GeneratedProtocolMessageType('TextInput', (_message.Message,), dict( + DESCRIPTOR = _TEXTINPUT, + __module__ = 'google.cloud.dialogflow_v2.proto.session_pb2' + , + __doc__ = """Represents the natural language text to be processed. + + + Attributes: + text: + Required. The UTF-8 encoded natural language text to be + processed. Text length must not exceed 256 bytes. + language_code: + Required. The language of this conversational query. See + `Language Support `__ + for a list of the currently supported language codes. Note + that queries in the same session do not necessarily need to + specify the same language. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.TextInput) + )) +_sym_db.RegisterMessage(TextInput) + +EventInput = _reflection.GeneratedProtocolMessageType('EventInput', (_message.Message,), dict( + DESCRIPTOR = _EVENTINPUT, + __module__ = 'google.cloud.dialogflow_v2.proto.session_pb2' + , + __doc__ = """Events allow for matching intents by event name instead of the natural + language input. For instance, input + ```` can + trigger a personalized welcome response. The parameter ``name`` may be + used by the agent in the response: + ``“Hello #welcome_event.name! What can I do for you today?”``. + + + Attributes: + name: + Required. The unique identifier of the event. + parameters: + Optional. The collection of parameters associated with the + event. + language_code: + Required. The language of this query. See `Language Support + `__ for a list of the + currently supported language codes. Note that queries in the + same session do not necessarily need to specify the same + language. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.EventInput) + )) +_sym_db.RegisterMessage(EventInput) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\036com.google.cloud.dialogflow.v2B\014SessionProtoP\001ZDgoogle.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow\370\001\001\242\002\002DF\252\002\032Google.Cloud.Dialogflow.V2')) +try: + # THESE ELEMENTS WILL BE DEPRECATED. + # Please use the generated *_pb2_grpc.py files instead. + import grpc + from grpc.beta import implementations as beta_implementations + from grpc.beta import interfaces as beta_interfaces + from grpc.framework.common import cardinality + from grpc.framework.interfaces.face import utilities as face_utilities + + + class SessionsStub(object): + """Manages user sessions. + + # + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.DetectIntent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Sessions/DetectIntent', + request_serializer=DetectIntentRequest.SerializeToString, + response_deserializer=DetectIntentResponse.FromString, + ) + self.StreamingDetectIntent = channel.stream_stream( + '/google.cloud.dialogflow.v2.Sessions/StreamingDetectIntent', + request_serializer=StreamingDetectIntentRequest.SerializeToString, + response_deserializer=StreamingDetectIntentResponse.FromString, + ) + + + class SessionsServicer(object): + """Manages user sessions. + + # + """ + + def DetectIntent(self, request, context): + """Processes a natural language query and returns structured, actionable data + as a result. This method is not idempotent, because it may cause contexts + and session entity types to be updated, which in turn might affect + results of future queries. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def StreamingDetectIntent(self, request_iterator, context): + """Processes a natural language query in audio format in a streaming fashion + and returns structured, actionable data as a result. This method is only + available via the gRPC API (not REST). + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + + def add_SessionsServicer_to_server(servicer, server): + rpc_method_handlers = { + 'DetectIntent': grpc.unary_unary_rpc_method_handler( + servicer.DetectIntent, + request_deserializer=DetectIntentRequest.FromString, + response_serializer=DetectIntentResponse.SerializeToString, + ), + 'StreamingDetectIntent': grpc.stream_stream_rpc_method_handler( + servicer.StreamingDetectIntent, + request_deserializer=StreamingDetectIntentRequest.FromString, + response_serializer=StreamingDetectIntentResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'google.cloud.dialogflow.v2.Sessions', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + class BetaSessionsServicer(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Manages user sessions. + + # + """ + def DetectIntent(self, request, context): + """Processes a natural language query and returns structured, actionable data + as a result. This method is not idempotent, because it may cause contexts + and session entity types to be updated, which in turn might affect + results of future queries. + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + def StreamingDetectIntent(self, request_iterator, context): + """Processes a natural language query in audio format in a streaming fashion + and returns structured, actionable data as a result. This method is only + available via the gRPC API (not REST). + """ + context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) + + + class BetaSessionsStub(object): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This class was generated + only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" + """Manages user sessions. + + # + """ + def DetectIntent(self, request, timeout, metadata=None, with_call=False, protocol_options=None): + """Processes a natural language query and returns structured, actionable data + as a result. This method is not idempotent, because it may cause contexts + and session entity types to be updated, which in turn might affect + results of future queries. + """ + raise NotImplementedError() + DetectIntent.future = None + def StreamingDetectIntent(self, request_iterator, timeout, metadata=None, with_call=False, protocol_options=None): + """Processes a natural language query in audio format in a streaming fashion + and returns structured, actionable data as a result. This method is only + available via the gRPC API (not REST). + """ + raise NotImplementedError() + + + def beta_create_Sessions_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_deserializers = { + ('google.cloud.dialogflow.v2.Sessions', 'DetectIntent'): DetectIntentRequest.FromString, + ('google.cloud.dialogflow.v2.Sessions', 'StreamingDetectIntent'): StreamingDetectIntentRequest.FromString, + } + response_serializers = { + ('google.cloud.dialogflow.v2.Sessions', 'DetectIntent'): DetectIntentResponse.SerializeToString, + ('google.cloud.dialogflow.v2.Sessions', 'StreamingDetectIntent'): StreamingDetectIntentResponse.SerializeToString, + } + method_implementations = { + ('google.cloud.dialogflow.v2.Sessions', 'DetectIntent'): face_utilities.unary_unary_inline(servicer.DetectIntent), + ('google.cloud.dialogflow.v2.Sessions', 'StreamingDetectIntent'): face_utilities.stream_stream_inline(servicer.StreamingDetectIntent), + } + server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) + return beta_implementations.server(method_implementations, options=server_options) + + + def beta_create_Sessions_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): + """The Beta API is deprecated for 0.15.0 and later. + + It is recommended to use the GA API (classes and functions in this + file not marked beta) for all further purposes. This function was + generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" + request_serializers = { + ('google.cloud.dialogflow.v2.Sessions', 'DetectIntent'): DetectIntentRequest.SerializeToString, + ('google.cloud.dialogflow.v2.Sessions', 'StreamingDetectIntent'): StreamingDetectIntentRequest.SerializeToString, + } + response_deserializers = { + ('google.cloud.dialogflow.v2.Sessions', 'DetectIntent'): DetectIntentResponse.FromString, + ('google.cloud.dialogflow.v2.Sessions', 'StreamingDetectIntent'): StreamingDetectIntentResponse.FromString, + } + cardinalities = { + 'DetectIntent': cardinality.Cardinality.UNARY_UNARY, + 'StreamingDetectIntent': cardinality.Cardinality.STREAM_STREAM, + } + stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) + return beta_implementations.dynamic_stub(channel, 'google.cloud.dialogflow.v2.Sessions', cardinalities, options=stub_options) +except ImportError: + pass +# @@protoc_insertion_point(module_scope) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/proto/session_pb2_grpc.py b/packages/google-cloud-dialogflow/dialogflow_v2/proto/session_pb2_grpc.py new file mode 100755 index 000000000000..4d9ffd8fb13f --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/proto/session_pb2_grpc.py @@ -0,0 +1,72 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + +import dialogflow_v2.proto.session_pb2 as google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__pb2 + + +class SessionsStub(object): + """Manages user sessions. + + # + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.DetectIntent = channel.unary_unary( + '/google.cloud.dialogflow.v2.Sessions/DetectIntent', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__pb2.DetectIntentRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__pb2.DetectIntentResponse.FromString, + ) + self.StreamingDetectIntent = channel.stream_stream( + '/google.cloud.dialogflow.v2.Sessions/StreamingDetectIntent', + request_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__pb2.StreamingDetectIntentRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__pb2.StreamingDetectIntentResponse.FromString, + ) + + +class SessionsServicer(object): + """Manages user sessions. + + # + """ + + def DetectIntent(self, request, context): + """Processes a natural language query and returns structured, actionable data + as a result. This method is not idempotent, because it may cause contexts + and session entity types to be updated, which in turn might affect + results of future queries. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def StreamingDetectIntent(self, request_iterator, context): + """Processes a natural language query in audio format in a streaming fashion + and returns structured, actionable data as a result. This method is only + available via the gRPC API (not REST). + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_SessionsServicer_to_server(servicer, server): + rpc_method_handlers = { + 'DetectIntent': grpc.unary_unary_rpc_method_handler( + servicer.DetectIntent, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__pb2.DetectIntentRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__pb2.DetectIntentResponse.SerializeToString, + ), + 'StreamingDetectIntent': grpc.stream_stream_rpc_method_handler( + servicer.StreamingDetectIntent, + request_deserializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__pb2.StreamingDetectIntentRequest.FromString, + response_serializer=google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__pb2.StreamingDetectIntentResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'google.cloud.dialogflow.v2.Sessions', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/proto/webhook_pb2.py b/packages/google-cloud-dialogflow/dialogflow_v2/proto/webhook_pb2.py new file mode 100755 index 000000000000..a8eca1a3d004 --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/proto/webhook_pb2.py @@ -0,0 +1,297 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/dialogflow_v2/proto/webhook.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 +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from dialogflow_v2.proto import context_pb2 as google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2 +from dialogflow_v2.proto import intent_pb2 as google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2 +from dialogflow_v2.proto import session_pb2 as google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__pb2 + +from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 + + +DESCRIPTOR = _descriptor.FileDescriptor( + name='google/cloud/dialogflow_v2/proto/webhook.proto', + package='google.cloud.dialogflow.v2', + syntax='proto3', + serialized_pb=_b('\n.google/cloud/dialogflow_v2/proto/webhook.proto\x12\x1agoogle.cloud.dialogflow.v2\x1a\x1cgoogle/api/annotations.proto\x1a.google/cloud/dialogflow_v2/proto/context.proto\x1a-google/cloud/dialogflow_v2/proto/intent.proto\x1a.google/cloud/dialogflow_v2/proto/session.proto\x1a\x1cgoogle/protobuf/struct.proto\"\xd6\x01\n\x0eWebhookRequest\x12\x0f\n\x07session\x18\x04 \x01(\t\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\x12=\n\x0cquery_result\x18\x02 \x01(\x0b\x32\'.google.cloud.dialogflow.v2.QueryResult\x12_\n\x1eoriginal_detect_intent_request\x18\x03 \x01(\x0b\x32\x37.google.cloud.dialogflow.v2.OriginalDetectIntentRequest\"\xb3\x02\n\x0fWebhookResponse\x12\x18\n\x10\x66ulfillment_text\x18\x01 \x01(\t\x12H\n\x14\x66ulfillment_messages\x18\x02 \x03(\x0b\x32*.google.cloud.dialogflow.v2.Intent.Message\x12\x0e\n\x06source\x18\x03 \x01(\t\x12(\n\x07payload\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12<\n\x0foutput_contexts\x18\x05 \x03(\x0b\x32#.google.cloud.dialogflow.v2.Context\x12\x44\n\x14\x66ollowup_event_input\x18\x06 \x01(\x0b\x32&.google.cloud.dialogflow.v2.EventInput\"W\n\x1bOriginalDetectIntentRequest\x12\x0e\n\x06source\x18\x01 \x01(\t\x12(\n\x07payload\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructB\x9b\x01\n\x1e\x63om.google.cloud.dialogflow.v2B\x0cWebhookProtoP\x01ZDgoogle.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow\xf8\x01\x01\xa2\x02\x02\x44\x46\xaa\x02\x1aGoogle.Cloud.Dialogflow.V2b\x06proto3') + , + dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR,google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2.DESCRIPTOR,google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2.DESCRIPTOR,google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__pb2.DESCRIPTOR,google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,]) +_sym_db.RegisterFileDescriptor(DESCRIPTOR) + + + + +_WEBHOOKREQUEST = _descriptor.Descriptor( + name='WebhookRequest', + full_name='google.cloud.dialogflow.v2.WebhookRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='session', full_name='google.cloud.dialogflow.v2.WebhookRequest.session', index=0, + number=4, 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, + options=None), + _descriptor.FieldDescriptor( + name='response_id', full_name='google.cloud.dialogflow.v2.WebhookRequest.response_id', index=1, + 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, + options=None), + _descriptor.FieldDescriptor( + name='query_result', full_name='google.cloud.dialogflow.v2.WebhookRequest.query_result', index=2, + 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, + options=None), + _descriptor.FieldDescriptor( + name='original_detect_intent_request', full_name='google.cloud.dialogflow.v2.WebhookRequest.original_detect_intent_request', index=3, + number=3, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=282, + serialized_end=496, +) + + +_WEBHOOKRESPONSE = _descriptor.Descriptor( + name='WebhookResponse', + full_name='google.cloud.dialogflow.v2.WebhookResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='fulfillment_text', full_name='google.cloud.dialogflow.v2.WebhookResponse.fulfillment_text', 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, + options=None), + _descriptor.FieldDescriptor( + name='fulfillment_messages', full_name='google.cloud.dialogflow.v2.WebhookResponse.fulfillment_messages', index=1, + number=2, 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, + options=None), + _descriptor.FieldDescriptor( + name='source', full_name='google.cloud.dialogflow.v2.WebhookResponse.source', index=2, + 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, + options=None), + _descriptor.FieldDescriptor( + name='payload', full_name='google.cloud.dialogflow.v2.WebhookResponse.payload', index=3, + number=4, 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, + options=None), + _descriptor.FieldDescriptor( + name='output_contexts', full_name='google.cloud.dialogflow.v2.WebhookResponse.output_contexts', index=4, + number=5, 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, + options=None), + _descriptor.FieldDescriptor( + name='followup_event_input', full_name='google.cloud.dialogflow.v2.WebhookResponse.followup_event_input', index=5, + number=6, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=499, + serialized_end=806, +) + + +_ORIGINALDETECTINTENTREQUEST = _descriptor.Descriptor( + name='OriginalDetectIntentRequest', + full_name='google.cloud.dialogflow.v2.OriginalDetectIntentRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='source', full_name='google.cloud.dialogflow.v2.OriginalDetectIntentRequest.source', 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, + options=None), + _descriptor.FieldDescriptor( + name='payload', full_name='google.cloud.dialogflow.v2.OriginalDetectIntentRequest.payload', index=1, + number=3, 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, + options=None), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=808, + serialized_end=895, +) + +_WEBHOOKREQUEST.fields_by_name['query_result'].message_type = google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__pb2._QUERYRESULT +_WEBHOOKREQUEST.fields_by_name['original_detect_intent_request'].message_type = _ORIGINALDETECTINTENTREQUEST +_WEBHOOKRESPONSE.fields_by_name['fulfillment_messages'].message_type = google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_intent__pb2._INTENT_MESSAGE +_WEBHOOKRESPONSE.fields_by_name['payload'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_WEBHOOKRESPONSE.fields_by_name['output_contexts'].message_type = google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_context__pb2._CONTEXT +_WEBHOOKRESPONSE.fields_by_name['followup_event_input'].message_type = google_dot_cloud_dot_dialogflow__v2_dot_proto_dot_session__pb2._EVENTINPUT +_ORIGINALDETECTINTENTREQUEST.fields_by_name['payload'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +DESCRIPTOR.message_types_by_name['WebhookRequest'] = _WEBHOOKREQUEST +DESCRIPTOR.message_types_by_name['WebhookResponse'] = _WEBHOOKRESPONSE +DESCRIPTOR.message_types_by_name['OriginalDetectIntentRequest'] = _ORIGINALDETECTINTENTREQUEST + +WebhookRequest = _reflection.GeneratedProtocolMessageType('WebhookRequest', (_message.Message,), dict( + DESCRIPTOR = _WEBHOOKREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.webhook_pb2' + , + __doc__ = """The request message for a webhook call. + + + Attributes: + session: + The unique identifier of detectIntent request session. Can be + used to identify end-user inside webhook implementation. + Format: ``projects//agent/sessions/``. + response_id: + The unique identifier of the response. Contains the same value + as ``[Streaming]DetectIntentResponse.response_id``. + query_result: + The result of the conversational query or event processing. + Contains the same value as + ``[Streaming]DetectIntentResponse.query_result``. + original_detect_intent_request: + Optional. The contents of the original request that was passed + to ``[Streaming]DetectIntent`` call. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.WebhookRequest) + )) +_sym_db.RegisterMessage(WebhookRequest) + +WebhookResponse = _reflection.GeneratedProtocolMessageType('WebhookResponse', (_message.Message,), dict( + DESCRIPTOR = _WEBHOOKRESPONSE, + __module__ = 'google.cloud.dialogflow_v2.proto.webhook_pb2' + , + __doc__ = """The response message for a webhook call. + + + Attributes: + fulfillment_text: + Optional. The text to be shown on the screen. This value is + passed directly to ``QueryResult.fulfillment_text``. + fulfillment_messages: + Optional. The collection of rich messages to present to the + user. This value is passed directly to + ``QueryResult.fulfillment_messages``. + source: + Optional. This value is passed directly to + ``QueryResult.webhook_source``. + payload: + Optional. This value is passed directly to + ``QueryResult.webhook_payload``. + output_contexts: + Optional. The collection of output contexts. This value is + passed directly to ``QueryResult.output_contexts``. + followup_event_input: + Optional. Makes the platform immediately invoke another + ``DetectIntent`` call internally with the specified event as + input. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.WebhookResponse) + )) +_sym_db.RegisterMessage(WebhookResponse) + +OriginalDetectIntentRequest = _reflection.GeneratedProtocolMessageType('OriginalDetectIntentRequest', (_message.Message,), dict( + DESCRIPTOR = _ORIGINALDETECTINTENTREQUEST, + __module__ = 'google.cloud.dialogflow_v2.proto.webhook_pb2' + , + __doc__ = """Represents the contents of the original request that was passed to the + ``[Streaming]DetectIntent`` call. + + + Attributes: + source: + The source of this request, e.g., ``google``, ``facebook``, + ``slack``. It is set by Dialogflow-owned servers. Possible + values of this field correspond to [Intent.Message.Platform][g + oogle.cloud.dialogflow.v2.Intent.Message.Platform]. + payload: + Optional. This field is set to the value of + ``QueryParameters.payload`` field passed in the request. + """, + # @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.OriginalDetectIntentRequest) + )) +_sym_db.RegisterMessage(OriginalDetectIntentRequest) + + +DESCRIPTOR.has_options = True +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\036com.google.cloud.dialogflow.v2B\014WebhookProtoP\001ZDgoogle.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow\370\001\001\242\002\002DF\252\002\032Google.Cloud.Dialogflow.V2')) +try: + # THESE ELEMENTS WILL BE DEPRECATED. + # Please use the generated *_pb2_grpc.py files instead. + import grpc + from grpc.beta import implementations as beta_implementations + from grpc.beta import interfaces as beta_interfaces + from grpc.framework.common import cardinality + from grpc.framework.interfaces.face import utilities as face_utilities +except ImportError: + pass +# @@protoc_insertion_point(module_scope) diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/proto/webhook_pb2_grpc.py b/packages/google-cloud-dialogflow/dialogflow_v2/proto/webhook_pb2_grpc.py new file mode 100755 index 000000000000..a89435267cb2 --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/proto/webhook_pb2_grpc.py @@ -0,0 +1,3 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +import grpc + diff --git a/packages/google-cloud-dialogflow/dialogflow_v2/types.py b/packages/google-cloud-dialogflow/dialogflow_v2/types.py new file mode 100755 index 000000000000..37ed4fe65fca --- /dev/null +++ b/packages/google-cloud-dialogflow/dialogflow_v2/types.py @@ -0,0 +1,62 @@ +# Copyright 2018 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. + +from __future__ import absolute_import +import sys + +from google.api_core.protobuf_helpers import get_messages + +from google.api import http_pb2 +from google.longrunning import operations_pb2 +from google.protobuf import any_pb2 +from google.protobuf import descriptor_pb2 +from google.protobuf import empty_pb2 +from google.protobuf import field_mask_pb2 +from google.protobuf import struct_pb2 +from google.rpc import status_pb2 +from google.type import latlng_pb2 + +from dialogflow_v2.proto import agent_pb2 +from dialogflow_v2.proto import context_pb2 +from dialogflow_v2.proto import entity_type_pb2 +from dialogflow_v2.proto import intent_pb2 +from dialogflow_v2.proto import session_entity_type_pb2 +from dialogflow_v2.proto import session_pb2 +from dialogflow_v2.proto import webhook_pb2 + +names = [] +for module in ( + http_pb2, + agent_pb2, + context_pb2, + entity_type_pb2, + intent_pb2, + session_entity_type_pb2, + session_pb2, + webhook_pb2, + operations_pb2, + any_pb2, + descriptor_pb2, + empty_pb2, + field_mask_pb2, + struct_pb2, + status_pb2, + latlng_pb2, +): + for name, message in get_messages(module).items(): + message.__module__ = 'google.cloud.dialogflow_v2.types' + setattr(sys.modules[__name__], name, message) + names.append(name) + +__all__ = tuple(sorted(names)) diff --git a/packages/google-cloud-dialogflow/docs/gapic/v2/api.rst b/packages/google-cloud-dialogflow/docs/gapic/v2/api.rst new file mode 100755 index 000000000000..972bffc3d4fb --- /dev/null +++ b/packages/google-cloud-dialogflow/docs/gapic/v2/api.rst @@ -0,0 +1,6 @@ +Client for Dialogflow API +========================= + +.. automodule:: dialogflow_v2 + :members: + :inherited-members: diff --git a/packages/google-cloud-dialogflow/docs/gapic/v2/types.rst b/packages/google-cloud-dialogflow/docs/gapic/v2/types.rst new file mode 100755 index 000000000000..fb2e408daf38 --- /dev/null +++ b/packages/google-cloud-dialogflow/docs/gapic/v2/types.rst @@ -0,0 +1,5 @@ +Types for Dialogflow API Client +=============================== + +.. automodule:: dialogflow_v2.types + :members: diff --git a/packages/google-cloud-dialogflow/docs/index.rst b/packages/google-cloud-dialogflow/docs/index.rst index 9ce09c4d079e..b1c152c6794b 100644 --- a/packages/google-cloud-dialogflow/docs/index.rst +++ b/packages/google-cloud-dialogflow/docs/index.rst @@ -183,5 +183,8 @@ Api Reference .. toctree:: :maxdepth: 2 + gapic/v2/api + gapic/v2/types + gapic/v2beta1/api gapic/v2beta1/types diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_agents_client_v2.py b/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_agents_client_v2.py new file mode 100755 index 000000000000..874d13da5768 --- /dev/null +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_agents_client_v2.py @@ -0,0 +1,325 @@ +# Copyright 2018 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 pytest + +from google.rpc import status_pb2 + +import dialogflow_v2 +from dialogflow_v2.proto import agent_pb2 +from google.longrunning import operations_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 TestAgentsClient(object): + def test_get_agent(self): + # Setup Expected Response + parent_2 = 'parent21175163357' + display_name = 'displayName1615086568' + default_language_code = 'defaultLanguageCode856575222' + time_zone = 'timeZone36848094' + description = 'description-1724546052' + avatar_uri = 'avatarUri-402824826' + enable_logging = False + classification_threshold = 1.11581064E8 + expected_response = { + 'parent': parent_2, + 'display_name': display_name, + 'default_language_code': default_language_code, + 'time_zone': time_zone, + 'description': description, + 'avatar_uri': avatar_uri, + 'enable_logging': enable_logging, + 'classification_threshold': classification_threshold + } + expected_response = agent_pb2.Agent(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.AgentsClient(channel=channel) + + # Setup Request + parent = client.project_path('[PROJECT]') + + response = client.get_agent(parent) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = agent_pb2.GetAgentRequest(parent=parent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_get_agent_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.AgentsClient(channel=channel) + + # Setup request + parent = client.project_path('[PROJECT]') + + with pytest.raises(CustomException): + client.get_agent(parent) + + def test_search_agents(self): + # Setup Expected Response + next_page_token = '' + agents_element = {} + agents = [agents_element] + expected_response = { + 'next_page_token': next_page_token, + 'agents': agents + } + expected_response = agent_pb2.SearchAgentsResponse(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.AgentsClient(channel=channel) + + # Setup Request + parent = client.project_path('[PROJECT]') + + paged_list_response = client.search_agents(parent) + resources = list(paged_list_response) + assert len(resources) == 1 + + assert expected_response.agents[0] == resources[0] + + assert len(channel.requests) == 1 + expected_request = agent_pb2.SearchAgentsRequest(parent=parent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_search_agents_exception(self): + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.AgentsClient(channel=channel) + + # Setup request + parent = client.project_path('[PROJECT]') + + paged_list_response = client.search_agents(parent) + with pytest.raises(CustomException): + list(paged_list_response) + + def test_train_agent(self): + # Setup Expected Response + expected_response = {} + expected_response = empty_pb2.Empty(**expected_response) + operation = operations_pb2.Operation( + name='operations/test_train_agent', done=True) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.AgentsClient(channel=channel) + + # Setup Request + parent = client.project_path('[PROJECT]') + + response = client.train_agent(parent) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = agent_pb2.TrainAgentRequest(parent=parent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_train_agent_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name='operations/test_train_agent_exception', done=True) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.AgentsClient(channel=channel) + + # Setup Request + parent = client.project_path('[PROJECT]') + + response = client.train_agent(parent) + exception = response.exception() + assert exception.errors[0] == error + + def test_export_agent(self): + # Setup Expected Response + agent_uri = 'agentUri-1700713166' + agent_content = b'63' + expected_response = { + 'agent_uri': agent_uri, + 'agent_content': agent_content + } + expected_response = agent_pb2.ExportAgentResponse(**expected_response) + operation = operations_pb2.Operation( + name='operations/test_export_agent', done=True) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.AgentsClient(channel=channel) + + # Setup Request + parent = client.project_path('[PROJECT]') + + response = client.export_agent(parent) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = agent_pb2.ExportAgentRequest(parent=parent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_export_agent_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name='operations/test_export_agent_exception', done=True) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.AgentsClient(channel=channel) + + # Setup Request + parent = client.project_path('[PROJECT]') + + response = client.export_agent(parent) + exception = response.exception() + assert exception.errors[0] == error + + def test_import_agent(self): + # Setup Expected Response + expected_response = {} + expected_response = empty_pb2.Empty(**expected_response) + operation = operations_pb2.Operation( + name='operations/test_import_agent', done=True) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.AgentsClient(channel=channel) + + # Setup Request + parent = client.project_path('[PROJECT]') + + response = client.import_agent(parent) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = agent_pb2.ImportAgentRequest(parent=parent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_import_agent_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name='operations/test_import_agent_exception', done=True) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.AgentsClient(channel=channel) + + # Setup Request + parent = client.project_path('[PROJECT]') + + response = client.import_agent(parent) + exception = response.exception() + assert exception.errors[0] == error + + def test_restore_agent(self): + # Setup Expected Response + expected_response = {} + expected_response = empty_pb2.Empty(**expected_response) + operation = operations_pb2.Operation( + name='operations/test_restore_agent', done=True) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.AgentsClient(channel=channel) + + # Setup Request + parent = client.project_path('[PROJECT]') + + response = client.restore_agent(parent) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = agent_pb2.RestoreAgentRequest(parent=parent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_restore_agent_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name='operations/test_restore_agent_exception', done=True) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.AgentsClient(channel=channel) + + # Setup Request + parent = client.project_path('[PROJECT]') + + response = client.restore_agent(parent) + exception = response.exception() + assert exception.errors[0] == error diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_contexts_client_v2.py b/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_contexts_client_v2.py new file mode 100755 index 000000000000..996467ff129a --- /dev/null +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_contexts_client_v2.py @@ -0,0 +1,253 @@ +# Copyright 2018 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 pytest + +import dialogflow_v2 +from dialogflow_v2.proto import context_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 TestContextsClient(object): + def test_list_contexts(self): + # Setup Expected Response + next_page_token = '' + contexts_element = {} + contexts = [contexts_element] + expected_response = { + 'next_page_token': next_page_token, + 'contexts': contexts + } + expected_response = context_pb2.ListContextsResponse( + **expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.ContextsClient(channel=channel) + + # Setup Request + parent = client.session_path('[PROJECT]', '[SESSION]') + + paged_list_response = client.list_contexts(parent) + resources = list(paged_list_response) + assert len(resources) == 1 + + assert expected_response.contexts[0] == resources[0] + + assert len(channel.requests) == 1 + expected_request = context_pb2.ListContextsRequest(parent=parent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_list_contexts_exception(self): + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.ContextsClient(channel=channel) + + # Setup request + parent = client.session_path('[PROJECT]', '[SESSION]') + + paged_list_response = client.list_contexts(parent) + with pytest.raises(CustomException): + list(paged_list_response) + + def test_get_context(self): + # Setup Expected Response + name_2 = 'name2-1052831874' + lifespan_count = 1178775510 + expected_response = {'name': name_2, 'lifespan_count': lifespan_count} + expected_response = context_pb2.Context(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.ContextsClient(channel=channel) + + # Setup Request + name = client.context_path('[PROJECT]', '[SESSION]', '[CONTEXT]') + + response = client.get_context(name) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = context_pb2.GetContextRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_get_context_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.ContextsClient(channel=channel) + + # Setup request + name = client.context_path('[PROJECT]', '[SESSION]', '[CONTEXT]') + + with pytest.raises(CustomException): + client.get_context(name) + + def test_create_context(self): + # Setup Expected Response + name = 'name3373707' + lifespan_count = 1178775510 + expected_response = {'name': name, 'lifespan_count': lifespan_count} + expected_response = context_pb2.Context(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.ContextsClient(channel=channel) + + # Setup Request + parent = client.session_path('[PROJECT]', '[SESSION]') + context = {} + + response = client.create_context(parent, context) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = context_pb2.CreateContextRequest( + parent=parent, context=context) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_create_context_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.ContextsClient(channel=channel) + + # Setup request + parent = client.session_path('[PROJECT]', '[SESSION]') + context = {} + + with pytest.raises(CustomException): + client.create_context(parent, context) + + def test_update_context(self): + # Setup Expected Response + name = 'name3373707' + lifespan_count = 1178775510 + expected_response = {'name': name, 'lifespan_count': lifespan_count} + expected_response = context_pb2.Context(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.ContextsClient(channel=channel) + + # Setup Request + context = {} + + response = client.update_context(context) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = context_pb2.UpdateContextRequest(context=context) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_update_context_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.ContextsClient(channel=channel) + + # Setup request + context = {} + + with pytest.raises(CustomException): + client.update_context(context) + + def test_delete_context(self): + channel = ChannelStub() + client = dialogflow_v2.ContextsClient(channel=channel) + + # Setup Request + name = client.context_path('[PROJECT]', '[SESSION]', '[CONTEXT]') + + client.delete_context(name) + + assert len(channel.requests) == 1 + expected_request = context_pb2.DeleteContextRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_delete_context_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.ContextsClient(channel=channel) + + # Setup request + name = client.context_path('[PROJECT]', '[SESSION]', '[CONTEXT]') + + with pytest.raises(CustomException): + client.delete_context(name) + + def test_delete_all_contexts(self): + channel = ChannelStub() + client = dialogflow_v2.ContextsClient(channel=channel) + + # Setup Request + parent = client.session_path('[PROJECT]', '[SESSION]') + + client.delete_all_contexts(parent) + + assert len(channel.requests) == 1 + expected_request = context_pb2.DeleteAllContextsRequest(parent=parent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_delete_all_contexts_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.ContextsClient(channel=channel) + + # Setup request + parent = client.session_path('[PROJECT]', '[SESSION]') + + with pytest.raises(CustomException): + client.delete_all_contexts(parent) diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_entity_types_client_v2.py b/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_entity_types_client_v2.py new file mode 100755 index 000000000000..4a5e1a9d909f --- /dev/null +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_entity_types_client_v2.py @@ -0,0 +1,460 @@ +# Copyright 2018 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 pytest + +from google.rpc import status_pb2 + +import dialogflow_v2 +from dialogflow_v2.proto import entity_type_pb2 +from google.longrunning import operations_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 TestEntityTypesClient(object): + def test_list_entity_types(self): + # Setup Expected Response + next_page_token = '' + entity_types_element = {} + entity_types = [entity_types_element] + expected_response = { + 'next_page_token': next_page_token, + 'entity_types': entity_types + } + expected_response = entity_type_pb2.ListEntityTypesResponse( + **expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup Request + parent = client.project_agent_path('[PROJECT]') + + paged_list_response = client.list_entity_types(parent) + resources = list(paged_list_response) + assert len(resources) == 1 + + assert expected_response.entity_types[0] == resources[0] + + assert len(channel.requests) == 1 + expected_request = entity_type_pb2.ListEntityTypesRequest( + parent=parent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_list_entity_types_exception(self): + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup request + parent = client.project_agent_path('[PROJECT]') + + paged_list_response = client.list_entity_types(parent) + with pytest.raises(CustomException): + list(paged_list_response) + + def test_get_entity_type(self): + # Setup Expected Response + name_2 = 'name2-1052831874' + display_name = 'displayName1615086568' + expected_response = {'name': name_2, 'display_name': display_name} + expected_response = entity_type_pb2.EntityType(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup Request + name = client.entity_type_path('[PROJECT]', '[ENTITY_TYPE]') + + response = client.get_entity_type(name) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = entity_type_pb2.GetEntityTypeRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_get_entity_type_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup request + name = client.entity_type_path('[PROJECT]', '[ENTITY_TYPE]') + + with pytest.raises(CustomException): + client.get_entity_type(name) + + def test_create_entity_type(self): + # Setup Expected Response + name = 'name3373707' + display_name = 'displayName1615086568' + expected_response = {'name': name, 'display_name': display_name} + expected_response = entity_type_pb2.EntityType(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup Request + parent = client.project_agent_path('[PROJECT]') + entity_type = {} + + response = client.create_entity_type(parent, entity_type) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = entity_type_pb2.CreateEntityTypeRequest( + parent=parent, entity_type=entity_type) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_create_entity_type_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup request + parent = client.project_agent_path('[PROJECT]') + entity_type = {} + + with pytest.raises(CustomException): + client.create_entity_type(parent, entity_type) + + def test_update_entity_type(self): + # Setup Expected Response + name = 'name3373707' + display_name = 'displayName1615086568' + expected_response = {'name': name, 'display_name': display_name} + expected_response = entity_type_pb2.EntityType(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup Request + entity_type = {} + + response = client.update_entity_type(entity_type) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = entity_type_pb2.UpdateEntityTypeRequest( + entity_type=entity_type) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_update_entity_type_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup request + entity_type = {} + + with pytest.raises(CustomException): + client.update_entity_type(entity_type) + + def test_delete_entity_type(self): + channel = ChannelStub() + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup Request + name = client.entity_type_path('[PROJECT]', '[ENTITY_TYPE]') + + client.delete_entity_type(name) + + assert len(channel.requests) == 1 + expected_request = entity_type_pb2.DeleteEntityTypeRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_delete_entity_type_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup request + name = client.entity_type_path('[PROJECT]', '[ENTITY_TYPE]') + + with pytest.raises(CustomException): + client.delete_entity_type(name) + + def test_batch_update_entity_types(self): + # Setup Expected Response + expected_response = {} + expected_response = entity_type_pb2.BatchUpdateEntityTypesResponse( + **expected_response) + operation = operations_pb2.Operation( + name='operations/test_batch_update_entity_types', done=True) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup Request + parent = client.project_agent_path('[PROJECT]') + + response = client.batch_update_entity_types(parent) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = entity_type_pb2.BatchUpdateEntityTypesRequest( + parent=parent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_batch_update_entity_types_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name='operations/test_batch_update_entity_types_exception', + done=True) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup Request + parent = client.project_agent_path('[PROJECT]') + + response = client.batch_update_entity_types(parent) + exception = response.exception() + assert exception.errors[0] == error + + def test_batch_delete_entity_types(self): + # Setup Expected Response + expected_response = {} + expected_response = empty_pb2.Empty(**expected_response) + operation = operations_pb2.Operation( + name='operations/test_batch_delete_entity_types', done=True) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup Request + parent = client.project_agent_path('[PROJECT]') + entity_type_names = [] + + response = client.batch_delete_entity_types(parent, entity_type_names) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = entity_type_pb2.BatchDeleteEntityTypesRequest( + parent=parent, entity_type_names=entity_type_names) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_batch_delete_entity_types_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name='operations/test_batch_delete_entity_types_exception', + done=True) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup Request + parent = client.project_agent_path('[PROJECT]') + entity_type_names = [] + + response = client.batch_delete_entity_types(parent, entity_type_names) + exception = response.exception() + assert exception.errors[0] == error + + def test_batch_create_entities(self): + # Setup Expected Response + expected_response = {} + expected_response = empty_pb2.Empty(**expected_response) + operation = operations_pb2.Operation( + name='operations/test_batch_create_entities', done=True) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup Request + parent = client.entity_type_path('[PROJECT]', '[ENTITY_TYPE]') + entities = [] + + response = client.batch_create_entities(parent, entities) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = entity_type_pb2.BatchCreateEntitiesRequest( + parent=parent, entities=entities) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_batch_create_entities_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name='operations/test_batch_create_entities_exception', done=True) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup Request + parent = client.entity_type_path('[PROJECT]', '[ENTITY_TYPE]') + entities = [] + + response = client.batch_create_entities(parent, entities) + exception = response.exception() + assert exception.errors[0] == error + + def test_batch_update_entities(self): + # Setup Expected Response + expected_response = {} + expected_response = empty_pb2.Empty(**expected_response) + operation = operations_pb2.Operation( + name='operations/test_batch_update_entities', done=True) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup Request + parent = client.entity_type_path('[PROJECT]', '[ENTITY_TYPE]') + entities = [] + + response = client.batch_update_entities(parent, entities) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = entity_type_pb2.BatchUpdateEntitiesRequest( + parent=parent, entities=entities) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_batch_update_entities_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name='operations/test_batch_update_entities_exception', done=True) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup Request + parent = client.entity_type_path('[PROJECT]', '[ENTITY_TYPE]') + entities = [] + + response = client.batch_update_entities(parent, entities) + exception = response.exception() + assert exception.errors[0] == error + + def test_batch_delete_entities(self): + # Setup Expected Response + expected_response = {} + expected_response = empty_pb2.Empty(**expected_response) + operation = operations_pb2.Operation( + name='operations/test_batch_delete_entities', done=True) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup Request + parent = client.entity_type_path('[PROJECT]', '[ENTITY_TYPE]') + entity_values = [] + + response = client.batch_delete_entities(parent, entity_values) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = entity_type_pb2.BatchDeleteEntitiesRequest( + parent=parent, entity_values=entity_values) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_batch_delete_entities_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name='operations/test_batch_delete_entities_exception', done=True) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.EntityTypesClient(channel=channel) + + # Setup Request + parent = client.entity_type_path('[PROJECT]', '[ENTITY_TYPE]') + entity_values = [] + + response = client.batch_delete_entities(parent, entity_values) + exception = response.exception() + assert exception.errors[0] == error diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_intents_client_v2.py b/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_intents_client_v2.py new file mode 100755 index 000000000000..aecee6f0690e --- /dev/null +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_intents_client_v2.py @@ -0,0 +1,376 @@ +# Copyright 2018 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 pytest + +from google.rpc import status_pb2 + +import dialogflow_v2 +from dialogflow_v2.proto import intent_pb2 +from google.longrunning import operations_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 TestIntentsClient(object): + def test_list_intents(self): + # Setup Expected Response + next_page_token = '' + intents_element = {} + intents = [intents_element] + expected_response = { + 'next_page_token': next_page_token, + 'intents': intents + } + expected_response = intent_pb2.ListIntentsResponse(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.IntentsClient(channel=channel) + + # Setup Request + parent = client.project_agent_path('[PROJECT]') + + paged_list_response = client.list_intents(parent) + resources = list(paged_list_response) + assert len(resources) == 1 + + assert expected_response.intents[0] == resources[0] + + assert len(channel.requests) == 1 + expected_request = intent_pb2.ListIntentsRequest(parent=parent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_list_intents_exception(self): + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.IntentsClient(channel=channel) + + # Setup request + parent = client.project_agent_path('[PROJECT]') + + paged_list_response = client.list_intents(parent) + with pytest.raises(CustomException): + list(paged_list_response) + + def test_get_intent(self): + # Setup Expected Response + name_2 = 'name2-1052831874' + display_name = 'displayName1615086568' + priority = 1165461084 + is_fallback = False + ml_disabled = True + action = 'action-1422950858' + reset_contexts = True + root_followup_intent_name = 'rootFollowupIntentName402253784' + parent_followup_intent_name = 'parentFollowupIntentName-1131901680' + expected_response = { + 'name': name_2, + 'display_name': display_name, + 'priority': priority, + 'is_fallback': is_fallback, + 'ml_disabled': ml_disabled, + 'action': action, + 'reset_contexts': reset_contexts, + 'root_followup_intent_name': root_followup_intent_name, + 'parent_followup_intent_name': parent_followup_intent_name + } + expected_response = intent_pb2.Intent(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.IntentsClient(channel=channel) + + # Setup Request + name = client.intent_path('[PROJECT]', '[INTENT]') + + response = client.get_intent(name) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = intent_pb2.GetIntentRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_get_intent_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.IntentsClient(channel=channel) + + # Setup request + name = client.intent_path('[PROJECT]', '[INTENT]') + + with pytest.raises(CustomException): + client.get_intent(name) + + def test_create_intent(self): + # Setup Expected Response + name = 'name3373707' + display_name = 'displayName1615086568' + priority = 1165461084 + is_fallback = False + ml_disabled = True + action = 'action-1422950858' + reset_contexts = True + root_followup_intent_name = 'rootFollowupIntentName402253784' + parent_followup_intent_name = 'parentFollowupIntentName-1131901680' + expected_response = { + 'name': name, + 'display_name': display_name, + 'priority': priority, + 'is_fallback': is_fallback, + 'ml_disabled': ml_disabled, + 'action': action, + 'reset_contexts': reset_contexts, + 'root_followup_intent_name': root_followup_intent_name, + 'parent_followup_intent_name': parent_followup_intent_name + } + expected_response = intent_pb2.Intent(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.IntentsClient(channel=channel) + + # Setup Request + parent = client.project_agent_path('[PROJECT]') + intent = {} + + response = client.create_intent(parent, intent) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = intent_pb2.CreateIntentRequest( + parent=parent, intent=intent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_create_intent_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.IntentsClient(channel=channel) + + # Setup request + parent = client.project_agent_path('[PROJECT]') + intent = {} + + with pytest.raises(CustomException): + client.create_intent(parent, intent) + + def test_update_intent(self): + # Setup Expected Response + name = 'name3373707' + display_name = 'displayName1615086568' + priority = 1165461084 + is_fallback = False + ml_disabled = True + action = 'action-1422950858' + reset_contexts = True + root_followup_intent_name = 'rootFollowupIntentName402253784' + parent_followup_intent_name = 'parentFollowupIntentName-1131901680' + expected_response = { + 'name': name, + 'display_name': display_name, + 'priority': priority, + 'is_fallback': is_fallback, + 'ml_disabled': ml_disabled, + 'action': action, + 'reset_contexts': reset_contexts, + 'root_followup_intent_name': root_followup_intent_name, + 'parent_followup_intent_name': parent_followup_intent_name + } + expected_response = intent_pb2.Intent(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.IntentsClient(channel=channel) + + # Setup Request + intent = {} + language_code = 'languageCode-412800396' + + response = client.update_intent(intent, language_code) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = intent_pb2.UpdateIntentRequest( + intent=intent, language_code=language_code) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_update_intent_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.IntentsClient(channel=channel) + + # Setup request + intent = {} + language_code = 'languageCode-412800396' + + with pytest.raises(CustomException): + client.update_intent(intent, language_code) + + def test_delete_intent(self): + channel = ChannelStub() + client = dialogflow_v2.IntentsClient(channel=channel) + + # Setup Request + name = client.intent_path('[PROJECT]', '[INTENT]') + + client.delete_intent(name) + + assert len(channel.requests) == 1 + expected_request = intent_pb2.DeleteIntentRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_delete_intent_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.IntentsClient(channel=channel) + + # Setup request + name = client.intent_path('[PROJECT]', '[INTENT]') + + with pytest.raises(CustomException): + client.delete_intent(name) + + def test_batch_update_intents(self): + # Setup Expected Response + expected_response = {} + expected_response = intent_pb2.BatchUpdateIntentsResponse( + **expected_response) + operation = operations_pb2.Operation( + name='operations/test_batch_update_intents', done=True) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.IntentsClient(channel=channel) + + # Setup Request + parent = client.agent_path('[PROJECT]', '[AGENT]') + language_code = 'languageCode-412800396' + + response = client.batch_update_intents(parent, language_code) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = intent_pb2.BatchUpdateIntentsRequest( + parent=parent, language_code=language_code) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_batch_update_intents_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name='operations/test_batch_update_intents_exception', done=True) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.IntentsClient(channel=channel) + + # Setup Request + parent = client.agent_path('[PROJECT]', '[AGENT]') + language_code = 'languageCode-412800396' + + response = client.batch_update_intents(parent, language_code) + exception = response.exception() + assert exception.errors[0] == error + + def test_batch_delete_intents(self): + # Setup Expected Response + expected_response = {} + expected_response = empty_pb2.Empty(**expected_response) + operation = operations_pb2.Operation( + name='operations/test_batch_delete_intents', done=True) + operation.response.Pack(expected_response) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.IntentsClient(channel=channel) + + # Setup Request + parent = client.agent_path('[PROJECT]', '[AGENT]') + intents = [] + + response = client.batch_delete_intents(parent, intents) + result = response.result() + assert expected_response == result + + assert len(channel.requests) == 1 + expected_request = intent_pb2.BatchDeleteIntentsRequest( + parent=parent, intents=intents) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_batch_delete_intents_exception(self): + # Setup Response + error = status_pb2.Status() + operation = operations_pb2.Operation( + name='operations/test_batch_delete_intents_exception', done=True) + operation.error.CopyFrom(error) + + # Mock the API response + channel = ChannelStub(responses=[operation]) + client = dialogflow_v2.IntentsClient(channel=channel) + + # Setup Request + parent = client.agent_path('[PROJECT]', '[AGENT]') + intents = [] + + response = client.batch_delete_intents(parent, intents) + exception = response.exception() + assert exception.errors[0] == error diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_session_entity_types_client_v2.py b/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_session_entity_types_client_v2.py new file mode 100755 index 000000000000..fa738d70ff3d --- /dev/null +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_session_entity_types_client_v2.py @@ -0,0 +1,238 @@ +# Copyright 2018 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 pytest + +import dialogflow_v2 +from dialogflow_v2.proto import session_entity_type_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 TestSessionEntityTypesClient(object): + def test_list_session_entity_types(self): + # Setup Expected Response + next_page_token = '' + session_entity_types_element = {} + session_entity_types = [session_entity_types_element] + expected_response = { + 'next_page_token': next_page_token, + 'session_entity_types': session_entity_types + } + expected_response = session_entity_type_pb2.ListSessionEntityTypesResponse( + **expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.SessionEntityTypesClient(channel=channel) + + # Setup Request + parent = client.session_path('[PROJECT]', '[SESSION]') + + paged_list_response = client.list_session_entity_types(parent) + resources = list(paged_list_response) + assert len(resources) == 1 + + assert expected_response.session_entity_types[0] == resources[0] + + assert len(channel.requests) == 1 + expected_request = session_entity_type_pb2.ListSessionEntityTypesRequest( + parent=parent) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_list_session_entity_types_exception(self): + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.SessionEntityTypesClient(channel=channel) + + # Setup request + parent = client.session_path('[PROJECT]', '[SESSION]') + + paged_list_response = client.list_session_entity_types(parent) + with pytest.raises(CustomException): + list(paged_list_response) + + def test_get_session_entity_type(self): + # Setup Expected Response + name_2 = 'name2-1052831874' + expected_response = {'name': name_2} + expected_response = session_entity_type_pb2.SessionEntityType( + **expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.SessionEntityTypesClient(channel=channel) + + # Setup Request + name = client.session_entity_type_path('[PROJECT]', '[SESSION]', + '[ENTITY_TYPE]') + + response = client.get_session_entity_type(name) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = session_entity_type_pb2.GetSessionEntityTypeRequest( + name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_get_session_entity_type_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.SessionEntityTypesClient(channel=channel) + + # Setup request + name = client.session_entity_type_path('[PROJECT]', '[SESSION]', + '[ENTITY_TYPE]') + + with pytest.raises(CustomException): + client.get_session_entity_type(name) + + def test_create_session_entity_type(self): + # Setup Expected Response + name = 'name3373707' + expected_response = {'name': name} + expected_response = session_entity_type_pb2.SessionEntityType( + **expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.SessionEntityTypesClient(channel=channel) + + # Setup Request + parent = client.session_path('[PROJECT]', '[SESSION]') + session_entity_type = {} + + response = client.create_session_entity_type(parent, + session_entity_type) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = session_entity_type_pb2.CreateSessionEntityTypeRequest( + parent=parent, session_entity_type=session_entity_type) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_create_session_entity_type_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.SessionEntityTypesClient(channel=channel) + + # Setup request + parent = client.session_path('[PROJECT]', '[SESSION]') + session_entity_type = {} + + with pytest.raises(CustomException): + client.create_session_entity_type(parent, session_entity_type) + + def test_update_session_entity_type(self): + # Setup Expected Response + name = 'name3373707' + expected_response = {'name': name} + expected_response = session_entity_type_pb2.SessionEntityType( + **expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.SessionEntityTypesClient(channel=channel) + + # Setup Request + session_entity_type = {} + + response = client.update_session_entity_type(session_entity_type) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = session_entity_type_pb2.UpdateSessionEntityTypeRequest( + session_entity_type=session_entity_type) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_update_session_entity_type_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.SessionEntityTypesClient(channel=channel) + + # Setup request + session_entity_type = {} + + with pytest.raises(CustomException): + client.update_session_entity_type(session_entity_type) + + def test_delete_session_entity_type(self): + channel = ChannelStub() + client = dialogflow_v2.SessionEntityTypesClient(channel=channel) + + # Setup Request + name = client.session_entity_type_path('[PROJECT]', '[SESSION]', + '[ENTITY_TYPE]') + + client.delete_session_entity_type(name) + + assert len(channel.requests) == 1 + expected_request = session_entity_type_pb2.DeleteSessionEntityTypeRequest( + name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_delete_session_entity_type_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.SessionEntityTypesClient(channel=channel) + + # Setup request + name = client.session_entity_type_path('[PROJECT]', '[SESSION]', + '[ENTITY_TYPE]') + + with pytest.raises(CustomException): + client.delete_session_entity_type(name) diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_sessions_client_v2.py b/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_sessions_client_v2.py new file mode 100755 index 000000000000..bed3c30b2a34 --- /dev/null +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/v2/test_sessions_client_v2.py @@ -0,0 +1,147 @@ +# Copyright 2018 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 pytest + +import dialogflow_v2 +from dialogflow_v2.proto import session_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) + + def stream_stream(self, + method, + request_serializer=None, + response_deserializer=None): + return MultiCallableStub(method, self) + + +class CustomException(Exception): + pass + + +class TestSessionsClient(object): + def test_detect_intent(self): + # Setup Expected Response + response_id = 'responseId1847552473' + expected_response = {'response_id': response_id} + expected_response = session_pb2.DetectIntentResponse( + **expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + client = dialogflow_v2.SessionsClient(channel=channel) + + # Setup Request + session = client.session_path('[PROJECT]', '[SESSION]') + query_input = {} + + response = client.detect_intent(session, query_input) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = session_pb2.DetectIntentRequest( + session=session, query_input=query_input) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_detect_intent_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.SessionsClient(channel=channel) + + # Setup request + session = client.session_path('[PROJECT]', '[SESSION]') + query_input = {} + + with pytest.raises(CustomException): + client.detect_intent(session, query_input) + + def test_streaming_detect_intent(self): + # Setup Expected Response + response_id = 'responseId1847552473' + expected_response = {'response_id': response_id} + expected_response = session_pb2.StreamingDetectIntentResponse( + **expected_response) + + # Mock the API response + channel = ChannelStub(responses=[iter([expected_response])]) + client = dialogflow_v2.SessionsClient(channel=channel) + + # Setup Request + session = 'session1984987798' + query_input = {} + request = {'session': session, 'query_input': query_input} + request = session_pb2.StreamingDetectIntentRequest(**request) + requests = [request] + + response = client.streaming_detect_intent(requests) + resources = list(response) + assert len(resources) == 1 + assert expected_response == resources[0] + + assert len(channel.requests) == 1 + actual_requests = channel.requests[0][1] + assert len(actual_requests) == 1 + actual_request = list(actual_requests)[0] + assert request == actual_request + + def test_streaming_detect_intent_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + client = dialogflow_v2.SessionsClient(channel=channel) + + # Setup request + session = 'session1984987798' + query_input = {} + request = {'session': session, 'query_input': query_input} + + request = session_pb2.StreamingDetectIntentRequest(**request) + requests = [request] + + with pytest.raises(CustomException): + client.streaming_detect_intent(requests) diff --git a/packages/google-cloud-dialogflow/tests/unit/test_versionless.py b/packages/google-cloud-dialogflow/tests/unit/test_versionless.py index 34624cb8c820..9932bc037488 100644 --- a/packages/google-cloud-dialogflow/tests/unit/test_versionless.py +++ b/packages/google-cloud-dialogflow/tests/unit/test_versionless.py @@ -13,7 +13,7 @@ # limitations under the License. import dialogflow -import dialogflow_v2beta1 +import dialogflow_v2 def test_versionless(): @@ -22,4 +22,4 @@ def test_versionless(): for key in dir(dialogflow): if key.startswith('_'): continue - assert getattr(dialogflow_v2beta1, key) is getattr(dialogflow, key) + assert getattr(dialogflow_v2, key) is getattr(dialogflow, key)