diff --git a/google/cloud/dialogflowcx/__init__.py b/google/cloud/dialogflowcx/__init__.py index a829256b..c622d0ba 100644 --- a/google/cloud/dialogflowcx/__init__.py +++ b/google/cloud/dialogflowcx/__init__.py @@ -167,6 +167,7 @@ from google.cloud.dialogflowcx_v3.types.flow import ExportFlowRequest from google.cloud.dialogflowcx_v3.types.flow import ExportFlowResponse from google.cloud.dialogflowcx_v3.types.flow import Flow +from google.cloud.dialogflowcx_v3.types.flow import FlowImportStrategy from google.cloud.dialogflowcx_v3.types.flow import FlowValidationResult from google.cloud.dialogflowcx_v3.types.flow import GetFlowRequest from google.cloud.dialogflowcx_v3.types.flow import GetFlowValidationResultRequest @@ -180,6 +181,7 @@ from google.cloud.dialogflowcx_v3.types.flow import ValidateFlowRequest from google.cloud.dialogflowcx_v3.types.fulfillment import Fulfillment from google.cloud.dialogflowcx_v3.types.gcs import GcsDestination +from google.cloud.dialogflowcx_v3.types.import_strategy import ImportStrategy from google.cloud.dialogflowcx_v3.types.intent import CreateIntentRequest from google.cloud.dialogflowcx_v3.types.intent import DeleteIntentRequest from google.cloud.dialogflowcx_v3.types.intent import GetIntentRequest @@ -446,6 +448,7 @@ "ExportFlowRequest", "ExportFlowResponse", "Flow", + "FlowImportStrategy", "FlowValidationResult", "GetFlowRequest", "GetFlowValidationResultRequest", @@ -459,6 +462,7 @@ "ValidateFlowRequest", "Fulfillment", "GcsDestination", + "ImportStrategy", "CreateIntentRequest", "DeleteIntentRequest", "GetIntentRequest", diff --git a/google/cloud/dialogflowcx_v3/__init__.py b/google/cloud/dialogflowcx_v3/__init__.py index 27e213bd..f2d54b1d 100644 --- a/google/cloud/dialogflowcx_v3/__init__.py +++ b/google/cloud/dialogflowcx_v3/__init__.py @@ -127,6 +127,7 @@ from .types.flow import ExportFlowRequest from .types.flow import ExportFlowResponse from .types.flow import Flow +from .types.flow import FlowImportStrategy from .types.flow import FlowValidationResult from .types.flow import GetFlowRequest from .types.flow import GetFlowValidationResultRequest @@ -140,6 +141,7 @@ from .types.flow import ValidateFlowRequest from .types.fulfillment import Fulfillment from .types.gcs import GcsDestination +from .types.import_strategy import ImportStrategy from .types.intent import CreateIntentRequest from .types.intent import DeleteIntentRequest from .types.intent import GetIntentRequest @@ -345,6 +347,7 @@ "ExportTestCasesRequest", "ExportTestCasesResponse", "Flow", + "FlowImportStrategy", "FlowValidationResult", "FlowsClient", "Form", @@ -372,6 +375,7 @@ "GetWebhookRequest", "ImportFlowRequest", "ImportFlowResponse", + "ImportStrategy", "ImportTestCasesMetadata", "ImportTestCasesRequest", "ImportTestCasesResponse", diff --git a/google/cloud/dialogflowcx_v3/services/agents/async_client.py b/google/cloud/dialogflowcx_v3/services/agents/async_client.py index 0b4b9d0b..ba078806 100644 --- a/google/cloud/dialogflowcx_v3/services/agents/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/agents/async_client.py @@ -417,7 +417,8 @@ async def sample_get_agent(): [Flows][google.cloud.dialogflow.cx.v3.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3.Fulfillment], [Webhooks][google.cloud.dialogflow.cx.v3.Webhook], - and so on to manage the conversation flows.. + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] + and so on to manage the conversation flows. """ # Create or coerce a protobuf request object. @@ -547,7 +548,8 @@ async def sample_create_agent(): [Flows][google.cloud.dialogflow.cx.v3.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3.Fulfillment], [Webhooks][google.cloud.dialogflow.cx.v3.Webhook], - and so on to manage the conversation flows.. + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] + and so on to manage the conversation flows. """ # Create or coerce a protobuf request object. @@ -688,7 +690,8 @@ async def sample_update_agent(): [Flows][google.cloud.dialogflow.cx.v3.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3.Fulfillment], [Webhooks][google.cloud.dialogflow.cx.v3.Webhook], - and so on to manage the conversation flows.. + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] + and so on to manage the conversation flows. """ # Create or coerce a protobuf request object. diff --git a/google/cloud/dialogflowcx_v3/services/agents/client.py b/google/cloud/dialogflowcx_v3/services/agents/client.py index ca05e036..de412c5a 100644 --- a/google/cloud/dialogflowcx_v3/services/agents/client.py +++ b/google/cloud/dialogflowcx_v3/services/agents/client.py @@ -752,7 +752,8 @@ def sample_get_agent(): [Flows][google.cloud.dialogflow.cx.v3.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3.Fulfillment], [Webhooks][google.cloud.dialogflow.cx.v3.Webhook], - and so on to manage the conversation flows.. + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] + and so on to manage the conversation flows. """ # Create or coerce a protobuf request object. @@ -882,7 +883,8 @@ def sample_create_agent(): [Flows][google.cloud.dialogflow.cx.v3.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3.Fulfillment], [Webhooks][google.cloud.dialogflow.cx.v3.Webhook], - and so on to manage the conversation flows.. + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] + and so on to manage the conversation flows. """ # Create or coerce a protobuf request object. @@ -1014,7 +1016,8 @@ def sample_update_agent(): [Flows][google.cloud.dialogflow.cx.v3.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3.Fulfillment], [Webhooks][google.cloud.dialogflow.cx.v3.Webhook], - and so on to manage the conversation flows.. + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] + and so on to manage the conversation flows. """ # Create or coerce a protobuf request object. diff --git a/google/cloud/dialogflowcx_v3/services/agents/transports/rest.py b/google/cloud/dialogflowcx_v3/services/agents/transports/rest.py index 644b4d4e..b6602823 100644 --- a/google/cloud/dialogflowcx_v3/services/agents/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/agents/transports/rest.py @@ -640,8 +640,9 @@ def __call__( Types][google.cloud.dialogflow.cx.v3.EntityType], [Flows][google.cloud.dialogflow.cx.v3.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3.Fulfillment], - [Webhooks][google.cloud.dialogflow.cx.v3.Webhook], and - so on to manage the conversation flows.. + [Webhooks][google.cloud.dialogflow.cx.v3.Webhook], + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] + and so on to manage the conversation flows. """ @@ -921,8 +922,9 @@ def __call__( Types][google.cloud.dialogflow.cx.v3.EntityType], [Flows][google.cloud.dialogflow.cx.v3.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3.Fulfillment], - [Webhooks][google.cloud.dialogflow.cx.v3.Webhook], and - so on to manage the conversation flows.. + [Webhooks][google.cloud.dialogflow.cx.v3.Webhook], + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] + and so on to manage the conversation flows. """ @@ -1299,8 +1301,9 @@ def __call__( Types][google.cloud.dialogflow.cx.v3.EntityType], [Flows][google.cloud.dialogflow.cx.v3.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3.Fulfillment], - [Webhooks][google.cloud.dialogflow.cx.v3.Webhook], and - so on to manage the conversation flows.. + [Webhooks][google.cloud.dialogflow.cx.v3.Webhook], + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] + and so on to manage the conversation flows. """ diff --git a/google/cloud/dialogflowcx_v3/services/transition_route_groups/async_client.py b/google/cloud/dialogflowcx_v3/services/transition_route_groups/async_client.py index 7b73703b..c9712d7e 100644 --- a/google/cloud/dialogflowcx_v3/services/transition_route_groups/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/transition_route_groups/async_client.py @@ -285,7 +285,8 @@ async def sample_list_transition_route_groups(): parent (:class:`str`): Required. The flow to list all transition route groups for. Format: - ``projects//locations//agents//flows/``. + ``projects//locations//agents//flows/`` + or \`projects//locations//agents/. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -404,7 +405,9 @@ async def sample_get_transition_route_group(): Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. Format: - ``projects//locations//agents//flows//transitionRouteGroups/``. + ``projects//locations//agents//flows//transitionRouteGroups/`` + or + ``projects//locations//agents//transitionRouteGroups/``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -417,7 +420,7 @@ async def sample_get_transition_route_group(): Returns: google.cloud.dialogflowcx_v3.types.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [TransitionRoutes][google.cloud.dialogflow.cx.v3.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3.Page]. @@ -525,7 +528,10 @@ async def sample_create_transition_route_group(): Required. The flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] for. Format: - ``projects//locations//agents//flows/``. + ``projects//locations//agents//flows/`` + or + ``projects//locations//agents/`` + for agent-level groups. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -545,7 +551,7 @@ async def sample_create_transition_route_group(): Returns: google.cloud.dialogflowcx_v3.types.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [TransitionRoutes][google.cloud.dialogflow.cx.v3.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3.Page]. @@ -671,7 +677,7 @@ async def sample_update_transition_route_group(): Returns: google.cloud.dialogflowcx_v3.types.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [TransitionRoutes][google.cloud.dialogflow.cx.v3.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3.Page]. @@ -772,7 +778,9 @@ async def sample_delete_transition_route_group(): Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] to delete. Format: - ``projects//locations//agents//flows//transitionRouteGroups/``. + ``projects//locations//agents//flows//transitionRouteGroups/`` + or + ``projects//locations//agents//transitionRouteGroups/``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/google/cloud/dialogflowcx_v3/services/transition_route_groups/client.py b/google/cloud/dialogflowcx_v3/services/transition_route_groups/client.py index 57ff357c..c53d35a0 100644 --- a/google/cloud/dialogflowcx_v3/services/transition_route_groups/client.py +++ b/google/cloud/dialogflowcx_v3/services/transition_route_groups/client.py @@ -601,7 +601,8 @@ def sample_list_transition_route_groups(): parent (str): Required. The flow to list all transition route groups for. Format: - ``projects//locations//agents//flows/``. + ``projects//locations//agents//flows/`` + or \`projects//locations//agents/. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -724,7 +725,9 @@ def sample_get_transition_route_group(): Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. Format: - ``projects//locations//agents//flows//transitionRouteGroups/``. + ``projects//locations//agents//flows//transitionRouteGroups/`` + or + ``projects//locations//agents//transitionRouteGroups/``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -737,7 +740,7 @@ def sample_get_transition_route_group(): Returns: google.cloud.dialogflowcx_v3.types.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [TransitionRoutes][google.cloud.dialogflow.cx.v3.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3.Page]. @@ -849,7 +852,10 @@ def sample_create_transition_route_group(): Required. The flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] for. Format: - ``projects//locations//agents//flows/``. + ``projects//locations//agents//flows/`` + or + ``projects//locations//agents/`` + for agent-level groups. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -869,7 +875,7 @@ def sample_create_transition_route_group(): Returns: google.cloud.dialogflowcx_v3.types.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [TransitionRoutes][google.cloud.dialogflow.cx.v3.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3.Page]. @@ -1001,7 +1007,7 @@ def sample_update_transition_route_group(): Returns: google.cloud.dialogflowcx_v3.types.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [TransitionRoutes][google.cloud.dialogflow.cx.v3.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3.Page]. @@ -1108,7 +1114,9 @@ def sample_delete_transition_route_group(): Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] to delete. Format: - ``projects//locations//agents//flows//transitionRouteGroups/``. + ``projects//locations//agents//flows//transitionRouteGroups/`` + or + ``projects//locations//agents//transitionRouteGroups/``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/rest.py b/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/rest.py index 6d58d14f..17592dbf 100644 --- a/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/rest.py +++ b/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/rest.py @@ -483,7 +483,7 @@ def __call__( Returns: ~.gcdc_transition_route_group.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [``TransitionRoutes``][google.cloud.dialogflow.cx.v3.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3.Page]. @@ -496,6 +496,11 @@ def __call__( "uri": "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups", "body": "transition_route_group", }, + { + "method": "post", + "uri": "/v3/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups", + "body": "transition_route_group", + }, ] request, metadata = self._interceptor.pre_create_transition_route_group( request, metadata @@ -594,6 +599,10 @@ def __call__( "method": "delete", "uri": "/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", }, + { + "method": "delete", + "uri": "/v3/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}", + }, ] request, metadata = self._interceptor.pre_delete_transition_route_group( request, metadata @@ -670,7 +679,7 @@ def __call__( Returns: ~.transition_route_group.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [``TransitionRoutes``][google.cloud.dialogflow.cx.v3.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3.Page]. @@ -682,6 +691,10 @@ def __call__( "method": "get", "uri": "/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", }, + { + "method": "get", + "uri": "/v3/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}", + }, ] request, metadata = self._interceptor.pre_get_transition_route_group( request, metadata @@ -776,6 +789,10 @@ def __call__( "method": "get", "uri": "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups", }, + { + "method": "get", + "uri": "/v3/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups", + }, ] request, metadata = self._interceptor.pre_list_transition_route_groups( request, metadata @@ -860,7 +877,7 @@ def __call__( Returns: ~.gcdc_transition_route_group.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [``TransitionRoutes``][google.cloud.dialogflow.cx.v3.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3.Page]. @@ -873,6 +890,11 @@ def __call__( "uri": "/v3/{transition_route_group.name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", "body": "transition_route_group", }, + { + "method": "patch", + "uri": "/v3/{transition_route_group.name=projects/*/locations/*/agents/*/transitionRouteGroups/*}", + "body": "transition_route_group", + }, ] request, metadata = self._interceptor.pre_update_transition_route_group( request, metadata diff --git a/google/cloud/dialogflowcx_v3/types/__init__.py b/google/cloud/dialogflowcx_v3/types/__init__.py index 108b7534..4a6bbcd2 100644 --- a/google/cloud/dialogflowcx_v3/types/__init__.py +++ b/google/cloud/dialogflowcx_v3/types/__init__.py @@ -106,6 +106,7 @@ ExportFlowRequest, ExportFlowResponse, Flow, + FlowImportStrategy, FlowValidationResult, GetFlowRequest, GetFlowValidationResultRequest, @@ -342,6 +343,7 @@ "ExportFlowRequest", "ExportFlowResponse", "Flow", + "FlowImportStrategy", "FlowValidationResult", "GetFlowRequest", "GetFlowValidationResultRequest", @@ -355,6 +357,7 @@ "ValidateFlowRequest", "Fulfillment", "GcsDestination", + "ImportStrategy", "CreateIntentRequest", "DeleteIntentRequest", "GetIntentRequest", diff --git a/google/cloud/dialogflowcx_v3/types/agent.py b/google/cloud/dialogflowcx_v3/types/agent.py index 82801e86..bbee8d20 100644 --- a/google/cloud/dialogflowcx_v3/types/agent.py +++ b/google/cloud/dialogflowcx_v3/types/agent.py @@ -74,8 +74,9 @@ class Agent(proto.Message): Types][google.cloud.dialogflow.cx.v3.EntityType], [Flows][google.cloud.dialogflow.cx.v3.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3.Fulfillment], - [Webhooks][google.cloud.dialogflow.cx.v3.Webhook], and so on to - manage the conversation flows.. + [Webhooks][google.cloud.dialogflow.cx.v3.Webhook], + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] + and so on to manage the conversation flows. Attributes: name (str): @@ -173,8 +174,8 @@ class GithubSettings(proto.Message): The GitHub repository URI related to the agent. tracking_branch (str): - The branch of GitHub repository tracked for - this agent. + The branch of the GitHub repository tracked + for this agent. access_token (str): The access token used to authenticate the access to the GitHub repository. @@ -545,7 +546,7 @@ class ExportAgentResponse(proto.Message): This field is a member of `oneof`_ ``agent``. commit_sha (str): Commit SHA of the git push. This field is populated if - ``git_destination`` are specified in + ``git_destination`` is specified in [ExportAgentRequest][google.cloud.dialogflow.cx.v3.ExportAgentRequest]. This field is a member of `oneof`_ ``agent``. diff --git a/google/cloud/dialogflowcx_v3/types/flow.py b/google/cloud/dialogflowcx_v3/types/flow.py index 1c46ed9c..372913ad 100644 --- a/google/cloud/dialogflowcx_v3/types/flow.py +++ b/google/cloud/dialogflowcx_v3/types/flow.py @@ -19,6 +19,7 @@ import proto # type: ignore +from google.cloud.dialogflowcx_v3.types import import_strategy from google.cloud.dialogflowcx_v3.types import page from google.cloud.dialogflowcx_v3.types import validation_message from google.protobuf import field_mask_pb2 # type: ignore @@ -41,6 +42,7 @@ "GetFlowValidationResultRequest", "FlowValidationResult", "ImportFlowRequest", + "FlowImportStrategy", "ImportFlowResponse", "ExportFlowRequest", "ExportFlowResponse", @@ -193,7 +195,10 @@ class Flow(proto.Message): groups defined in the page have higher priority than those defined in the flow. - Format:\ ``projects//locations//agents//flows//transitionRouteGroups/``. + Format:\ ``projects//locations//agents//flows//transitionRouteGroups/`` + or + ``projects//locations//agents//transitionRouteGroups/`` + for agent-level groups. nlu_settings (google.cloud.dialogflowcx_v3.types.NluSettings): NLU related settings of the flow. """ @@ -584,6 +589,9 @@ class ImportFlowRequest(proto.Message): This field is a member of `oneof`_ ``flow``. import_option (google.cloud.dialogflowcx_v3.types.ImportFlowRequest.ImportOption): Flow import mode. If not specified, ``KEEP`` is assumed. + flow_import_strategy (google.cloud.dialogflowcx_v3.types.FlowImportStrategy): + Optional. Specifies the import strategy used + when resolving resource conflicts. """ class ImportOption(proto.Enum): @@ -626,6 +634,31 @@ class ImportOption(proto.Enum): number=4, enum=ImportOption, ) + flow_import_strategy: "FlowImportStrategy" = proto.Field( + proto.MESSAGE, + number=5, + message="FlowImportStrategy", + ) + + +class FlowImportStrategy(proto.Message): + r"""The flow import strategy used for resource conflict resolution + associated with an + [ImportFlowRequest][google.cloud.dialogflow.cx.v3.ImportFlowRequest]. + + Attributes: + global_import_strategy (google.cloud.dialogflowcx_v3.types.ImportStrategy): + Optional. Import strategy for resource conflict resolution, + applied globally throughout the flow. It will be applied for + all display name conflicts in the imported content. If not + specified, 'CREATE_NEW' is assumed. + """ + + global_import_strategy: import_strategy.ImportStrategy = proto.Field( + proto.ENUM, + number=1, + enum=import_strategy.ImportStrategy, + ) class ImportFlowResponse(proto.Message): diff --git a/google/cloud/dialogflowcx_v3/types/import_strategy.py b/google/cloud/dialogflowcx_v3/types/import_strategy.py new file mode 100644 index 00000000..6732226a --- /dev/null +++ b/google/cloud/dialogflowcx_v3/types/import_strategy.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 +# +# http://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 annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + + +__protobuf__ = proto.module( + package="google.cloud.dialogflow.cx.v3", + manifest={ + "ImportStrategy", + }, +) + + +class ImportStrategy(proto.Enum): + r"""Import strategies for the conflict resolution of resources + (i.e. intents, entities, and webhooks) with identical display + names during import operations. + + Values: + IMPORT_STRATEGY_UNSPECIFIED (0): + Unspecified. Treated as 'CREATE_NEW'. + IMPORT_STRATEGY_CREATE_NEW (1): + Create a new resource with a numeric suffix + appended to the end of the existing display + name. + IMPORT_STRATEGY_REPLACE (2): + Replace existing resource with incoming + resource in the content to be imported. + IMPORT_STRATEGY_KEEP (3): + Keep existing resource and discard incoming + resource in the content to be imported. + IMPORT_STRATEGY_MERGE (4): + Combine existing and incoming resources when + a conflict is encountered. + IMPORT_STRATEGY_THROW_ERROR (5): + Throw error if a conflict is encountered. + """ + IMPORT_STRATEGY_UNSPECIFIED = 0 + IMPORT_STRATEGY_CREATE_NEW = 1 + IMPORT_STRATEGY_REPLACE = 2 + IMPORT_STRATEGY_KEEP = 3 + IMPORT_STRATEGY_MERGE = 4 + IMPORT_STRATEGY_THROW_ERROR = 5 + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/dialogflowcx_v3/types/page.py b/google/cloud/dialogflowcx_v3/types/page.py index 20bfab7b..522967a3 100644 --- a/google/cloud/dialogflowcx_v3/types/page.py +++ b/google/cloud/dialogflowcx_v3/types/page.py @@ -94,7 +94,10 @@ class Page(proto.Message): the same intent, then the first group in the ordered list takes precedence. - Format:\ ``projects//locations//agents//flows//transitionRouteGroups/``. + Format:\ ``projects//locations//agents//flows//transitionRouteGroups/`` + or + ``projects//locations//agents//transitionRouteGroups/`` + for agent-level groups. transition_routes (MutableSequence[google.cloud.dialogflowcx_v3.types.TransitionRoute]): A list of transitions for the transition rules of this page. They route the conversation to another page in the same diff --git a/google/cloud/dialogflowcx_v3/types/response_message.py b/google/cloud/dialogflowcx_v3/types/response_message.py index 4dc1de1b..9505fb7a 100644 --- a/google/cloud/dialogflowcx_v3/types/response_message.py +++ b/google/cloud/dialogflowcx_v3/types/response_message.py @@ -118,6 +118,8 @@ class ResponseMessage(proto.Message): third-party endpoint. This field is a member of `oneof`_ ``message``. + response_type (google.cloud.dialogflowcx_v3.types.ResponseMessage.ResponseType): + Response type. channel (str): The channel which the response is associated with. Clients can specify the channel via @@ -125,6 +127,31 @@ class ResponseMessage(proto.Message): and only associated channel response will be returned. """ + class ResponseType(proto.Enum): + r"""Represents different response types. + + Values: + RESPONSE_TYPE_UNSPECIFIED (0): + Not specified. + ENTRY_PROMPT (1): + The response is from an [entry + prompt][google.cloud.dialogflow.cx.v3.Page.entry_fulfillment] + in the page. + PARAMETER_PROMPT (2): + The response is from [form-filling + prompt][google.cloud.dialogflow.cx.v3.Form.Parameter.fill_behavior] + in the page. + HANDLER_PROMPT (3): + The response is from a [transition + route][google.cloud.dialogflow.cx.v3.TransitionRoute] or an + [event handler][EventHandler] in the page or flow or + transition route group. + """ + RESPONSE_TYPE_UNSPECIFIED = 0 + ENTRY_PROMPT = 1 + PARAMETER_PROMPT = 2 + HANDLER_PROMPT = 3 + class Text(proto.Message): r"""The text response message. @@ -427,6 +454,11 @@ class TelephonyTransferCall(proto.Message): oneof="message", message=TelephonyTransferCall, ) + response_type: ResponseType = proto.Field( + proto.ENUM, + number=4, + enum=ResponseType, + ) channel: str = proto.Field( proto.STRING, number=19, diff --git a/google/cloud/dialogflowcx_v3/types/session.py b/google/cloud/dialogflowcx_v3/types/session.py index b9bc3dfc..78d89c0d 100644 --- a/google/cloud/dialogflowcx_v3/types/session.py +++ b/google/cloud/dialogflowcx_v3/types/session.py @@ -848,14 +848,14 @@ class QueryParameters(proto.Message): class QueryInput(proto.Message): r"""Represents the query input. It can contain one of: - 1. A conversational query in the form of text. + 1. A conversational query in the form of text. - 2. An intent query that specifies which intent to trigger. - 3. Natural language speech audio to be processed. + 2. An intent query that specifies which intent to trigger. + 3. Natural language speech audio to be processed. - 4. An event to be triggered. + 4. An event to be triggered. - 5. DTMF digits to invoke an intent and fill in parameter value. + 5. DTMF digits to invoke an intent and fill in parameter value. This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. diff --git a/google/cloud/dialogflowcx_v3/types/transition_route_group.py b/google/cloud/dialogflowcx_v3/types/transition_route_group.py index 951aa699..d612a5e9 100644 --- a/google/cloud/dialogflowcx_v3/types/transition_route_group.py +++ b/google/cloud/dialogflowcx_v3/types/transition_route_group.py @@ -38,7 +38,7 @@ class TransitionRouteGroup(proto.Message): - r"""An TransitionRouteGroup represents a group of + r"""A TransitionRouteGroup represents a group of [``TransitionRoutes``][google.cloud.dialogflow.cx.v3.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3.Page]. @@ -47,7 +47,8 @@ class TransitionRouteGroup(proto.Message): The unique identifier of the transition route group. [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.CreateTransitionRouteGroup] populates the name automatically. Format: - ``projects//locations//agents//flows//transitionRouteGroups/``. + ``projects//locations//agents//flows//transitionRouteGroups/`` + . display_name (str): Required. The human-readable name of the transition route group, unique within the flow. @@ -81,7 +82,8 @@ class ListTransitionRouteGroupsRequest(proto.Message): parent (str): Required. The flow to list all transition route groups for. Format: - ``projects//locations//agents//flows/``. + ``projects//locations//agents//flows/`` + or \`projects//locations//agents/. page_size (int): The maximum number of items to return in a single page. By default 100 and at most 1000. @@ -165,7 +167,9 @@ class GetTransitionRouteGroupRequest(proto.Message): Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. Format: - ``projects//locations//agents//flows//transitionRouteGroups/``. + ``projects//locations//agents//flows//transitionRouteGroups/`` + or + ``projects//locations//agents//transitionRouteGroups/``. language_code (str): The language to retrieve the transition route group for. The following fields are language dependent: @@ -201,7 +205,10 @@ class CreateTransitionRouteGroupRequest(proto.Message): Required. The flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] for. Format: - ``projects//locations//agents//flows/``. + ``projects//locations//agents//flows/`` + or + ``projects//locations//agents/`` + for agent-level groups. transition_route_group (google.cloud.dialogflowcx_v3.types.TransitionRouteGroup): Required. The transition route group to create. @@ -287,7 +294,9 @@ class DeleteTransitionRouteGroupRequest(proto.Message): Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] to delete. Format: - ``projects//locations//agents//flows//transitionRouteGroups/``. + ``projects//locations//agents//flows//transitionRouteGroups/`` + or + ``projects//locations//agents//transitionRouteGroups/``. force (bool): This field has no effect for transition route group that no page is using. If the transition route group is referenced diff --git a/google/cloud/dialogflowcx_v3beta1/__init__.py b/google/cloud/dialogflowcx_v3beta1/__init__.py index 0a8b3cab..59b31204 100644 --- a/google/cloud/dialogflowcx_v3beta1/__init__.py +++ b/google/cloud/dialogflowcx_v3beta1/__init__.py @@ -127,6 +127,7 @@ from .types.flow import ExportFlowRequest from .types.flow import ExportFlowResponse from .types.flow import Flow +from .types.flow import FlowImportStrategy from .types.flow import FlowValidationResult from .types.flow import GetFlowRequest from .types.flow import GetFlowValidationResultRequest @@ -140,6 +141,7 @@ from .types.flow import ValidateFlowRequest from .types.fulfillment import Fulfillment from .types.gcs import GcsDestination +from .types.import_strategy import ImportStrategy from .types.intent import CreateIntentRequest from .types.intent import DeleteIntentRequest from .types.intent import GetIntentRequest @@ -345,6 +347,7 @@ "ExportTestCasesRequest", "ExportTestCasesResponse", "Flow", + "FlowImportStrategy", "FlowValidationResult", "FlowsClient", "Form", @@ -372,6 +375,7 @@ "GetWebhookRequest", "ImportFlowRequest", "ImportFlowResponse", + "ImportStrategy", "ImportTestCasesMetadata", "ImportTestCasesRequest", "ImportTestCasesResponse", diff --git a/google/cloud/dialogflowcx_v3beta1/services/agents/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/agents/async_client.py index 8281565e..f90df861 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/agents/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/agents/async_client.py @@ -419,7 +419,8 @@ async def sample_get_agent(): [Flows][google.cloud.dialogflow.cx.v3beta1.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3beta1.Fulfillment], [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook], - and so on to manage the conversation flows.. + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] + and so on to manage the conversation flows. """ # Create or coerce a protobuf request object. @@ -549,7 +550,8 @@ async def sample_create_agent(): [Flows][google.cloud.dialogflow.cx.v3beta1.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3beta1.Fulfillment], [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook], - and so on to manage the conversation flows.. + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] + and so on to manage the conversation flows. """ # Create or coerce a protobuf request object. @@ -690,7 +692,8 @@ async def sample_update_agent(): [Flows][google.cloud.dialogflow.cx.v3beta1.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3beta1.Fulfillment], [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook], - and so on to manage the conversation flows.. + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] + and so on to manage the conversation flows. """ # Create or coerce a protobuf request object. diff --git a/google/cloud/dialogflowcx_v3beta1/services/agents/client.py b/google/cloud/dialogflowcx_v3beta1/services/agents/client.py index 1d64d603..e2e9c624 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/agents/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/agents/client.py @@ -754,7 +754,8 @@ def sample_get_agent(): [Flows][google.cloud.dialogflow.cx.v3beta1.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3beta1.Fulfillment], [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook], - and so on to manage the conversation flows.. + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] + and so on to manage the conversation flows. """ # Create or coerce a protobuf request object. @@ -884,7 +885,8 @@ def sample_create_agent(): [Flows][google.cloud.dialogflow.cx.v3beta1.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3beta1.Fulfillment], [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook], - and so on to manage the conversation flows.. + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] + and so on to manage the conversation flows. """ # Create or coerce a protobuf request object. @@ -1016,7 +1018,8 @@ def sample_update_agent(): [Flows][google.cloud.dialogflow.cx.v3beta1.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3beta1.Fulfillment], [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook], - and so on to manage the conversation flows.. + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] + and so on to manage the conversation flows. """ # Create or coerce a protobuf request object. diff --git a/google/cloud/dialogflowcx_v3beta1/services/agents/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/agents/transports/rest.py index 848a2124..5c893a5b 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/agents/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/agents/transports/rest.py @@ -643,7 +643,8 @@ def __call__( [Flows][google.cloud.dialogflow.cx.v3beta1.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3beta1.Fulfillment], [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook], - and so on to manage the conversation flows.. + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] + and so on to manage the conversation flows. """ @@ -925,7 +926,8 @@ def __call__( [Flows][google.cloud.dialogflow.cx.v3beta1.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3beta1.Fulfillment], [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook], - and so on to manage the conversation flows.. + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] + and so on to manage the conversation flows. """ @@ -1304,7 +1306,8 @@ def __call__( [Flows][google.cloud.dialogflow.cx.v3beta1.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3beta1.Fulfillment], [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook], - and so on to manage the conversation flows.. + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] + and so on to manage the conversation flows. """ diff --git a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/async_client.py index 89215b27..c504d6ff 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/async_client.py @@ -285,7 +285,8 @@ async def sample_list_transition_route_groups(): parent (:class:`str`): Required. The flow to list all transition route groups for. Format: - ``projects//locations//agents//flows/``. + ``projects//locations//agents//flows/`` + or \`projects//locations//agents/. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -404,7 +405,9 @@ async def sample_get_transition_route_group(): Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. Format: - ``projects//locations//agents//flows//transitionRouteGroups/``. + ``projects//locations//agents//flows//transitionRouteGroups/`` + or + ``projects//locations//agents//transitionRouteGroups/``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -417,7 +420,7 @@ async def sample_get_transition_route_group(): Returns: google.cloud.dialogflowcx_v3beta1.types.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [TransitionRoutes][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3beta1.Page]. @@ -525,7 +528,10 @@ async def sample_create_transition_route_group(): Required. The flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for. Format: - ``projects//locations//agents//flows/``. + ``projects//locations//agents//flows/`` + or + ``projects//locations//agents/`` + for agent-level groups. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -545,7 +551,7 @@ async def sample_create_transition_route_group(): Returns: google.cloud.dialogflowcx_v3beta1.types.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [TransitionRoutes][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3beta1.Page]. @@ -671,7 +677,7 @@ async def sample_update_transition_route_group(): Returns: google.cloud.dialogflowcx_v3beta1.types.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [TransitionRoutes][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3beta1.Page]. @@ -772,7 +778,9 @@ async def sample_delete_transition_route_group(): Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete. Format: - ``projects//locations//agents//flows//transitionRouteGroups/``. + ``projects//locations//agents//flows//transitionRouteGroups/`` + or + ``projects//locations//agents//transitionRouteGroups/``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/client.py b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/client.py index 5e81c12a..10e9cbc4 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/client.py @@ -601,7 +601,8 @@ def sample_list_transition_route_groups(): parent (str): Required. The flow to list all transition route groups for. Format: - ``projects//locations//agents//flows/``. + ``projects//locations//agents//flows/`` + or \`projects//locations//agents/. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -724,7 +725,9 @@ def sample_get_transition_route_group(): Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. Format: - ``projects//locations//agents//flows//transitionRouteGroups/``. + ``projects//locations//agents//flows//transitionRouteGroups/`` + or + ``projects//locations//agents//transitionRouteGroups/``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -737,7 +740,7 @@ def sample_get_transition_route_group(): Returns: google.cloud.dialogflowcx_v3beta1.types.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [TransitionRoutes][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3beta1.Page]. @@ -849,7 +852,10 @@ def sample_create_transition_route_group(): Required. The flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for. Format: - ``projects//locations//agents//flows/``. + ``projects//locations//agents//flows/`` + or + ``projects//locations//agents/`` + for agent-level groups. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -869,7 +875,7 @@ def sample_create_transition_route_group(): Returns: google.cloud.dialogflowcx_v3beta1.types.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [TransitionRoutes][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3beta1.Page]. @@ -1001,7 +1007,7 @@ def sample_update_transition_route_group(): Returns: google.cloud.dialogflowcx_v3beta1.types.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [TransitionRoutes][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3beta1.Page]. @@ -1108,7 +1114,9 @@ def sample_delete_transition_route_group(): Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete. Format: - ``projects//locations//agents//flows//transitionRouteGroups/``. + ``projects//locations//agents//flows//transitionRouteGroups/`` + or + ``projects//locations//agents//transitionRouteGroups/``. This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/rest.py b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/rest.py index b0676c8d..4436ad8e 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/rest.py +++ b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/rest.py @@ -483,7 +483,7 @@ def __call__( Returns: ~.gcdc_transition_route_group.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [``TransitionRoutes``][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3beta1.Page]. @@ -496,6 +496,11 @@ def __call__( "uri": "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups", "body": "transition_route_group", }, + { + "method": "post", + "uri": "/v3beta1/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups", + "body": "transition_route_group", + }, ] request, metadata = self._interceptor.pre_create_transition_route_group( request, metadata @@ -594,6 +599,10 @@ def __call__( "method": "delete", "uri": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", }, + { + "method": "delete", + "uri": "/v3beta1/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}", + }, ] request, metadata = self._interceptor.pre_delete_transition_route_group( request, metadata @@ -670,7 +679,7 @@ def __call__( Returns: ~.transition_route_group.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [``TransitionRoutes``][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3beta1.Page]. @@ -682,6 +691,10 @@ def __call__( "method": "get", "uri": "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", }, + { + "method": "get", + "uri": "/v3beta1/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}", + }, ] request, metadata = self._interceptor.pre_get_transition_route_group( request, metadata @@ -776,6 +789,10 @@ def __call__( "method": "get", "uri": "/v3beta1/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups", }, + { + "method": "get", + "uri": "/v3beta1/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups", + }, ] request, metadata = self._interceptor.pre_list_transition_route_groups( request, metadata @@ -860,7 +877,7 @@ def __call__( Returns: ~.gcdc_transition_route_group.TransitionRouteGroup: - An TransitionRouteGroup represents a group of + A TransitionRouteGroup represents a group of [``TransitionRoutes``][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3beta1.Page]. @@ -873,6 +890,11 @@ def __call__( "uri": "/v3beta1/{transition_route_group.name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}", "body": "transition_route_group", }, + { + "method": "patch", + "uri": "/v3beta1/{transition_route_group.name=projects/*/locations/*/agents/*/transitionRouteGroups/*}", + "body": "transition_route_group", + }, ] request, metadata = self._interceptor.pre_update_transition_route_group( request, metadata diff --git a/google/cloud/dialogflowcx_v3beta1/types/__init__.py b/google/cloud/dialogflowcx_v3beta1/types/__init__.py index 108b7534..4a6bbcd2 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/__init__.py +++ b/google/cloud/dialogflowcx_v3beta1/types/__init__.py @@ -106,6 +106,7 @@ ExportFlowRequest, ExportFlowResponse, Flow, + FlowImportStrategy, FlowValidationResult, GetFlowRequest, GetFlowValidationResultRequest, @@ -342,6 +343,7 @@ "ExportFlowRequest", "ExportFlowResponse", "Flow", + "FlowImportStrategy", "FlowValidationResult", "GetFlowRequest", "GetFlowValidationResultRequest", @@ -355,6 +357,7 @@ "ValidateFlowRequest", "Fulfillment", "GcsDestination", + "ImportStrategy", "CreateIntentRequest", "DeleteIntentRequest", "GetIntentRequest", diff --git a/google/cloud/dialogflowcx_v3beta1/types/agent.py b/google/cloud/dialogflowcx_v3beta1/types/agent.py index 96d63c93..61f187de 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/agent.py +++ b/google/cloud/dialogflowcx_v3beta1/types/agent.py @@ -74,8 +74,9 @@ class Agent(proto.Message): Types][google.cloud.dialogflow.cx.v3beta1.EntityType], [Flows][google.cloud.dialogflow.cx.v3beta1.Flow], [Fulfillments][google.cloud.dialogflow.cx.v3beta1.Fulfillment], - [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook], and so on to - manage the conversation flows.. + [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook], + [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] + and so on to manage the conversation flows. Attributes: name (str): diff --git a/google/cloud/dialogflowcx_v3beta1/types/flow.py b/google/cloud/dialogflowcx_v3beta1/types/flow.py index 629dd5da..22d5b0bb 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/flow.py +++ b/google/cloud/dialogflowcx_v3beta1/types/flow.py @@ -19,6 +19,7 @@ import proto # type: ignore +from google.cloud.dialogflowcx_v3beta1.types import import_strategy from google.cloud.dialogflowcx_v3beta1.types import page from google.cloud.dialogflowcx_v3beta1.types import validation_message from google.protobuf import field_mask_pb2 # type: ignore @@ -41,6 +42,7 @@ "GetFlowValidationResultRequest", "FlowValidationResult", "ImportFlowRequest", + "FlowImportStrategy", "ImportFlowResponse", "ExportFlowRequest", "ExportFlowResponse", @@ -193,7 +195,10 @@ class Flow(proto.Message): groups defined in the page have higher priority than those defined in the flow. - Format:\ ``projects//locations//agents//flows//transitionRouteGroups/``. + Format:\ ``projects//locations//agents//flows//transitionRouteGroups/`` + or + ``projects//locations//agents//transitionRouteGroups/`` + for agent-level groups. nlu_settings (google.cloud.dialogflowcx_v3beta1.types.NluSettings): NLU related settings of the flow. """ @@ -584,6 +589,9 @@ class ImportFlowRequest(proto.Message): This field is a member of `oneof`_ ``flow``. import_option (google.cloud.dialogflowcx_v3beta1.types.ImportFlowRequest.ImportOption): Flow import mode. If not specified, ``KEEP`` is assumed. + flow_import_strategy (google.cloud.dialogflowcx_v3beta1.types.FlowImportStrategy): + Optional. Specifies the import strategy used + when resolving resource conflicts. """ class ImportOption(proto.Enum): @@ -626,6 +634,32 @@ class ImportOption(proto.Enum): number=4, enum=ImportOption, ) + flow_import_strategy: "FlowImportStrategy" = proto.Field( + proto.MESSAGE, + number=5, + message="FlowImportStrategy", + ) + + +class FlowImportStrategy(proto.Message): + r"""The flow import strategy used for resource conflict resolution + associated with an + [ImportFlowRequest][google.cloud.dialogflow.cx.v3beta1.ImportFlowRequest]. + + Attributes: + global_import_strategy (google.cloud.dialogflowcx_v3beta1.types.ImportStrategy): + Optional. Global flow import strategy for resource conflict + resolution. The import Import strategy for resource conflict + resolution, applied globally throughout the flow. It will be + applied for all display name conflicts in the imported + content. If not specified, 'CREATE_NEW' is assumed. + """ + + global_import_strategy: import_strategy.ImportStrategy = proto.Field( + proto.ENUM, + number=1, + enum=import_strategy.ImportStrategy, + ) class ImportFlowResponse(proto.Message): diff --git a/google/cloud/dialogflowcx_v3beta1/types/import_strategy.py b/google/cloud/dialogflowcx_v3beta1/types/import_strategy.py new file mode 100644 index 00000000..911538b7 --- /dev/null +++ b/google/cloud/dialogflowcx_v3beta1/types/import_strategy.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +# Copyright 2023 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 +# +# http://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 annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + + +__protobuf__ = proto.module( + package="google.cloud.dialogflow.cx.v3beta1", + manifest={ + "ImportStrategy", + }, +) + + +class ImportStrategy(proto.Enum): + r"""Import strategies for the conflict resolution of resources + (i.e. intents, entities, and webhooks) with identical display + names during import operations. + + Values: + IMPORT_STRATEGY_UNSPECIFIED (0): + Unspecified. Treated as 'CREATE_NEW'. + IMPORT_STRATEGY_CREATE_NEW (1): + Create a new resource with a numeric suffix + appended to the end of the existing display + name. + IMPORT_STRATEGY_REPLACE (2): + Replace existing resource with incoming + resource in the content to be imported. + IMPORT_STRATEGY_KEEP (3): + Keep existing resource and discard incoming + resource in the content to be imported. + IMPORT_STRATEGY_MERGE (4): + Combine existing and incoming resources when + a conflict is encountered. + IMPORT_STRATEGY_THROW_ERROR (5): + Throw error if a conflict is encountered. + """ + IMPORT_STRATEGY_UNSPECIFIED = 0 + IMPORT_STRATEGY_CREATE_NEW = 1 + IMPORT_STRATEGY_REPLACE = 2 + IMPORT_STRATEGY_KEEP = 3 + IMPORT_STRATEGY_MERGE = 4 + IMPORT_STRATEGY_THROW_ERROR = 5 + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/dialogflowcx_v3beta1/types/page.py b/google/cloud/dialogflowcx_v3beta1/types/page.py index cc0e9ca1..646f3659 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/page.py +++ b/google/cloud/dialogflowcx_v3beta1/types/page.py @@ -94,7 +94,10 @@ class Page(proto.Message): the same intent, then the first group in the ordered list takes precedence. - Format:\ ``projects//locations//agents//flows//transitionRouteGroups/``. + Format:\ ``projects//locations//agents//flows//transitionRouteGroups/`` + or + ``projects//locations//agents//transitionRouteGroups/`` + for agent-level groups. transition_routes (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.TransitionRoute]): A list of transitions for the transition rules of this page. They route the conversation to another page in the same diff --git a/google/cloud/dialogflowcx_v3beta1/types/session.py b/google/cloud/dialogflowcx_v3beta1/types/session.py index 66ef6d9f..76c757f1 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/session.py +++ b/google/cloud/dialogflowcx_v3beta1/types/session.py @@ -848,14 +848,14 @@ class QueryParameters(proto.Message): class QueryInput(proto.Message): r"""Represents the query input. It can contain one of: - 1. A conversational query in the form of text. + 1. A conversational query in the form of text. - 2. An intent query that specifies which intent to trigger. - 3. Natural language speech audio to be processed. + 2. An intent query that specifies which intent to trigger. + 3. Natural language speech audio to be processed. - 4. An event to be triggered. + 4. An event to be triggered. - 5. DTMF digits to invoke an intent and fill in parameter value. + 5. DTMF digits to invoke an intent and fill in parameter value. This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. diff --git a/google/cloud/dialogflowcx_v3beta1/types/transition_route_group.py b/google/cloud/dialogflowcx_v3beta1/types/transition_route_group.py index 4d366a0a..22b949c9 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/transition_route_group.py +++ b/google/cloud/dialogflowcx_v3beta1/types/transition_route_group.py @@ -38,7 +38,7 @@ class TransitionRouteGroup(proto.Message): - r"""An TransitionRouteGroup represents a group of + r"""A TransitionRouteGroup represents a group of [``TransitionRoutes``][google.cloud.dialogflow.cx.v3beta1.TransitionRoute] to be used by a [Page][google.cloud.dialogflow.cx.v3beta1.Page]. @@ -47,7 +47,10 @@ class TransitionRouteGroup(proto.Message): The unique identifier of the transition route group. [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup] populates the name automatically. Format: - ``projects//locations//agents//flows//transitionRouteGroups/``. + ``projects//locations//agents//flows//transitionRouteGroups/`` + or + ``projects//locations//agents//transitionRouteGroups/`` + for agent-level groups. display_name (str): Required. The human-readable name of the transition route group, unique within the flow. @@ -81,7 +84,8 @@ class ListTransitionRouteGroupsRequest(proto.Message): parent (str): Required. The flow to list all transition route groups for. Format: - ``projects//locations//agents//flows/``. + ``projects//locations//agents//flows/`` + or \`projects//locations//agents/. page_size (int): The maximum number of items to return in a single page. By default 100 and at most 1000. @@ -165,7 +169,9 @@ class GetTransitionRouteGroupRequest(proto.Message): Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. Format: - ``projects//locations//agents//flows//transitionRouteGroups/``. + ``projects//locations//agents//flows//transitionRouteGroups/`` + or + ``projects//locations//agents//transitionRouteGroups/``. language_code (str): The language to retrieve the transition route group for. The following fields are language dependent: @@ -201,7 +207,10 @@ class CreateTransitionRouteGroupRequest(proto.Message): Required. The flow to create an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for. Format: - ``projects//locations//agents//flows/``. + ``projects//locations//agents//flows/`` + or + ``projects//locations//agents/`` + for agent-level groups. transition_route_group (google.cloud.dialogflowcx_v3beta1.types.TransitionRouteGroup): Required. The transition route group to create. @@ -287,7 +296,9 @@ class DeleteTransitionRouteGroupRequest(proto.Message): Required. The name of the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete. Format: - ``projects//locations//agents//flows//transitionRouteGroups/``. + ``projects//locations//agents//flows//transitionRouteGroups/`` + or + ``projects//locations//agents//transitionRouteGroups/``. force (bool): This field has no effect for transition route group that no page is using. If the transition route group is referenced diff --git a/google/cloud/dialogflowcx_v3beta1/types/webhook.py b/google/cloud/dialogflowcx_v3beta1/types/webhook.py index 3a03954c..92411979 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/webhook.py +++ b/google/cloud/dialogflowcx_v3beta1/types/webhook.py @@ -130,8 +130,8 @@ class GenericWebService(proto.Message): Optional. Maps the values extracted from specific fields of the flexible webhook response into session parameters. - - Key: session parameter name - - Value: field path in the webhook response + - Key: session parameter name + - Value: field path in the webhook response """ class WebhookType(proto.Enum): diff --git a/scripts/fixup_dialogflowcx_v3_keywords.py b/scripts/fixup_dialogflowcx_v3_keywords.py index d9b1f220..5b56952f 100644 --- a/scripts/fixup_dialogflowcx_v3_keywords.py +++ b/scripts/fixup_dialogflowcx_v3_keywords.py @@ -92,7 +92,7 @@ class dialogflowcxCallTransformer(cst.CSTTransformer): 'get_transition_route_group': ('name', 'language_code', ), 'get_version': ('name', ), 'get_webhook': ('name', ), - 'import_flow': ('parent', 'flow_uri', 'flow_content', 'import_option', ), + 'import_flow': ('parent', 'flow_uri', 'flow_content', 'import_option', 'flow_import_strategy', ), 'import_test_cases': ('parent', 'gcs_uri', 'content', ), 'list_agents': ('parent', 'page_size', 'page_token', ), 'list_changelogs': ('parent', 'filter', 'page_size', 'page_token', ), diff --git a/scripts/fixup_dialogflowcx_v3beta1_keywords.py b/scripts/fixup_dialogflowcx_v3beta1_keywords.py index d9b1f220..5b56952f 100644 --- a/scripts/fixup_dialogflowcx_v3beta1_keywords.py +++ b/scripts/fixup_dialogflowcx_v3beta1_keywords.py @@ -92,7 +92,7 @@ class dialogflowcxCallTransformer(cst.CSTTransformer): 'get_transition_route_group': ('name', 'language_code', ), 'get_version': ('name', ), 'get_webhook': ('name', ), - 'import_flow': ('parent', 'flow_uri', 'flow_content', 'import_option', ), + 'import_flow': ('parent', 'flow_uri', 'flow_content', 'import_option', 'flow_import_strategy', ), 'import_test_cases': ('parent', 'gcs_uri', 'content', ), 'list_agents': ('parent', 'page_size', 'page_token', ), 'list_changelogs': ('parent', 'filter', 'page_size', 'page_token', ), diff --git a/tests/unit/gapic/dialogflowcx_v3/test_flows.py b/tests/unit/gapic/dialogflowcx_v3/test_flows.py index 5e3b02e3..c5d3a6e4 100644 --- a/tests/unit/gapic/dialogflowcx_v3/test_flows.py +++ b/tests/unit/gapic/dialogflowcx_v3/test_flows.py @@ -55,6 +55,7 @@ from google.cloud.dialogflowcx_v3.types import flow from google.cloud.dialogflowcx_v3.types import flow as gcdc_flow from google.cloud.dialogflowcx_v3.types import fulfillment +from google.cloud.dialogflowcx_v3.types import import_strategy from google.cloud.dialogflowcx_v3.types import page from google.cloud.dialogflowcx_v3.types import response_message from google.cloud.dialogflowcx_v3.types import validation_message @@ -3026,6 +3027,7 @@ def test_create_flow_rest(request_type): "telephony_transfer_call": { "phone_number": "phone_number_value" }, + "response_type": 1, "channel": "channel_value", } ], @@ -3308,6 +3310,7 @@ def test_create_flow_rest_bad_request( "telephony_transfer_call": { "phone_number": "phone_number_value" }, + "response_type": 1, "channel": "channel_value", } ], @@ -4364,6 +4367,7 @@ def test_update_flow_rest(request_type): "telephony_transfer_call": { "phone_number": "phone_number_value" }, + "response_type": 1, "channel": "channel_value", } ], @@ -4650,6 +4654,7 @@ def test_update_flow_rest_bad_request( "telephony_transfer_call": { "phone_number": "phone_number_value" }, + "response_type": 1, "channel": "channel_value", } ], diff --git a/tests/unit/gapic/dialogflowcx_v3/test_pages.py b/tests/unit/gapic/dialogflowcx_v3/test_pages.py index 5869d13d..6f485429 100644 --- a/tests/unit/gapic/dialogflowcx_v3/test_pages.py +++ b/tests/unit/gapic/dialogflowcx_v3/test_pages.py @@ -2704,6 +2704,7 @@ def test_create_page_rest(request_type): ] }, "telephony_transfer_call": {"phone_number": "phone_number_value"}, + "response_type": 1, "channel": "channel_value", } ], @@ -2993,6 +2994,7 @@ def test_create_page_rest_bad_request( ] }, "telephony_transfer_call": {"phone_number": "phone_number_value"}, + "response_type": 1, "channel": "channel_value", } ], @@ -3195,6 +3197,7 @@ def test_update_page_rest(request_type): ] }, "telephony_transfer_call": {"phone_number": "phone_number_value"}, + "response_type": 1, "channel": "channel_value", } ], @@ -3486,6 +3489,7 @@ def test_update_page_rest_bad_request( ] }, "telephony_transfer_call": {"phone_number": "phone_number_value"}, + "response_type": 1, "channel": "channel_value", } ], diff --git a/tests/unit/gapic/dialogflowcx_v3/test_test_cases.py b/tests/unit/gapic/dialogflowcx_v3/test_test_cases.py index f337fe7a..ee52327a 100644 --- a/tests/unit/gapic/dialogflowcx_v3/test_test_cases.py +++ b/tests/unit/gapic/dialogflowcx_v3/test_test_cases.py @@ -4567,6 +4567,7 @@ def test_create_test_case_rest(request_type): "telephony_transfer_call": { "phone_number": "phone_number_value" }, + "response_type": 1, "channel": "channel_value", } ], @@ -4964,6 +4965,7 @@ def test_create_test_case_rest_bad_request( "telephony_transfer_call": { "phone_number": "phone_number_value" }, + "response_type": 1, "channel": "channel_value", } ], @@ -5268,6 +5270,7 @@ def test_update_test_case_rest(request_type): "telephony_transfer_call": { "phone_number": "phone_number_value" }, + "response_type": 1, "channel": "channel_value", } ], @@ -5666,6 +5669,7 @@ def test_update_test_case_rest_bad_request( "telephony_transfer_call": { "phone_number": "phone_number_value" }, + "response_type": 1, "channel": "channel_value", } ], diff --git a/tests/unit/gapic/dialogflowcx_v3/test_transition_route_groups.py b/tests/unit/gapic/dialogflowcx_v3/test_transition_route_groups.py index 28dcdc89..30b6f755 100644 --- a/tests/unit/gapic/dialogflowcx_v3/test_transition_route_groups.py +++ b/tests/unit/gapic/dialogflowcx_v3/test_transition_route_groups.py @@ -2959,6 +2959,7 @@ def test_create_transition_route_group_rest(request_type): "telephony_transfer_call": { "phone_number": "phone_number_value" }, + "response_type": 1, "channel": "channel_value", } ], @@ -3239,6 +3240,7 @@ def test_create_transition_route_group_rest_bad_request( "telephony_transfer_call": { "phone_number": "phone_number_value" }, + "response_type": 1, "channel": "channel_value", } ], @@ -3421,6 +3423,7 @@ def test_update_transition_route_group_rest(request_type): "telephony_transfer_call": { "phone_number": "phone_number_value" }, + "response_type": 1, "channel": "channel_value", } ], @@ -3703,6 +3706,7 @@ def test_update_transition_route_group_rest_bad_request( "telephony_transfer_call": { "phone_number": "phone_number_value" }, + "response_type": 1, "channel": "channel_value", } ], diff --git a/tests/unit/gapic/dialogflowcx_v3beta1/test_flows.py b/tests/unit/gapic/dialogflowcx_v3beta1/test_flows.py index 0d7ff42f..a2f9b467 100644 --- a/tests/unit/gapic/dialogflowcx_v3beta1/test_flows.py +++ b/tests/unit/gapic/dialogflowcx_v3beta1/test_flows.py @@ -55,6 +55,7 @@ from google.cloud.dialogflowcx_v3beta1.types import flow from google.cloud.dialogflowcx_v3beta1.types import flow as gcdc_flow from google.cloud.dialogflowcx_v3beta1.types import fulfillment +from google.cloud.dialogflowcx_v3beta1.types import import_strategy from google.cloud.dialogflowcx_v3beta1.types import page from google.cloud.dialogflowcx_v3beta1.types import response_message from google.cloud.dialogflowcx_v3beta1.types import validation_message