diff --git a/packages/google-cloud-dialogflow/dialogflow-v2-py.tar.gz b/packages/google-cloud-dialogflow/dialogflow-v2-py.tar.gz new file mode 100644 index 000000000000..f3569ef7e582 Binary files /dev/null and b/packages/google-cloud-dialogflow/dialogflow-v2-py.tar.gz differ diff --git a/packages/google-cloud-dialogflow/docs/dialogflow_v2/conversation_datasets.rst b/packages/google-cloud-dialogflow/docs/dialogflow_v2/conversation_datasets.rst new file mode 100644 index 000000000000..d0510a1fcf77 --- /dev/null +++ b/packages/google-cloud-dialogflow/docs/dialogflow_v2/conversation_datasets.rst @@ -0,0 +1,10 @@ +ConversationDatasets +-------------------------------------- + +.. automodule:: google.cloud.dialogflow_v2.services.conversation_datasets + :members: + :inherited-members: + +.. automodule:: google.cloud.dialogflow_v2.services.conversation_datasets.pagers + :members: + :inherited-members: diff --git a/packages/google-cloud-dialogflow/docs/dialogflow_v2/conversation_models.rst b/packages/google-cloud-dialogflow/docs/dialogflow_v2/conversation_models.rst new file mode 100644 index 000000000000..2c15658418dc --- /dev/null +++ b/packages/google-cloud-dialogflow/docs/dialogflow_v2/conversation_models.rst @@ -0,0 +1,10 @@ +ConversationModels +------------------------------------ + +.. automodule:: google.cloud.dialogflow_v2.services.conversation_models + :members: + :inherited-members: + +.. automodule:: google.cloud.dialogflow_v2.services.conversation_models.pagers + :members: + :inherited-members: diff --git a/packages/google-cloud-dialogflow/docs/dialogflow_v2/services.rst b/packages/google-cloud-dialogflow/docs/dialogflow_v2/services.rst index 8bdbdfe4145e..c6039fcafb7b 100644 --- a/packages/google-cloud-dialogflow/docs/dialogflow_v2/services.rst +++ b/packages/google-cloud-dialogflow/docs/dialogflow_v2/services.rst @@ -6,6 +6,8 @@ Services for Google Cloud Dialogflow v2 API agents answer_records contexts + conversation_datasets + conversation_models conversation_profiles conversations documents diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow/__init__.py index 3e2be7a0c44d..5944f232c06d 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -26,6 +26,18 @@ from google.cloud.dialogflow_v2.services.contexts.async_client import ( ContextsAsyncClient, ) +from google.cloud.dialogflow_v2.services.conversation_datasets.client import ( + ConversationDatasetsClient, +) +from google.cloud.dialogflow_v2.services.conversation_datasets.async_client import ( + ConversationDatasetsAsyncClient, +) +from google.cloud.dialogflow_v2.services.conversation_models.client import ( + ConversationModelsClient, +) +from google.cloud.dialogflow_v2.services.conversation_models.async_client import ( + ConversationModelsAsyncClient, +) from google.cloud.dialogflow_v2.services.conversation_profiles.client import ( ConversationProfilesClient, ) @@ -126,8 +138,106 @@ from google.cloud.dialogflow_v2.types.conversation import ListConversationsResponse from google.cloud.dialogflow_v2.types.conversation import ListMessagesRequest from google.cloud.dialogflow_v2.types.conversation import ListMessagesResponse +from google.cloud.dialogflow_v2.types.conversation_dataset import ConversationDataset +from google.cloud.dialogflow_v2.types.conversation_dataset import ConversationInfo +from google.cloud.dialogflow_v2.types.conversation_dataset import ( + CreateConversationDatasetOperationMetadata, +) +from google.cloud.dialogflow_v2.types.conversation_dataset import ( + CreateConversationDatasetRequest, +) +from google.cloud.dialogflow_v2.types.conversation_dataset import ( + DeleteConversationDatasetOperationMetadata, +) +from google.cloud.dialogflow_v2.types.conversation_dataset import ( + DeleteConversationDatasetRequest, +) +from google.cloud.dialogflow_v2.types.conversation_dataset import ( + GetConversationDatasetRequest, +) +from google.cloud.dialogflow_v2.types.conversation_dataset import ( + ImportConversationDataOperationMetadata, +) +from google.cloud.dialogflow_v2.types.conversation_dataset import ( + ImportConversationDataOperationResponse, +) +from google.cloud.dialogflow_v2.types.conversation_dataset import ( + ImportConversationDataRequest, +) +from google.cloud.dialogflow_v2.types.conversation_dataset import InputConfig +from google.cloud.dialogflow_v2.types.conversation_dataset import ( + ListConversationDatasetsRequest, +) +from google.cloud.dialogflow_v2.types.conversation_dataset import ( + ListConversationDatasetsResponse, +) from google.cloud.dialogflow_v2.types.conversation_event import ConversationEvent +from google.cloud.dialogflow_v2.types.conversation_model import ( + ArticleSuggestionModelMetadata, +) +from google.cloud.dialogflow_v2.types.conversation_model import ConversationModel +from google.cloud.dialogflow_v2.types.conversation_model import ( + ConversationModelEvaluation, +) +from google.cloud.dialogflow_v2.types.conversation_model import ( + CreateConversationModelEvaluationOperationMetadata, +) +from google.cloud.dialogflow_v2.types.conversation_model import ( + CreateConversationModelEvaluationRequest, +) +from google.cloud.dialogflow_v2.types.conversation_model import ( + CreateConversationModelOperationMetadata, +) +from google.cloud.dialogflow_v2.types.conversation_model import ( + CreateConversationModelRequest, +) +from google.cloud.dialogflow_v2.types.conversation_model import ( + DeleteConversationModelOperationMetadata, +) +from google.cloud.dialogflow_v2.types.conversation_model import ( + DeleteConversationModelRequest, +) +from google.cloud.dialogflow_v2.types.conversation_model import ( + DeployConversationModelOperationMetadata, +) +from google.cloud.dialogflow_v2.types.conversation_model import ( + DeployConversationModelRequest, +) +from google.cloud.dialogflow_v2.types.conversation_model import EvaluationConfig +from google.cloud.dialogflow_v2.types.conversation_model import ( + GetConversationModelEvaluationRequest, +) +from google.cloud.dialogflow_v2.types.conversation_model import ( + GetConversationModelRequest, +) +from google.cloud.dialogflow_v2.types.conversation_model import InputDataset +from google.cloud.dialogflow_v2.types.conversation_model import ( + ListConversationModelEvaluationsRequest, +) +from google.cloud.dialogflow_v2.types.conversation_model import ( + ListConversationModelEvaluationsResponse, +) +from google.cloud.dialogflow_v2.types.conversation_model import ( + ListConversationModelsRequest, +) +from google.cloud.dialogflow_v2.types.conversation_model import ( + ListConversationModelsResponse, +) +from google.cloud.dialogflow_v2.types.conversation_model import SmartReplyMetrics +from google.cloud.dialogflow_v2.types.conversation_model import SmartReplyModelMetadata +from google.cloud.dialogflow_v2.types.conversation_model import ( + UndeployConversationModelOperationMetadata, +) +from google.cloud.dialogflow_v2.types.conversation_model import ( + UndeployConversationModelRequest, +) from google.cloud.dialogflow_v2.types.conversation_profile import AutomatedAgentConfig +from google.cloud.dialogflow_v2.types.conversation_profile import ( + ClearSuggestionFeatureConfigOperationMetadata, +) +from google.cloud.dialogflow_v2.types.conversation_profile import ( + ClearSuggestionFeatureConfigRequest, +) from google.cloud.dialogflow_v2.types.conversation_profile import ConversationProfile from google.cloud.dialogflow_v2.types.conversation_profile import ( CreateConversationProfileRequest, @@ -152,6 +262,12 @@ ) from google.cloud.dialogflow_v2.types.conversation_profile import LoggingConfig from google.cloud.dialogflow_v2.types.conversation_profile import NotificationConfig +from google.cloud.dialogflow_v2.types.conversation_profile import ( + SetSuggestionFeatureConfigOperationMetadata, +) +from google.cloud.dialogflow_v2.types.conversation_profile import ( + SetSuggestionFeatureConfigRequest, +) from google.cloud.dialogflow_v2.types.conversation_profile import SuggestionFeature from google.cloud.dialogflow_v2.types.conversation_profile import ( UpdateConversationProfileRequest, @@ -160,6 +276,7 @@ from google.cloud.dialogflow_v2.types.document import DeleteDocumentRequest from google.cloud.dialogflow_v2.types.document import Document from google.cloud.dialogflow_v2.types.document import ExportDocumentRequest +from google.cloud.dialogflow_v2.types.document import ExportOperationMetadata from google.cloud.dialogflow_v2.types.document import GetDocumentRequest from google.cloud.dialogflow_v2.types.document import ImportDocumentsRequest from google.cloud.dialogflow_v2.types.document import ImportDocumentsResponse @@ -297,6 +414,10 @@ "AnswerRecordsAsyncClient", "ContextsClient", "ContextsAsyncClient", + "ConversationDatasetsClient", + "ConversationDatasetsAsyncClient", + "ConversationModelsClient", + "ConversationModelsAsyncClient", "ConversationProfilesClient", "ConversationProfilesAsyncClient", "ConversationsClient", @@ -368,8 +489,46 @@ "ListConversationsResponse", "ListMessagesRequest", "ListMessagesResponse", + "ConversationDataset", + "ConversationInfo", + "CreateConversationDatasetOperationMetadata", + "CreateConversationDatasetRequest", + "DeleteConversationDatasetOperationMetadata", + "DeleteConversationDatasetRequest", + "GetConversationDatasetRequest", + "ImportConversationDataOperationMetadata", + "ImportConversationDataOperationResponse", + "ImportConversationDataRequest", + "InputConfig", + "ListConversationDatasetsRequest", + "ListConversationDatasetsResponse", "ConversationEvent", + "ArticleSuggestionModelMetadata", + "ConversationModel", + "ConversationModelEvaluation", + "CreateConversationModelEvaluationOperationMetadata", + "CreateConversationModelEvaluationRequest", + "CreateConversationModelOperationMetadata", + "CreateConversationModelRequest", + "DeleteConversationModelOperationMetadata", + "DeleteConversationModelRequest", + "DeployConversationModelOperationMetadata", + "DeployConversationModelRequest", + "EvaluationConfig", + "GetConversationModelEvaluationRequest", + "GetConversationModelRequest", + "InputDataset", + "ListConversationModelEvaluationsRequest", + "ListConversationModelEvaluationsResponse", + "ListConversationModelsRequest", + "ListConversationModelsResponse", + "SmartReplyMetrics", + "SmartReplyModelMetadata", + "UndeployConversationModelOperationMetadata", + "UndeployConversationModelRequest", "AutomatedAgentConfig", + "ClearSuggestionFeatureConfigOperationMetadata", + "ClearSuggestionFeatureConfigRequest", "ConversationProfile", "CreateConversationProfileRequest", "DeleteConversationProfileRequest", @@ -380,12 +539,15 @@ "ListConversationProfilesResponse", "LoggingConfig", "NotificationConfig", + "SetSuggestionFeatureConfigOperationMetadata", + "SetSuggestionFeatureConfigRequest", "SuggestionFeature", "UpdateConversationProfileRequest", "CreateDocumentRequest", "DeleteDocumentRequest", "Document", "ExportDocumentRequest", + "ExportOperationMetadata", "GetDocumentRequest", "ImportDocumentsRequest", "ImportDocumentsResponse", diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/__init__.py index e436704ffc0a..83aab244baac 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,6 +20,10 @@ from .services.answer_records import AnswerRecordsAsyncClient from .services.contexts import ContextsClient from .services.contexts import ContextsAsyncClient +from .services.conversation_datasets import ConversationDatasetsClient +from .services.conversation_datasets import ConversationDatasetsAsyncClient +from .services.conversation_models import ConversationModelsClient +from .services.conversation_models import ConversationModelsAsyncClient from .services.conversation_profiles import ConversationProfilesClient from .services.conversation_profiles import ConversationProfilesAsyncClient from .services.conversations import ConversationsClient @@ -92,8 +96,46 @@ from .types.conversation import ListConversationsResponse from .types.conversation import ListMessagesRequest from .types.conversation import ListMessagesResponse +from .types.conversation_dataset import ConversationDataset +from .types.conversation_dataset import ConversationInfo +from .types.conversation_dataset import CreateConversationDatasetOperationMetadata +from .types.conversation_dataset import CreateConversationDatasetRequest +from .types.conversation_dataset import DeleteConversationDatasetOperationMetadata +from .types.conversation_dataset import DeleteConversationDatasetRequest +from .types.conversation_dataset import GetConversationDatasetRequest +from .types.conversation_dataset import ImportConversationDataOperationMetadata +from .types.conversation_dataset import ImportConversationDataOperationResponse +from .types.conversation_dataset import ImportConversationDataRequest +from .types.conversation_dataset import InputConfig +from .types.conversation_dataset import ListConversationDatasetsRequest +from .types.conversation_dataset import ListConversationDatasetsResponse from .types.conversation_event import ConversationEvent +from .types.conversation_model import ArticleSuggestionModelMetadata +from .types.conversation_model import ConversationModel +from .types.conversation_model import ConversationModelEvaluation +from .types.conversation_model import CreateConversationModelEvaluationOperationMetadata +from .types.conversation_model import CreateConversationModelEvaluationRequest +from .types.conversation_model import CreateConversationModelOperationMetadata +from .types.conversation_model import CreateConversationModelRequest +from .types.conversation_model import DeleteConversationModelOperationMetadata +from .types.conversation_model import DeleteConversationModelRequest +from .types.conversation_model import DeployConversationModelOperationMetadata +from .types.conversation_model import DeployConversationModelRequest +from .types.conversation_model import EvaluationConfig +from .types.conversation_model import GetConversationModelEvaluationRequest +from .types.conversation_model import GetConversationModelRequest +from .types.conversation_model import InputDataset +from .types.conversation_model import ListConversationModelEvaluationsRequest +from .types.conversation_model import ListConversationModelEvaluationsResponse +from .types.conversation_model import ListConversationModelsRequest +from .types.conversation_model import ListConversationModelsResponse +from .types.conversation_model import SmartReplyMetrics +from .types.conversation_model import SmartReplyModelMetadata +from .types.conversation_model import UndeployConversationModelOperationMetadata +from .types.conversation_model import UndeployConversationModelRequest from .types.conversation_profile import AutomatedAgentConfig +from .types.conversation_profile import ClearSuggestionFeatureConfigOperationMetadata +from .types.conversation_profile import ClearSuggestionFeatureConfigRequest from .types.conversation_profile import ConversationProfile from .types.conversation_profile import CreateConversationProfileRequest from .types.conversation_profile import DeleteConversationProfileRequest @@ -104,12 +146,15 @@ from .types.conversation_profile import ListConversationProfilesResponse from .types.conversation_profile import LoggingConfig from .types.conversation_profile import NotificationConfig +from .types.conversation_profile import SetSuggestionFeatureConfigOperationMetadata +from .types.conversation_profile import SetSuggestionFeatureConfigRequest from .types.conversation_profile import SuggestionFeature from .types.conversation_profile import UpdateConversationProfileRequest from .types.document import CreateDocumentRequest from .types.document import DeleteDocumentRequest from .types.document import Document from .types.document import ExportDocumentRequest +from .types.document import ExportOperationMetadata from .types.document import GetDocumentRequest from .types.document import ImportDocumentsRequest from .types.document import ImportDocumentsResponse @@ -230,6 +275,8 @@ "AgentsAsyncClient", "AnswerRecordsAsyncClient", "ContextsAsyncClient", + "ConversationDatasetsAsyncClient", + "ConversationModelsAsyncClient", "ConversationProfilesAsyncClient", "ConversationsAsyncClient", "DocumentsAsyncClient", @@ -253,6 +300,7 @@ "AnswerRecord", "AnswerRecordsClient", "ArticleAnswer", + "ArticleSuggestionModelMetadata", "AssistQueryParameters", "AudioEncoding", "AutomatedAgentConfig", @@ -266,16 +314,30 @@ "BatchUpdateEntityTypesResponse", "BatchUpdateIntentsRequest", "BatchUpdateIntentsResponse", + "ClearSuggestionFeatureConfigOperationMetadata", + "ClearSuggestionFeatureConfigRequest", "CompleteConversationRequest", "Context", "ContextsClient", "Conversation", + "ConversationDataset", + "ConversationDatasetsClient", "ConversationEvent", + "ConversationInfo", + "ConversationModel", + "ConversationModelEvaluation", + "ConversationModelsClient", "ConversationPhoneNumber", "ConversationProfile", "ConversationProfilesClient", "ConversationsClient", "CreateContextRequest", + "CreateConversationDatasetOperationMetadata", + "CreateConversationDatasetRequest", + "CreateConversationModelEvaluationOperationMetadata", + "CreateConversationModelEvaluationRequest", + "CreateConversationModelOperationMetadata", + "CreateConversationModelRequest", "CreateConversationProfileRequest", "CreateConversationRequest", "CreateDocumentRequest", @@ -289,6 +351,10 @@ "DeleteAgentRequest", "DeleteAllContextsRequest", "DeleteContextRequest", + "DeleteConversationDatasetOperationMetadata", + "DeleteConversationDatasetRequest", + "DeleteConversationModelOperationMetadata", + "DeleteConversationModelRequest", "DeleteConversationProfileRequest", "DeleteDocumentRequest", "DeleteEntityTypeRequest", @@ -297,6 +363,8 @@ "DeleteKnowledgeBaseRequest", "DeleteSessionEntityTypeRequest", "DeleteVersionRequest", + "DeployConversationModelOperationMetadata", + "DeployConversationModelRequest", "DetectIntentRequest", "DetectIntentResponse", "Document", @@ -308,10 +376,12 @@ "Environment", "EnvironmentHistory", "EnvironmentsClient", + "EvaluationConfig", "EventInput", "ExportAgentRequest", "ExportAgentResponse", "ExportDocumentRequest", + "ExportOperationMetadata", "FaqAnswer", "Fulfillment", "FulfillmentsClient", @@ -319,6 +389,9 @@ "GcsSources", "GetAgentRequest", "GetContextRequest", + "GetConversationDatasetRequest", + "GetConversationModelEvaluationRequest", + "GetConversationModelRequest", "GetConversationProfileRequest", "GetConversationRequest", "GetDocumentRequest", @@ -336,10 +409,15 @@ "HumanAgentAssistantEvent", "HumanAgentHandoffConfig", "ImportAgentRequest", + "ImportConversationDataOperationMetadata", + "ImportConversationDataOperationResponse", + "ImportConversationDataRequest", "ImportDocumentTemplate", "ImportDocumentsRequest", "ImportDocumentsResponse", "InputAudioConfig", + "InputConfig", + "InputDataset", "Intent", "IntentBatch", "IntentView", @@ -351,6 +429,12 @@ "ListAnswerRecordsResponse", "ListContextsRequest", "ListContextsResponse", + "ListConversationDatasetsRequest", + "ListConversationDatasetsResponse", + "ListConversationModelEvaluationsRequest", + "ListConversationModelEvaluationsResponse", + "ListConversationModelsRequest", + "ListConversationModelsResponse", "ListConversationProfilesRequest", "ListConversationProfilesResponse", "ListConversationsRequest", @@ -397,7 +481,11 @@ "SessionEntityTypesClient", "SessionsClient", "SetAgentRequest", + "SetSuggestionFeatureConfigOperationMetadata", + "SetSuggestionFeatureConfigRequest", "SmartReplyAnswer", + "SmartReplyMetrics", + "SmartReplyModelMetadata", "SpeechContext", "SpeechModelVariant", "SpeechToTextConfig", @@ -418,6 +506,8 @@ "TextInput", "TextToSpeechSettings", "TrainAgentRequest", + "UndeployConversationModelOperationMetadata", + "UndeployConversationModelRequest", "UpdateAnswerRecordRequest", "UpdateContextRequest", "UpdateConversationProfileRequest", diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/gapic_metadata.json b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/gapic_metadata.json index cfaea99dca5d..9112f71028b9 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/gapic_metadata.json +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/gapic_metadata.json @@ -217,11 +217,184 @@ } } }, + "ConversationDatasets": { + "clients": { + "grpc": { + "libraryClient": "ConversationDatasetsClient", + "rpcs": { + "CreateConversationDataset": { + "methods": [ + "create_conversation_dataset" + ] + }, + "DeleteConversationDataset": { + "methods": [ + "delete_conversation_dataset" + ] + }, + "GetConversationDataset": { + "methods": [ + "get_conversation_dataset" + ] + }, + "ImportConversationData": { + "methods": [ + "import_conversation_data" + ] + }, + "ListConversationDatasets": { + "methods": [ + "list_conversation_datasets" + ] + } + } + }, + "grpc-async": { + "libraryClient": "ConversationDatasetsAsyncClient", + "rpcs": { + "CreateConversationDataset": { + "methods": [ + "create_conversation_dataset" + ] + }, + "DeleteConversationDataset": { + "methods": [ + "delete_conversation_dataset" + ] + }, + "GetConversationDataset": { + "methods": [ + "get_conversation_dataset" + ] + }, + "ImportConversationData": { + "methods": [ + "import_conversation_data" + ] + }, + "ListConversationDatasets": { + "methods": [ + "list_conversation_datasets" + ] + } + } + } + } + }, + "ConversationModels": { + "clients": { + "grpc": { + "libraryClient": "ConversationModelsClient", + "rpcs": { + "CreateConversationModel": { + "methods": [ + "create_conversation_model" + ] + }, + "CreateConversationModelEvaluation": { + "methods": [ + "create_conversation_model_evaluation" + ] + }, + "DeleteConversationModel": { + "methods": [ + "delete_conversation_model" + ] + }, + "DeployConversationModel": { + "methods": [ + "deploy_conversation_model" + ] + }, + "GetConversationModel": { + "methods": [ + "get_conversation_model" + ] + }, + "GetConversationModelEvaluation": { + "methods": [ + "get_conversation_model_evaluation" + ] + }, + "ListConversationModelEvaluations": { + "methods": [ + "list_conversation_model_evaluations" + ] + }, + "ListConversationModels": { + "methods": [ + "list_conversation_models" + ] + }, + "UndeployConversationModel": { + "methods": [ + "undeploy_conversation_model" + ] + } + } + }, + "grpc-async": { + "libraryClient": "ConversationModelsAsyncClient", + "rpcs": { + "CreateConversationModel": { + "methods": [ + "create_conversation_model" + ] + }, + "CreateConversationModelEvaluation": { + "methods": [ + "create_conversation_model_evaluation" + ] + }, + "DeleteConversationModel": { + "methods": [ + "delete_conversation_model" + ] + }, + "DeployConversationModel": { + "methods": [ + "deploy_conversation_model" + ] + }, + "GetConversationModel": { + "methods": [ + "get_conversation_model" + ] + }, + "GetConversationModelEvaluation": { + "methods": [ + "get_conversation_model_evaluation" + ] + }, + "ListConversationModelEvaluations": { + "methods": [ + "list_conversation_model_evaluations" + ] + }, + "ListConversationModels": { + "methods": [ + "list_conversation_models" + ] + }, + "UndeployConversationModel": { + "methods": [ + "undeploy_conversation_model" + ] + } + } + } + } + }, "ConversationProfiles": { "clients": { "grpc": { "libraryClient": "ConversationProfilesClient", "rpcs": { + "ClearSuggestionFeatureConfig": { + "methods": [ + "clear_suggestion_feature_config" + ] + }, "CreateConversationProfile": { "methods": [ "create_conversation_profile" @@ -242,6 +415,11 @@ "list_conversation_profiles" ] }, + "SetSuggestionFeatureConfig": { + "methods": [ + "set_suggestion_feature_config" + ] + }, "UpdateConversationProfile": { "methods": [ "update_conversation_profile" @@ -252,6 +430,11 @@ "grpc-async": { "libraryClient": "ConversationProfilesAsyncClient", "rpcs": { + "ClearSuggestionFeatureConfig": { + "methods": [ + "clear_suggestion_feature_config" + ] + }, "CreateConversationProfile": { "methods": [ "create_conversation_profile" @@ -272,6 +455,11 @@ "list_conversation_profiles" ] }, + "SetSuggestionFeatureConfig": { + "methods": [ + "set_suggestion_feature_config" + ] + }, "UpdateConversationProfile": { "methods": [ "update_conversation_profile" diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/__init__.py index 4de65971c238..e8e1c3845db5 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/__init__.py index 0501fa947495..db2a1a7d2c0c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/async_client.py index 13bad140fd2e..3ef3510bbed1 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -209,7 +209,7 @@ async def get_agent( ) -> agent.Agent: r"""Retrieves the specified agent. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -313,7 +313,7 @@ async def set_agent( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -418,7 +418,7 @@ async def delete_agent( ) -> None: r"""Deletes the specified agent. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -505,7 +505,7 @@ async def search_agents( Sub-Collections `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -620,7 +620,7 @@ async def train_agent( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -746,7 +746,7 @@ async def export_agent( [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse] - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -881,7 +881,7 @@ async def import_agent( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1002,7 +1002,7 @@ async def restore_agent( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1099,7 +1099,7 @@ async def get_validation_result( automatically when training is completed. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/client.py index 5136fb32c05e..4e48b82d8721 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -409,8 +409,7 @@ def get_agent( ) -> agent.Agent: r"""Retrieves the specified agent. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -514,8 +513,7 @@ def set_agent( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -620,8 +618,7 @@ def delete_agent( ) -> None: r"""Deletes the specified agent. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -708,8 +705,7 @@ def search_agents( Sub-Collections `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -824,8 +820,7 @@ def train_agent( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -951,8 +946,7 @@ def export_agent( [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse] - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1087,8 +1081,7 @@ def import_agent( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1210,8 +1203,7 @@ def restore_agent( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1309,8 +1301,7 @@ def get_validation_result( automatically when training is completed. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/pagers.py index 8dbecf85bb63..9df41a693628 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/transports/__init__.py index ceadcd3aacb3..703a3046be7b 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/transports/base.py index e7727b244a94..43eee555b15b 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/transports/grpc.py index 21f5032e9286..06af394cf091 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/transports/grpc_asyncio.py index 7cd70d487a08..0ae691c36a20 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/agents/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/__init__.py index 25960120e18f..6fb08a96ff0a 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/async_client.py index 2120040c209c..6442728eb350 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -221,7 +221,7 @@ async def list_answer_records( specified project in reverse chronological order. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -324,7 +324,7 @@ async def update_answer_record( ) -> gcd_answer_record.AnswerRecord: r"""Updates the specified answer record. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/client.py index d1e1a04947f8..02050d6eee34 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -413,8 +413,7 @@ def list_answer_records( specified project in reverse chronological order. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -517,8 +516,7 @@ def update_answer_record( ) -> gcd_answer_record.AnswerRecord: r"""Updates the specified answer record. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/pagers.py index 7a92f17a1f8c..552c4822783f 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/transports/__init__.py index e97f4f57dadd..889c9420deb6 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/transports/base.py index 514a003e3413..1f0a7a18571e 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/transports/grpc.py index d1d55afdd608..638a9dd01fff 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/transports/grpc_asyncio.py index d2e087ffb814..78c0eedc6c34 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/__init__.py index 4c5791dcf005..4f3cbf86928e 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/async_client.py index b3ba8df35366..cd098a21e998 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -210,7 +210,7 @@ async def list_contexts( session. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -314,7 +314,7 @@ async def get_context( ) -> context.Context: r"""Retrieves the specified context. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -430,7 +430,7 @@ async def create_context( context. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -553,7 +553,7 @@ async def update_context( ) -> gcd_context.Context: r"""Updates the specified context. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -672,7 +672,7 @@ async def delete_context( ) -> None: r"""Deletes the specified context. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -757,7 +757,7 @@ async def delete_all_contexts( ) -> None: r"""Deletes all active contexts in the specified session. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/client.py index 25612ec6dacc..230e874dd343 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -413,8 +413,7 @@ def list_contexts( session. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -518,8 +517,7 @@ def get_context( ) -> context.Context: r"""Retrieves the specified context. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -635,8 +633,7 @@ def create_context( context. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -759,8 +756,7 @@ def update_context( ) -> gcd_context.Context: r"""Updates the specified context. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -879,8 +875,7 @@ def delete_context( ) -> None: r"""Deletes the specified context. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -965,8 +960,7 @@ def delete_all_contexts( ) -> None: r"""Deletes all active contexts in the specified session. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/pagers.py index a8c9d5cbcc3b..cc751bbdfef9 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/transports/__init__.py index d25eca3aaec7..412097665e34 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/transports/base.py index c2f65b08e489..c6317d90e172 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/transports/grpc.py index a9c91434a57a..a320d5242929 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/transports/grpc_asyncio.py index 2de42077077c..96be8e085eff 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/contexts/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/__init__.py new file mode 100644 index 000000000000..35817e2b2094 --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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 .client import ConversationDatasetsClient +from .async_client import ConversationDatasetsAsyncClient + +__all__ = ( + "ConversationDatasetsClient", + "ConversationDatasetsAsyncClient", +) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/async_client.py new file mode 100644 index 000000000000..f722d44f9ef2 --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/async_client.py @@ -0,0 +1,799 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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 collections import OrderedDict +import functools +import re +from typing import Dict, Optional, Sequence, Tuple, Type, Union +import pkg_resources + +from google.api_core.client_options import ClientOptions +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.auth import credentials as ga_credentials # type: ignore +from google.oauth2 import service_account # type: ignore + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object] # type: ignore + +from google.api_core import operation # type: ignore +from google.api_core import operation_async # type: ignore +from google.cloud.dialogflow_v2.services.conversation_datasets import pagers +from google.cloud.dialogflow_v2.types import conversation_dataset +from google.cloud.dialogflow_v2.types import ( + conversation_dataset as gcd_conversation_dataset, +) +from google.protobuf import empty_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore +from .transports.base import ConversationDatasetsTransport, DEFAULT_CLIENT_INFO +from .transports.grpc_asyncio import ConversationDatasetsGrpcAsyncIOTransport +from .client import ConversationDatasetsClient + + +class ConversationDatasetsAsyncClient: + """Conversation datasets. + Conversation datasets contain raw conversation files and their + customizable metadata that can be used for model training. + """ + + _client: ConversationDatasetsClient + + DEFAULT_ENDPOINT = ConversationDatasetsClient.DEFAULT_ENDPOINT + DEFAULT_MTLS_ENDPOINT = ConversationDatasetsClient.DEFAULT_MTLS_ENDPOINT + + conversation_dataset_path = staticmethod( + ConversationDatasetsClient.conversation_dataset_path + ) + parse_conversation_dataset_path = staticmethod( + ConversationDatasetsClient.parse_conversation_dataset_path + ) + common_billing_account_path = staticmethod( + ConversationDatasetsClient.common_billing_account_path + ) + parse_common_billing_account_path = staticmethod( + ConversationDatasetsClient.parse_common_billing_account_path + ) + common_folder_path = staticmethod(ConversationDatasetsClient.common_folder_path) + parse_common_folder_path = staticmethod( + ConversationDatasetsClient.parse_common_folder_path + ) + common_organization_path = staticmethod( + ConversationDatasetsClient.common_organization_path + ) + parse_common_organization_path = staticmethod( + ConversationDatasetsClient.parse_common_organization_path + ) + common_project_path = staticmethod(ConversationDatasetsClient.common_project_path) + parse_common_project_path = staticmethod( + ConversationDatasetsClient.parse_common_project_path + ) + common_location_path = staticmethod(ConversationDatasetsClient.common_location_path) + parse_common_location_path = staticmethod( + ConversationDatasetsClient.parse_common_location_path + ) + + @classmethod + def from_service_account_info(cls, info: dict, *args, **kwargs): + """Creates an instance of this client using the provided credentials + info. + + Args: + info (dict): The service account private key info. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + ConversationDatasetsAsyncClient: The constructed client. + """ + return ConversationDatasetsClient.from_service_account_info.__func__(ConversationDatasetsAsyncClient, info, *args, **kwargs) # type: ignore + + @classmethod + def from_service_account_file(cls, filename: str, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + ConversationDatasetsAsyncClient: The constructed client. + """ + return ConversationDatasetsClient.from_service_account_file.__func__(ConversationDatasetsAsyncClient, filename, *args, **kwargs) # type: ignore + + from_service_account_json = from_service_account_file + + @classmethod + def get_mtls_endpoint_and_cert_source( + cls, client_options: Optional[ClientOptions] = None + ): + """Return the API endpoint and client cert source for mutual TLS. + + The client cert source is determined in the following order: + (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the + client cert source is None. + (2) if `client_options.client_cert_source` is provided, use the provided one; if the + default client cert source exists, use the default one; otherwise the client cert + source is None. + + The API endpoint is determined in the following order: + (1) if `client_options.api_endpoint` if provided, use the provided one. + (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the + default mTLS endpoint; if the environment variabel is "never", use the default API + endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise + use the default API endpoint. + + More details can be found at https://google.aip.dev/auth/4114. + + Args: + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. Only the `api_endpoint` and `client_cert_source` properties may be used + in this method. + + Returns: + Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the + client cert source to use. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If any errors happen. + """ + return ConversationDatasetsClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore + + @property + def transport(self) -> ConversationDatasetsTransport: + """Returns the transport used by the client instance. + + Returns: + ConversationDatasetsTransport: The transport used by the client instance. + """ + return self._client.transport + + get_transport_class = functools.partial( + type(ConversationDatasetsClient).get_transport_class, + type(ConversationDatasetsClient), + ) + + def __init__( + self, + *, + credentials: ga_credentials.Credentials = None, + transport: Union[str, ConversationDatasetsTransport] = "grpc_asyncio", + client_options: ClientOptions = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + ) -> None: + """Instantiates the conversation datasets client. + + Args: + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + transport (Union[str, ~.ConversationDatasetsTransport]): The + transport to use. If set to None, a transport is chosen + automatically. + client_options (ClientOptions): Custom options for the client. It + won't take effect if a ``transport`` instance is provided. + (1) The ``api_endpoint`` property can be used to override the + default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT + environment variable can also be used to override the endpoint: + "always" (always use the default mTLS endpoint), "never" (always + use the default regular endpoint) and "auto" (auto switch to the + default mTLS endpoint if client certificate is present, this is + the default value). However, the ``api_endpoint`` property takes + precedence if provided. + (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable + is "true", then the ``client_cert_source`` property can be used + to provide client certificate for mutual TLS transport. If + not provided, the default SSL client certificate will be used if + present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not + set, no client certificate will be used. + + Raises: + google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport + creation failed for any reason. + """ + self._client = ConversationDatasetsClient( + credentials=credentials, + transport=transport, + client_options=client_options, + client_info=client_info, + ) + + async def create_conversation_dataset( + self, + request: Union[ + gcd_conversation_dataset.CreateConversationDatasetRequest, dict + ] = None, + *, + parent: str = None, + conversation_dataset: gcd_conversation_dataset.ConversationDataset = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation_async.AsyncOperation: + r"""Creates a new conversation dataset. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [CreateConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata] + - ``response``: + [ConversationDataset][google.cloud.dialogflow.v2.ConversationDataset] + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_create_conversation_dataset(): + # Create a client + client = dialogflow_v2.ConversationDatasetsClient() + + # Initialize request argument(s) + conversation_dataset = dialogflow_v2.ConversationDataset() + conversation_dataset.display_name = "display_name_value" + + request = dialogflow_v2.CreateConversationDatasetRequest( + parent="parent_value", + conversation_dataset=conversation_dataset, + ) + + # Make the request + operation = client.create_conversation_dataset(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.CreateConversationDatasetRequest, dict]): + The request object. The request message for + [ConversationDatasets.CreateConversationDataset][google.cloud.dialogflow.v2.ConversationDatasets.CreateConversationDataset]. + parent (:class:`str`): + Required. The project to create conversation dataset + for. Format: + ``projects//locations/`` + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + conversation_dataset (:class:`google.cloud.dialogflow_v2.types.ConversationDataset`): + Required. The conversation dataset to + create. + + This corresponds to the ``conversation_dataset`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.dialogflow_v2.types.ConversationDataset` Represents a conversation dataset that a user imports raw data into. + The data inside ConversationDataset can not be + changed after ImportConversationData finishes (and + calling ImportConversationData on a dataset that + already has data is not allowed). + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent, conversation_dataset]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + request = gcd_conversation_dataset.CreateConversationDatasetRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + if conversation_dataset is not None: + request.conversation_dataset = conversation_dataset + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.create_conversation_dataset, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + gcd_conversation_dataset.ConversationDataset, + metadata_type=gcd_conversation_dataset.CreateConversationDatasetOperationMetadata, + ) + + # Done; return the response. + return response + + async def get_conversation_dataset( + self, + request: Union[conversation_dataset.GetConversationDatasetRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> conversation_dataset.ConversationDataset: + r"""Retrieves the specified conversation dataset. + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_get_conversation_dataset(): + # Create a client + client = dialogflow_v2.ConversationDatasetsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetConversationDatasetRequest( + name="name_value", + ) + + # Make the request + response = client.get_conversation_dataset(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.GetConversationDatasetRequest, dict]): + The request object. The request message for + [ConversationDatasets.GetConversationDataset][google.cloud.dialogflow.v2.ConversationDatasets.GetConversationDataset]. + name (:class:`str`): + Required. The conversation dataset to retrieve. Format: + ``projects//locations//conversationDatasets/`` + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dialogflow_v2.types.ConversationDataset: + Represents a conversation dataset + that a user imports raw data into. The + data inside ConversationDataset can not + be changed after ImportConversationData + finishes (and calling + ImportConversationData on a dataset that + already has data is not allowed). + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + request = conversation_dataset.GetConversationDatasetRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.get_conversation_dataset, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Done; return the response. + return response + + async def list_conversation_datasets( + self, + request: Union[ + conversation_dataset.ListConversationDatasetsRequest, dict + ] = None, + *, + parent: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListConversationDatasetsAsyncPager: + r"""Returns the list of all conversation datasets in the + specified project and location. + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_list_conversation_datasets(): + # Create a client + client = dialogflow_v2.ConversationDatasetsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListConversationDatasetsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversation_datasets(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.ListConversationDatasetsRequest, dict]): + The request object. The request message for + [ConversationDatasets.ListConversationDatasets][google.cloud.dialogflow.v2.ConversationDatasets.ListConversationDatasets]. + parent (:class:`str`): + Required. The project and location name to list all + conversation datasets for. Format: + ``projects//locations/`` + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dialogflow_v2.services.conversation_datasets.pagers.ListConversationDatasetsAsyncPager: + The response message for + [ConversationDatasets.ListConversationDatasets][google.cloud.dialogflow.v2.ConversationDatasets.ListConversationDatasets]. + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + request = conversation_dataset.ListConversationDatasetsRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.list_conversation_datasets, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # This method is paged; wrap the response in a pager, which provides + # an `__aiter__` convenience method. + response = pagers.ListConversationDatasetsAsyncPager( + method=rpc, request=request, response=response, metadata=metadata, + ) + + # Done; return the response. + return response + + async def delete_conversation_dataset( + self, + request: Union[ + conversation_dataset.DeleteConversationDatasetRequest, dict + ] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation_async.AsyncOperation: + r"""Deletes the specified conversation dataset. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [DeleteConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata] + - ``response``: An `Empty + message `__ + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_delete_conversation_dataset(): + # Create a client + client = dialogflow_v2.ConversationDatasetsClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteConversationDatasetRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_conversation_dataset(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.DeleteConversationDatasetRequest, dict]): + The request object. The request message for + [ConversationDatasets.DeleteConversationDataset][google.cloud.dialogflow.v2.ConversationDatasets.DeleteConversationDataset]. + name (:class:`str`): + Required. The conversation dataset to delete. Format: + ``projects//locations//conversationDatasets/`` + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to + use it as the request or the response type of an API + method. For instance: + + service Foo { + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); + + } + + The JSON representation for Empty is empty JSON + object {}. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + request = conversation_dataset.DeleteConversationDatasetRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.delete_conversation_dataset, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + empty_pb2.Empty, + metadata_type=conversation_dataset.DeleteConversationDatasetOperationMetadata, + ) + + # Done; return the response. + return response + + async def import_conversation_data( + self, + request: Union[conversation_dataset.ImportConversationDataRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation_async.AsyncOperation: + r"""Import data into the specified conversation dataset. Note that + it is not allowed to import data to a conversation dataset that + already has data in it. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [ImportConversationDataOperationMetadata][google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata] + - ``response``: + [ImportConversationDataOperationResponse][google.cloud.dialogflow.v2.ImportConversationDataOperationResponse] + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_import_conversation_data(): + # Create a client + client = dialogflow_v2.ConversationDatasetsClient() + + # Initialize request argument(s) + input_config = dialogflow_v2.InputConfig() + input_config.gcs_source.uris = ['uris_value_1', 'uris_value_2'] + + request = dialogflow_v2.ImportConversationDataRequest( + name="name_value", + input_config=input_config, + ) + + # Make the request + operation = client.import_conversation_data(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.ImportConversationDataRequest, dict]): + The request object. The request message for + [ConversationDatasets.ImportConversationData][google.cloud.dialogflow.v2.ConversationDatasets.ImportConversationData]. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.dialogflow_v2.types.ImportConversationDataOperationResponse` Response used for [ConversationDatasets.ImportConversationData][google.cloud.dialogflow.v2.ConversationDatasets.ImportConversationData] long + running operation. + + """ + # Create or coerce a protobuf request object. + request = conversation_dataset.ImportConversationDataRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.import_conversation_data, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + conversation_dataset.ImportConversationDataOperationResponse, + metadata_type=conversation_dataset.ImportConversationDataOperationMetadata, + ) + + # Done; return the response. + return response + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc, tb): + await self.transport.close() + + +try: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=pkg_resources.get_distribution( + "google-cloud-dialogflow", + ).version, + ) +except pkg_resources.DistributionNotFound: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() + + +__all__ = ("ConversationDatasetsAsyncClient",) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/client.py new file mode 100644 index 000000000000..afb008c3f3ff --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/client.py @@ -0,0 +1,1017 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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 collections import OrderedDict +import os +import re +from typing import Dict, Optional, Sequence, Tuple, Type, Union +import pkg_resources + +from google.api_core import client_options as client_options_lib +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.transport import mtls # type: ignore +from google.auth.transport.grpc import SslCredentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore +from google.oauth2 import service_account # type: ignore + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object] # type: ignore + +from google.api_core import operation # type: ignore +from google.api_core import operation_async # type: ignore +from google.cloud.dialogflow_v2.services.conversation_datasets import pagers +from google.cloud.dialogflow_v2.types import conversation_dataset +from google.cloud.dialogflow_v2.types import ( + conversation_dataset as gcd_conversation_dataset, +) +from google.protobuf import empty_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore +from .transports.base import ConversationDatasetsTransport, DEFAULT_CLIENT_INFO +from .transports.grpc import ConversationDatasetsGrpcTransport +from .transports.grpc_asyncio import ConversationDatasetsGrpcAsyncIOTransport + + +class ConversationDatasetsClientMeta(type): + """Metaclass for the ConversationDatasets client. + + This provides class-level methods for building and retrieving + support objects (e.g. transport) without polluting the client instance + objects. + """ + + _transport_registry = ( + OrderedDict() + ) # type: Dict[str, Type[ConversationDatasetsTransport]] + _transport_registry["grpc"] = ConversationDatasetsGrpcTransport + _transport_registry["grpc_asyncio"] = ConversationDatasetsGrpcAsyncIOTransport + + def get_transport_class( + cls, label: str = None, + ) -> Type[ConversationDatasetsTransport]: + """Returns an appropriate transport class. + + Args: + label: The name of the desired transport. If none is + provided, then the first transport in the registry is used. + + Returns: + The transport class to use. + """ + # If a specific transport is requested, return that one. + if label: + return cls._transport_registry[label] + + # No transport is requested; return the default (that is, the first one + # in the dictionary). + return next(iter(cls._transport_registry.values())) + + +class ConversationDatasetsClient(metaclass=ConversationDatasetsClientMeta): + """Conversation datasets. + Conversation datasets contain raw conversation files and their + customizable metadata that can be used for model training. + """ + + @staticmethod + def _get_default_mtls_endpoint(api_endpoint): + """Converts api endpoint to mTLS endpoint. + + Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to + "*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively. + Args: + api_endpoint (Optional[str]): the api endpoint to convert. + Returns: + str: converted mTLS api endpoint. + """ + if not api_endpoint: + return api_endpoint + + mtls_endpoint_re = re.compile( + r"(?P[^.]+)(?P\.mtls)?(?P\.sandbox)?(?P\.googleapis\.com)?" + ) + + m = mtls_endpoint_re.match(api_endpoint) + name, mtls, sandbox, googledomain = m.groups() + if mtls or not googledomain: + return api_endpoint + + if sandbox: + return api_endpoint.replace( + "sandbox.googleapis.com", "mtls.sandbox.googleapis.com" + ) + + return api_endpoint.replace(".googleapis.com", ".mtls.googleapis.com") + + DEFAULT_ENDPOINT = "dialogflow.googleapis.com" + DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore + DEFAULT_ENDPOINT + ) + + @classmethod + def from_service_account_info(cls, info: dict, *args, **kwargs): + """Creates an instance of this client using the provided credentials + info. + + Args: + info (dict): The service account private key info. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + ConversationDatasetsClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_info(info) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + @classmethod + def from_service_account_file(cls, filename: str, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + ConversationDatasetsClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_file(filename) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + from_service_account_json = from_service_account_file + + @property + def transport(self) -> ConversationDatasetsTransport: + """Returns the transport used by the client instance. + + Returns: + ConversationDatasetsTransport: The transport used by the client + instance. + """ + return self._transport + + @staticmethod + def conversation_dataset_path( + project: str, location: str, conversation_dataset: str, + ) -> str: + """Returns a fully-qualified conversation_dataset string.""" + return "projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}".format( + project=project, + location=location, + conversation_dataset=conversation_dataset, + ) + + @staticmethod + def parse_conversation_dataset_path(path: str) -> Dict[str, str]: + """Parses a conversation_dataset path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/conversationDatasets/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def common_billing_account_path(billing_account: str,) -> str: + """Returns a fully-qualified billing_account string.""" + return "billingAccounts/{billing_account}".format( + billing_account=billing_account, + ) + + @staticmethod + def parse_common_billing_account_path(path: str) -> Dict[str, str]: + """Parse a billing_account path into its component segments.""" + m = re.match(r"^billingAccounts/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_folder_path(folder: str,) -> str: + """Returns a fully-qualified folder string.""" + return "folders/{folder}".format(folder=folder,) + + @staticmethod + def parse_common_folder_path(path: str) -> Dict[str, str]: + """Parse a folder path into its component segments.""" + m = re.match(r"^folders/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_organization_path(organization: str,) -> str: + """Returns a fully-qualified organization string.""" + return "organizations/{organization}".format(organization=organization,) + + @staticmethod + def parse_common_organization_path(path: str) -> Dict[str, str]: + """Parse a organization path into its component segments.""" + m = re.match(r"^organizations/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_project_path(project: str,) -> str: + """Returns a fully-qualified project string.""" + return "projects/{project}".format(project=project,) + + @staticmethod + def parse_common_project_path(path: str) -> Dict[str, str]: + """Parse a project path into its component segments.""" + m = re.match(r"^projects/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_location_path(project: str, location: str,) -> str: + """Returns a fully-qualified location string.""" + return "projects/{project}/locations/{location}".format( + project=project, location=location, + ) + + @staticmethod + def parse_common_location_path(path: str) -> Dict[str, str]: + """Parse a location path into its component segments.""" + m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)$", path) + return m.groupdict() if m else {} + + @classmethod + def get_mtls_endpoint_and_cert_source( + cls, client_options: Optional[client_options_lib.ClientOptions] = None + ): + """Return the API endpoint and client cert source for mutual TLS. + + The client cert source is determined in the following order: + (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the + client cert source is None. + (2) if `client_options.client_cert_source` is provided, use the provided one; if the + default client cert source exists, use the default one; otherwise the client cert + source is None. + + The API endpoint is determined in the following order: + (1) if `client_options.api_endpoint` if provided, use the provided one. + (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the + default mTLS endpoint; if the environment variabel is "never", use the default API + endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise + use the default API endpoint. + + More details can be found at https://google.aip.dev/auth/4114. + + Args: + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. Only the `api_endpoint` and `client_cert_source` properties may be used + in this method. + + Returns: + Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the + client cert source to use. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If any errors happen. + """ + if client_options is None: + client_options = client_options_lib.ClientOptions() + use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") + use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") + if use_client_cert not in ("true", "false"): + raise ValueError( + "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + if use_mtls_endpoint not in ("auto", "never", "always"): + raise MutualTLSChannelError( + "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + # Figure out the client cert source to use. + client_cert_source = None + if use_client_cert == "true": + if client_options.client_cert_source: + client_cert_source = client_options.client_cert_source + elif mtls.has_default_client_cert_source(): + client_cert_source = mtls.default_client_cert_source() + + # Figure out which api endpoint to use. + if client_options.api_endpoint is not None: + api_endpoint = client_options.api_endpoint + elif use_mtls_endpoint == "always" or ( + use_mtls_endpoint == "auto" and client_cert_source + ): + api_endpoint = cls.DEFAULT_MTLS_ENDPOINT + else: + api_endpoint = cls.DEFAULT_ENDPOINT + + return api_endpoint, client_cert_source + + def __init__( + self, + *, + credentials: Optional[ga_credentials.Credentials] = None, + transport: Union[str, ConversationDatasetsTransport, None] = None, + client_options: Optional[client_options_lib.ClientOptions] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + ) -> None: + """Instantiates the conversation datasets client. + + Args: + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + transport (Union[str, ConversationDatasetsTransport]): The + transport to use. If set to None, a transport is chosen + automatically. + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. It won't take effect if a ``transport`` instance is provided. + (1) The ``api_endpoint`` property can be used to override the + default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT + environment variable can also be used to override the endpoint: + "always" (always use the default mTLS endpoint), "never" (always + use the default regular endpoint) and "auto" (auto switch to the + default mTLS endpoint if client certificate is present, this is + the default value). However, the ``api_endpoint`` property takes + precedence if provided. + (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable + is "true", then the ``client_cert_source`` property can be used + to provide client certificate for mutual TLS transport. If + not provided, the default SSL client certificate will be used if + present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not + set, no client certificate will be 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. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport + creation failed for any reason. + """ + if isinstance(client_options, dict): + client_options = client_options_lib.from_dict(client_options) + if client_options is None: + client_options = client_options_lib.ClientOptions() + + api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( + client_options + ) + + api_key_value = getattr(client_options, "api_key", None) + if api_key_value and credentials: + raise ValueError( + "client_options.api_key and credentials are mutually exclusive" + ) + + # Save or instantiate the transport. + # Ordinarily, we provide the transport, but allowing a custom transport + # instance provides an extensibility point for unusual situations. + if isinstance(transport, ConversationDatasetsTransport): + # transport is a ConversationDatasetsTransport instance. + if credentials or client_options.credentials_file or api_key_value: + raise ValueError( + "When providing a transport instance, " + "provide its credentials directly." + ) + if client_options.scopes: + raise ValueError( + "When providing a transport instance, provide its scopes " + "directly." + ) + self._transport = transport + else: + import google.auth._default # type: ignore + + if api_key_value and hasattr( + google.auth._default, "get_api_key_credentials" + ): + credentials = google.auth._default.get_api_key_credentials( + api_key_value + ) + + Transport = type(self).get_transport_class(transport) + self._transport = Transport( + credentials=credentials, + credentials_file=client_options.credentials_file, + host=api_endpoint, + scopes=client_options.scopes, + client_cert_source_for_mtls=client_cert_source_func, + quota_project_id=client_options.quota_project_id, + client_info=client_info, + always_use_jwt_access=True, + ) + + def create_conversation_dataset( + self, + request: Union[ + gcd_conversation_dataset.CreateConversationDatasetRequest, dict + ] = None, + *, + parent: str = None, + conversation_dataset: gcd_conversation_dataset.ConversationDataset = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation.Operation: + r"""Creates a new conversation dataset. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [CreateConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata] + - ``response``: + [ConversationDataset][google.cloud.dialogflow.v2.ConversationDataset] + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_create_conversation_dataset(): + # Create a client + client = dialogflow_v2.ConversationDatasetsClient() + + # Initialize request argument(s) + conversation_dataset = dialogflow_v2.ConversationDataset() + conversation_dataset.display_name = "display_name_value" + + request = dialogflow_v2.CreateConversationDatasetRequest( + parent="parent_value", + conversation_dataset=conversation_dataset, + ) + + # Make the request + operation = client.create_conversation_dataset(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.CreateConversationDatasetRequest, dict]): + The request object. The request message for + [ConversationDatasets.CreateConversationDataset][google.cloud.dialogflow.v2.ConversationDatasets.CreateConversationDataset]. + parent (str): + Required. The project to create conversation dataset + for. Format: + ``projects//locations/`` + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + conversation_dataset (google.cloud.dialogflow_v2.types.ConversationDataset): + Required. The conversation dataset to + create. + + This corresponds to the ``conversation_dataset`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.dialogflow_v2.types.ConversationDataset` Represents a conversation dataset that a user imports raw data into. + The data inside ConversationDataset can not be + changed after ImportConversationData finishes (and + calling ImportConversationData on a dataset that + already has data is not allowed). + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent, conversation_dataset]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a gcd_conversation_dataset.CreateConversationDatasetRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance( + request, gcd_conversation_dataset.CreateConversationDatasetRequest + ): + request = gcd_conversation_dataset.CreateConversationDatasetRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + if conversation_dataset is not None: + request.conversation_dataset = conversation_dataset + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.create_conversation_dataset + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + gcd_conversation_dataset.ConversationDataset, + metadata_type=gcd_conversation_dataset.CreateConversationDatasetOperationMetadata, + ) + + # Done; return the response. + return response + + def get_conversation_dataset( + self, + request: Union[conversation_dataset.GetConversationDatasetRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> conversation_dataset.ConversationDataset: + r"""Retrieves the specified conversation dataset. + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_get_conversation_dataset(): + # Create a client + client = dialogflow_v2.ConversationDatasetsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetConversationDatasetRequest( + name="name_value", + ) + + # Make the request + response = client.get_conversation_dataset(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.GetConversationDatasetRequest, dict]): + The request object. The request message for + [ConversationDatasets.GetConversationDataset][google.cloud.dialogflow.v2.ConversationDatasets.GetConversationDataset]. + name (str): + Required. The conversation dataset to retrieve. Format: + ``projects//locations//conversationDatasets/`` + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dialogflow_v2.types.ConversationDataset: + Represents a conversation dataset + that a user imports raw data into. The + data inside ConversationDataset can not + be changed after ImportConversationData + finishes (and calling + ImportConversationData on a dataset that + already has data is not allowed). + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a conversation_dataset.GetConversationDatasetRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, conversation_dataset.GetConversationDatasetRequest): + request = conversation_dataset.GetConversationDatasetRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get_conversation_dataset] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Done; return the response. + return response + + def list_conversation_datasets( + self, + request: Union[ + conversation_dataset.ListConversationDatasetsRequest, dict + ] = None, + *, + parent: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListConversationDatasetsPager: + r"""Returns the list of all conversation datasets in the + specified project and location. + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_list_conversation_datasets(): + # Create a client + client = dialogflow_v2.ConversationDatasetsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListConversationDatasetsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversation_datasets(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.ListConversationDatasetsRequest, dict]): + The request object. The request message for + [ConversationDatasets.ListConversationDatasets][google.cloud.dialogflow.v2.ConversationDatasets.ListConversationDatasets]. + parent (str): + Required. The project and location name to list all + conversation datasets for. Format: + ``projects//locations/`` + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dialogflow_v2.services.conversation_datasets.pagers.ListConversationDatasetsPager: + The response message for + [ConversationDatasets.ListConversationDatasets][google.cloud.dialogflow.v2.ConversationDatasets.ListConversationDatasets]. + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a conversation_dataset.ListConversationDatasetsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance( + request, conversation_dataset.ListConversationDatasetsRequest + ): + request = conversation_dataset.ListConversationDatasetsRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.list_conversation_datasets + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # This method is paged; wrap the response in a pager, which provides + # an `__iter__` convenience method. + response = pagers.ListConversationDatasetsPager( + method=rpc, request=request, response=response, metadata=metadata, + ) + + # Done; return the response. + return response + + def delete_conversation_dataset( + self, + request: Union[ + conversation_dataset.DeleteConversationDatasetRequest, dict + ] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation.Operation: + r"""Deletes the specified conversation dataset. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [DeleteConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata] + - ``response``: An `Empty + message `__ + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_delete_conversation_dataset(): + # Create a client + client = dialogflow_v2.ConversationDatasetsClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteConversationDatasetRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_conversation_dataset(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.DeleteConversationDatasetRequest, dict]): + The request object. The request message for + [ConversationDatasets.DeleteConversationDataset][google.cloud.dialogflow.v2.ConversationDatasets.DeleteConversationDataset]. + name (str): + Required. The conversation dataset to delete. Format: + ``projects//locations//conversationDatasets/`` + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to + use it as the request or the response type of an API + method. For instance: + + service Foo { + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); + + } + + The JSON representation for Empty is empty JSON + object {}. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a conversation_dataset.DeleteConversationDatasetRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance( + request, conversation_dataset.DeleteConversationDatasetRequest + ): + request = conversation_dataset.DeleteConversationDatasetRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.delete_conversation_dataset + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + empty_pb2.Empty, + metadata_type=conversation_dataset.DeleteConversationDatasetOperationMetadata, + ) + + # Done; return the response. + return response + + def import_conversation_data( + self, + request: Union[conversation_dataset.ImportConversationDataRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation.Operation: + r"""Import data into the specified conversation dataset. Note that + it is not allowed to import data to a conversation dataset that + already has data in it. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [ImportConversationDataOperationMetadata][google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata] + - ``response``: + [ImportConversationDataOperationResponse][google.cloud.dialogflow.v2.ImportConversationDataOperationResponse] + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_import_conversation_data(): + # Create a client + client = dialogflow_v2.ConversationDatasetsClient() + + # Initialize request argument(s) + input_config = dialogflow_v2.InputConfig() + input_config.gcs_source.uris = ['uris_value_1', 'uris_value_2'] + + request = dialogflow_v2.ImportConversationDataRequest( + name="name_value", + input_config=input_config, + ) + + # Make the request + operation = client.import_conversation_data(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.ImportConversationDataRequest, dict]): + The request object. The request message for + [ConversationDatasets.ImportConversationData][google.cloud.dialogflow.v2.ConversationDatasets.ImportConversationData]. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.cloud.dialogflow_v2.types.ImportConversationDataOperationResponse` Response used for [ConversationDatasets.ImportConversationData][google.cloud.dialogflow.v2.ConversationDatasets.ImportConversationData] long + running operation. + + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a conversation_dataset.ImportConversationDataRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, conversation_dataset.ImportConversationDataRequest): + request = conversation_dataset.ImportConversationDataRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.import_conversation_data] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + conversation_dataset.ImportConversationDataOperationResponse, + metadata_type=conversation_dataset.ImportConversationDataOperationMetadata, + ) + + # Done; return the response. + return response + + def __enter__(self): + return self + + def __exit__(self, type, value, traceback): + """Releases underlying transport's resources. + + .. warning:: + ONLY use as a context manager if the transport is NOT shared + with other clients! Exiting the with block will CLOSE the transport + and may cause errors in other clients! + """ + self.transport.close() + + +try: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=pkg_resources.get_distribution( + "google-cloud-dialogflow", + ).version, + ) +except pkg_resources.DistributionNotFound: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() + + +__all__ = ("ConversationDatasetsClient",) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/pagers.py new file mode 100644 index 000000000000..e949eca2abb8 --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/pagers.py @@ -0,0 +1,159 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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 typing import ( + Any, + AsyncIterator, + Awaitable, + Callable, + Sequence, + Tuple, + Optional, + Iterator, +) + +from google.cloud.dialogflow_v2.types import conversation_dataset + + +class ListConversationDatasetsPager: + """A pager for iterating through ``list_conversation_datasets`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dialogflow_v2.types.ListConversationDatasetsResponse` object, and + provides an ``__iter__`` method to iterate through its + ``conversation_datasets`` field. + + If there are more pages, the ``__iter__`` method will make additional + ``ListConversationDatasets`` requests and continue to iterate + through the ``conversation_datasets`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dialogflow_v2.types.ListConversationDatasetsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + + def __init__( + self, + method: Callable[..., conversation_dataset.ListConversationDatasetsResponse], + request: conversation_dataset.ListConversationDatasetsRequest, + response: conversation_dataset.ListConversationDatasetsResponse, + *, + metadata: Sequence[Tuple[str, str]] = () + ): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dialogflow_v2.types.ListConversationDatasetsRequest): + The initial request object. + response (google.cloud.dialogflow_v2.types.ListConversationDatasetsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = conversation_dataset.ListConversationDatasetsRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages(self) -> Iterator[conversation_dataset.ListConversationDatasetsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method(self._request, metadata=self._metadata) + yield self._response + + def __iter__(self) -> Iterator[conversation_dataset.ConversationDataset]: + for page in self.pages: + yield from page.conversation_datasets + + def __repr__(self) -> str: + return "{0}<{1!r}>".format(self.__class__.__name__, self._response) + + +class ListConversationDatasetsAsyncPager: + """A pager for iterating through ``list_conversation_datasets`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dialogflow_v2.types.ListConversationDatasetsResponse` object, and + provides an ``__aiter__`` method to iterate through its + ``conversation_datasets`` field. + + If there are more pages, the ``__aiter__`` method will make additional + ``ListConversationDatasets`` requests and continue to iterate + through the ``conversation_datasets`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dialogflow_v2.types.ListConversationDatasetsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + + def __init__( + self, + method: Callable[ + ..., Awaitable[conversation_dataset.ListConversationDatasetsResponse] + ], + request: conversation_dataset.ListConversationDatasetsRequest, + response: conversation_dataset.ListConversationDatasetsResponse, + *, + metadata: Sequence[Tuple[str, str]] = () + ): + """Instantiates the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dialogflow_v2.types.ListConversationDatasetsRequest): + The initial request object. + response (google.cloud.dialogflow_v2.types.ListConversationDatasetsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = conversation_dataset.ListConversationDatasetsRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + async def pages( + self, + ) -> AsyncIterator[conversation_dataset.ListConversationDatasetsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = await self._method(self._request, metadata=self._metadata) + yield self._response + + def __aiter__(self) -> AsyncIterator[conversation_dataset.ConversationDataset]: + async def async_generator(): + async for page in self.pages: + for response in page.conversation_datasets: + yield response + + return async_generator() + + def __repr__(self) -> str: + return "{0}<{1!r}>".format(self.__class__.__name__, self._response) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/transports/__init__.py new file mode 100644 index 000000000000..19a859357951 --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/transports/__init__.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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 collections import OrderedDict +from typing import Dict, Type + +from .base import ConversationDatasetsTransport +from .grpc import ConversationDatasetsGrpcTransport +from .grpc_asyncio import ConversationDatasetsGrpcAsyncIOTransport + + +# Compile a registry of transports. +_transport_registry = ( + OrderedDict() +) # type: Dict[str, Type[ConversationDatasetsTransport]] +_transport_registry["grpc"] = ConversationDatasetsGrpcTransport +_transport_registry["grpc_asyncio"] = ConversationDatasetsGrpcAsyncIOTransport + +__all__ = ( + "ConversationDatasetsTransport", + "ConversationDatasetsGrpcTransport", + "ConversationDatasetsGrpcAsyncIOTransport", +) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/transports/base.py new file mode 100644 index 000000000000..d4bb742f8f0e --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/transports/base.py @@ -0,0 +1,224 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +import abc +from typing import Awaitable, Callable, Dict, Optional, Sequence, Union +import pkg_resources + +import google.auth # type: ignore +import google.api_core +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.api_core import operations_v1 +from google.auth import credentials as ga_credentials # type: ignore +from google.oauth2 import service_account # type: ignore + +from google.cloud.dialogflow_v2.types import conversation_dataset +from google.cloud.dialogflow_v2.types import ( + conversation_dataset as gcd_conversation_dataset, +) +from google.longrunning import operations_pb2 # type: ignore + +try: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=pkg_resources.get_distribution( + "google-cloud-dialogflow", + ).version, + ) +except pkg_resources.DistributionNotFound: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() + + +class ConversationDatasetsTransport(abc.ABC): + """Abstract transport class for ConversationDatasets.""" + + AUTH_SCOPES = ( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow", + ) + + DEFAULT_HOST: str = "dialogflow.googleapis.com" + + def __init__( + self, + *, + host: str = DEFAULT_HOST, + credentials: ga_credentials.Credentials = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + quota_project_id: Optional[str] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + **kwargs, + ) -> None: + """Instantiate the transport. + + Args: + host (Optional[str]): + The hostname to connect to. + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is mutually exclusive with credentials. + scopes (Optional[Sequence[str]]): A list of scopes. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + 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. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + + scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} + + # Save the scopes. + self._scopes = scopes + + # If no credentials are provided, then determine the appropriate + # defaults. + if credentials and credentials_file: + raise core_exceptions.DuplicateCredentialArgs( + "'credentials_file' and 'credentials' are mutually exclusive" + ) + + if credentials_file is not None: + credentials, _ = google.auth.load_credentials_from_file( + credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + ) + elif credentials is None: + credentials, _ = google.auth.default( + **scopes_kwargs, quota_project_id=quota_project_id + ) + + # If the credentials are service account credentials, then always try to use self signed JWT. + if ( + always_use_jwt_access + and isinstance(credentials, service_account.Credentials) + and hasattr(service_account.Credentials, "with_always_use_jwt_access") + ): + credentials = credentials.with_always_use_jwt_access(True) + + # Save the credentials. + self._credentials = credentials + + def _prep_wrapped_messages(self, client_info): + # Precompute the wrapped methods. + self._wrapped_methods = { + self.create_conversation_dataset: gapic_v1.method.wrap_method( + self.create_conversation_dataset, + default_timeout=None, + client_info=client_info, + ), + self.get_conversation_dataset: gapic_v1.method.wrap_method( + self.get_conversation_dataset, + default_timeout=None, + client_info=client_info, + ), + self.list_conversation_datasets: gapic_v1.method.wrap_method( + self.list_conversation_datasets, + default_timeout=None, + client_info=client_info, + ), + self.delete_conversation_dataset: gapic_v1.method.wrap_method( + self.delete_conversation_dataset, + default_timeout=None, + client_info=client_info, + ), + self.import_conversation_data: gapic_v1.method.wrap_method( + self.import_conversation_data, + default_timeout=None, + client_info=client_info, + ), + } + + def close(self): + """Closes resources associated with the transport. + + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! + """ + raise NotImplementedError() + + @property + def operations_client(self): + """Return the client designed to process long-running operations.""" + raise NotImplementedError() + + @property + def create_conversation_dataset( + self, + ) -> Callable[ + [gcd_conversation_dataset.CreateConversationDatasetRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + + @property + def get_conversation_dataset( + self, + ) -> Callable[ + [conversation_dataset.GetConversationDatasetRequest], + Union[ + conversation_dataset.ConversationDataset, + Awaitable[conversation_dataset.ConversationDataset], + ], + ]: + raise NotImplementedError() + + @property + def list_conversation_datasets( + self, + ) -> Callable[ + [conversation_dataset.ListConversationDatasetsRequest], + Union[ + conversation_dataset.ListConversationDatasetsResponse, + Awaitable[conversation_dataset.ListConversationDatasetsResponse], + ], + ]: + raise NotImplementedError() + + @property + def delete_conversation_dataset( + self, + ) -> Callable[ + [conversation_dataset.DeleteConversationDatasetRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + + @property + def import_conversation_data( + self, + ) -> Callable[ + [conversation_dataset.ImportConversationDataRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + + +__all__ = ("ConversationDatasetsTransport",) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/transports/grpc.py new file mode 100644 index 000000000000..fa18f3e7df41 --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/transports/grpc.py @@ -0,0 +1,434 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +import warnings +from typing import Callable, Dict, Optional, Sequence, Tuple, Union + +from google.api_core import grpc_helpers +from google.api_core import operations_v1 +from google.api_core import gapic_v1 +import google.auth # type: ignore +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.transport.grpc import SslCredentials # type: ignore + +import grpc # type: ignore + +from google.cloud.dialogflow_v2.types import conversation_dataset +from google.cloud.dialogflow_v2.types import ( + conversation_dataset as gcd_conversation_dataset, +) +from google.longrunning import operations_pb2 # type: ignore +from .base import ConversationDatasetsTransport, DEFAULT_CLIENT_INFO + + +class ConversationDatasetsGrpcTransport(ConversationDatasetsTransport): + """gRPC backend transport for ConversationDatasets. + + Conversation datasets. + Conversation datasets contain raw conversation files and their + customizable metadata that can be used for model training. + + This class defines the same methods as the primary client, so the + primary client can load the underlying transport implementation + and call it. + + It sends protocol buffers over the wire using gRPC (which is built on + top of HTTP/2); the ``grpcio`` package must be installed. + """ + + _stubs: Dict[str, Callable] + + def __init__( + self, + *, + host: str = "dialogflow.googleapis.com", + credentials: ga_credentials.Credentials = None, + credentials_file: str = None, + scopes: Sequence[str] = None, + channel: grpc.Channel = None, + api_mtls_endpoint: str = None, + client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, + ssl_channel_credentials: grpc.ChannelCredentials = None, + client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + quota_project_id: Optional[str] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + ) -> None: + """Instantiate the transport. + + Args: + host (Optional[str]): + The hostname to connect to. + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + This argument is ignored if ``channel`` is provided. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is ignored if ``channel`` is provided. + scopes (Optional(Sequence[str])): A list of scopes. This argument is + ignored if ``channel`` is provided. + channel (Optional[grpc.Channel]): A ``Channel`` instance through + which to make calls. + api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. + If provided, it overrides the ``host`` argument and tries to create + a mutual TLS channel with client SSL credentials from + ``client_cert_source`` or application default SSL credentials. + client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): + Deprecated. A callback to provide client SSL certificate bytes and + private key bytes, both in PEM format. It is ignored if + ``api_mtls_endpoint`` is None. + ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials + for the grpc channel. It is ignored if ``channel`` is provided. + client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): + A callback to provide client certificate bytes and private key bytes, + both in PEM format. It is used to configure a mutual TLS channel. It is + ignored if ``channel`` or ``ssl_channel_credentials`` is provided. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + 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. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport + creation failed for any reason. + google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` + and ``credentials_file`` are passed. + """ + self._grpc_channel = None + self._ssl_channel_credentials = ssl_channel_credentials + self._stubs: Dict[str, Callable] = {} + self._operations_client: Optional[operations_v1.OperationsClient] = None + + if api_mtls_endpoint: + warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) + if client_cert_source: + warnings.warn("client_cert_source is deprecated", DeprecationWarning) + + if channel: + # Ignore credentials if a channel was passed. + credentials = False + # If a channel was explicitly provided, set it. + self._grpc_channel = channel + self._ssl_channel_credentials = None + + else: + if api_mtls_endpoint: + host = api_mtls_endpoint + + # Create SSL credentials with client_cert_source or application + # default SSL credentials. + if client_cert_source: + cert, key = client_cert_source() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + else: + self._ssl_channel_credentials = SslCredentials().ssl_credentials + + else: + if client_cert_source_for_mtls and not ssl_channel_credentials: + cert, key = client_cert_source_for_mtls() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + + # The base transport sets the host, credentials and scopes + super().__init__( + host=host, + credentials=credentials, + credentials_file=credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + client_info=client_info, + always_use_jwt_access=always_use_jwt_access, + ) + + if not self._grpc_channel: + self._grpc_channel = type(self).create_channel( + self._host, + # use the credentials which are saved + credentials=self._credentials, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, + scopes=self._scopes, + ssl_credentials=self._ssl_channel_credentials, + quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + # Wrap messages. This must be done after self._grpc_channel exists + self._prep_wrapped_messages(client_info) + + @classmethod + def create_channel( + cls, + host: str = "dialogflow.googleapis.com", + credentials: ga_credentials.Credentials = None, + credentials_file: str = None, + scopes: Optional[Sequence[str]] = None, + quota_project_id: Optional[str] = None, + **kwargs, + ) -> grpc.Channel: + """Create and return a gRPC channel object. + Args: + host (Optional[str]): The host for the channel to use. + credentials (Optional[~.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. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is mutually exclusive with credentials. + scopes (Optional[Sequence[str]]): A optional list of scopes needed for this + service. These are only used when credentials are not specified and + are passed to :func:`google.auth.default`. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + kwargs (Optional[dict]): Keyword arguments, which are passed to the + channel creation. + Returns: + grpc.Channel: A gRPC channel object. + + Raises: + google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` + and ``credentials_file`` are passed. + """ + + return grpc_helpers.create_channel( + host, + credentials=credentials, + credentials_file=credentials_file, + quota_project_id=quota_project_id, + default_scopes=cls.AUTH_SCOPES, + scopes=scopes, + default_host=cls.DEFAULT_HOST, + **kwargs, + ) + + @property + def grpc_channel(self) -> grpc.Channel: + """Return the channel designed to connect to this service. + """ + return self._grpc_channel + + @property + def operations_client(self) -> operations_v1.OperationsClient: + """Create the client designed to process long-running operations. + + This property caches on the instance; repeated calls return the same + client. + """ + # Quick check: Only create a new client if we do not already have one. + if self._operations_client is None: + self._operations_client = operations_v1.OperationsClient(self.grpc_channel) + + # Return the client from cache. + return self._operations_client + + @property + def create_conversation_dataset( + self, + ) -> Callable[ + [gcd_conversation_dataset.CreateConversationDatasetRequest], + operations_pb2.Operation, + ]: + r"""Return a callable for the create conversation dataset method over gRPC. + + Creates a new conversation dataset. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [CreateConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata] + - ``response``: + [ConversationDataset][google.cloud.dialogflow.v2.ConversationDataset] + + Returns: + Callable[[~.CreateConversationDatasetRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "create_conversation_dataset" not in self._stubs: + self._stubs["create_conversation_dataset"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationDatasets/CreateConversationDataset", + request_serializer=gcd_conversation_dataset.CreateConversationDatasetRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["create_conversation_dataset"] + + @property + def get_conversation_dataset( + self, + ) -> Callable[ + [conversation_dataset.GetConversationDatasetRequest], + conversation_dataset.ConversationDataset, + ]: + r"""Return a callable for the get conversation dataset method over gRPC. + + Retrieves the specified conversation dataset. + + Returns: + Callable[[~.GetConversationDatasetRequest], + ~.ConversationDataset]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_conversation_dataset" not in self._stubs: + self._stubs["get_conversation_dataset"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationDatasets/GetConversationDataset", + request_serializer=conversation_dataset.GetConversationDatasetRequest.serialize, + response_deserializer=conversation_dataset.ConversationDataset.deserialize, + ) + return self._stubs["get_conversation_dataset"] + + @property + def list_conversation_datasets( + self, + ) -> Callable[ + [conversation_dataset.ListConversationDatasetsRequest], + conversation_dataset.ListConversationDatasetsResponse, + ]: + r"""Return a callable for the list conversation datasets method over gRPC. + + Returns the list of all conversation datasets in the + specified project and location. + + Returns: + Callable[[~.ListConversationDatasetsRequest], + ~.ListConversationDatasetsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "list_conversation_datasets" not in self._stubs: + self._stubs["list_conversation_datasets"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationDatasets/ListConversationDatasets", + request_serializer=conversation_dataset.ListConversationDatasetsRequest.serialize, + response_deserializer=conversation_dataset.ListConversationDatasetsResponse.deserialize, + ) + return self._stubs["list_conversation_datasets"] + + @property + def delete_conversation_dataset( + self, + ) -> Callable[ + [conversation_dataset.DeleteConversationDatasetRequest], + operations_pb2.Operation, + ]: + r"""Return a callable for the delete conversation dataset method over gRPC. + + Deletes the specified conversation dataset. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [DeleteConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata] + - ``response``: An `Empty + message `__ + + Returns: + Callable[[~.DeleteConversationDatasetRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "delete_conversation_dataset" not in self._stubs: + self._stubs["delete_conversation_dataset"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationDatasets/DeleteConversationDataset", + request_serializer=conversation_dataset.DeleteConversationDatasetRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["delete_conversation_dataset"] + + @property + def import_conversation_data( + self, + ) -> Callable[ + [conversation_dataset.ImportConversationDataRequest], operations_pb2.Operation + ]: + r"""Return a callable for the import conversation data method over gRPC. + + Import data into the specified conversation dataset. Note that + it is not allowed to import data to a conversation dataset that + already has data in it. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [ImportConversationDataOperationMetadata][google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata] + - ``response``: + [ImportConversationDataOperationResponse][google.cloud.dialogflow.v2.ImportConversationDataOperationResponse] + + Returns: + Callable[[~.ImportConversationDataRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "import_conversation_data" not in self._stubs: + self._stubs["import_conversation_data"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationDatasets/ImportConversationData", + request_serializer=conversation_dataset.ImportConversationDataRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["import_conversation_data"] + + def close(self): + self.grpc_channel.close() + + +__all__ = ("ConversationDatasetsGrpcTransport",) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/transports/grpc_asyncio.py new file mode 100644 index 000000000000..c5c5e0979eab --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_datasets/transports/grpc_asyncio.py @@ -0,0 +1,439 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +import warnings +from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union + +from google.api_core import gapic_v1 +from google.api_core import grpc_helpers_async +from google.api_core import operations_v1 +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.transport.grpc import SslCredentials # type: ignore + +import grpc # type: ignore +from grpc.experimental import aio # type: ignore + +from google.cloud.dialogflow_v2.types import conversation_dataset +from google.cloud.dialogflow_v2.types import ( + conversation_dataset as gcd_conversation_dataset, +) +from google.longrunning import operations_pb2 # type: ignore +from .base import ConversationDatasetsTransport, DEFAULT_CLIENT_INFO +from .grpc import ConversationDatasetsGrpcTransport + + +class ConversationDatasetsGrpcAsyncIOTransport(ConversationDatasetsTransport): + """gRPC AsyncIO backend transport for ConversationDatasets. + + Conversation datasets. + Conversation datasets contain raw conversation files and their + customizable metadata that can be used for model training. + + This class defines the same methods as the primary client, so the + primary client can load the underlying transport implementation + and call it. + + It sends protocol buffers over the wire using gRPC (which is built on + top of HTTP/2); the ``grpcio`` package must be installed. + """ + + _grpc_channel: aio.Channel + _stubs: Dict[str, Callable] = {} + + @classmethod + def create_channel( + cls, + host: str = "dialogflow.googleapis.com", + credentials: ga_credentials.Credentials = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + quota_project_id: Optional[str] = None, + **kwargs, + ) -> aio.Channel: + """Create and return a gRPC AsyncIO channel object. + Args: + host (Optional[str]): The host for the channel to use. + credentials (Optional[~.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. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is ignored if ``channel`` is provided. + scopes (Optional[Sequence[str]]): A optional list of scopes needed for this + service. These are only used when credentials are not specified and + are passed to :func:`google.auth.default`. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + kwargs (Optional[dict]): Keyword arguments, which are passed to the + channel creation. + Returns: + aio.Channel: A gRPC AsyncIO channel object. + """ + + return grpc_helpers_async.create_channel( + host, + credentials=credentials, + credentials_file=credentials_file, + quota_project_id=quota_project_id, + default_scopes=cls.AUTH_SCOPES, + scopes=scopes, + default_host=cls.DEFAULT_HOST, + **kwargs, + ) + + def __init__( + self, + *, + host: str = "dialogflow.googleapis.com", + credentials: ga_credentials.Credentials = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: aio.Channel = None, + api_mtls_endpoint: str = None, + client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, + ssl_channel_credentials: grpc.ChannelCredentials = None, + client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + quota_project_id=None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + ) -> None: + """Instantiate the transport. + + Args: + host (Optional[str]): + The hostname to connect to. + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + This argument is ignored if ``channel`` is provided. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is ignored if ``channel`` is provided. + scopes (Optional[Sequence[str]]): A optional list of scopes needed for this + service. These are only used when credentials are not specified and + are passed to :func:`google.auth.default`. + channel (Optional[aio.Channel]): A ``Channel`` instance through + which to make calls. + api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. + If provided, it overrides the ``host`` argument and tries to create + a mutual TLS channel with client SSL credentials from + ``client_cert_source`` or application default SSL credentials. + client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): + Deprecated. A callback to provide client SSL certificate bytes and + private key bytes, both in PEM format. It is ignored if + ``api_mtls_endpoint`` is None. + ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials + for the grpc channel. It is ignored if ``channel`` is provided. + client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): + A callback to provide client certificate bytes and private key bytes, + both in PEM format. It is used to configure a mutual TLS channel. It is + ignored if ``channel`` or ``ssl_channel_credentials`` is provided. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + 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. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + + Raises: + google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport + creation failed for any reason. + google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` + and ``credentials_file`` are passed. + """ + self._grpc_channel = None + self._ssl_channel_credentials = ssl_channel_credentials + self._stubs: Dict[str, Callable] = {} + self._operations_client: Optional[operations_v1.OperationsAsyncClient] = None + + if api_mtls_endpoint: + warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) + if client_cert_source: + warnings.warn("client_cert_source is deprecated", DeprecationWarning) + + if channel: + # Ignore credentials if a channel was passed. + credentials = False + # If a channel was explicitly provided, set it. + self._grpc_channel = channel + self._ssl_channel_credentials = None + else: + if api_mtls_endpoint: + host = api_mtls_endpoint + + # Create SSL credentials with client_cert_source or application + # default SSL credentials. + if client_cert_source: + cert, key = client_cert_source() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + else: + self._ssl_channel_credentials = SslCredentials().ssl_credentials + + else: + if client_cert_source_for_mtls and not ssl_channel_credentials: + cert, key = client_cert_source_for_mtls() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + + # The base transport sets the host, credentials and scopes + super().__init__( + host=host, + credentials=credentials, + credentials_file=credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + client_info=client_info, + always_use_jwt_access=always_use_jwt_access, + ) + + if not self._grpc_channel: + self._grpc_channel = type(self).create_channel( + self._host, + # use the credentials which are saved + credentials=self._credentials, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, + scopes=self._scopes, + ssl_credentials=self._ssl_channel_credentials, + quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + # Wrap messages. This must be done after self._grpc_channel exists + self._prep_wrapped_messages(client_info) + + @property + def grpc_channel(self) -> aio.Channel: + """Create the channel designed to connect to this service. + + This property caches on the instance; repeated calls return + the same channel. + """ + # Return the channel from cache. + return self._grpc_channel + + @property + def operations_client(self) -> operations_v1.OperationsAsyncClient: + """Create the client designed to process long-running operations. + + This property caches on the instance; repeated calls return the same + client. + """ + # Quick check: Only create a new client if we do not already have one. + if self._operations_client is None: + self._operations_client = operations_v1.OperationsAsyncClient( + self.grpc_channel + ) + + # Return the client from cache. + return self._operations_client + + @property + def create_conversation_dataset( + self, + ) -> Callable[ + [gcd_conversation_dataset.CreateConversationDatasetRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the create conversation dataset method over gRPC. + + Creates a new conversation dataset. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [CreateConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata] + - ``response``: + [ConversationDataset][google.cloud.dialogflow.v2.ConversationDataset] + + Returns: + Callable[[~.CreateConversationDatasetRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "create_conversation_dataset" not in self._stubs: + self._stubs["create_conversation_dataset"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationDatasets/CreateConversationDataset", + request_serializer=gcd_conversation_dataset.CreateConversationDatasetRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["create_conversation_dataset"] + + @property + def get_conversation_dataset( + self, + ) -> Callable[ + [conversation_dataset.GetConversationDatasetRequest], + Awaitable[conversation_dataset.ConversationDataset], + ]: + r"""Return a callable for the get conversation dataset method over gRPC. + + Retrieves the specified conversation dataset. + + Returns: + Callable[[~.GetConversationDatasetRequest], + Awaitable[~.ConversationDataset]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_conversation_dataset" not in self._stubs: + self._stubs["get_conversation_dataset"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationDatasets/GetConversationDataset", + request_serializer=conversation_dataset.GetConversationDatasetRequest.serialize, + response_deserializer=conversation_dataset.ConversationDataset.deserialize, + ) + return self._stubs["get_conversation_dataset"] + + @property + def list_conversation_datasets( + self, + ) -> Callable[ + [conversation_dataset.ListConversationDatasetsRequest], + Awaitable[conversation_dataset.ListConversationDatasetsResponse], + ]: + r"""Return a callable for the list conversation datasets method over gRPC. + + Returns the list of all conversation datasets in the + specified project and location. + + Returns: + Callable[[~.ListConversationDatasetsRequest], + Awaitable[~.ListConversationDatasetsResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "list_conversation_datasets" not in self._stubs: + self._stubs["list_conversation_datasets"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationDatasets/ListConversationDatasets", + request_serializer=conversation_dataset.ListConversationDatasetsRequest.serialize, + response_deserializer=conversation_dataset.ListConversationDatasetsResponse.deserialize, + ) + return self._stubs["list_conversation_datasets"] + + @property + def delete_conversation_dataset( + self, + ) -> Callable[ + [conversation_dataset.DeleteConversationDatasetRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the delete conversation dataset method over gRPC. + + Deletes the specified conversation dataset. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [DeleteConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata] + - ``response``: An `Empty + message `__ + + Returns: + Callable[[~.DeleteConversationDatasetRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "delete_conversation_dataset" not in self._stubs: + self._stubs["delete_conversation_dataset"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationDatasets/DeleteConversationDataset", + request_serializer=conversation_dataset.DeleteConversationDatasetRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["delete_conversation_dataset"] + + @property + def import_conversation_data( + self, + ) -> Callable[ + [conversation_dataset.ImportConversationDataRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the import conversation data method over gRPC. + + Import data into the specified conversation dataset. Note that + it is not allowed to import data to a conversation dataset that + already has data in it. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [ImportConversationDataOperationMetadata][google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata] + - ``response``: + [ImportConversationDataOperationResponse][google.cloud.dialogflow.v2.ImportConversationDataOperationResponse] + + Returns: + Callable[[~.ImportConversationDataRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "import_conversation_data" not in self._stubs: + self._stubs["import_conversation_data"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationDatasets/ImportConversationData", + request_serializer=conversation_dataset.ImportConversationDataRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["import_conversation_data"] + + def close(self): + return self.grpc_channel.close() + + +__all__ = ("ConversationDatasetsGrpcAsyncIOTransport",) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/__init__.py new file mode 100644 index 000000000000..477b58b0d87d --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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 .client import ConversationModelsClient +from .async_client import ConversationModelsAsyncClient + +__all__ = ( + "ConversationModelsClient", + "ConversationModelsAsyncClient", +) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/async_client.py new file mode 100644 index 000000000000..e93b32f5e98e --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/async_client.py @@ -0,0 +1,1223 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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 collections import OrderedDict +import functools +import re +from typing import Dict, Optional, Sequence, Tuple, Type, Union +import pkg_resources + +from google.api_core.client_options import ClientOptions +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.auth import credentials as ga_credentials # type: ignore +from google.oauth2 import service_account # type: ignore + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object] # type: ignore + +from google.api_core import operation # type: ignore +from google.api_core import operation_async # type: ignore +from google.cloud.dialogflow_v2.services.conversation_models import pagers +from google.cloud.dialogflow_v2.types import conversation_model +from google.cloud.dialogflow_v2.types import ( + conversation_model as gcd_conversation_model, +) +from google.protobuf import empty_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore +from .transports.base import ConversationModelsTransport, DEFAULT_CLIENT_INFO +from .transports.grpc_asyncio import ConversationModelsGrpcAsyncIOTransport +from .client import ConversationModelsClient + + +class ConversationModelsAsyncClient: + """Manages a collection of models for human agent assistant.""" + + _client: ConversationModelsClient + + DEFAULT_ENDPOINT = ConversationModelsClient.DEFAULT_ENDPOINT + DEFAULT_MTLS_ENDPOINT = ConversationModelsClient.DEFAULT_MTLS_ENDPOINT + + conversation_dataset_path = staticmethod( + ConversationModelsClient.conversation_dataset_path + ) + parse_conversation_dataset_path = staticmethod( + ConversationModelsClient.parse_conversation_dataset_path + ) + conversation_model_path = staticmethod( + ConversationModelsClient.conversation_model_path + ) + parse_conversation_model_path = staticmethod( + ConversationModelsClient.parse_conversation_model_path + ) + conversation_model_evaluation_path = staticmethod( + ConversationModelsClient.conversation_model_evaluation_path + ) + parse_conversation_model_evaluation_path = staticmethod( + ConversationModelsClient.parse_conversation_model_evaluation_path + ) + document_path = staticmethod(ConversationModelsClient.document_path) + parse_document_path = staticmethod(ConversationModelsClient.parse_document_path) + common_billing_account_path = staticmethod( + ConversationModelsClient.common_billing_account_path + ) + parse_common_billing_account_path = staticmethod( + ConversationModelsClient.parse_common_billing_account_path + ) + common_folder_path = staticmethod(ConversationModelsClient.common_folder_path) + parse_common_folder_path = staticmethod( + ConversationModelsClient.parse_common_folder_path + ) + common_organization_path = staticmethod( + ConversationModelsClient.common_organization_path + ) + parse_common_organization_path = staticmethod( + ConversationModelsClient.parse_common_organization_path + ) + common_project_path = staticmethod(ConversationModelsClient.common_project_path) + parse_common_project_path = staticmethod( + ConversationModelsClient.parse_common_project_path + ) + common_location_path = staticmethod(ConversationModelsClient.common_location_path) + parse_common_location_path = staticmethod( + ConversationModelsClient.parse_common_location_path + ) + + @classmethod + def from_service_account_info(cls, info: dict, *args, **kwargs): + """Creates an instance of this client using the provided credentials + info. + + Args: + info (dict): The service account private key info. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + ConversationModelsAsyncClient: The constructed client. + """ + return ConversationModelsClient.from_service_account_info.__func__(ConversationModelsAsyncClient, info, *args, **kwargs) # type: ignore + + @classmethod + def from_service_account_file(cls, filename: str, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + ConversationModelsAsyncClient: The constructed client. + """ + return ConversationModelsClient.from_service_account_file.__func__(ConversationModelsAsyncClient, filename, *args, **kwargs) # type: ignore + + from_service_account_json = from_service_account_file + + @classmethod + def get_mtls_endpoint_and_cert_source( + cls, client_options: Optional[ClientOptions] = None + ): + """Return the API endpoint and client cert source for mutual TLS. + + The client cert source is determined in the following order: + (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the + client cert source is None. + (2) if `client_options.client_cert_source` is provided, use the provided one; if the + default client cert source exists, use the default one; otherwise the client cert + source is None. + + The API endpoint is determined in the following order: + (1) if `client_options.api_endpoint` if provided, use the provided one. + (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the + default mTLS endpoint; if the environment variabel is "never", use the default API + endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise + use the default API endpoint. + + More details can be found at https://google.aip.dev/auth/4114. + + Args: + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. Only the `api_endpoint` and `client_cert_source` properties may be used + in this method. + + Returns: + Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the + client cert source to use. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If any errors happen. + """ + return ConversationModelsClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore + + @property + def transport(self) -> ConversationModelsTransport: + """Returns the transport used by the client instance. + + Returns: + ConversationModelsTransport: The transport used by the client instance. + """ + return self._client.transport + + get_transport_class = functools.partial( + type(ConversationModelsClient).get_transport_class, + type(ConversationModelsClient), + ) + + def __init__( + self, + *, + credentials: ga_credentials.Credentials = None, + transport: Union[str, ConversationModelsTransport] = "grpc_asyncio", + client_options: ClientOptions = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + ) -> None: + """Instantiates the conversation models client. + + Args: + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + transport (Union[str, ~.ConversationModelsTransport]): The + transport to use. If set to None, a transport is chosen + automatically. + client_options (ClientOptions): Custom options for the client. It + won't take effect if a ``transport`` instance is provided. + (1) The ``api_endpoint`` property can be used to override the + default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT + environment variable can also be used to override the endpoint: + "always" (always use the default mTLS endpoint), "never" (always + use the default regular endpoint) and "auto" (auto switch to the + default mTLS endpoint if client certificate is present, this is + the default value). However, the ``api_endpoint`` property takes + precedence if provided. + (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable + is "true", then the ``client_cert_source`` property can be used + to provide client certificate for mutual TLS transport. If + not provided, the default SSL client certificate will be used if + present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not + set, no client certificate will be used. + + Raises: + google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport + creation failed for any reason. + """ + self._client = ConversationModelsClient( + credentials=credentials, + transport=transport, + client_options=client_options, + client_info=client_info, + ) + + async def create_conversation_model( + self, + request: Union[ + gcd_conversation_model.CreateConversationModelRequest, dict + ] = None, + *, + parent: str = None, + conversation_model: gcd_conversation_model.ConversationModel = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation_async.AsyncOperation: + r"""Creates a model. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [CreateConversationModelOperationMetadata][google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata] + - ``response``: + [ConversationModel][google.cloud.dialogflow.v2.ConversationModel] + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_create_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + conversation_model = dialogflow_v2.ConversationModel() + conversation_model.display_name = "display_name_value" + conversation_model.datasets.dataset = "dataset_value" + + request = dialogflow_v2.CreateConversationModelRequest( + conversation_model=conversation_model, + ) + + # Make the request + operation = client.create_conversation_model(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.CreateConversationModelRequest, dict]): + The request object. The request message for + [ConversationModels.CreateConversationModel][google.cloud.dialogflow.v2.ConversationModels.CreateConversationModel] + parent (:class:`str`): + The project to create conversation model for. Format: + ``projects/`` + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + conversation_model (:class:`google.cloud.dialogflow_v2.types.ConversationModel`): + Required. The conversation model to + create. + + This corresponds to the ``conversation_model`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.cloud.dialogflow_v2.types.ConversationModel` + Represents a conversation model. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent, conversation_model]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + request = gcd_conversation_model.CreateConversationModelRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + if conversation_model is not None: + request.conversation_model = conversation_model + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.create_conversation_model, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + gcd_conversation_model.ConversationModel, + metadata_type=gcd_conversation_model.CreateConversationModelOperationMetadata, + ) + + # Done; return the response. + return response + + async def get_conversation_model( + self, + request: Union[conversation_model.GetConversationModelRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> conversation_model.ConversationModel: + r"""Gets conversation model. + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_get_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetConversationModelRequest( + name="name_value", + ) + + # Make the request + response = client.get_conversation_model(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.GetConversationModelRequest, dict]): + The request object. The request message for + [ConversationModels.GetConversationModel][google.cloud.dialogflow.v2.ConversationModels.GetConversationModel] + name (:class:`str`): + Required. The conversation model to retrieve. Format: + ``projects//conversationModels/`` + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dialogflow_v2.types.ConversationModel: + Represents a conversation model. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + request = conversation_model.GetConversationModelRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.get_conversation_model, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Done; return the response. + return response + + async def list_conversation_models( + self, + request: Union[conversation_model.ListConversationModelsRequest, dict] = None, + *, + parent: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListConversationModelsAsyncPager: + r"""Lists conversation models. + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_list_conversation_models(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListConversationModelsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversation_models(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.ListConversationModelsRequest, dict]): + The request object. The request message for + [ConversationModels.ListConversationModels][google.cloud.dialogflow.v2.ConversationModels.ListConversationModels] + parent (:class:`str`): + Required. The project to list all conversation models + for. Format: ``projects/`` + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dialogflow_v2.services.conversation_models.pagers.ListConversationModelsAsyncPager: + The response message for + [ConversationModels.ListConversationModels][google.cloud.dialogflow.v2.ConversationModels.ListConversationModels] + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + request = conversation_model.ListConversationModelsRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.list_conversation_models, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # This method is paged; wrap the response in a pager, which provides + # an `__aiter__` convenience method. + response = pagers.ListConversationModelsAsyncPager( + method=rpc, request=request, response=response, metadata=metadata, + ) + + # Done; return the response. + return response + + async def delete_conversation_model( + self, + request: Union[conversation_model.DeleteConversationModelRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation_async.AsyncOperation: + r"""Deletes a model. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [DeleteConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata] + - ``response``: An `Empty + message `__ + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_delete_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteConversationModelRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_conversation_model(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.DeleteConversationModelRequest, dict]): + The request object. The request message for + [ConversationModels.DeleteConversationModel][google.cloud.dialogflow.v2.ConversationModels.DeleteConversationModel] + name (:class:`str`): + Required. The conversation model to delete. Format: + ``projects//conversationModels/`` + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to + use it as the request or the response type of an API + method. For instance: + + service Foo { + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); + + } + + The JSON representation for Empty is empty JSON + object {}. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + request = conversation_model.DeleteConversationModelRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.delete_conversation_model, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + empty_pb2.Empty, + metadata_type=conversation_model.DeleteConversationModelOperationMetadata, + ) + + # Done; return the response. + return response + + async def deploy_conversation_model( + self, + request: Union[conversation_model.DeployConversationModelRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation_async.AsyncOperation: + r"""Deploys a model. If a model is already deployed, deploying it + has no effect. A model can only serve prediction requests after + it gets deployed. For article suggestion, custom model will not + be used unless it is deployed. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [DeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeployConversationModelOperationMetadata] + - ``response``: An `Empty + message `__ + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_deploy_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeployConversationModelRequest( + name="name_value", + ) + + # Make the request + operation = client.deploy_conversation_model(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.DeployConversationModelRequest, dict]): + The request object. The request message for + [ConversationModels.DeployConversationModel][google.cloud.dialogflow.v2.ConversationModels.DeployConversationModel] + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to + use it as the request or the response type of an API + method. For instance: + + service Foo { + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); + + } + + The JSON representation for Empty is empty JSON + object {}. + + """ + # Create or coerce a protobuf request object. + request = conversation_model.DeployConversationModelRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.deploy_conversation_model, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + empty_pb2.Empty, + metadata_type=conversation_model.DeployConversationModelOperationMetadata, + ) + + # Done; return the response. + return response + + async def undeploy_conversation_model( + self, + request: Union[ + conversation_model.UndeployConversationModelRequest, dict + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation_async.AsyncOperation: + r"""Undeploys a model. If the model is not deployed this method has + no effect. If the model is currently being used: + + - For article suggestion, article suggestion will fallback to + the default model if model is undeployed. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [UndeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.UndeployConversationModelOperationMetadata] + - ``response``: An `Empty + message `__ + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_undeploy_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.UndeployConversationModelRequest( + name="name_value", + ) + + # Make the request + operation = client.undeploy_conversation_model(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.UndeployConversationModelRequest, dict]): + The request object. The request message for + [ConversationModels.UndeployConversationModel][google.cloud.dialogflow.v2.ConversationModels.UndeployConversationModel] + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to + use it as the request or the response type of an API + method. For instance: + + service Foo { + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); + + } + + The JSON representation for Empty is empty JSON + object {}. + + """ + # Create or coerce a protobuf request object. + request = conversation_model.UndeployConversationModelRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.undeploy_conversation_model, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + empty_pb2.Empty, + metadata_type=conversation_model.UndeployConversationModelOperationMetadata, + ) + + # Done; return the response. + return response + + async def get_conversation_model_evaluation( + self, + request: Union[ + conversation_model.GetConversationModelEvaluationRequest, dict + ] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> conversation_model.ConversationModelEvaluation: + r"""Gets an evaluation of conversation model. + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_get_conversation_model_evaluation(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetConversationModelEvaluationRequest( + name="name_value", + ) + + # Make the request + response = client.get_conversation_model_evaluation(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.GetConversationModelEvaluationRequest, dict]): + The request object. The request message for + [ConversationModels.GetConversationModelEvaluation][google.cloud.dialogflow.v2.ConversationModels.GetConversationModelEvaluation] + name (:class:`str`): + Required. The conversation model evaluation resource + name. Format: + ``projects//conversationModels//evaluations/`` + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dialogflow_v2.types.ConversationModelEvaluation: + Represents evaluation result of a + conversation model. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + request = conversation_model.GetConversationModelEvaluationRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.get_conversation_model_evaluation, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Done; return the response. + return response + + async def list_conversation_model_evaluations( + self, + request: Union[ + conversation_model.ListConversationModelEvaluationsRequest, dict + ] = None, + *, + parent: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListConversationModelEvaluationsAsyncPager: + r"""Lists evaluations of a conversation model. + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_list_conversation_model_evaluations(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListConversationModelEvaluationsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversation_model_evaluations(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.ListConversationModelEvaluationsRequest, dict]): + The request object. The request message for + [ConversationModels.ListConversationModelEvaluations][google.cloud.dialogflow.v2.ConversationModels.ListConversationModelEvaluations] + parent (:class:`str`): + Required. The conversation model resource name. Format: + ``projects//conversationModels/`` + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dialogflow_v2.services.conversation_models.pagers.ListConversationModelEvaluationsAsyncPager: + The response message for + [ConversationModels.ListConversationModelEvaluations][google.cloud.dialogflow.v2.ConversationModels.ListConversationModelEvaluations] + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + request = conversation_model.ListConversationModelEvaluationsRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.list_conversation_model_evaluations, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # This method is paged; wrap the response in a pager, which provides + # an `__aiter__` convenience method. + response = pagers.ListConversationModelEvaluationsAsyncPager( + method=rpc, request=request, response=response, metadata=metadata, + ) + + # Done; return the response. + return response + + async def create_conversation_model_evaluation( + self, + request: Union[ + conversation_model.CreateConversationModelEvaluationRequest, dict + ] = None, + *, + parent: str = None, + conversation_model_evaluation: conversation_model.ConversationModelEvaluation = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation_async.AsyncOperation: + r"""Creates evaluation of a conversation model. + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_create_conversation_model_evaluation(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.CreateConversationModelEvaluationRequest( + parent="parent_value", + ) + + # Make the request + operation = client.create_conversation_model_evaluation(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.CreateConversationModelEvaluationRequest, dict]): + The request object. The request message for + [ConversationModels.CreateConversationModelEvaluation][google.cloud.dialogflow.v2.ConversationModels.CreateConversationModelEvaluation] + parent (:class:`str`): + Required. The conversation model resource name. Format: + ``projects//locations//conversationModels/`` + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + conversation_model_evaluation (:class:`google.cloud.dialogflow_v2.types.ConversationModelEvaluation`): + Required. The conversation model + evaluation to be created. + + This corresponds to the ``conversation_model_evaluation`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.cloud.dialogflow_v2.types.ConversationModelEvaluation` + Represents evaluation result of a conversation model. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent, conversation_model_evaluation]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + request = conversation_model.CreateConversationModelEvaluationRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + if conversation_model_evaluation is not None: + request.conversation_model_evaluation = conversation_model_evaluation + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.create_conversation_model_evaluation, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + conversation_model.ConversationModelEvaluation, + metadata_type=conversation_model.CreateConversationModelEvaluationOperationMetadata, + ) + + # Done; return the response. + return response + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc, tb): + await self.transport.close() + + +try: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=pkg_resources.get_distribution( + "google-cloud-dialogflow", + ).version, + ) +except pkg_resources.DistributionNotFound: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() + + +__all__ = ("ConversationModelsAsyncClient",) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/client.py new file mode 100644 index 000000000000..ead70deaf30d --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/client.py @@ -0,0 +1,1494 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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 collections import OrderedDict +import os +import re +from typing import Dict, Optional, Sequence, Tuple, Type, Union +import pkg_resources + +from google.api_core import client_options as client_options_lib +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.transport import mtls # type: ignore +from google.auth.transport.grpc import SslCredentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore +from google.oauth2 import service_account # type: ignore + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object] # type: ignore + +from google.api_core import operation # type: ignore +from google.api_core import operation_async # type: ignore +from google.cloud.dialogflow_v2.services.conversation_models import pagers +from google.cloud.dialogflow_v2.types import conversation_model +from google.cloud.dialogflow_v2.types import ( + conversation_model as gcd_conversation_model, +) +from google.protobuf import empty_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore +from .transports.base import ConversationModelsTransport, DEFAULT_CLIENT_INFO +from .transports.grpc import ConversationModelsGrpcTransport +from .transports.grpc_asyncio import ConversationModelsGrpcAsyncIOTransport + + +class ConversationModelsClientMeta(type): + """Metaclass for the ConversationModels client. + + This provides class-level methods for building and retrieving + support objects (e.g. transport) without polluting the client instance + objects. + """ + + _transport_registry = ( + OrderedDict() + ) # type: Dict[str, Type[ConversationModelsTransport]] + _transport_registry["grpc"] = ConversationModelsGrpcTransport + _transport_registry["grpc_asyncio"] = ConversationModelsGrpcAsyncIOTransport + + def get_transport_class( + cls, label: str = None, + ) -> Type[ConversationModelsTransport]: + """Returns an appropriate transport class. + + Args: + label: The name of the desired transport. If none is + provided, then the first transport in the registry is used. + + Returns: + The transport class to use. + """ + # If a specific transport is requested, return that one. + if label: + return cls._transport_registry[label] + + # No transport is requested; return the default (that is, the first one + # in the dictionary). + return next(iter(cls._transport_registry.values())) + + +class ConversationModelsClient(metaclass=ConversationModelsClientMeta): + """Manages a collection of models for human agent assistant.""" + + @staticmethod + def _get_default_mtls_endpoint(api_endpoint): + """Converts api endpoint to mTLS endpoint. + + Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to + "*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively. + Args: + api_endpoint (Optional[str]): the api endpoint to convert. + Returns: + str: converted mTLS api endpoint. + """ + if not api_endpoint: + return api_endpoint + + mtls_endpoint_re = re.compile( + r"(?P[^.]+)(?P\.mtls)?(?P\.sandbox)?(?P\.googleapis\.com)?" + ) + + m = mtls_endpoint_re.match(api_endpoint) + name, mtls, sandbox, googledomain = m.groups() + if mtls or not googledomain: + return api_endpoint + + if sandbox: + return api_endpoint.replace( + "sandbox.googleapis.com", "mtls.sandbox.googleapis.com" + ) + + return api_endpoint.replace(".googleapis.com", ".mtls.googleapis.com") + + DEFAULT_ENDPOINT = "dialogflow.googleapis.com" + DEFAULT_MTLS_ENDPOINT = _get_default_mtls_endpoint.__func__( # type: ignore + DEFAULT_ENDPOINT + ) + + @classmethod + def from_service_account_info(cls, info: dict, *args, **kwargs): + """Creates an instance of this client using the provided credentials + info. + + Args: + info (dict): The service account private key info. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + ConversationModelsClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_info(info) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + @classmethod + def from_service_account_file(cls, filename: str, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + ConversationModelsClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_file(filename) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + + from_service_account_json = from_service_account_file + + @property + def transport(self) -> ConversationModelsTransport: + """Returns the transport used by the client instance. + + Returns: + ConversationModelsTransport: The transport used by the client + instance. + """ + return self._transport + + @staticmethod + def conversation_dataset_path( + project: str, location: str, conversation_dataset: str, + ) -> str: + """Returns a fully-qualified conversation_dataset string.""" + return "projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}".format( + project=project, + location=location, + conversation_dataset=conversation_dataset, + ) + + @staticmethod + def parse_conversation_dataset_path(path: str) -> Dict[str, str]: + """Parses a conversation_dataset path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/conversationDatasets/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def conversation_model_path( + project: str, location: str, conversation_model: str, + ) -> str: + """Returns a fully-qualified conversation_model string.""" + return "projects/{project}/locations/{location}/conversationModels/{conversation_model}".format( + project=project, location=location, conversation_model=conversation_model, + ) + + @staticmethod + def parse_conversation_model_path(path: str) -> Dict[str, str]: + """Parses a conversation_model path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/conversationModels/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def conversation_model_evaluation_path( + project: str, conversation_model: str, + ) -> str: + """Returns a fully-qualified conversation_model_evaluation string.""" + return "projects/{project}/conversationModels/{conversation_model}/evaluations/evaluation".format( + project=project, conversation_model=conversation_model, + ) + + @staticmethod + def parse_conversation_model_evaluation_path(path: str) -> Dict[str, str]: + """Parses a conversation_model_evaluation path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/conversationModels/(?P.+?)/evaluations/evaluation$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def document_path(project: str, knowledge_base: str, document: str,) -> str: + """Returns a fully-qualified document string.""" + return "projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}".format( + project=project, knowledge_base=knowledge_base, document=document, + ) + + @staticmethod + def parse_document_path(path: str) -> Dict[str, str]: + """Parses a document path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/knowledgeBases/(?P.+?)/documents/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def common_billing_account_path(billing_account: str,) -> str: + """Returns a fully-qualified billing_account string.""" + return "billingAccounts/{billing_account}".format( + billing_account=billing_account, + ) + + @staticmethod + def parse_common_billing_account_path(path: str) -> Dict[str, str]: + """Parse a billing_account path into its component segments.""" + m = re.match(r"^billingAccounts/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_folder_path(folder: str,) -> str: + """Returns a fully-qualified folder string.""" + return "folders/{folder}".format(folder=folder,) + + @staticmethod + def parse_common_folder_path(path: str) -> Dict[str, str]: + """Parse a folder path into its component segments.""" + m = re.match(r"^folders/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_organization_path(organization: str,) -> str: + """Returns a fully-qualified organization string.""" + return "organizations/{organization}".format(organization=organization,) + + @staticmethod + def parse_common_organization_path(path: str) -> Dict[str, str]: + """Parse a organization path into its component segments.""" + m = re.match(r"^organizations/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_project_path(project: str,) -> str: + """Returns a fully-qualified project string.""" + return "projects/{project}".format(project=project,) + + @staticmethod + def parse_common_project_path(path: str) -> Dict[str, str]: + """Parse a project path into its component segments.""" + m = re.match(r"^projects/(?P.+?)$", path) + return m.groupdict() if m else {} + + @staticmethod + def common_location_path(project: str, location: str,) -> str: + """Returns a fully-qualified location string.""" + return "projects/{project}/locations/{location}".format( + project=project, location=location, + ) + + @staticmethod + def parse_common_location_path(path: str) -> Dict[str, str]: + """Parse a location path into its component segments.""" + m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)$", path) + return m.groupdict() if m else {} + + @classmethod + def get_mtls_endpoint_and_cert_source( + cls, client_options: Optional[client_options_lib.ClientOptions] = None + ): + """Return the API endpoint and client cert source for mutual TLS. + + The client cert source is determined in the following order: + (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the + client cert source is None. + (2) if `client_options.client_cert_source` is provided, use the provided one; if the + default client cert source exists, use the default one; otherwise the client cert + source is None. + + The API endpoint is determined in the following order: + (1) if `client_options.api_endpoint` if provided, use the provided one. + (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the + default mTLS endpoint; if the environment variabel is "never", use the default API + endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise + use the default API endpoint. + + More details can be found at https://google.aip.dev/auth/4114. + + Args: + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. Only the `api_endpoint` and `client_cert_source` properties may be used + in this method. + + Returns: + Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the + client cert source to use. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If any errors happen. + """ + if client_options is None: + client_options = client_options_lib.ClientOptions() + use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") + use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") + if use_client_cert not in ("true", "false"): + raise ValueError( + "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + if use_mtls_endpoint not in ("auto", "never", "always"): + raise MutualTLSChannelError( + "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + # Figure out the client cert source to use. + client_cert_source = None + if use_client_cert == "true": + if client_options.client_cert_source: + client_cert_source = client_options.client_cert_source + elif mtls.has_default_client_cert_source(): + client_cert_source = mtls.default_client_cert_source() + + # Figure out which api endpoint to use. + if client_options.api_endpoint is not None: + api_endpoint = client_options.api_endpoint + elif use_mtls_endpoint == "always" or ( + use_mtls_endpoint == "auto" and client_cert_source + ): + api_endpoint = cls.DEFAULT_MTLS_ENDPOINT + else: + api_endpoint = cls.DEFAULT_ENDPOINT + + return api_endpoint, client_cert_source + + def __init__( + self, + *, + credentials: Optional[ga_credentials.Credentials] = None, + transport: Union[str, ConversationModelsTransport, None] = None, + client_options: Optional[client_options_lib.ClientOptions] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + ) -> None: + """Instantiates the conversation models client. + + Args: + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + transport (Union[str, ConversationModelsTransport]): The + transport to use. If set to None, a transport is chosen + automatically. + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. It won't take effect if a ``transport`` instance is provided. + (1) The ``api_endpoint`` property can be used to override the + default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT + environment variable can also be used to override the endpoint: + "always" (always use the default mTLS endpoint), "never" (always + use the default regular endpoint) and "auto" (auto switch to the + default mTLS endpoint if client certificate is present, this is + the default value). However, the ``api_endpoint`` property takes + precedence if provided. + (2) If GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable + is "true", then the ``client_cert_source`` property can be used + to provide client certificate for mutual TLS transport. If + not provided, the default SSL client certificate will be used if + present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not + set, no client certificate will be 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. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport + creation failed for any reason. + """ + if isinstance(client_options, dict): + client_options = client_options_lib.from_dict(client_options) + if client_options is None: + client_options = client_options_lib.ClientOptions() + + api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( + client_options + ) + + api_key_value = getattr(client_options, "api_key", None) + if api_key_value and credentials: + raise ValueError( + "client_options.api_key and credentials are mutually exclusive" + ) + + # Save or instantiate the transport. + # Ordinarily, we provide the transport, but allowing a custom transport + # instance provides an extensibility point for unusual situations. + if isinstance(transport, ConversationModelsTransport): + # transport is a ConversationModelsTransport instance. + if credentials or client_options.credentials_file or api_key_value: + raise ValueError( + "When providing a transport instance, " + "provide its credentials directly." + ) + if client_options.scopes: + raise ValueError( + "When providing a transport instance, provide its scopes " + "directly." + ) + self._transport = transport + else: + import google.auth._default # type: ignore + + if api_key_value and hasattr( + google.auth._default, "get_api_key_credentials" + ): + credentials = google.auth._default.get_api_key_credentials( + api_key_value + ) + + Transport = type(self).get_transport_class(transport) + self._transport = Transport( + credentials=credentials, + credentials_file=client_options.credentials_file, + host=api_endpoint, + scopes=client_options.scopes, + client_cert_source_for_mtls=client_cert_source_func, + quota_project_id=client_options.quota_project_id, + client_info=client_info, + always_use_jwt_access=True, + ) + + def create_conversation_model( + self, + request: Union[ + gcd_conversation_model.CreateConversationModelRequest, dict + ] = None, + *, + parent: str = None, + conversation_model: gcd_conversation_model.ConversationModel = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation.Operation: + r"""Creates a model. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [CreateConversationModelOperationMetadata][google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata] + - ``response``: + [ConversationModel][google.cloud.dialogflow.v2.ConversationModel] + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_create_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + conversation_model = dialogflow_v2.ConversationModel() + conversation_model.display_name = "display_name_value" + conversation_model.datasets.dataset = "dataset_value" + + request = dialogflow_v2.CreateConversationModelRequest( + conversation_model=conversation_model, + ) + + # Make the request + operation = client.create_conversation_model(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.CreateConversationModelRequest, dict]): + The request object. The request message for + [ConversationModels.CreateConversationModel][google.cloud.dialogflow.v2.ConversationModels.CreateConversationModel] + parent (str): + The project to create conversation model for. Format: + ``projects/`` + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + conversation_model (google.cloud.dialogflow_v2.types.ConversationModel): + Required. The conversation model to + create. + + This corresponds to the ``conversation_model`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.cloud.dialogflow_v2.types.ConversationModel` + Represents a conversation model. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent, conversation_model]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a gcd_conversation_model.CreateConversationModelRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance( + request, gcd_conversation_model.CreateConversationModelRequest + ): + request = gcd_conversation_model.CreateConversationModelRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + if conversation_model is not None: + request.conversation_model = conversation_model + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.create_conversation_model + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + gcd_conversation_model.ConversationModel, + metadata_type=gcd_conversation_model.CreateConversationModelOperationMetadata, + ) + + # Done; return the response. + return response + + def get_conversation_model( + self, + request: Union[conversation_model.GetConversationModelRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> conversation_model.ConversationModel: + r"""Gets conversation model. + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_get_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetConversationModelRequest( + name="name_value", + ) + + # Make the request + response = client.get_conversation_model(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.GetConversationModelRequest, dict]): + The request object. The request message for + [ConversationModels.GetConversationModel][google.cloud.dialogflow.v2.ConversationModels.GetConversationModel] + name (str): + Required. The conversation model to retrieve. Format: + ``projects//conversationModels/`` + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dialogflow_v2.types.ConversationModel: + Represents a conversation model. + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a conversation_model.GetConversationModelRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, conversation_model.GetConversationModelRequest): + request = conversation_model.GetConversationModelRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.get_conversation_model] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Done; return the response. + return response + + def list_conversation_models( + self, + request: Union[conversation_model.ListConversationModelsRequest, dict] = None, + *, + parent: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListConversationModelsPager: + r"""Lists conversation models. + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_list_conversation_models(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListConversationModelsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversation_models(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.ListConversationModelsRequest, dict]): + The request object. The request message for + [ConversationModels.ListConversationModels][google.cloud.dialogflow.v2.ConversationModels.ListConversationModels] + parent (str): + Required. The project to list all conversation models + for. Format: ``projects/`` + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dialogflow_v2.services.conversation_models.pagers.ListConversationModelsPager: + The response message for + [ConversationModels.ListConversationModels][google.cloud.dialogflow.v2.ConversationModels.ListConversationModels] + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a conversation_model.ListConversationModelsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, conversation_model.ListConversationModelsRequest): + request = conversation_model.ListConversationModelsRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.list_conversation_models] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # This method is paged; wrap the response in a pager, which provides + # an `__iter__` convenience method. + response = pagers.ListConversationModelsPager( + method=rpc, request=request, response=response, metadata=metadata, + ) + + # Done; return the response. + return response + + def delete_conversation_model( + self, + request: Union[conversation_model.DeleteConversationModelRequest, dict] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation.Operation: + r"""Deletes a model. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [DeleteConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata] + - ``response``: An `Empty + message `__ + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_delete_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteConversationModelRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_conversation_model(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.DeleteConversationModelRequest, dict]): + The request object. The request message for + [ConversationModels.DeleteConversationModel][google.cloud.dialogflow.v2.ConversationModels.DeleteConversationModel] + name (str): + Required. The conversation model to delete. Format: + ``projects//conversationModels/`` + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to + use it as the request or the response type of an API + method. For instance: + + service Foo { + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); + + } + + The JSON representation for Empty is empty JSON + object {}. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a conversation_model.DeleteConversationModelRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, conversation_model.DeleteConversationModelRequest): + request = conversation_model.DeleteConversationModelRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.delete_conversation_model + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + empty_pb2.Empty, + metadata_type=conversation_model.DeleteConversationModelOperationMetadata, + ) + + # Done; return the response. + return response + + def deploy_conversation_model( + self, + request: Union[conversation_model.DeployConversationModelRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation.Operation: + r"""Deploys a model. If a model is already deployed, deploying it + has no effect. A model can only serve prediction requests after + it gets deployed. For article suggestion, custom model will not + be used unless it is deployed. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [DeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeployConversationModelOperationMetadata] + - ``response``: An `Empty + message `__ + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_deploy_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeployConversationModelRequest( + name="name_value", + ) + + # Make the request + operation = client.deploy_conversation_model(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.DeployConversationModelRequest, dict]): + The request object. The request message for + [ConversationModels.DeployConversationModel][google.cloud.dialogflow.v2.ConversationModels.DeployConversationModel] + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to + use it as the request or the response type of an API + method. For instance: + + service Foo { + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); + + } + + The JSON representation for Empty is empty JSON + object {}. + + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a conversation_model.DeployConversationModelRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, conversation_model.DeployConversationModelRequest): + request = conversation_model.DeployConversationModelRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.deploy_conversation_model + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + empty_pb2.Empty, + metadata_type=conversation_model.DeployConversationModelOperationMetadata, + ) + + # Done; return the response. + return response + + def undeploy_conversation_model( + self, + request: Union[ + conversation_model.UndeployConversationModelRequest, dict + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation.Operation: + r"""Undeploys a model. If the model is not deployed this method has + no effect. If the model is currently being used: + + - For article suggestion, article suggestion will fallback to + the default model if model is undeployed. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [UndeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.UndeployConversationModelOperationMetadata] + - ``response``: An `Empty + message `__ + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_undeploy_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.UndeployConversationModelRequest( + name="name_value", + ) + + # Make the request + operation = client.undeploy_conversation_model(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.UndeployConversationModelRequest, dict]): + The request object. The request message for + [ConversationModels.UndeployConversationModel][google.cloud.dialogflow.v2.ConversationModels.UndeployConversationModel] + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be :class:`google.protobuf.empty_pb2.Empty` A generic empty message that you can re-use to avoid defining duplicated + empty messages in your APIs. A typical example is to + use it as the request or the response type of an API + method. For instance: + + service Foo { + rpc Bar(google.protobuf.Empty) returns + (google.protobuf.Empty); + + } + + The JSON representation for Empty is empty JSON + object {}. + + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a conversation_model.UndeployConversationModelRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, conversation_model.UndeployConversationModelRequest): + request = conversation_model.UndeployConversationModelRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.undeploy_conversation_model + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + empty_pb2.Empty, + metadata_type=conversation_model.UndeployConversationModelOperationMetadata, + ) + + # Done; return the response. + return response + + def get_conversation_model_evaluation( + self, + request: Union[ + conversation_model.GetConversationModelEvaluationRequest, dict + ] = None, + *, + name: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> conversation_model.ConversationModelEvaluation: + r"""Gets an evaluation of conversation model. + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_get_conversation_model_evaluation(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetConversationModelEvaluationRequest( + name="name_value", + ) + + # Make the request + response = client.get_conversation_model_evaluation(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.GetConversationModelEvaluationRequest, dict]): + The request object. The request message for + [ConversationModels.GetConversationModelEvaluation][google.cloud.dialogflow.v2.ConversationModels.GetConversationModelEvaluation] + name (str): + Required. The conversation model evaluation resource + name. Format: + ``projects//conversationModels//evaluations/`` + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dialogflow_v2.types.ConversationModelEvaluation: + Represents evaluation result of a + conversation model. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a conversation_model.GetConversationModelEvaluationRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance( + request, conversation_model.GetConversationModelEvaluationRequest + ): + request = conversation_model.GetConversationModelEvaluationRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.get_conversation_model_evaluation + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Done; return the response. + return response + + def list_conversation_model_evaluations( + self, + request: Union[ + conversation_model.ListConversationModelEvaluationsRequest, dict + ] = None, + *, + parent: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> pagers.ListConversationModelEvaluationsPager: + r"""Lists evaluations of a conversation model. + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_list_conversation_model_evaluations(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListConversationModelEvaluationsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversation_model_evaluations(request=request) + + # Handle the response + for response in page_result: + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.ListConversationModelEvaluationsRequest, dict]): + The request object. The request message for + [ConversationModels.ListConversationModelEvaluations][google.cloud.dialogflow.v2.ConversationModels.ListConversationModelEvaluations] + parent (str): + Required. The conversation model resource name. Format: + ``projects//conversationModels/`` + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.dialogflow_v2.services.conversation_models.pagers.ListConversationModelEvaluationsPager: + The response message for + [ConversationModels.ListConversationModelEvaluations][google.cloud.dialogflow.v2.ConversationModels.ListConversationModelEvaluations] + + Iterating over this object will yield results and + resolve additional pages automatically. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a conversation_model.ListConversationModelEvaluationsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance( + request, conversation_model.ListConversationModelEvaluationsRequest + ): + request = conversation_model.ListConversationModelEvaluationsRequest( + request + ) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.list_conversation_model_evaluations + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # This method is paged; wrap the response in a pager, which provides + # an `__iter__` convenience method. + response = pagers.ListConversationModelEvaluationsPager( + method=rpc, request=request, response=response, metadata=metadata, + ) + + # Done; return the response. + return response + + def create_conversation_model_evaluation( + self, + request: Union[ + conversation_model.CreateConversationModelEvaluationRequest, dict + ] = None, + *, + parent: str = None, + conversation_model_evaluation: conversation_model.ConversationModelEvaluation = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation.Operation: + r"""Creates evaluation of a conversation model. + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_create_conversation_model_evaluation(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.CreateConversationModelEvaluationRequest( + parent="parent_value", + ) + + # Make the request + operation = client.create_conversation_model_evaluation(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.CreateConversationModelEvaluationRequest, dict]): + The request object. The request message for + [ConversationModels.CreateConversationModelEvaluation][google.cloud.dialogflow.v2.ConversationModels.CreateConversationModelEvaluation] + parent (str): + Required. The conversation model resource name. Format: + ``projects//locations//conversationModels/`` + + This corresponds to the ``parent`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + conversation_model_evaluation (google.cloud.dialogflow_v2.types.ConversationModelEvaluation): + Required. The conversation model + evaluation to be created. + + This corresponds to the ``conversation_model_evaluation`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.cloud.dialogflow_v2.types.ConversationModelEvaluation` + Represents evaluation result of a conversation model. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([parent, conversation_model_evaluation]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a conversation_model.CreateConversationModelEvaluationRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance( + request, conversation_model.CreateConversationModelEvaluationRequest + ): + request = conversation_model.CreateConversationModelEvaluationRequest( + request + ) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if parent is not None: + request.parent = parent + if conversation_model_evaluation is not None: + request.conversation_model_evaluation = conversation_model_evaluation + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.create_conversation_model_evaluation + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + conversation_model.ConversationModelEvaluation, + metadata_type=conversation_model.CreateConversationModelEvaluationOperationMetadata, + ) + + # Done; return the response. + return response + + def __enter__(self): + return self + + def __exit__(self, type, value, traceback): + """Releases underlying transport's resources. + + .. warning:: + ONLY use as a context manager if the transport is NOT shared + with other clients! Exiting the with block will CLOSE the transport + and may cause errors in other clients! + """ + self.transport.close() + + +try: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=pkg_resources.get_distribution( + "google-cloud-dialogflow", + ).version, + ) +except pkg_resources.DistributionNotFound: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() + + +__all__ = ("ConversationModelsClient",) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/pagers.py new file mode 100644 index 000000000000..eb45a88124de --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/pagers.py @@ -0,0 +1,301 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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 typing import ( + Any, + AsyncIterator, + Awaitable, + Callable, + Sequence, + Tuple, + Optional, + Iterator, +) + +from google.cloud.dialogflow_v2.types import conversation_model + + +class ListConversationModelsPager: + """A pager for iterating through ``list_conversation_models`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dialogflow_v2.types.ListConversationModelsResponse` object, and + provides an ``__iter__`` method to iterate through its + ``conversation_models`` field. + + If there are more pages, the ``__iter__`` method will make additional + ``ListConversationModels`` requests and continue to iterate + through the ``conversation_models`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dialogflow_v2.types.ListConversationModelsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + + def __init__( + self, + method: Callable[..., conversation_model.ListConversationModelsResponse], + request: conversation_model.ListConversationModelsRequest, + response: conversation_model.ListConversationModelsResponse, + *, + metadata: Sequence[Tuple[str, str]] = () + ): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dialogflow_v2.types.ListConversationModelsRequest): + The initial request object. + response (google.cloud.dialogflow_v2.types.ListConversationModelsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = conversation_model.ListConversationModelsRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages(self) -> Iterator[conversation_model.ListConversationModelsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method(self._request, metadata=self._metadata) + yield self._response + + def __iter__(self) -> Iterator[conversation_model.ConversationModel]: + for page in self.pages: + yield from page.conversation_models + + def __repr__(self) -> str: + return "{0}<{1!r}>".format(self.__class__.__name__, self._response) + + +class ListConversationModelsAsyncPager: + """A pager for iterating through ``list_conversation_models`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dialogflow_v2.types.ListConversationModelsResponse` object, and + provides an ``__aiter__`` method to iterate through its + ``conversation_models`` field. + + If there are more pages, the ``__aiter__`` method will make additional + ``ListConversationModels`` requests and continue to iterate + through the ``conversation_models`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dialogflow_v2.types.ListConversationModelsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + + def __init__( + self, + method: Callable[ + ..., Awaitable[conversation_model.ListConversationModelsResponse] + ], + request: conversation_model.ListConversationModelsRequest, + response: conversation_model.ListConversationModelsResponse, + *, + metadata: Sequence[Tuple[str, str]] = () + ): + """Instantiates the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dialogflow_v2.types.ListConversationModelsRequest): + The initial request object. + response (google.cloud.dialogflow_v2.types.ListConversationModelsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = conversation_model.ListConversationModelsRequest(request) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + async def pages( + self, + ) -> AsyncIterator[conversation_model.ListConversationModelsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = await self._method(self._request, metadata=self._metadata) + yield self._response + + def __aiter__(self) -> AsyncIterator[conversation_model.ConversationModel]: + async def async_generator(): + async for page in self.pages: + for response in page.conversation_models: + yield response + + return async_generator() + + def __repr__(self) -> str: + return "{0}<{1!r}>".format(self.__class__.__name__, self._response) + + +class ListConversationModelEvaluationsPager: + """A pager for iterating through ``list_conversation_model_evaluations`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dialogflow_v2.types.ListConversationModelEvaluationsResponse` object, and + provides an ``__iter__`` method to iterate through its + ``conversation_model_evaluations`` field. + + If there are more pages, the ``__iter__`` method will make additional + ``ListConversationModelEvaluations`` requests and continue to iterate + through the ``conversation_model_evaluations`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dialogflow_v2.types.ListConversationModelEvaluationsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + + def __init__( + self, + method: Callable[ + ..., conversation_model.ListConversationModelEvaluationsResponse + ], + request: conversation_model.ListConversationModelEvaluationsRequest, + response: conversation_model.ListConversationModelEvaluationsResponse, + *, + metadata: Sequence[Tuple[str, str]] = () + ): + """Instantiate the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dialogflow_v2.types.ListConversationModelEvaluationsRequest): + The initial request object. + response (google.cloud.dialogflow_v2.types.ListConversationModelEvaluationsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = conversation_model.ListConversationModelEvaluationsRequest( + request + ) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + def pages( + self, + ) -> Iterator[conversation_model.ListConversationModelEvaluationsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = self._method(self._request, metadata=self._metadata) + yield self._response + + def __iter__(self) -> Iterator[conversation_model.ConversationModelEvaluation]: + for page in self.pages: + yield from page.conversation_model_evaluations + + def __repr__(self) -> str: + return "{0}<{1!r}>".format(self.__class__.__name__, self._response) + + +class ListConversationModelEvaluationsAsyncPager: + """A pager for iterating through ``list_conversation_model_evaluations`` requests. + + This class thinly wraps an initial + :class:`google.cloud.dialogflow_v2.types.ListConversationModelEvaluationsResponse` object, and + provides an ``__aiter__`` method to iterate through its + ``conversation_model_evaluations`` field. + + If there are more pages, the ``__aiter__`` method will make additional + ``ListConversationModelEvaluations`` requests and continue to iterate + through the ``conversation_model_evaluations`` field on the + corresponding responses. + + All the usual :class:`google.cloud.dialogflow_v2.types.ListConversationModelEvaluationsResponse` + attributes are available on the pager. If multiple requests are made, only + the most recent response is retained, and thus used for attribute lookup. + """ + + def __init__( + self, + method: Callable[ + ..., Awaitable[conversation_model.ListConversationModelEvaluationsResponse] + ], + request: conversation_model.ListConversationModelEvaluationsRequest, + response: conversation_model.ListConversationModelEvaluationsResponse, + *, + metadata: Sequence[Tuple[str, str]] = () + ): + """Instantiates the pager. + + Args: + method (Callable): The method that was originally called, and + which instantiated this pager. + request (google.cloud.dialogflow_v2.types.ListConversationModelEvaluationsRequest): + The initial request object. + response (google.cloud.dialogflow_v2.types.ListConversationModelEvaluationsResponse): + The initial response object. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + """ + self._method = method + self._request = conversation_model.ListConversationModelEvaluationsRequest( + request + ) + self._response = response + self._metadata = metadata + + def __getattr__(self, name: str) -> Any: + return getattr(self._response, name) + + @property + async def pages( + self, + ) -> AsyncIterator[conversation_model.ListConversationModelEvaluationsResponse]: + yield self._response + while self._response.next_page_token: + self._request.page_token = self._response.next_page_token + self._response = await self._method(self._request, metadata=self._metadata) + yield self._response + + def __aiter__( + self, + ) -> AsyncIterator[conversation_model.ConversationModelEvaluation]: + async def async_generator(): + async for page in self.pages: + for response in page.conversation_model_evaluations: + yield response + + return async_generator() + + def __repr__(self) -> str: + return "{0}<{1!r}>".format(self.__class__.__name__, self._response) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/transports/__init__.py new file mode 100644 index 000000000000..86586e1301a8 --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/transports/__init__.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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 collections import OrderedDict +from typing import Dict, Type + +from .base import ConversationModelsTransport +from .grpc import ConversationModelsGrpcTransport +from .grpc_asyncio import ConversationModelsGrpcAsyncIOTransport + + +# Compile a registry of transports. +_transport_registry = ( + OrderedDict() +) # type: Dict[str, Type[ConversationModelsTransport]] +_transport_registry["grpc"] = ConversationModelsGrpcTransport +_transport_registry["grpc_asyncio"] = ConversationModelsGrpcAsyncIOTransport + +__all__ = ( + "ConversationModelsTransport", + "ConversationModelsGrpcTransport", + "ConversationModelsGrpcAsyncIOTransport", +) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/transports/base.py new file mode 100644 index 000000000000..1ecb27b30ae5 --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/transports/base.py @@ -0,0 +1,286 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +import abc +from typing import Awaitable, Callable, Dict, Optional, Sequence, Union +import pkg_resources + +import google.auth # type: ignore +import google.api_core +from google.api_core import exceptions as core_exceptions +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.api_core import operations_v1 +from google.auth import credentials as ga_credentials # type: ignore +from google.oauth2 import service_account # type: ignore + +from google.cloud.dialogflow_v2.types import conversation_model +from google.cloud.dialogflow_v2.types import ( + conversation_model as gcd_conversation_model, +) +from google.longrunning import operations_pb2 # type: ignore + +try: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=pkg_resources.get_distribution( + "google-cloud-dialogflow", + ).version, + ) +except pkg_resources.DistributionNotFound: + DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() + + +class ConversationModelsTransport(abc.ABC): + """Abstract transport class for ConversationModels.""" + + AUTH_SCOPES = ( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow", + ) + + DEFAULT_HOST: str = "dialogflow.googleapis.com" + + def __init__( + self, + *, + host: str = DEFAULT_HOST, + credentials: ga_credentials.Credentials = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + quota_project_id: Optional[str] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + **kwargs, + ) -> None: + """Instantiate the transport. + + Args: + host (Optional[str]): + The hostname to connect to. + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is mutually exclusive with credentials. + scopes (Optional[Sequence[str]]): A list of scopes. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + 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. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. + if ":" not in host: + host += ":443" + self._host = host + + scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES} + + # Save the scopes. + self._scopes = scopes + + # If no credentials are provided, then determine the appropriate + # defaults. + if credentials and credentials_file: + raise core_exceptions.DuplicateCredentialArgs( + "'credentials_file' and 'credentials' are mutually exclusive" + ) + + if credentials_file is not None: + credentials, _ = google.auth.load_credentials_from_file( + credentials_file, **scopes_kwargs, quota_project_id=quota_project_id + ) + elif credentials is None: + credentials, _ = google.auth.default( + **scopes_kwargs, quota_project_id=quota_project_id + ) + + # If the credentials are service account credentials, then always try to use self signed JWT. + if ( + always_use_jwt_access + and isinstance(credentials, service_account.Credentials) + and hasattr(service_account.Credentials, "with_always_use_jwt_access") + ): + credentials = credentials.with_always_use_jwt_access(True) + + # Save the credentials. + self._credentials = credentials + + def _prep_wrapped_messages(self, client_info): + # Precompute the wrapped methods. + self._wrapped_methods = { + self.create_conversation_model: gapic_v1.method.wrap_method( + self.create_conversation_model, + default_timeout=None, + client_info=client_info, + ), + self.get_conversation_model: gapic_v1.method.wrap_method( + self.get_conversation_model, + default_timeout=None, + client_info=client_info, + ), + self.list_conversation_models: gapic_v1.method.wrap_method( + self.list_conversation_models, + default_timeout=None, + client_info=client_info, + ), + self.delete_conversation_model: gapic_v1.method.wrap_method( + self.delete_conversation_model, + default_timeout=None, + client_info=client_info, + ), + self.deploy_conversation_model: gapic_v1.method.wrap_method( + self.deploy_conversation_model, + default_timeout=None, + client_info=client_info, + ), + self.undeploy_conversation_model: gapic_v1.method.wrap_method( + self.undeploy_conversation_model, + default_timeout=None, + client_info=client_info, + ), + self.get_conversation_model_evaluation: gapic_v1.method.wrap_method( + self.get_conversation_model_evaluation, + default_timeout=None, + client_info=client_info, + ), + self.list_conversation_model_evaluations: gapic_v1.method.wrap_method( + self.list_conversation_model_evaluations, + default_timeout=None, + client_info=client_info, + ), + self.create_conversation_model_evaluation: gapic_v1.method.wrap_method( + self.create_conversation_model_evaluation, + default_timeout=None, + client_info=client_info, + ), + } + + def close(self): + """Closes resources associated with the transport. + + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! + """ + raise NotImplementedError() + + @property + def operations_client(self): + """Return the client designed to process long-running operations.""" + raise NotImplementedError() + + @property + def create_conversation_model( + self, + ) -> Callable[ + [gcd_conversation_model.CreateConversationModelRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + + @property + def get_conversation_model( + self, + ) -> Callable[ + [conversation_model.GetConversationModelRequest], + Union[ + conversation_model.ConversationModel, + Awaitable[conversation_model.ConversationModel], + ], + ]: + raise NotImplementedError() + + @property + def list_conversation_models( + self, + ) -> Callable[ + [conversation_model.ListConversationModelsRequest], + Union[ + conversation_model.ListConversationModelsResponse, + Awaitable[conversation_model.ListConversationModelsResponse], + ], + ]: + raise NotImplementedError() + + @property + def delete_conversation_model( + self, + ) -> Callable[ + [conversation_model.DeleteConversationModelRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + + @property + def deploy_conversation_model( + self, + ) -> Callable[ + [conversation_model.DeployConversationModelRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + + @property + def undeploy_conversation_model( + self, + ) -> Callable[ + [conversation_model.UndeployConversationModelRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + + @property + def get_conversation_model_evaluation( + self, + ) -> Callable[ + [conversation_model.GetConversationModelEvaluationRequest], + Union[ + conversation_model.ConversationModelEvaluation, + Awaitable[conversation_model.ConversationModelEvaluation], + ], + ]: + raise NotImplementedError() + + @property + def list_conversation_model_evaluations( + self, + ) -> Callable[ + [conversation_model.ListConversationModelEvaluationsRequest], + Union[ + conversation_model.ListConversationModelEvaluationsResponse, + Awaitable[conversation_model.ListConversationModelEvaluationsResponse], + ], + ]: + raise NotImplementedError() + + @property + def create_conversation_model_evaluation( + self, + ) -> Callable[ + [conversation_model.CreateConversationModelEvaluationRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + + +__all__ = ("ConversationModelsTransport",) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/transports/grpc.py new file mode 100644 index 000000000000..ac2e4fca492e --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/transports/grpc.py @@ -0,0 +1,569 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +import warnings +from typing import Callable, Dict, Optional, Sequence, Tuple, Union + +from google.api_core import grpc_helpers +from google.api_core import operations_v1 +from google.api_core import gapic_v1 +import google.auth # type: ignore +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.transport.grpc import SslCredentials # type: ignore + +import grpc # type: ignore + +from google.cloud.dialogflow_v2.types import conversation_model +from google.cloud.dialogflow_v2.types import ( + conversation_model as gcd_conversation_model, +) +from google.longrunning import operations_pb2 # type: ignore +from .base import ConversationModelsTransport, DEFAULT_CLIENT_INFO + + +class ConversationModelsGrpcTransport(ConversationModelsTransport): + """gRPC backend transport for ConversationModels. + + Manages a collection of models for human agent assistant. + + This class defines the same methods as the primary client, so the + primary client can load the underlying transport implementation + and call it. + + It sends protocol buffers over the wire using gRPC (which is built on + top of HTTP/2); the ``grpcio`` package must be installed. + """ + + _stubs: Dict[str, Callable] + + def __init__( + self, + *, + host: str = "dialogflow.googleapis.com", + credentials: ga_credentials.Credentials = None, + credentials_file: str = None, + scopes: Sequence[str] = None, + channel: grpc.Channel = None, + api_mtls_endpoint: str = None, + client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, + ssl_channel_credentials: grpc.ChannelCredentials = None, + client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + quota_project_id: Optional[str] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + ) -> None: + """Instantiate the transport. + + Args: + host (Optional[str]): + The hostname to connect to. + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + This argument is ignored if ``channel`` is provided. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is ignored if ``channel`` is provided. + scopes (Optional(Sequence[str])): A list of scopes. This argument is + ignored if ``channel`` is provided. + channel (Optional[grpc.Channel]): A ``Channel`` instance through + which to make calls. + api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. + If provided, it overrides the ``host`` argument and tries to create + a mutual TLS channel with client SSL credentials from + ``client_cert_source`` or application default SSL credentials. + client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): + Deprecated. A callback to provide client SSL certificate bytes and + private key bytes, both in PEM format. It is ignored if + ``api_mtls_endpoint`` is None. + ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials + for the grpc channel. It is ignored if ``channel`` is provided. + client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): + A callback to provide client certificate bytes and private key bytes, + both in PEM format. It is used to configure a mutual TLS channel. It is + ignored if ``channel`` or ``ssl_channel_credentials`` is provided. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + 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. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport + creation failed for any reason. + google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` + and ``credentials_file`` are passed. + """ + self._grpc_channel = None + self._ssl_channel_credentials = ssl_channel_credentials + self._stubs: Dict[str, Callable] = {} + self._operations_client: Optional[operations_v1.OperationsClient] = None + + if api_mtls_endpoint: + warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) + if client_cert_source: + warnings.warn("client_cert_source is deprecated", DeprecationWarning) + + if channel: + # Ignore credentials if a channel was passed. + credentials = False + # If a channel was explicitly provided, set it. + self._grpc_channel = channel + self._ssl_channel_credentials = None + + else: + if api_mtls_endpoint: + host = api_mtls_endpoint + + # Create SSL credentials with client_cert_source or application + # default SSL credentials. + if client_cert_source: + cert, key = client_cert_source() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + else: + self._ssl_channel_credentials = SslCredentials().ssl_credentials + + else: + if client_cert_source_for_mtls and not ssl_channel_credentials: + cert, key = client_cert_source_for_mtls() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + + # The base transport sets the host, credentials and scopes + super().__init__( + host=host, + credentials=credentials, + credentials_file=credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + client_info=client_info, + always_use_jwt_access=always_use_jwt_access, + ) + + if not self._grpc_channel: + self._grpc_channel = type(self).create_channel( + self._host, + # use the credentials which are saved + credentials=self._credentials, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, + scopes=self._scopes, + ssl_credentials=self._ssl_channel_credentials, + quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + # Wrap messages. This must be done after self._grpc_channel exists + self._prep_wrapped_messages(client_info) + + @classmethod + def create_channel( + cls, + host: str = "dialogflow.googleapis.com", + credentials: ga_credentials.Credentials = None, + credentials_file: str = None, + scopes: Optional[Sequence[str]] = None, + quota_project_id: Optional[str] = None, + **kwargs, + ) -> grpc.Channel: + """Create and return a gRPC channel object. + Args: + host (Optional[str]): The host for the channel to use. + credentials (Optional[~.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. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is mutually exclusive with credentials. + scopes (Optional[Sequence[str]]): A optional list of scopes needed for this + service. These are only used when credentials are not specified and + are passed to :func:`google.auth.default`. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + kwargs (Optional[dict]): Keyword arguments, which are passed to the + channel creation. + Returns: + grpc.Channel: A gRPC channel object. + + Raises: + google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` + and ``credentials_file`` are passed. + """ + + return grpc_helpers.create_channel( + host, + credentials=credentials, + credentials_file=credentials_file, + quota_project_id=quota_project_id, + default_scopes=cls.AUTH_SCOPES, + scopes=scopes, + default_host=cls.DEFAULT_HOST, + **kwargs, + ) + + @property + def grpc_channel(self) -> grpc.Channel: + """Return the channel designed to connect to this service. + """ + return self._grpc_channel + + @property + def operations_client(self) -> operations_v1.OperationsClient: + """Create the client designed to process long-running operations. + + This property caches on the instance; repeated calls return the same + client. + """ + # Quick check: Only create a new client if we do not already have one. + if self._operations_client is None: + self._operations_client = operations_v1.OperationsClient(self.grpc_channel) + + # Return the client from cache. + return self._operations_client + + @property + def create_conversation_model( + self, + ) -> Callable[ + [gcd_conversation_model.CreateConversationModelRequest], + operations_pb2.Operation, + ]: + r"""Return a callable for the create conversation model method over gRPC. + + Creates a model. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [CreateConversationModelOperationMetadata][google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata] + - ``response``: + [ConversationModel][google.cloud.dialogflow.v2.ConversationModel] + + Returns: + Callable[[~.CreateConversationModelRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "create_conversation_model" not in self._stubs: + self._stubs["create_conversation_model"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/CreateConversationModel", + request_serializer=gcd_conversation_model.CreateConversationModelRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["create_conversation_model"] + + @property + def get_conversation_model( + self, + ) -> Callable[ + [conversation_model.GetConversationModelRequest], + conversation_model.ConversationModel, + ]: + r"""Return a callable for the get conversation model method over gRPC. + + Gets conversation model. + + Returns: + Callable[[~.GetConversationModelRequest], + ~.ConversationModel]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_conversation_model" not in self._stubs: + self._stubs["get_conversation_model"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/GetConversationModel", + request_serializer=conversation_model.GetConversationModelRequest.serialize, + response_deserializer=conversation_model.ConversationModel.deserialize, + ) + return self._stubs["get_conversation_model"] + + @property + def list_conversation_models( + self, + ) -> Callable[ + [conversation_model.ListConversationModelsRequest], + conversation_model.ListConversationModelsResponse, + ]: + r"""Return a callable for the list conversation models method over gRPC. + + Lists conversation models. + + Returns: + Callable[[~.ListConversationModelsRequest], + ~.ListConversationModelsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "list_conversation_models" not in self._stubs: + self._stubs["list_conversation_models"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/ListConversationModels", + request_serializer=conversation_model.ListConversationModelsRequest.serialize, + response_deserializer=conversation_model.ListConversationModelsResponse.deserialize, + ) + return self._stubs["list_conversation_models"] + + @property + def delete_conversation_model( + self, + ) -> Callable[ + [conversation_model.DeleteConversationModelRequest], operations_pb2.Operation + ]: + r"""Return a callable for the delete conversation model method over gRPC. + + Deletes a model. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [DeleteConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata] + - ``response``: An `Empty + message `__ + + Returns: + Callable[[~.DeleteConversationModelRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "delete_conversation_model" not in self._stubs: + self._stubs["delete_conversation_model"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/DeleteConversationModel", + request_serializer=conversation_model.DeleteConversationModelRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["delete_conversation_model"] + + @property + def deploy_conversation_model( + self, + ) -> Callable[ + [conversation_model.DeployConversationModelRequest], operations_pb2.Operation + ]: + r"""Return a callable for the deploy conversation model method over gRPC. + + Deploys a model. If a model is already deployed, deploying it + has no effect. A model can only serve prediction requests after + it gets deployed. For article suggestion, custom model will not + be used unless it is deployed. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [DeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeployConversationModelOperationMetadata] + - ``response``: An `Empty + message `__ + + Returns: + Callable[[~.DeployConversationModelRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "deploy_conversation_model" not in self._stubs: + self._stubs["deploy_conversation_model"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/DeployConversationModel", + request_serializer=conversation_model.DeployConversationModelRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["deploy_conversation_model"] + + @property + def undeploy_conversation_model( + self, + ) -> Callable[ + [conversation_model.UndeployConversationModelRequest], operations_pb2.Operation + ]: + r"""Return a callable for the undeploy conversation model method over gRPC. + + Undeploys a model. If the model is not deployed this method has + no effect. If the model is currently being used: + + - For article suggestion, article suggestion will fallback to + the default model if model is undeployed. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [UndeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.UndeployConversationModelOperationMetadata] + - ``response``: An `Empty + message `__ + + Returns: + Callable[[~.UndeployConversationModelRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "undeploy_conversation_model" not in self._stubs: + self._stubs["undeploy_conversation_model"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/UndeployConversationModel", + request_serializer=conversation_model.UndeployConversationModelRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["undeploy_conversation_model"] + + @property + def get_conversation_model_evaluation( + self, + ) -> Callable[ + [conversation_model.GetConversationModelEvaluationRequest], + conversation_model.ConversationModelEvaluation, + ]: + r"""Return a callable for the get conversation model + evaluation method over gRPC. + + Gets an evaluation of conversation model. + + Returns: + Callable[[~.GetConversationModelEvaluationRequest], + ~.ConversationModelEvaluation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_conversation_model_evaluation" not in self._stubs: + self._stubs[ + "get_conversation_model_evaluation" + ] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/GetConversationModelEvaluation", + request_serializer=conversation_model.GetConversationModelEvaluationRequest.serialize, + response_deserializer=conversation_model.ConversationModelEvaluation.deserialize, + ) + return self._stubs["get_conversation_model_evaluation"] + + @property + def list_conversation_model_evaluations( + self, + ) -> Callable[ + [conversation_model.ListConversationModelEvaluationsRequest], + conversation_model.ListConversationModelEvaluationsResponse, + ]: + r"""Return a callable for the list conversation model + evaluations method over gRPC. + + Lists evaluations of a conversation model. + + Returns: + Callable[[~.ListConversationModelEvaluationsRequest], + ~.ListConversationModelEvaluationsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "list_conversation_model_evaluations" not in self._stubs: + self._stubs[ + "list_conversation_model_evaluations" + ] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/ListConversationModelEvaluations", + request_serializer=conversation_model.ListConversationModelEvaluationsRequest.serialize, + response_deserializer=conversation_model.ListConversationModelEvaluationsResponse.deserialize, + ) + return self._stubs["list_conversation_model_evaluations"] + + @property + def create_conversation_model_evaluation( + self, + ) -> Callable[ + [conversation_model.CreateConversationModelEvaluationRequest], + operations_pb2.Operation, + ]: + r"""Return a callable for the create conversation model + evaluation method over gRPC. + + Creates evaluation of a conversation model. + + Returns: + Callable[[~.CreateConversationModelEvaluationRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "create_conversation_model_evaluation" not in self._stubs: + self._stubs[ + "create_conversation_model_evaluation" + ] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/CreateConversationModelEvaluation", + request_serializer=conversation_model.CreateConversationModelEvaluationRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["create_conversation_model_evaluation"] + + def close(self): + self.grpc_channel.close() + + +__all__ = ("ConversationModelsGrpcTransport",) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/transports/grpc_asyncio.py new file mode 100644 index 000000000000..28c8ddc8c7a7 --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_models/transports/grpc_asyncio.py @@ -0,0 +1,576 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +import warnings +from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union + +from google.api_core import gapic_v1 +from google.api_core import grpc_helpers_async +from google.api_core import operations_v1 +from google.auth import credentials as ga_credentials # type: ignore +from google.auth.transport.grpc import SslCredentials # type: ignore + +import grpc # type: ignore +from grpc.experimental import aio # type: ignore + +from google.cloud.dialogflow_v2.types import conversation_model +from google.cloud.dialogflow_v2.types import ( + conversation_model as gcd_conversation_model, +) +from google.longrunning import operations_pb2 # type: ignore +from .base import ConversationModelsTransport, DEFAULT_CLIENT_INFO +from .grpc import ConversationModelsGrpcTransport + + +class ConversationModelsGrpcAsyncIOTransport(ConversationModelsTransport): + """gRPC AsyncIO backend transport for ConversationModels. + + Manages a collection of models for human agent assistant. + + This class defines the same methods as the primary client, so the + primary client can load the underlying transport implementation + and call it. + + It sends protocol buffers over the wire using gRPC (which is built on + top of HTTP/2); the ``grpcio`` package must be installed. + """ + + _grpc_channel: aio.Channel + _stubs: Dict[str, Callable] = {} + + @classmethod + def create_channel( + cls, + host: str = "dialogflow.googleapis.com", + credentials: ga_credentials.Credentials = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + quota_project_id: Optional[str] = None, + **kwargs, + ) -> aio.Channel: + """Create and return a gRPC AsyncIO channel object. + Args: + host (Optional[str]): The host for the channel to use. + credentials (Optional[~.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. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is ignored if ``channel`` is provided. + scopes (Optional[Sequence[str]]): A optional list of scopes needed for this + service. These are only used when credentials are not specified and + are passed to :func:`google.auth.default`. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + kwargs (Optional[dict]): Keyword arguments, which are passed to the + channel creation. + Returns: + aio.Channel: A gRPC AsyncIO channel object. + """ + + return grpc_helpers_async.create_channel( + host, + credentials=credentials, + credentials_file=credentials_file, + quota_project_id=quota_project_id, + default_scopes=cls.AUTH_SCOPES, + scopes=scopes, + default_host=cls.DEFAULT_HOST, + **kwargs, + ) + + def __init__( + self, + *, + host: str = "dialogflow.googleapis.com", + credentials: ga_credentials.Credentials = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: aio.Channel = None, + api_mtls_endpoint: str = None, + client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, + ssl_channel_credentials: grpc.ChannelCredentials = None, + client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + quota_project_id=None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + always_use_jwt_access: Optional[bool] = False, + ) -> None: + """Instantiate the transport. + + Args: + host (Optional[str]): + The hostname to connect to. + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + This argument is ignored if ``channel`` is provided. + credentials_file (Optional[str]): A file with credentials that can + be loaded with :func:`google.auth.load_credentials_from_file`. + This argument is ignored if ``channel`` is provided. + scopes (Optional[Sequence[str]]): A optional list of scopes needed for this + service. These are only used when credentials are not specified and + are passed to :func:`google.auth.default`. + channel (Optional[aio.Channel]): A ``Channel`` instance through + which to make calls. + api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint. + If provided, it overrides the ``host`` argument and tries to create + a mutual TLS channel with client SSL credentials from + ``client_cert_source`` or application default SSL credentials. + client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]): + Deprecated. A callback to provide client SSL certificate bytes and + private key bytes, both in PEM format. It is ignored if + ``api_mtls_endpoint`` is None. + ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials + for the grpc channel. It is ignored if ``channel`` is provided. + client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): + A callback to provide client certificate bytes and private key bytes, + both in PEM format. It is used to configure a mutual TLS channel. It is + ignored if ``channel`` or ``ssl_channel_credentials`` is provided. + quota_project_id (Optional[str]): An optional project to use for billing + and quota. + 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. + always_use_jwt_access (Optional[bool]): Whether self signed JWT should + be used for service account credentials. + + Raises: + google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport + creation failed for any reason. + google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` + and ``credentials_file`` are passed. + """ + self._grpc_channel = None + self._ssl_channel_credentials = ssl_channel_credentials + self._stubs: Dict[str, Callable] = {} + self._operations_client: Optional[operations_v1.OperationsAsyncClient] = None + + if api_mtls_endpoint: + warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) + if client_cert_source: + warnings.warn("client_cert_source is deprecated", DeprecationWarning) + + if channel: + # Ignore credentials if a channel was passed. + credentials = False + # If a channel was explicitly provided, set it. + self._grpc_channel = channel + self._ssl_channel_credentials = None + else: + if api_mtls_endpoint: + host = api_mtls_endpoint + + # Create SSL credentials with client_cert_source or application + # default SSL credentials. + if client_cert_source: + cert, key = client_cert_source() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + else: + self._ssl_channel_credentials = SslCredentials().ssl_credentials + + else: + if client_cert_source_for_mtls and not ssl_channel_credentials: + cert, key = client_cert_source_for_mtls() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + + # The base transport sets the host, credentials and scopes + super().__init__( + host=host, + credentials=credentials, + credentials_file=credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + client_info=client_info, + always_use_jwt_access=always_use_jwt_access, + ) + + if not self._grpc_channel: + self._grpc_channel = type(self).create_channel( + self._host, + # use the credentials which are saved + credentials=self._credentials, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, + scopes=self._scopes, + ssl_credentials=self._ssl_channel_credentials, + quota_project_id=quota_project_id, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + # Wrap messages. This must be done after self._grpc_channel exists + self._prep_wrapped_messages(client_info) + + @property + def grpc_channel(self) -> aio.Channel: + """Create the channel designed to connect to this service. + + This property caches on the instance; repeated calls return + the same channel. + """ + # Return the channel from cache. + return self._grpc_channel + + @property + def operations_client(self) -> operations_v1.OperationsAsyncClient: + """Create the client designed to process long-running operations. + + This property caches on the instance; repeated calls return the same + client. + """ + # Quick check: Only create a new client if we do not already have one. + if self._operations_client is None: + self._operations_client = operations_v1.OperationsAsyncClient( + self.grpc_channel + ) + + # Return the client from cache. + return self._operations_client + + @property + def create_conversation_model( + self, + ) -> Callable[ + [gcd_conversation_model.CreateConversationModelRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the create conversation model method over gRPC. + + Creates a model. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [CreateConversationModelOperationMetadata][google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata] + - ``response``: + [ConversationModel][google.cloud.dialogflow.v2.ConversationModel] + + Returns: + Callable[[~.CreateConversationModelRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "create_conversation_model" not in self._stubs: + self._stubs["create_conversation_model"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/CreateConversationModel", + request_serializer=gcd_conversation_model.CreateConversationModelRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["create_conversation_model"] + + @property + def get_conversation_model( + self, + ) -> Callable[ + [conversation_model.GetConversationModelRequest], + Awaitable[conversation_model.ConversationModel], + ]: + r"""Return a callable for the get conversation model method over gRPC. + + Gets conversation model. + + Returns: + Callable[[~.GetConversationModelRequest], + Awaitable[~.ConversationModel]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_conversation_model" not in self._stubs: + self._stubs["get_conversation_model"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/GetConversationModel", + request_serializer=conversation_model.GetConversationModelRequest.serialize, + response_deserializer=conversation_model.ConversationModel.deserialize, + ) + return self._stubs["get_conversation_model"] + + @property + def list_conversation_models( + self, + ) -> Callable[ + [conversation_model.ListConversationModelsRequest], + Awaitable[conversation_model.ListConversationModelsResponse], + ]: + r"""Return a callable for the list conversation models method over gRPC. + + Lists conversation models. + + Returns: + Callable[[~.ListConversationModelsRequest], + Awaitable[~.ListConversationModelsResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "list_conversation_models" not in self._stubs: + self._stubs["list_conversation_models"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/ListConversationModels", + request_serializer=conversation_model.ListConversationModelsRequest.serialize, + response_deserializer=conversation_model.ListConversationModelsResponse.deserialize, + ) + return self._stubs["list_conversation_models"] + + @property + def delete_conversation_model( + self, + ) -> Callable[ + [conversation_model.DeleteConversationModelRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the delete conversation model method over gRPC. + + Deletes a model. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [DeleteConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata] + - ``response``: An `Empty + message `__ + + Returns: + Callable[[~.DeleteConversationModelRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "delete_conversation_model" not in self._stubs: + self._stubs["delete_conversation_model"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/DeleteConversationModel", + request_serializer=conversation_model.DeleteConversationModelRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["delete_conversation_model"] + + @property + def deploy_conversation_model( + self, + ) -> Callable[ + [conversation_model.DeployConversationModelRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the deploy conversation model method over gRPC. + + Deploys a model. If a model is already deployed, deploying it + has no effect. A model can only serve prediction requests after + it gets deployed. For article suggestion, custom model will not + be used unless it is deployed. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [DeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeployConversationModelOperationMetadata] + - ``response``: An `Empty + message `__ + + Returns: + Callable[[~.DeployConversationModelRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "deploy_conversation_model" not in self._stubs: + self._stubs["deploy_conversation_model"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/DeployConversationModel", + request_serializer=conversation_model.DeployConversationModelRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["deploy_conversation_model"] + + @property + def undeploy_conversation_model( + self, + ) -> Callable[ + [conversation_model.UndeployConversationModelRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the undeploy conversation model method over gRPC. + + Undeploys a model. If the model is not deployed this method has + no effect. If the model is currently being used: + + - For article suggestion, article suggestion will fallback to + the default model if model is undeployed. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [UndeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.UndeployConversationModelOperationMetadata] + - ``response``: An `Empty + message `__ + + Returns: + Callable[[~.UndeployConversationModelRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "undeploy_conversation_model" not in self._stubs: + self._stubs["undeploy_conversation_model"] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/UndeployConversationModel", + request_serializer=conversation_model.UndeployConversationModelRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["undeploy_conversation_model"] + + @property + def get_conversation_model_evaluation( + self, + ) -> Callable[ + [conversation_model.GetConversationModelEvaluationRequest], + Awaitable[conversation_model.ConversationModelEvaluation], + ]: + r"""Return a callable for the get conversation model + evaluation method over gRPC. + + Gets an evaluation of conversation model. + + Returns: + Callable[[~.GetConversationModelEvaluationRequest], + Awaitable[~.ConversationModelEvaluation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "get_conversation_model_evaluation" not in self._stubs: + self._stubs[ + "get_conversation_model_evaluation" + ] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/GetConversationModelEvaluation", + request_serializer=conversation_model.GetConversationModelEvaluationRequest.serialize, + response_deserializer=conversation_model.ConversationModelEvaluation.deserialize, + ) + return self._stubs["get_conversation_model_evaluation"] + + @property + def list_conversation_model_evaluations( + self, + ) -> Callable[ + [conversation_model.ListConversationModelEvaluationsRequest], + Awaitable[conversation_model.ListConversationModelEvaluationsResponse], + ]: + r"""Return a callable for the list conversation model + evaluations method over gRPC. + + Lists evaluations of a conversation model. + + Returns: + Callable[[~.ListConversationModelEvaluationsRequest], + Awaitable[~.ListConversationModelEvaluationsResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "list_conversation_model_evaluations" not in self._stubs: + self._stubs[ + "list_conversation_model_evaluations" + ] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/ListConversationModelEvaluations", + request_serializer=conversation_model.ListConversationModelEvaluationsRequest.serialize, + response_deserializer=conversation_model.ListConversationModelEvaluationsResponse.deserialize, + ) + return self._stubs["list_conversation_model_evaluations"] + + @property + def create_conversation_model_evaluation( + self, + ) -> Callable[ + [conversation_model.CreateConversationModelEvaluationRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the create conversation model + evaluation method over gRPC. + + Creates evaluation of a conversation model. + + Returns: + Callable[[~.CreateConversationModelEvaluationRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "create_conversation_model_evaluation" not in self._stubs: + self._stubs[ + "create_conversation_model_evaluation" + ] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationModels/CreateConversationModelEvaluation", + request_serializer=conversation_model.CreateConversationModelEvaluationRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["create_conversation_model_evaluation"] + + def close(self): + return self.grpc_channel.close() + + +__all__ = ("ConversationModelsGrpcAsyncIOTransport",) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/__init__.py index c0cb1cd03856..ba1e4487dc42 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/async_client.py index 55b3c3c18ca4..b583a5d7f80c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -31,6 +31,8 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore +from google.api_core import operation # type: ignore +from google.api_core import operation_async # type: ignore from google.cloud.dialogflow_v2.services.conversation_profiles import pagers from google.cloud.dialogflow_v2.types import audio_config from google.cloud.dialogflow_v2.types import conversation_profile @@ -250,7 +252,7 @@ async def list_conversation_profiles( specified project. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -351,7 +353,7 @@ async def get_conversation_profile( ) -> conversation_profile.ConversationProfile: r"""Retrieves the specified conversation profile. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -452,7 +454,7 @@ async def create_conversation_profile( API. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -566,7 +568,7 @@ async def update_conversation_profile( API. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -672,7 +674,7 @@ async def delete_conversation_profile( ) -> None: r"""Deletes the specified conversation profile. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -744,6 +746,263 @@ def sample_delete_conversation_profile(): request, retry=retry, timeout=timeout, metadata=metadata, ) + async def set_suggestion_feature_config( + self, + request: Union[ + gcd_conversation_profile.SetSuggestionFeatureConfigRequest, dict + ] = None, + *, + conversation_profile: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation_async.AsyncOperation: + r"""Adds or updates a suggestion feature in a conversation profile. + If the conversation profile contains the type of suggestion + feature for the participant role, it will update it. Otherwise + it will insert the suggestion feature. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [SetSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata] + - ``response``: + [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] + + If a long running operation to add or update suggestion feature + config for the same conversation profile, participant role and + suggestion feature type exists, please cancel the existing long + running operation before sending such request, otherwise the + request will be rejected. + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_set_suggestion_feature_config(): + # Create a client + client = dialogflow_v2.ConversationProfilesClient() + + # Initialize request argument(s) + request = dialogflow_v2.SetSuggestionFeatureConfigRequest( + conversation_profile="conversation_profile_value", + participant_role="END_USER", + ) + + # Make the request + operation = client.set_suggestion_feature_config(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.SetSuggestionFeatureConfigRequest, dict]): + The request object. The request message for + [ConversationProfiles.SetSuggestionFeature][]. + conversation_profile (:class:`str`): + Required. The Conversation Profile to add or update the + suggestion feature config. Format: + ``projects//locations//conversationProfiles/``. + + This corresponds to the ``conversation_profile`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.cloud.dialogflow_v2.types.ConversationProfile` + Defines the services to connect to incoming Dialogflow + conversations. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([conversation_profile]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + request = gcd_conversation_profile.SetSuggestionFeatureConfigRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if conversation_profile is not None: + request.conversation_profile = conversation_profile + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.set_suggestion_feature_config, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + (("conversation_profile", request.conversation_profile),) + ), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + gcd_conversation_profile.ConversationProfile, + metadata_type=gcd_conversation_profile.SetSuggestionFeatureConfigOperationMetadata, + ) + + # Done; return the response. + return response + + async def clear_suggestion_feature_config( + self, + request: Union[ + gcd_conversation_profile.ClearSuggestionFeatureConfigRequest, dict + ] = None, + *, + conversation_profile: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation_async.AsyncOperation: + r"""Clears a suggestion feature from a conversation profile for the + given participant role. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [ClearSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata] + - ``response``: + [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_clear_suggestion_feature_config(): + # Create a client + client = dialogflow_v2.ConversationProfilesClient() + + # Initialize request argument(s) + request = dialogflow_v2.ClearSuggestionFeatureConfigRequest( + conversation_profile="conversation_profile_value", + participant_role="END_USER", + suggestion_feature_type="SMART_REPLY", + ) + + # Make the request + operation = client.clear_suggestion_feature_config(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.ClearSuggestionFeatureConfigRequest, dict]): + The request object. The request message for + [ConversationProfiles.ClearFeature][]. + conversation_profile (:class:`str`): + Required. The Conversation Profile to add or update the + suggestion feature config. Format: + ``projects//locations//conversationProfiles/``. + + This corresponds to the ``conversation_profile`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation_async.AsyncOperation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.cloud.dialogflow_v2.types.ConversationProfile` + Defines the services to connect to incoming Dialogflow + conversations. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([conversation_profile]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + request = gcd_conversation_profile.ClearSuggestionFeatureConfigRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if conversation_profile is not None: + request.conversation_profile = conversation_profile + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.clear_suggestion_feature_config, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + (("conversation_profile", request.conversation_profile),) + ), + ) + + # Send the request. + response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation_async.from_gapic( + response, + self._client._transport.operations_client, + gcd_conversation_profile.ConversationProfile, + metadata_type=gcd_conversation_profile.ClearSuggestionFeatureConfigOperationMetadata, + ) + + # Done; return the response. + return response + async def __aenter__(self): return self diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/client.py index 68d7201e0812..2c1719f54d82 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -34,6 +34,8 @@ except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore +from google.api_core import operation # type: ignore +from google.api_core import operation_async # type: ignore from google.cloud.dialogflow_v2.services.conversation_profiles import pagers from google.cloud.dialogflow_v2.types import audio_config from google.cloud.dialogflow_v2.types import conversation_profile @@ -502,8 +504,7 @@ def list_conversation_profiles( specified project. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -608,8 +609,7 @@ def get_conversation_profile( ) -> conversation_profile.ConversationProfile: r"""Retrieves the specified conversation profile. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -710,8 +710,7 @@ def create_conversation_profile( API. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -829,8 +828,7 @@ def update_conversation_profile( API. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -940,8 +938,7 @@ def delete_conversation_profile( ) -> None: r"""Deletes the specified conversation profile. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1017,6 +1014,275 @@ def sample_delete_conversation_profile(): request, retry=retry, timeout=timeout, metadata=metadata, ) + def set_suggestion_feature_config( + self, + request: Union[ + gcd_conversation_profile.SetSuggestionFeatureConfigRequest, dict + ] = None, + *, + conversation_profile: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation.Operation: + r"""Adds or updates a suggestion feature in a conversation profile. + If the conversation profile contains the type of suggestion + feature for the participant role, it will update it. Otherwise + it will insert the suggestion feature. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [SetSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata] + - ``response``: + [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] + + If a long running operation to add or update suggestion feature + config for the same conversation profile, participant role and + suggestion feature type exists, please cancel the existing long + running operation before sending such request, otherwise the + request will be rejected. + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_set_suggestion_feature_config(): + # Create a client + client = dialogflow_v2.ConversationProfilesClient() + + # Initialize request argument(s) + request = dialogflow_v2.SetSuggestionFeatureConfigRequest( + conversation_profile="conversation_profile_value", + participant_role="END_USER", + ) + + # Make the request + operation = client.set_suggestion_feature_config(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.SetSuggestionFeatureConfigRequest, dict]): + The request object. The request message for + [ConversationProfiles.SetSuggestionFeature][]. + conversation_profile (str): + Required. The Conversation Profile to add or update the + suggestion feature config. Format: + ``projects//locations//conversationProfiles/``. + + This corresponds to the ``conversation_profile`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.cloud.dialogflow_v2.types.ConversationProfile` + Defines the services to connect to incoming Dialogflow + conversations. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([conversation_profile]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a gcd_conversation_profile.SetSuggestionFeatureConfigRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance( + request, gcd_conversation_profile.SetSuggestionFeatureConfigRequest + ): + request = gcd_conversation_profile.SetSuggestionFeatureConfigRequest( + request + ) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if conversation_profile is not None: + request.conversation_profile = conversation_profile + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.set_suggestion_feature_config + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + (("conversation_profile", request.conversation_profile),) + ), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + gcd_conversation_profile.ConversationProfile, + metadata_type=gcd_conversation_profile.SetSuggestionFeatureConfigOperationMetadata, + ) + + # Done; return the response. + return response + + def clear_suggestion_feature_config( + self, + request: Union[ + gcd_conversation_profile.ClearSuggestionFeatureConfigRequest, dict + ] = None, + *, + conversation_profile: str = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> operation.Operation: + r"""Clears a suggestion feature from a conversation profile for the + given participant role. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [ClearSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata] + - ``response``: + [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] + + + .. code-block:: python + + from google.cloud import dialogflow_v2 + + def sample_clear_suggestion_feature_config(): + # Create a client + client = dialogflow_v2.ConversationProfilesClient() + + # Initialize request argument(s) + request = dialogflow_v2.ClearSuggestionFeatureConfigRequest( + conversation_profile="conversation_profile_value", + participant_role="END_USER", + suggestion_feature_type="SMART_REPLY", + ) + + # Make the request + operation = client.clear_suggestion_feature_config(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.dialogflow_v2.types.ClearSuggestionFeatureConfigRequest, dict]): + The request object. The request message for + [ConversationProfiles.ClearFeature][]. + conversation_profile (str): + Required. The Conversation Profile to add or update the + suggestion feature config. Format: + ``projects//locations//conversationProfiles/``. + + This corresponds to the ``conversation_profile`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.api_core.operation.Operation: + An object representing a long-running operation. + + The result type for the operation will be + :class:`google.cloud.dialogflow_v2.types.ConversationProfile` + Defines the services to connect to incoming Dialogflow + conversations. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([conversation_profile]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a gcd_conversation_profile.ClearSuggestionFeatureConfigRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance( + request, gcd_conversation_profile.ClearSuggestionFeatureConfigRequest + ): + request = gcd_conversation_profile.ClearSuggestionFeatureConfigRequest( + request + ) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if conversation_profile is not None: + request.conversation_profile = conversation_profile + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.clear_suggestion_feature_config + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + (("conversation_profile", request.conversation_profile),) + ), + ) + + # Send the request. + response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + + # Wrap the response in an operation future. + response = operation.from_gapic( + response, + self._transport.operations_client, + gcd_conversation_profile.ConversationProfile, + metadata_type=gcd_conversation_profile.ClearSuggestionFeatureConfigOperationMetadata, + ) + + # Done; return the response. + return response + def __enter__(self): return self diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/pagers.py index e12f2bbb47bd..ca1450f7b4b9 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/transports/__init__.py index f2a4e22037c5..75117ebe9caf 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/transports/base.py index f4d8b24e89c5..15e54b36b2b4 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core import operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore @@ -29,6 +30,7 @@ from google.cloud.dialogflow_v2.types import ( conversation_profile as gcd_conversation_profile, ) +from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore try: @@ -152,6 +154,16 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.set_suggestion_feature_config: gapic_v1.method.wrap_method( + self.set_suggestion_feature_config, + default_timeout=None, + client_info=client_info, + ), + self.clear_suggestion_feature_config: gapic_v1.method.wrap_method( + self.clear_suggestion_feature_config, + default_timeout=None, + client_info=client_info, + ), } def close(self): @@ -163,6 +175,11 @@ def close(self): """ raise NotImplementedError() + @property + def operations_client(self): + """Return the client designed to process long-running operations.""" + raise NotImplementedError() + @property def list_conversation_profiles( self, @@ -220,5 +237,23 @@ def delete_conversation_profile( ]: raise NotImplementedError() + @property + def set_suggestion_feature_config( + self, + ) -> Callable[ + [gcd_conversation_profile.SetSuggestionFeatureConfigRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + + @property + def clear_suggestion_feature_config( + self, + ) -> Callable[ + [gcd_conversation_profile.ClearSuggestionFeatureConfigRequest], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], + ]: + raise NotImplementedError() + __all__ = ("ConversationProfilesTransport",) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/transports/grpc.py index 170676cda7fc..2df4f54048a0 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ from typing import Callable, Dict, Optional, Sequence, Tuple, Union from google.api_core import grpc_helpers +from google.api_core import operations_v1 from google.api_core import gapic_v1 import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore @@ -28,6 +29,7 @@ from google.cloud.dialogflow_v2.types import ( conversation_profile as gcd_conversation_profile, ) +from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore from .base import ConversationProfilesTransport, DEFAULT_CLIENT_INFO @@ -115,6 +117,7 @@ def __init__( self._grpc_channel = None self._ssl_channel_credentials = ssl_channel_credentials self._stubs: Dict[str, Callable] = {} + self._operations_client: Optional[operations_v1.OperationsClient] = None if api_mtls_endpoint: warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) @@ -233,6 +236,20 @@ def grpc_channel(self) -> grpc.Channel: """ return self._grpc_channel + @property + def operations_client(self) -> operations_v1.OperationsClient: + """Create the client designed to process long-running operations. + + This property caches on the instance; repeated calls return the same + client. + """ + # Quick check: Only create a new client if we do not already have one. + if self._operations_client is None: + self._operations_client = operations_v1.OperationsClient(self.grpc_channel) + + # Return the client from cache. + return self._operations_client + @property def list_conversation_profiles( self, @@ -390,6 +407,99 @@ def delete_conversation_profile( ) return self._stubs["delete_conversation_profile"] + @property + def set_suggestion_feature_config( + self, + ) -> Callable[ + [gcd_conversation_profile.SetSuggestionFeatureConfigRequest], + operations_pb2.Operation, + ]: + r"""Return a callable for the set suggestion feature config method over gRPC. + + Adds or updates a suggestion feature in a conversation profile. + If the conversation profile contains the type of suggestion + feature for the participant role, it will update it. Otherwise + it will insert the suggestion feature. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [SetSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata] + - ``response``: + [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] + + If a long running operation to add or update suggestion feature + config for the same conversation profile, participant role and + suggestion feature type exists, please cancel the existing long + running operation before sending such request, otherwise the + request will be rejected. + + Returns: + Callable[[~.SetSuggestionFeatureConfigRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "set_suggestion_feature_config" not in self._stubs: + self._stubs[ + "set_suggestion_feature_config" + ] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationProfiles/SetSuggestionFeatureConfig", + request_serializer=gcd_conversation_profile.SetSuggestionFeatureConfigRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["set_suggestion_feature_config"] + + @property + def clear_suggestion_feature_config( + self, + ) -> Callable[ + [gcd_conversation_profile.ClearSuggestionFeatureConfigRequest], + operations_pb2.Operation, + ]: + r"""Return a callable for the clear suggestion feature + config method over gRPC. + + Clears a suggestion feature from a conversation profile for the + given participant role. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [ClearSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata] + - ``response``: + [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] + + Returns: + Callable[[~.ClearSuggestionFeatureConfigRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "clear_suggestion_feature_config" not in self._stubs: + self._stubs[ + "clear_suggestion_feature_config" + ] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationProfiles/ClearSuggestionFeatureConfig", + request_serializer=gcd_conversation_profile.ClearSuggestionFeatureConfigRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["clear_suggestion_feature_config"] + def close(self): self.grpc_channel.close() diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/transports/grpc_asyncio.py index 3ceb7d8b35e2..9f1d9b922723 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversation_profiles/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ from google.api_core import gapic_v1 from google.api_core import grpc_helpers_async +from google.api_core import operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore @@ -28,6 +29,7 @@ from google.cloud.dialogflow_v2.types import ( conversation_profile as gcd_conversation_profile, ) +from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore from .base import ConversationProfilesTransport, DEFAULT_CLIENT_INFO from .grpc import ConversationProfilesGrpcTransport @@ -161,6 +163,7 @@ def __init__( self._grpc_channel = None self._ssl_channel_credentials = ssl_channel_credentials self._stubs: Dict[str, Callable] = {} + self._operations_client: Optional[operations_v1.OperationsAsyncClient] = None if api_mtls_endpoint: warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) @@ -235,6 +238,22 @@ def grpc_channel(self) -> aio.Channel: # Return the channel from cache. return self._grpc_channel + @property + def operations_client(self) -> operations_v1.OperationsAsyncClient: + """Create the client designed to process long-running operations. + + This property caches on the instance; repeated calls return the same + client. + """ + # Quick check: Only create a new client if we do not already have one. + if self._operations_client is None: + self._operations_client = operations_v1.OperationsAsyncClient( + self.grpc_channel + ) + + # Return the client from cache. + return self._operations_client + @property def list_conversation_profiles( self, @@ -393,6 +412,99 @@ def delete_conversation_profile( ) return self._stubs["delete_conversation_profile"] + @property + def set_suggestion_feature_config( + self, + ) -> Callable[ + [gcd_conversation_profile.SetSuggestionFeatureConfigRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the set suggestion feature config method over gRPC. + + Adds or updates a suggestion feature in a conversation profile. + If the conversation profile contains the type of suggestion + feature for the participant role, it will update it. Otherwise + it will insert the suggestion feature. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [SetSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata] + - ``response``: + [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] + + If a long running operation to add or update suggestion feature + config for the same conversation profile, participant role and + suggestion feature type exists, please cancel the existing long + running operation before sending such request, otherwise the + request will be rejected. + + Returns: + Callable[[~.SetSuggestionFeatureConfigRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "set_suggestion_feature_config" not in self._stubs: + self._stubs[ + "set_suggestion_feature_config" + ] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationProfiles/SetSuggestionFeatureConfig", + request_serializer=gcd_conversation_profile.SetSuggestionFeatureConfigRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["set_suggestion_feature_config"] + + @property + def clear_suggestion_feature_config( + self, + ) -> Callable[ + [gcd_conversation_profile.ClearSuggestionFeatureConfigRequest], + Awaitable[operations_pb2.Operation], + ]: + r"""Return a callable for the clear suggestion feature + config method over gRPC. + + Clears a suggestion feature from a conversation profile for the + given participant role. + + This method is a `long-running + operation `__. + The returned ``Operation`` type has the following + method-specific fields: + + - ``metadata``: + [ClearSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata] + - ``response``: + [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile] + + Returns: + Callable[[~.ClearSuggestionFeatureConfigRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "clear_suggestion_feature_config" not in self._stubs: + self._stubs[ + "clear_suggestion_feature_config" + ] = self.grpc_channel.unary_unary( + "/google.cloud.dialogflow.v2.ConversationProfiles/ClearSuggestionFeatureConfig", + request_serializer=gcd_conversation_profile.ClearSuggestionFeatureConfigRequest.serialize, + response_deserializer=operations_pb2.Operation.FromString, + ) + return self._stubs["clear_suggestion_feature_config"] + def close(self): return self.grpc_channel.close() diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/__init__.py index f6f6b90ff3eb..3869363a87e1 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/async_client.py index 9bce19c18961..b73bc764d528 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -248,7 +248,7 @@ async def create_conversation( is triggered, conversation will transfer to Assist Stage. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -357,7 +357,7 @@ async def list_conversations( specified project. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -458,7 +458,7 @@ async def get_conversation( ) -> conversation.Conversation: r"""Retrieves the specific conversation. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -556,7 +556,7 @@ async def complete_conversation( days. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -657,7 +657,7 @@ async def list_messages( and empty page_token. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/client.py index fad41b6e0a4a..0ecd391b4dd0 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -466,8 +466,7 @@ def create_conversation( is triggered, conversation will transfer to Assist Stage. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -576,8 +575,7 @@ def list_conversations( specified project. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -678,8 +676,7 @@ def get_conversation( ) -> conversation.Conversation: r"""Retrieves the specific conversation. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -777,8 +774,7 @@ def complete_conversation( days. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -879,8 +875,7 @@ def list_messages( and empty page_token. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/pagers.py index e8e0ef6e3896..d2c414f2fbe0 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/transports/__init__.py index 2989914f7938..f94552209491 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/transports/base.py index 03f7bcee44c3..b541d71ff4a6 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/transports/grpc.py index ca834df44a7f..c8dff9283189 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/transports/grpc_asyncio.py index 95fd398c8ae9..64de0d5f62e2 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/__init__.py index f610c36b0b2f..26fc1b45432a 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/async_client.py index 978d7324de28..0a5a5d3582a9 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -216,7 +216,7 @@ async def list_documents( base. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -317,7 +317,7 @@ async def get_document( ) -> document.Document: r"""Retrieves the specified document. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -425,7 +425,7 @@ async def create_document( - ``response``: [Document][google.cloud.dialogflow.v2.Document] - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -438,7 +438,7 @@ def sample_create_document(): document.content_uri = "content_uri_value" document.display_name = "display_name_value" document.mime_type = "mime_type_value" - document.knowledge_types = "ARTICLE_SUGGESTION" + document.knowledge_types = "AGENT_FACING_SMART_REPLY" request = dialogflow_v2.CreateDocumentRequest( parent="parent_value", @@ -565,7 +565,7 @@ async def import_documents( [ImportDocumentsResponse][google.cloud.dialogflow.v2.ImportDocumentsResponse] - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -579,7 +579,7 @@ def sample_import_documents(): document_template = dialogflow_v2.ImportDocumentTemplate() document_template.mime_type = "mime_type_value" - document_template.knowledge_types = "ARTICLE_SUGGESTION" + document_template.knowledge_types = "AGENT_FACING_SMART_REPLY" request = dialogflow_v2.ImportDocumentsRequest( gcs_source=gcs_source, @@ -670,7 +670,7 @@ async def delete_document( message `__ - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -796,7 +796,7 @@ async def update_document( - ``response``: [Document][google.cloud.dialogflow.v2.Document] - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -809,7 +809,7 @@ def sample_update_document(): document.content_uri = "content_uri_value" document.display_name = "display_name_value" document.mime_type = "mime_type_value" - document.knowledge_types = "ARTICLE_SUGGESTION" + document.knowledge_types = "AGENT_FACING_SMART_REPLY" request = dialogflow_v2.UpdateDocumentRequest( document=document, @@ -943,7 +943,7 @@ async def reload_document( is deprecated; only use ``projects.knowledgeBases.documents``. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1079,7 +1079,7 @@ async def export_document( - ``response``: [Document][google.cloud.dialogflow.v2.Document] - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/client.py index ad9d265f502f..6779309b1147 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -417,8 +417,7 @@ def list_documents( base. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -519,8 +518,7 @@ def get_document( ) -> document.Document: r"""Retrieves the specified document. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -628,8 +626,7 @@ def create_document( - ``response``: [Document][google.cloud.dialogflow.v2.Document] - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -642,7 +639,7 @@ def sample_create_document(): document.content_uri = "content_uri_value" document.display_name = "display_name_value" document.mime_type = "mime_type_value" - document.knowledge_types = "ARTICLE_SUGGESTION" + document.knowledge_types = "AGENT_FACING_SMART_REPLY" request = dialogflow_v2.CreateDocumentRequest( parent="parent_value", @@ -769,8 +766,7 @@ def import_documents( [ImportDocumentsResponse][google.cloud.dialogflow.v2.ImportDocumentsResponse] - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -784,7 +780,7 @@ def sample_import_documents(): document_template = dialogflow_v2.ImportDocumentTemplate() document_template.mime_type = "mime_type_value" - document_template.knowledge_types = "ARTICLE_SUGGESTION" + document_template.knowledge_types = "AGENT_FACING_SMART_REPLY" request = dialogflow_v2.ImportDocumentsRequest( gcs_source=gcs_source, @@ -876,8 +872,7 @@ def delete_document( message `__ - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1003,8 +998,7 @@ def update_document( - ``response``: [Document][google.cloud.dialogflow.v2.Document] - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1017,7 +1011,7 @@ def sample_update_document(): document.content_uri = "content_uri_value" document.display_name = "display_name_value" document.mime_type = "mime_type_value" - document.knowledge_types = "ARTICLE_SUGGESTION" + document.knowledge_types = "AGENT_FACING_SMART_REPLY" request = dialogflow_v2.UpdateDocumentRequest( document=document, @@ -1151,8 +1145,7 @@ def reload_document( is deprecated; only use ``projects.knowledgeBases.documents``. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1288,8 +1281,7 @@ def export_document( - ``response``: [Document][google.cloud.dialogflow.v2.Document] - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/pagers.py index d0dd63f48d0e..6c04411c5e9c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/transports/__init__.py index 5d4948aa0054..2e363c1e2151 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/transports/base.py index 90ccfdea9ce3..2622dd3d51c1 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/transports/grpc.py index 0013b05b4d98..bc26419a1f16 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/transports/grpc_asyncio.py index 28f5fa2c0bc7..c93598061758 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/documents/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/__init__.py index 77cd53e9c1f1..b0093027afbc 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/async_client.py index 4cf6f0084b00..0be66687b0c3 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -219,7 +219,7 @@ async def list_entity_types( agent. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -332,7 +332,7 @@ async def get_entity_type( ) -> entity_type.EntityType: r"""Retrieves the specified entity type. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -454,7 +454,7 @@ async def create_entity_type( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -587,7 +587,7 @@ async def update_entity_type( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -711,7 +711,7 @@ async def delete_entity_type( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -805,7 +805,7 @@ async def batch_update_entity_types( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -907,7 +907,7 @@ async def batch_delete_entity_types( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1049,7 +1049,7 @@ async def batch_create_entities( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1208,7 +1208,7 @@ async def batch_update_entities( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1367,7 +1367,7 @@ async def batch_delete_entities( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/client.py index 834026e8dade..90a799becf68 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -417,8 +417,7 @@ def list_entity_types( agent. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -531,8 +530,7 @@ def get_entity_type( ) -> entity_type.EntityType: r"""Retrieves the specified entity type. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -654,8 +652,7 @@ def create_entity_type( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -788,8 +785,7 @@ def update_entity_type( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -913,8 +909,7 @@ def delete_entity_type( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1008,8 +1003,7 @@ def batch_update_entity_types( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1114,8 +1108,7 @@ def batch_delete_entity_types( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1259,8 +1252,7 @@ def batch_create_entities( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1419,8 +1411,7 @@ def batch_update_entities( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1579,8 +1570,7 @@ def batch_delete_entities( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/pagers.py index bd8839192dc5..1e77845f536a 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/transports/__init__.py index 07ea82e1b45f..2a22d6640edb 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/transports/base.py index 51de4497c56e..5b3b759f4ad4 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/transports/grpc.py index c1ca0c5653e8..9cedb66e455b 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/transports/grpc_asyncio.py index f13b91d4822c..281309e3e739 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/entity_types/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/__init__.py index 0c2be9484d25..2283376579f4 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/async_client.py index 216a5977cf32..fc3542597626 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -219,7 +219,7 @@ async def list_environments( the specified agent. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -321,7 +321,7 @@ async def get_environment( ) -> environment.Environment: r"""Retrieves the specified agent environment. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -408,7 +408,7 @@ async def create_environment( ) -> environment.Environment: r"""Creates an agent environment. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -510,7 +510,7 @@ async def update_environment( calling this method. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -598,7 +598,7 @@ async def delete_environment( ) -> None: r"""Deletes the specified agent environment. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -656,7 +656,7 @@ async def get_environment_history( ) -> pagers.GetEnvironmentHistoryAsyncPager: r"""Gets the history of the specified environment. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/client.py index c42918a29a10..04d57a70d94e 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -439,8 +439,7 @@ def list_environments( the specified agent. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -542,8 +541,7 @@ def get_environment( ) -> environment.Environment: r"""Retrieves the specified agent environment. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -631,8 +629,7 @@ def create_environment( ) -> environment.Environment: r"""Creates an agent environment. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -735,8 +732,7 @@ def update_environment( calling this method. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -825,8 +821,7 @@ def delete_environment( ) -> None: r"""Deletes the specified agent environment. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -885,8 +880,7 @@ def get_environment_history( ) -> pagers.GetEnvironmentHistoryPager: r"""Gets the history of the specified environment. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/pagers.py index 41e4185fa3b2..15e10bf46e8f 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/transports/__init__.py index c72efee48830..0ecefb6122d1 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/transports/base.py index da41534fa975..0f7a4084ddd6 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/transports/grpc.py index c0aad67ba58e..4d194117bd91 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/transports/grpc_asyncio.py index 5a5747346f3f..540e19e2ef95 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/environments/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/__init__.py index 6bade52ddb4c..abd353a6df5c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/async_client.py index 7f5a874227b9..c163def3d9aa 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -212,7 +212,7 @@ async def get_fulfillment( ) -> fulfillment.Fulfillment: r"""Retrieves the fulfillment. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -313,7 +313,7 @@ async def update_fulfillment( ) -> gcd_fulfillment.Fulfillment: r"""Updates the fulfillment. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/client.py index 9d98206009af..df96dc8f533c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -406,8 +406,7 @@ def get_fulfillment( ) -> fulfillment.Fulfillment: r"""Retrieves the fulfillment. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -508,8 +507,7 @@ def update_fulfillment( ) -> gcd_fulfillment.Fulfillment: r"""Updates the fulfillment. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/transports/__init__.py index d822b662beac..425287bb074f 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/transports/base.py index 7ab589d604f7..96ac7accd2cc 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/transports/grpc.py index fed1a11ca975..d00dad6360a7 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/transports/grpc_asyncio.py index a9083f7d87c6..bec9593cb6f1 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/fulfillments/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/__init__.py index 5a2c263cff80..283553c4a1d7 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/async_client.py index 784968f9a7d2..6c614d753f39 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -217,7 +217,7 @@ async def list_intents( agent. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -339,7 +339,7 @@ async def get_intent( ) -> intent.Intent: r"""Retrieves the specified intent. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -457,7 +457,7 @@ async def create_intent( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -586,7 +586,7 @@ async def update_intent( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -715,7 +715,7 @@ async def delete_intent( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -814,7 +814,7 @@ async def batch_update_intents( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -958,7 +958,7 @@ async def batch_delete_intents( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/client.py index 4340e059ae19..f59000be5fa3 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -431,8 +431,7 @@ def list_intents( agent. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -554,8 +553,7 @@ def get_intent( ) -> intent.Intent: r"""Retrieves the specified intent. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -673,8 +671,7 @@ def create_intent( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -803,8 +800,7 @@ def update_intent( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -933,8 +929,7 @@ def delete_intent( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1033,8 +1028,7 @@ def batch_update_intents( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1178,8 +1172,7 @@ def batch_delete_intents( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/pagers.py index f28626ab8c4c..70fde9693bf6 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/transports/__init__.py index 974a58103548..876b5cd146eb 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/transports/base.py index ef9862467b42..b50ba489639b 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/transports/grpc.py index 49d9f5592490..debea24a8ee0 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/transports/grpc_asyncio.py index 9f20b2eb21a3..5e5c3010a315 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/intents/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/__init__.py index 24204c98218b..e1715313993f 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/async_client.py index c34aa25e1f91..d04cc17f6098 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -221,7 +221,7 @@ async def list_knowledge_bases( specified agent. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -322,7 +322,7 @@ async def get_knowledge_base( ) -> knowledge_base.KnowledgeBase: r"""Retrieves the specified knowledge base. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -424,7 +424,7 @@ async def create_knowledge_base( ) -> gcd_knowledge_base.KnowledgeBase: r"""Creates a knowledge base. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -538,7 +538,7 @@ async def delete_knowledge_base( ) -> None: r"""Deletes the specified knowledge base. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -620,7 +620,7 @@ async def update_knowledge_base( ) -> gcd_knowledge_base.KnowledgeBase: r"""Updates the specified knowledge base. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/client.py index 9461af25a322..eaa24f04993d 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -415,8 +415,7 @@ def list_knowledge_bases( specified agent. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -517,8 +516,7 @@ def get_knowledge_base( ) -> knowledge_base.KnowledgeBase: r"""Retrieves the specified knowledge base. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -620,8 +618,7 @@ def create_knowledge_base( ) -> gcd_knowledge_base.KnowledgeBase: r"""Creates a knowledge base. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -735,8 +732,7 @@ def delete_knowledge_base( ) -> None: r"""Deletes the specified knowledge base. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -818,8 +814,7 @@ def update_knowledge_base( ) -> gcd_knowledge_base.KnowledgeBase: r"""Updates the specified knowledge base. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/pagers.py index cbfa16b57a31..d9ac72bf4a85 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/transports/__init__.py index 38da4326dc5c..f3bf2daa6d7f 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/transports/base.py index a5efd1540d05..34d6963f0785 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/transports/grpc.py index 177c4dcc5989..c51cfe4c148f 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/transports/grpc_asyncio.py index 420bd593a646..f2055a98b9b1 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/knowledge_bases/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/__init__.py index 942327781d1b..b3b91ad6ab2b 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/async_client.py index e3c9666d37ad..8d0d2392cc31 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -227,7 +227,7 @@ async def create_participant( ) -> gcd_participant.Participant: r"""Creates a new participant in a conversation. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -325,7 +325,7 @@ async def get_participant( ) -> participant.Participant: r"""Retrieves a conversation participant. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -417,7 +417,7 @@ async def list_participants( conversation. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -519,7 +519,7 @@ async def update_participant( ) -> gcd_participant.Participant: r"""Updates the specified participant. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -625,7 +625,7 @@ async def analyze_content( environments `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -750,7 +750,7 @@ async def suggest_articles( specific historical messages. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -843,7 +843,7 @@ async def suggest_faq_answers( specific historical messages. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -936,7 +936,7 @@ async def suggest_smart_replies( specific historical messages. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/client.py index ad64bd7bd588..c38c5b9b15d2 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -490,8 +490,7 @@ def create_participant( ) -> gcd_participant.Participant: r"""Creates a new participant in a conversation. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -589,8 +588,7 @@ def get_participant( ) -> participant.Participant: r"""Retrieves a conversation participant. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -682,8 +680,7 @@ def list_participants( conversation. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -785,8 +782,7 @@ def update_participant( ) -> gcd_participant.Participant: r"""Updates the specified participant. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -892,8 +888,7 @@ def analyze_content( environments `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1009,8 +1004,7 @@ def suggest_articles( specific historical messages. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1103,8 +1097,7 @@ def suggest_faq_answers( specific historical messages. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -1197,8 +1190,7 @@ def suggest_smart_replies( specific historical messages. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/pagers.py index 2b0833112b12..485d97903c19 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/transports/__init__.py index 522813c1cd2e..146083f8075c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/transports/base.py index 395b017fd824..0b57fdd1b7cd 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/transports/grpc.py index 4654e6c5b605..1c9fadf295fb 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/transports/grpc_asyncio.py index 8f5dd22f5ffd..546251b7d268 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/__init__.py index cbd406b49249..a8d58e178c04 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/async_client.py index 22abba57e0be..83e036ba9587 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -230,7 +230,7 @@ async def list_session_entity_types( use session entities with Google Assistant integration. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -339,7 +339,7 @@ async def get_session_entity_type( use session entities with Google Assistant integration. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -452,7 +452,7 @@ async def create_session_entity_type( use session entities with Google Assistant integration. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -578,7 +578,7 @@ async def update_session_entity_type( use session entities with Google Assistant integration. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -697,7 +697,7 @@ async def delete_session_entity_type( use session entities with Google Assistant integration. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/client.py index c97415434e29..c4e4091efeb4 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -424,8 +424,7 @@ def list_session_entity_types( use session entities with Google Assistant integration. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -536,8 +535,7 @@ def get_session_entity_type( use session entities with Google Assistant integration. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -650,8 +648,7 @@ def create_session_entity_type( use session entities with Google Assistant integration. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -781,8 +778,7 @@ def update_session_entity_type( use session entities with Google Assistant integration. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -905,8 +901,7 @@ def delete_session_entity_type( use session entities with Google Assistant integration. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/pagers.py index 56e46abd4e8e..127870fb0474 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/transports/__init__.py index 633fd32cbee4..44e2a8d4388c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/transports/base.py index 431634dde60d..471df36dbf08 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/transports/grpc.py index 1dde438af219..99420e0e617e 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/transports/grpc_asyncio.py index 0675123293b8..ab36364e12ae 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/session_entity_types/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/__init__.py index 0adeafb97d75..49b86a28bb6f 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/async_client.py index 1677e9694195..324fff2cd3e6 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -245,7 +245,7 @@ async def detect_intent( environments `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -394,7 +394,7 @@ def streaming_detect_intent( environments `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/client.py index b4adcca56e1a..f74f92dd5ffa 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -474,8 +474,7 @@ def detect_intent( environments `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -615,8 +614,7 @@ def streaming_detect_intent( environments `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/transports/__init__.py index db0f7d045411..ce00ff37674e 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/transports/base.py index f9ac3926f667..d5ce6b3e26d1 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/transports/grpc.py index 41b5f67a6b9d..1f0a3bf9ac8e 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/transports/grpc_asyncio.py index c67743a5b809..a8842fb89cb2 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/sessions/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/__init__.py index 586be1818c01..78f73aa31a8d 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/async_client.py index 581f850bf563..c36f537c863b 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -210,7 +210,7 @@ async def list_versions( agent. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -313,7 +313,7 @@ async def get_version( ) -> version.Version: r"""Retrieves the specified agent version. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -428,7 +428,7 @@ async def create_version( "default" environment. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -553,7 +553,7 @@ async def update_version( version resource. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -674,7 +674,7 @@ async def delete_version( ) -> None: r"""Delete the specified agent version. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/client.py index 6d26ddc09998..ec58b6d7fbca 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -412,8 +412,7 @@ def list_versions( agent. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -516,8 +515,7 @@ def get_version( ) -> version.Version: r"""Retrieves the specified agent version. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -632,8 +630,7 @@ def create_version( "default" environment. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -758,8 +755,7 @@ def update_version( version resource. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 @@ -880,8 +876,7 @@ def delete_version( ) -> None: r"""Delete the specified agent version. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/pagers.py index 26b6b52c0c1d..a18ee98971f3 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/transports/__init__.py index c5a42a0e8fea..ab80b3b575df 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/transports/base.py index 032c583c2911..3130f1b69de7 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/transports/grpc.py index 0d8866e366ed..27e9176fae47 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/transports/grpc_asyncio.py index e65f107984f4..e9f7f3894f1c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/versions/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/__init__.py index 932ec067829f..09cf179e2bf3 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -70,9 +70,51 @@ ListMessagesRequest, ListMessagesResponse, ) +from .conversation_dataset import ( + ConversationDataset, + ConversationInfo, + CreateConversationDatasetOperationMetadata, + CreateConversationDatasetRequest, + DeleteConversationDatasetOperationMetadata, + DeleteConversationDatasetRequest, + GetConversationDatasetRequest, + ImportConversationDataOperationMetadata, + ImportConversationDataOperationResponse, + ImportConversationDataRequest, + InputConfig, + ListConversationDatasetsRequest, + ListConversationDatasetsResponse, +) from .conversation_event import ConversationEvent +from .conversation_model import ( + ArticleSuggestionModelMetadata, + ConversationModel, + ConversationModelEvaluation, + CreateConversationModelEvaluationOperationMetadata, + CreateConversationModelEvaluationRequest, + CreateConversationModelOperationMetadata, + CreateConversationModelRequest, + DeleteConversationModelOperationMetadata, + DeleteConversationModelRequest, + DeployConversationModelOperationMetadata, + DeployConversationModelRequest, + EvaluationConfig, + GetConversationModelEvaluationRequest, + GetConversationModelRequest, + InputDataset, + ListConversationModelEvaluationsRequest, + ListConversationModelEvaluationsResponse, + ListConversationModelsRequest, + ListConversationModelsResponse, + SmartReplyMetrics, + SmartReplyModelMetadata, + UndeployConversationModelOperationMetadata, + UndeployConversationModelRequest, +) from .conversation_profile import ( AutomatedAgentConfig, + ClearSuggestionFeatureConfigOperationMetadata, + ClearSuggestionFeatureConfigRequest, ConversationProfile, CreateConversationProfileRequest, DeleteConversationProfileRequest, @@ -83,6 +125,8 @@ ListConversationProfilesResponse, LoggingConfig, NotificationConfig, + SetSuggestionFeatureConfigOperationMetadata, + SetSuggestionFeatureConfigRequest, SuggestionFeature, UpdateConversationProfileRequest, ) @@ -91,6 +135,7 @@ DeleteDocumentRequest, Document, ExportDocumentRequest, + ExportOperationMetadata, GetDocumentRequest, ImportDocumentsRequest, ImportDocumentsResponse, @@ -280,8 +325,46 @@ "ListConversationsResponse", "ListMessagesRequest", "ListMessagesResponse", + "ConversationDataset", + "ConversationInfo", + "CreateConversationDatasetOperationMetadata", + "CreateConversationDatasetRequest", + "DeleteConversationDatasetOperationMetadata", + "DeleteConversationDatasetRequest", + "GetConversationDatasetRequest", + "ImportConversationDataOperationMetadata", + "ImportConversationDataOperationResponse", + "ImportConversationDataRequest", + "InputConfig", + "ListConversationDatasetsRequest", + "ListConversationDatasetsResponse", "ConversationEvent", + "ArticleSuggestionModelMetadata", + "ConversationModel", + "ConversationModelEvaluation", + "CreateConversationModelEvaluationOperationMetadata", + "CreateConversationModelEvaluationRequest", + "CreateConversationModelOperationMetadata", + "CreateConversationModelRequest", + "DeleteConversationModelOperationMetadata", + "DeleteConversationModelRequest", + "DeployConversationModelOperationMetadata", + "DeployConversationModelRequest", + "EvaluationConfig", + "GetConversationModelEvaluationRequest", + "GetConversationModelRequest", + "InputDataset", + "ListConversationModelEvaluationsRequest", + "ListConversationModelEvaluationsResponse", + "ListConversationModelsRequest", + "ListConversationModelsResponse", + "SmartReplyMetrics", + "SmartReplyModelMetadata", + "UndeployConversationModelOperationMetadata", + "UndeployConversationModelRequest", "AutomatedAgentConfig", + "ClearSuggestionFeatureConfigOperationMetadata", + "ClearSuggestionFeatureConfigRequest", "ConversationProfile", "CreateConversationProfileRequest", "DeleteConversationProfileRequest", @@ -292,12 +375,15 @@ "ListConversationProfilesResponse", "LoggingConfig", "NotificationConfig", + "SetSuggestionFeatureConfigOperationMetadata", + "SetSuggestionFeatureConfigRequest", "SuggestionFeature", "UpdateConversationProfileRequest", "CreateDocumentRequest", "DeleteDocumentRequest", "Document", "ExportDocumentRequest", + "ExportOperationMetadata", "GetDocumentRequest", "ImportDocumentsRequest", "ImportDocumentsResponse", diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/agent.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/agent.py index 049e9e28d21b..4e7694d3c875 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/agent.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/agent.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -259,6 +259,12 @@ class ExportAgentRequest(proto.Message): export the agent to. The format of this URI must be ``gs:///``. If left unspecified, the serialized agent is returned inline. + + Dialogflow performs a write operation for the Cloud Storage + object on the caller's behalf, so your request + authentication must have write permissions for the object. + For more information, see `Dialogflow access + control `__. """ parent = proto.Field(proto.STRING, number=1,) @@ -309,9 +315,14 @@ class ImportAgentRequest(proto.Message): 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://". + The URI to a Google Cloud Storage file containing the agent + to import. Note: The URI must start with "gs://". + + Dialogflow performs a read operation for the Cloud Storage + object on the caller's behalf, so your request + authentication must have read permissions for the object. + For more information, see `Dialogflow access + control `__. This field is a member of `oneof`_ ``agent``. agent_content (bytes): @@ -341,9 +352,14 @@ class RestoreAgentRequest(proto.Message): 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://". + The URI to a Google Cloud Storage file containing the agent + to restore. Note: The URI must start with "gs://". + + Dialogflow performs a read operation for the Cloud Storage + object on the caller's behalf, so your request + authentication must have read permissions for the object. + For more information, see `Dialogflow access + control `__. This field is a member of `oneof`_ ``agent``. agent_content (bytes): diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/answer_record.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/answer_record.py index dc41aa89c396..a6648532ecbb 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/answer_record.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/answer_record.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/audio_config.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/audio_config.py index 410a956402d8..32528809fb79 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/audio_config.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/audio_config.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/context.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/context.py index 0b16c414027f..3eb28878c229 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/context.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/context.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation.py index de71fa2d8971..badb27489b50 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_dataset.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_dataset.py new file mode 100644 index 000000000000..3e8fc3eee4ae --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_dataset.py @@ -0,0 +1,282 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +import proto # type: ignore + +from google.cloud.dialogflow_v2.types import gcs +from google.protobuf import timestamp_pb2 # type: ignore +from google.rpc import status_pb2 # type: ignore + + +__protobuf__ = proto.module( + package="google.cloud.dialogflow.v2", + manifest={ + "ConversationInfo", + "InputConfig", + "ConversationDataset", + "CreateConversationDatasetRequest", + "GetConversationDatasetRequest", + "ListConversationDatasetsRequest", + "ListConversationDatasetsResponse", + "DeleteConversationDatasetRequest", + "ImportConversationDataRequest", + "ImportConversationDataOperationMetadata", + "ImportConversationDataOperationResponse", + "CreateConversationDatasetOperationMetadata", + "DeleteConversationDatasetOperationMetadata", + }, +) + + +class ConversationInfo(proto.Message): + r"""Represents metadata of a conversation. + + Attributes: + language_code (str): + Optional. The language code of the conversation data within + this dataset. See + https://cloud.google.com/apis/design/standard_fields for + more information. Supports all UTF-8 languages. + """ + + language_code = proto.Field(proto.STRING, number=1,) + + +class InputConfig(proto.Message): + r"""Represents the configuration of importing a set of + conversation files in Google Cloud Storage. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + gcs_source (google.cloud.dialogflow_v2.types.GcsSources): + The Cloud Storage URI has the form gs:////agent*.json. + Wildcards are allowed and will be expanded into all matched + JSON files, which will be read as one conversation per file. + + This field is a member of `oneof`_ ``source``. + """ + + gcs_source = proto.Field( + proto.MESSAGE, number=1, oneof="source", message=gcs.GcsSources, + ) + + +class ConversationDataset(proto.Message): + r"""Represents a conversation dataset that a user imports raw + data into. The data inside ConversationDataset can not be + changed after ImportConversationData finishes (and calling + ImportConversationData on a dataset that already has data is not + allowed). + + Attributes: + name (str): + Output only. ConversationDataset resource name. Format: + ``projects//locations//conversationDatasets/`` + display_name (str): + Required. The display name of the dataset. + Maximum of 64 bytes. + description (str): + Optional. The description of the dataset. + Maximum of 10000 bytes. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. Creation time of this dataset. + input_config (google.cloud.dialogflow_v2.types.InputConfig): + Output only. Input configurations set during + conversation data import. + conversation_info (google.cloud.dialogflow_v2.types.ConversationInfo): + Output only. Metadata set during conversation + data import. + conversation_count (int): + Output only. The number of conversations this + conversation dataset contains. + """ + + name = proto.Field(proto.STRING, number=1,) + display_name = proto.Field(proto.STRING, number=2,) + description = proto.Field(proto.STRING, number=3,) + create_time = proto.Field(proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp,) + input_config = proto.Field(proto.MESSAGE, number=5, message="InputConfig",) + conversation_info = proto.Field( + proto.MESSAGE, number=6, message="ConversationInfo", + ) + conversation_count = proto.Field(proto.INT64, number=7,) + + +class CreateConversationDatasetRequest(proto.Message): + r"""The request message for + [ConversationDatasets.CreateConversationDataset][google.cloud.dialogflow.v2.ConversationDatasets.CreateConversationDataset]. + + Attributes: + parent (str): + Required. The project to create conversation dataset for. + Format: ``projects//locations/`` + conversation_dataset (google.cloud.dialogflow_v2.types.ConversationDataset): + Required. The conversation dataset to create. + """ + + parent = proto.Field(proto.STRING, number=1,) + conversation_dataset = proto.Field( + proto.MESSAGE, number=2, message="ConversationDataset", + ) + + +class GetConversationDatasetRequest(proto.Message): + r"""The request message for + [ConversationDatasets.GetConversationDataset][google.cloud.dialogflow.v2.ConversationDatasets.GetConversationDataset]. + + Attributes: + name (str): + Required. The conversation dataset to retrieve. Format: + ``projects//locations//conversationDatasets/`` + """ + + name = proto.Field(proto.STRING, number=1,) + + +class ListConversationDatasetsRequest(proto.Message): + r"""The request message for + [ConversationDatasets.ListConversationDatasets][google.cloud.dialogflow.v2.ConversationDatasets.ListConversationDatasets]. + + Attributes: + parent (str): + Required. The project and location name to list all + conversation datasets for. Format: + ``projects//locations/`` + page_size (int): + Optional. Maximum number of conversation + datasets to return in a single page. By default + 100 and at most 1000. + page_token (str): + Optional. The next_page_token value returned from a previous + list request. + """ + + parent = proto.Field(proto.STRING, number=1,) + page_size = proto.Field(proto.INT32, number=2,) + page_token = proto.Field(proto.STRING, number=3,) + + +class ListConversationDatasetsResponse(proto.Message): + r"""The response message for + [ConversationDatasets.ListConversationDatasets][google.cloud.dialogflow.v2.ConversationDatasets.ListConversationDatasets]. + + Attributes: + conversation_datasets (Sequence[google.cloud.dialogflow_v2.types.ConversationDataset]): + The list of datasets to return. + next_page_token (str): + The token to use to retrieve the next page of + results, or empty if there are no more results + in the list. + """ + + @property + def raw_page(self): + return self + + conversation_datasets = proto.RepeatedField( + proto.MESSAGE, number=1, message="ConversationDataset", + ) + next_page_token = proto.Field(proto.STRING, number=2,) + + +class DeleteConversationDatasetRequest(proto.Message): + r"""The request message for + [ConversationDatasets.DeleteConversationDataset][google.cloud.dialogflow.v2.ConversationDatasets.DeleteConversationDataset]. + + Attributes: + name (str): + Required. The conversation dataset to delete. Format: + ``projects//locations//conversationDatasets/`` + """ + + name = proto.Field(proto.STRING, number=1,) + + +class ImportConversationDataRequest(proto.Message): + r"""The request message for + [ConversationDatasets.ImportConversationData][google.cloud.dialogflow.v2.ConversationDatasets.ImportConversationData]. + + Attributes: + name (str): + Required. Dataset resource name. Format: + ``projects//locations//conversationDatasets/`` + input_config (google.cloud.dialogflow_v2.types.InputConfig): + Required. Configuration describing where to + import data from. + """ + + name = proto.Field(proto.STRING, number=1,) + input_config = proto.Field(proto.MESSAGE, number=2, message="InputConfig",) + + +class ImportConversationDataOperationMetadata(proto.Message): + r"""Metadata for a + [ConversationDatasets.ImportConversationData][google.cloud.dialogflow.v2.ConversationDatasets.ImportConversationData] + operation. + + Attributes: + conversation_dataset (str): + The resource name of the imported conversation dataset. + Format: + ``projects//locations//conversationDatasets/`` + partial_failures (Sequence[google.rpc.status_pb2.Status]): + Partial failures are failures that don't fail + the whole long running operation, e.g. single + files that couldn't be read. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Timestamp when import conversation data + request was created. The time is measured on + server side. + """ + + conversation_dataset = proto.Field(proto.STRING, number=1,) + partial_failures = proto.RepeatedField( + proto.MESSAGE, number=2, message=status_pb2.Status, + ) + create_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) + + +class ImportConversationDataOperationResponse(proto.Message): + r"""Response used for + [ConversationDatasets.ImportConversationData][google.cloud.dialogflow.v2.ConversationDatasets.ImportConversationData] + long running operation. + + Attributes: + conversation_dataset (str): + The resource name of the imported conversation dataset. + Format: + ``projects//locations//conversationDatasets/`` + import_count (int): + Number of conversations imported + successfully. + """ + + conversation_dataset = proto.Field(proto.STRING, number=1,) + import_count = proto.Field(proto.INT32, number=3,) + + +class CreateConversationDatasetOperationMetadata(proto.Message): + r"""Metadata for [ConversationDatasets][CreateConversationDataset]. + """ + + +class DeleteConversationDatasetOperationMetadata(proto.Message): + r"""Metadata for [ConversationDatasets][DeleteConversationDataset]. + """ + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_event.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_event.py index 1cfe751159cc..b6ec1f229ad7 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_event.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_event.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_model.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_model.py new file mode 100644 index 000000000000..b08d98106cbd --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_model.py @@ -0,0 +1,641 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +import proto # type: ignore + +from google.protobuf import timestamp_pb2 # type: ignore + + +__protobuf__ = proto.module( + package="google.cloud.dialogflow.v2", + manifest={ + "ConversationModel", + "ConversationModelEvaluation", + "EvaluationConfig", + "InputDataset", + "ArticleSuggestionModelMetadata", + "SmartReplyModelMetadata", + "SmartReplyMetrics", + "CreateConversationModelRequest", + "GetConversationModelRequest", + "ListConversationModelsRequest", + "ListConversationModelsResponse", + "DeleteConversationModelRequest", + "DeployConversationModelRequest", + "UndeployConversationModelRequest", + "GetConversationModelEvaluationRequest", + "ListConversationModelEvaluationsRequest", + "ListConversationModelEvaluationsResponse", + "CreateConversationModelEvaluationRequest", + "CreateConversationModelOperationMetadata", + "DeployConversationModelOperationMetadata", + "UndeployConversationModelOperationMetadata", + "DeleteConversationModelOperationMetadata", + "CreateConversationModelEvaluationOperationMetadata", + }, +) + + +class ConversationModel(proto.Message): + r"""Represents a conversation model. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + name (str): + ConversationModel resource name. Format: + ``projects//conversationModels/`` + display_name (str): + Required. The display name of the model. At + most 64 bytes long. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. Creation time of this model. + datasets (Sequence[google.cloud.dialogflow_v2.types.InputDataset]): + Required. Datasets used to create model. + state (google.cloud.dialogflow_v2.types.ConversationModel.State): + Output only. State of the model. A model can + only serve prediction requests after it gets + deployed. + language_code (str): + Language code for the conversation model. If not specified, + the language is en-US. Language at ConversationModel should + be set for all non en-us languages. This should be a + `BCP-47 `__ + language tag. Example: "en-US". + article_suggestion_model_metadata (google.cloud.dialogflow_v2.types.ArticleSuggestionModelMetadata): + Metadata for article suggestion models. + + This field is a member of `oneof`_ ``model_metadata``. + smart_reply_model_metadata (google.cloud.dialogflow_v2.types.SmartReplyModelMetadata): + Metadata for smart reply models. + + This field is a member of `oneof`_ ``model_metadata``. + """ + + class State(proto.Enum): + r"""State of the model.""" + STATE_UNSPECIFIED = 0 + CREATING = 1 + UNDEPLOYED = 2 + DEPLOYING = 3 + DEPLOYED = 4 + UNDEPLOYING = 5 + DELETING = 6 + FAILED = 7 + PENDING = 8 + + class ModelType(proto.Enum): + r"""Model type.""" + MODEL_TYPE_UNSPECIFIED = 0 + SMART_REPLY_DUAL_ENCODER_MODEL = 2 + SMART_REPLY_BERT_MODEL = 6 + + name = proto.Field(proto.STRING, number=1,) + display_name = proto.Field(proto.STRING, number=2,) + create_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) + datasets = proto.RepeatedField(proto.MESSAGE, number=4, message="InputDataset",) + state = proto.Field(proto.ENUM, number=7, enum=State,) + language_code = proto.Field(proto.STRING, number=19,) + article_suggestion_model_metadata = proto.Field( + proto.MESSAGE, + number=8, + oneof="model_metadata", + message="ArticleSuggestionModelMetadata", + ) + smart_reply_model_metadata = proto.Field( + proto.MESSAGE, + number=9, + oneof="model_metadata", + message="SmartReplyModelMetadata", + ) + + +class ConversationModelEvaluation(proto.Message): + r"""Represents evaluation result of a conversation model. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + name (str): + The resource name of the evaluation. Format: + ``projects//conversationModels//evaluations/`` + display_name (str): + Optional. The display name of the model + evaluation. At most 64 bytes long. + evaluation_config (google.cloud.dialogflow_v2.types.EvaluationConfig): + Optional. The configuration of the evaluation + task. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. Creation time of this model. + smart_reply_metrics (google.cloud.dialogflow_v2.types.SmartReplyMetrics): + Output only. Only available when model is for + smart reply. + + This field is a member of `oneof`_ ``metrics``. + """ + + name = proto.Field(proto.STRING, number=1,) + display_name = proto.Field(proto.STRING, number=2,) + evaluation_config = proto.Field( + proto.MESSAGE, number=6, message="EvaluationConfig", + ) + create_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) + smart_reply_metrics = proto.Field( + proto.MESSAGE, number=5, oneof="metrics", message="SmartReplyMetrics", + ) + + +class EvaluationConfig(proto.Message): + r"""The configuration for model evaluation. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + datasets (Sequence[google.cloud.dialogflow_v2.types.InputDataset]): + Required. Datasets used for evaluation. + smart_reply_config (google.cloud.dialogflow_v2.types.EvaluationConfig.SmartReplyConfig): + Configuration for smart reply model + evalution. + + This field is a member of `oneof`_ ``model_specific_config``. + smart_compose_config (google.cloud.dialogflow_v2.types.EvaluationConfig.SmartComposeConfig): + Configuration for smart compose model + evalution. + + This field is a member of `oneof`_ ``model_specific_config``. + """ + + class SmartReplyConfig(proto.Message): + r"""Smart reply specific configuration for evaluation job. + + Attributes: + allowlist_document (str): + The allowlist document resource name. Format: + ``projects//knowledgeBases//documents/``. + Only used for smart reply model. + max_result_count (int): + Required. The model to be evaluated can return multiple + results with confidence score on each query. These results + will be sorted by the descending order of the scores and we + only keep the first max_result_count results as the final + results to evaluate. + """ + + allowlist_document = proto.Field(proto.STRING, number=1,) + max_result_count = proto.Field(proto.INT32, number=2,) + + class SmartComposeConfig(proto.Message): + r"""Smart compose specific configuration for evaluation job. + + Attributes: + allowlist_document (str): + The allowlist document resource name. Format: + ``projects//knowledgeBases//documents/``. + Only used for smart compose model. + max_result_count (int): + Required. The model to be evaluated can return multiple + results with confidence score on each query. These results + will be sorted by the descending order of the scores and we + only keep the first max_result_count results as the final + results to evaluate. + """ + + allowlist_document = proto.Field(proto.STRING, number=1,) + max_result_count = proto.Field(proto.INT32, number=2,) + + datasets = proto.RepeatedField(proto.MESSAGE, number=3, message="InputDataset",) + smart_reply_config = proto.Field( + proto.MESSAGE, + number=2, + oneof="model_specific_config", + message=SmartReplyConfig, + ) + smart_compose_config = proto.Field( + proto.MESSAGE, + number=4, + oneof="model_specific_config", + message=SmartComposeConfig, + ) + + +class InputDataset(proto.Message): + r"""InputDataset used to create model or do evaluation. + NextID:5 + + Attributes: + dataset (str): + Required. ConversationDataset resource name. Format: + ``projects//locations//conversationDatasets/`` + """ + + dataset = proto.Field(proto.STRING, number=1,) + + +class ArticleSuggestionModelMetadata(proto.Message): + r"""Metadata for article suggestion models. + + Attributes: + training_model_type (google.cloud.dialogflow_v2.types.ConversationModel.ModelType): + Optional. Type of the article suggestion model. If not + provided, model_type is used. + """ + + training_model_type = proto.Field( + proto.ENUM, number=3, enum="ConversationModel.ModelType", + ) + + +class SmartReplyModelMetadata(proto.Message): + r"""Metadata for smart reply models. + + Attributes: + training_model_type (google.cloud.dialogflow_v2.types.ConversationModel.ModelType): + Optional. Type of the smart reply model. If not provided, + model_type is used. + """ + + training_model_type = proto.Field( + proto.ENUM, number=6, enum="ConversationModel.ModelType", + ) + + +class SmartReplyMetrics(proto.Message): + r"""The evaluation metrics for smart reply model. + + Attributes: + allowlist_coverage (float): + Percentage of target participant messages in the evaluation + dataset for which similar messages have appeared at least + once in the allowlist. Should be [0, 1]. + top_n_metrics (Sequence[google.cloud.dialogflow_v2.types.SmartReplyMetrics.TopNMetrics]): + Metrics of top n smart replies, sorted by [TopNMetric.n][]. + conversation_count (int): + Total number of conversations used to + generate this metric. + """ + + class TopNMetrics(proto.Message): + r"""Evaluation metrics when retrieving ``n`` smart replies with the + model. + + Attributes: + n (int): + Number of retrieved smart replies. For example, when ``n`` + is 3, this evaluation contains metrics for when Dialogflow + retrieves 3 smart replies with the model. + recall (float): + Defined as + ``number of queries whose top n smart replies have at least one similar (token match similarity above the defined threshold) reply as the real reply`` + divided by + ``number of queries with at least one smart reply``. Value + ranges from 0.0 to 1.0 inclusive. + """ + + n = proto.Field(proto.INT32, number=1,) + recall = proto.Field(proto.FLOAT, number=2,) + + allowlist_coverage = proto.Field(proto.FLOAT, number=1,) + top_n_metrics = proto.RepeatedField(proto.MESSAGE, number=2, message=TopNMetrics,) + conversation_count = proto.Field(proto.INT64, number=3,) + + +class CreateConversationModelRequest(proto.Message): + r"""The request message for + [ConversationModels.CreateConversationModel][google.cloud.dialogflow.v2.ConversationModels.CreateConversationModel] + + Attributes: + parent (str): + The project to create conversation model for. Format: + ``projects/`` + conversation_model (google.cloud.dialogflow_v2.types.ConversationModel): + Required. The conversation model to create. + """ + + parent = proto.Field(proto.STRING, number=1,) + conversation_model = proto.Field( + proto.MESSAGE, number=2, message="ConversationModel", + ) + + +class GetConversationModelRequest(proto.Message): + r"""The request message for + [ConversationModels.GetConversationModel][google.cloud.dialogflow.v2.ConversationModels.GetConversationModel] + + Attributes: + name (str): + Required. The conversation model to retrieve. Format: + ``projects//conversationModels/`` + """ + + name = proto.Field(proto.STRING, number=1,) + + +class ListConversationModelsRequest(proto.Message): + r"""The request message for + [ConversationModels.ListConversationModels][google.cloud.dialogflow.v2.ConversationModels.ListConversationModels] + + Attributes: + parent (str): + Required. The project to list all conversation models for. + Format: ``projects/`` + page_size (int): + Optional. Maximum number of conversation + models to return in a single page. By default + 100 and at most 1000. + page_token (str): + Optional. The next_page_token value returned from a previous + list request. + """ + + parent = proto.Field(proto.STRING, number=1,) + page_size = proto.Field(proto.INT32, number=2,) + page_token = proto.Field(proto.STRING, number=3,) + + +class ListConversationModelsResponse(proto.Message): + r"""The response message for + [ConversationModels.ListConversationModels][google.cloud.dialogflow.v2.ConversationModels.ListConversationModels] + + Attributes: + conversation_models (Sequence[google.cloud.dialogflow_v2.types.ConversationModel]): + The list of models to return. + next_page_token (str): + Token to retrieve the next page of results, + or empty if there are no more results in the + list. + """ + + @property + def raw_page(self): + return self + + conversation_models = proto.RepeatedField( + proto.MESSAGE, number=1, message="ConversationModel", + ) + next_page_token = proto.Field(proto.STRING, number=2,) + + +class DeleteConversationModelRequest(proto.Message): + r"""The request message for + [ConversationModels.DeleteConversationModel][google.cloud.dialogflow.v2.ConversationModels.DeleteConversationModel] + + Attributes: + name (str): + Required. The conversation model to delete. Format: + ``projects//conversationModels/`` + """ + + name = proto.Field(proto.STRING, number=1,) + + +class DeployConversationModelRequest(proto.Message): + r"""The request message for + [ConversationModels.DeployConversationModel][google.cloud.dialogflow.v2.ConversationModels.DeployConversationModel] + + Attributes: + name (str): + Required. The conversation model to deploy. Format: + ``projects//conversationModels/`` + """ + + name = proto.Field(proto.STRING, number=1,) + + +class UndeployConversationModelRequest(proto.Message): + r"""The request message for + [ConversationModels.UndeployConversationModel][google.cloud.dialogflow.v2.ConversationModels.UndeployConversationModel] + + Attributes: + name (str): + Required. The conversation model to undeploy. Format: + ``projects//conversationModels/`` + """ + + name = proto.Field(proto.STRING, number=1,) + + +class GetConversationModelEvaluationRequest(proto.Message): + r"""The request message for + [ConversationModels.GetConversationModelEvaluation][google.cloud.dialogflow.v2.ConversationModels.GetConversationModelEvaluation] + + Attributes: + name (str): + Required. The conversation model evaluation resource name. + Format: + ``projects//conversationModels//evaluations/`` + """ + + name = proto.Field(proto.STRING, number=1,) + + +class ListConversationModelEvaluationsRequest(proto.Message): + r"""The request message for + [ConversationModels.ListConversationModelEvaluations][google.cloud.dialogflow.v2.ConversationModels.ListConversationModelEvaluations] + + Attributes: + parent (str): + Required. The conversation model resource name. Format: + ``projects//conversationModels/`` + page_size (int): + Optional. Maximum number of evaluations to + return in a single page. By default 100 and at + most 1000. + page_token (str): + Optional. The next_page_token value returned from a previous + list request. + """ + + parent = proto.Field(proto.STRING, number=1,) + page_size = proto.Field(proto.INT32, number=2,) + page_token = proto.Field(proto.STRING, number=3,) + + +class ListConversationModelEvaluationsResponse(proto.Message): + r"""The response message for + [ConversationModels.ListConversationModelEvaluations][google.cloud.dialogflow.v2.ConversationModels.ListConversationModelEvaluations] + + Attributes: + conversation_model_evaluations (Sequence[google.cloud.dialogflow_v2.types.ConversationModelEvaluation]): + The list of evaluations to return. + next_page_token (str): + Token to retrieve the next page of results, + or empty if there are no more results in the + list. + """ + + @property + def raw_page(self): + return self + + conversation_model_evaluations = proto.RepeatedField( + proto.MESSAGE, number=1, message="ConversationModelEvaluation", + ) + next_page_token = proto.Field(proto.STRING, number=2,) + + +class CreateConversationModelEvaluationRequest(proto.Message): + r"""The request message for + [ConversationModels.CreateConversationModelEvaluation][google.cloud.dialogflow.v2.ConversationModels.CreateConversationModelEvaluation] + + Attributes: + parent (str): + Required. The conversation model resource name. Format: + ``projects//locations//conversationModels/`` + conversation_model_evaluation (google.cloud.dialogflow_v2.types.ConversationModelEvaluation): + Required. The conversation model evaluation + to be created. + """ + + parent = proto.Field(proto.STRING, number=1,) + conversation_model_evaluation = proto.Field( + proto.MESSAGE, number=2, message="ConversationModelEvaluation", + ) + + +class CreateConversationModelOperationMetadata(proto.Message): + r"""Metadata for a + [ConversationModels.CreateConversationModel][google.cloud.dialogflow.v2.ConversationModels.CreateConversationModel] + operation. + + Attributes: + conversation_model (str): + The resource name of the conversation model. Format: + ``projects//conversationModels/`` + state (google.cloud.dialogflow_v2.types.CreateConversationModelOperationMetadata.State): + State of CreateConversationModel operation. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Timestamp when the request to create + conversation model is submitted. The time is + measured on server side. + """ + + class State(proto.Enum): + r"""State of CreateConversationModel operation.""" + STATE_UNSPECIFIED = 0 + PENDING = 1 + SUCCEEDED = 2 + FAILED = 3 + CANCELLED = 4 + CANCELLING = 5 + TRAINING = 6 + + conversation_model = proto.Field(proto.STRING, number=1,) + state = proto.Field(proto.ENUM, number=2, enum=State,) + create_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) + + +class DeployConversationModelOperationMetadata(proto.Message): + r"""Metadata for a + [ConversationModels.DeployConversationModel][google.cloud.dialogflow.v2.ConversationModels.DeployConversationModel] + operation. + + Attributes: + conversation_model (str): + The resource name of the conversation model. Format: + ``projects//conversationModels/`` + create_time (google.protobuf.timestamp_pb2.Timestamp): + Timestamp when request to deploy conversation + model was submitted. The time is measured on + server side. + """ + + conversation_model = proto.Field(proto.STRING, number=1,) + create_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) + + +class UndeployConversationModelOperationMetadata(proto.Message): + r"""Metadata for a + [ConversationModels.UndeployConversationModel][google.cloud.dialogflow.v2.ConversationModels.UndeployConversationModel] + operation. + + Attributes: + conversation_model (str): + The resource name of the conversation model. Format: + ``projects//conversationModels/`` + create_time (google.protobuf.timestamp_pb2.Timestamp): + Timestamp when the request to undeploy + conversation model was submitted. The time is + measured on server side. + """ + + conversation_model = proto.Field(proto.STRING, number=1,) + create_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) + + +class DeleteConversationModelOperationMetadata(proto.Message): + r"""Metadata for a + [ConversationModels.DeleteConversationModel][google.cloud.dialogflow.v2.ConversationModels.DeleteConversationModel] + operation. + + Attributes: + conversation_model (str): + The resource name of the conversation model. Format: + ``projects//conversationModels/`` + create_time (google.protobuf.timestamp_pb2.Timestamp): + Timestamp when delete conversation model + request was created. The time is measured on + server side. + """ + + conversation_model = proto.Field(proto.STRING, number=1,) + create_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) + + +class CreateConversationModelEvaluationOperationMetadata(proto.Message): + r"""Metadata for a + [ConversationModels.CreateConversationModelEvaluation][google.cloud.dialogflow.v2.ConversationModels.CreateConversationModelEvaluation] + operation. + + Attributes: + conversation_model_evaluation (str): + The resource name of the conversation model. Format: + ``projects//locations//conversationModels//evaluations/`` + conversation_model (str): + The resource name of the conversation model. Format: + ``projects//locations//conversationModels/`` + state (google.cloud.dialogflow_v2.types.CreateConversationModelEvaluationOperationMetadata.State): + State of CreateConversationModel operation. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Timestamp when the request to create + conversation model was submitted. The time is + measured on server side. + """ + + class State(proto.Enum): + r"""State of CreateConversationModel operation.""" + STATE_UNSPECIFIED = 0 + INITIALIZING = 1 + RUNNING = 2 + CANCELLED = 3 + SUCCEEDED = 4 + FAILED = 5 + + conversation_model_evaluation = proto.Field(proto.STRING, number=1,) + conversation_model = proto.Field(proto.STRING, number=4,) + state = proto.Field(proto.ENUM, number=2, enum=State,) + create_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_profile.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_profile.py index 3803864e3eaa..f460314191dc 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_profile.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_profile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ import proto # type: ignore from google.cloud.dialogflow_v2.types import audio_config +from google.cloud.dialogflow_v2.types import participant from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -36,6 +37,10 @@ "NotificationConfig", "LoggingConfig", "SuggestionFeature", + "SetSuggestionFeatureConfigRequest", + "ClearSuggestionFeatureConfigRequest", + "SetSuggestionFeatureConfigOperationMetadata", + "ClearSuggestionFeatureConfigOperationMetadata", }, ) @@ -698,11 +703,16 @@ class NotificationConfig(proto.Message): [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. - Notification works for phone calls, if this topic either is - in the same project as the conversation or you grant + For telephony integration to receive notification, make sure + either this topic is in the same project as the conversation + or you grant ``service-@gcp-sa-dialogflow.iam.gserviceaccount.com`` the ``Dialogflow Service Agent`` role in the topic project. + For chat integration to receive notification, make sure API + caller has been granted the ``Dialogflow Service Agent`` + role for the topic. + Format: ``projects//locations//topics/``. message_format (google.cloud.dialogflow_v2.types.NotificationConfig.MessageFormat): @@ -755,4 +765,117 @@ class Type(proto.Enum): type_ = proto.Field(proto.ENUM, number=1, enum=Type,) +class SetSuggestionFeatureConfigRequest(proto.Message): + r"""The request message for + [ConversationProfiles.SetSuggestionFeature][]. + + Attributes: + conversation_profile (str): + Required. The Conversation Profile to add or update the + suggestion feature config. Format: + ``projects//locations//conversationProfiles/``. + participant_role (google.cloud.dialogflow_v2.types.Participant.Role): + Required. The participant role to add or update the + suggestion feature config. Only HUMAN_AGENT or END_USER can + be used. + suggestion_feature_config (google.cloud.dialogflow_v2.types.HumanAgentAssistantConfig.SuggestionFeatureConfig): + Required. The suggestion feature config to + add or update. + """ + + conversation_profile = proto.Field(proto.STRING, number=1,) + participant_role = proto.Field( + proto.ENUM, number=2, enum=participant.Participant.Role, + ) + suggestion_feature_config = proto.Field( + proto.MESSAGE, + number=3, + message="HumanAgentAssistantConfig.SuggestionFeatureConfig", + ) + + +class ClearSuggestionFeatureConfigRequest(proto.Message): + r"""The request message for [ConversationProfiles.ClearFeature][]. + + Attributes: + conversation_profile (str): + Required. The Conversation Profile to add or update the + suggestion feature config. Format: + ``projects//locations//conversationProfiles/``. + participant_role (google.cloud.dialogflow_v2.types.Participant.Role): + Required. The participant role to remove the suggestion + feature config. Only HUMAN_AGENT or END_USER can be used. + suggestion_feature_type (google.cloud.dialogflow_v2.types.SuggestionFeature.Type): + Required. The type of the suggestion feature + to remove. + """ + + conversation_profile = proto.Field(proto.STRING, number=1,) + participant_role = proto.Field( + proto.ENUM, number=2, enum=participant.Participant.Role, + ) + suggestion_feature_type = proto.Field( + proto.ENUM, number=3, enum="SuggestionFeature.Type", + ) + + +class SetSuggestionFeatureConfigOperationMetadata(proto.Message): + r"""Metadata for a [ConversationProfile.SetSuggestionFeatureConfig][] + operation. + + Attributes: + conversation_profile (str): + The resource name of the conversation profile. Format: + ``projects//locations//conversationProfiles/`` + participant_role (google.cloud.dialogflow_v2.types.Participant.Role): + Required. The participant role to add or update the + suggestion feature config. Only HUMAN_AGENT or END_USER can + be used. + suggestion_feature_type (google.cloud.dialogflow_v2.types.SuggestionFeature.Type): + Required. The type of the suggestion feature + to add or update. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Timestamp whe the request was created. The + time is measured on server side. + """ + + conversation_profile = proto.Field(proto.STRING, number=1,) + participant_role = proto.Field( + proto.ENUM, number=2, enum=participant.Participant.Role, + ) + suggestion_feature_type = proto.Field( + proto.ENUM, number=3, enum="SuggestionFeature.Type", + ) + create_time = proto.Field(proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp,) + + +class ClearSuggestionFeatureConfigOperationMetadata(proto.Message): + r"""Metadata for a [ConversationProfile.ClearSuggestionFeatureConfig][] + operation. + + Attributes: + conversation_profile (str): + The resource name of the conversation profile. Format: + ``projects//locations//conversationProfiles/`` + participant_role (google.cloud.dialogflow_v2.types.Participant.Role): + Required. The participant role to remove the suggestion + feature config. Only HUMAN_AGENT or END_USER can be used. + suggestion_feature_type (google.cloud.dialogflow_v2.types.SuggestionFeature.Type): + Required. The type of the suggestion feature + to remove. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Timestamp whe the request was created. The + time is measured on server side. + """ + + conversation_profile = proto.Field(proto.STRING, number=1,) + participant_role = proto.Field( + proto.ENUM, number=2, enum=participant.Participant.Role, + ) + suggestion_feature_type = proto.Field( + proto.ENUM, number=3, enum="SuggestionFeature.Type", + ) + create_time = proto.Field(proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp,) + + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/document.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/document.py index bb606d448bd1..185b5039ba62 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/document.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/document.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ "UpdateDocumentRequest", "ReloadDocumentRequest", "ExportDocumentRequest", + "ExportOperationMetadata", "KnowledgeOperationMetadata", }, ) @@ -120,6 +121,9 @@ class Document(proto.Message): storing a document's title, an external URL distinct from the document's content_uri, etc. The max size of a ``key`` or a ``value`` of the metadata is 1024 bytes. + state (google.cloud.dialogflow_v2.types.Document.State): + Output only. The current state of the + document. """ class KnowledgeType(proto.Enum): @@ -128,6 +132,16 @@ class KnowledgeType(proto.Enum): FAQ = 1 EXTRACTIVE_QA = 2 ARTICLE_SUGGESTION = 3 + AGENT_FACING_SMART_REPLY = 4 + + class State(proto.Enum): + r"""Possible states of the document""" + STATE_UNSPECIFIED = 0 + CREATING = 1 + ACTIVE = 2 + UPDATING = 3 + RELOADING = 4 + DELETING = 5 class ReloadStatus(proto.Message): r"""The status of a reload attempt. @@ -155,6 +169,7 @@ class ReloadStatus(proto.Message): enable_auto_reload = proto.Field(proto.BOOL, number=11,) latest_reload_status = proto.Field(proto.MESSAGE, number=12, message=ReloadStatus,) metadata = proto.MapField(proto.STRING, proto.STRING, number=7,) + state = proto.Field(proto.ENUM, number=13, enum=State,) class GetDocumentRequest(proto.Message): @@ -431,10 +446,27 @@ class ExportDocumentRequest(proto.Message): smart_messaging_partial_update = proto.Field(proto.BOOL, number=5,) +class ExportOperationMetadata(proto.Message): + r"""Metadata related to the Export Data Operations (e.g. + ExportDocument). + + Attributes: + exported_gcs_destination (google.cloud.dialogflow_v2.types.GcsDestination): + Cloud Storage file path of the exported data. + """ + + exported_gcs_destination = proto.Field( + proto.MESSAGE, number=1, message=gcs.GcsDestination, + ) + + class KnowledgeOperationMetadata(proto.Message): r"""Metadata in google::longrunning::Operation for Knowledge operations. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: state (google.cloud.dialogflow_v2.types.KnowledgeOperationMetadata.State): Output only. The current state of this @@ -442,6 +474,11 @@ class KnowledgeOperationMetadata(proto.Message): knowledge_base (str): The name of the knowledge base interacted with during the operation. + export_operation_metadata (google.cloud.dialogflow_v2.types.ExportOperationMetadata): + Metadata for the Export Data Operation such + as the destination of export. + + This field is a member of `oneof`_ ``operation_metadata``. """ class State(proto.Enum): @@ -453,6 +490,12 @@ class State(proto.Enum): state = proto.Field(proto.ENUM, number=1, enum=State,) knowledge_base = proto.Field(proto.STRING, number=3,) + export_operation_metadata = proto.Field( + proto.MESSAGE, + number=4, + oneof="operation_metadata", + message="ExportOperationMetadata", + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/entity_type.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/entity_type.py index 7b5edaa6372f..16a4fd8201e3 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/entity_type.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/entity_type.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/environment.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/environment.py index 63b3872aa9bf..e5b6b9c93c9d 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/environment.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/environment.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/fulfillment.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/fulfillment.py index 8a40dc83b7f7..9c6bd1eff6d0 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/fulfillment.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/fulfillment.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/gcs.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/gcs.py index 4aa2382eddc8..2d182fa8b0bd 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/gcs.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/gcs.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/human_agent_assistant_event.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/human_agent_assistant_event.py index 74a0afacf1b3..a0fa80415278 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/human_agent_assistant_event.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/human_agent_assistant_event.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/intent.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/intent.py index aafe6ca9ddf7..6e2123e94c66 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/intent.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/intent.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/knowledge_base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/knowledge_base.py index df6af1645967..e65469e5aecf 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/knowledge_base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/knowledge_base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/participant.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/participant.py index 7dbcf9376c64..f51e554c1f79 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/participant.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/participant.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/session.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/session.py index 077610f3bca4..de4d29cd5cc1 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/session.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/session.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -734,6 +734,11 @@ class EventInput(proto.Message): 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. + + This field is ignored when used in the context of a + [WebhookResponse.followup_event_input][google.cloud.dialogflow.v2.WebhookResponse.followup_event_input] + field, because the language was already defined in the + originating detect intent request. """ name = proto.Field(proto.STRING, number=1,) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/session_entity_type.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/session_entity_type.py index 619b7a8c9a50..7245da0024e3 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/session_entity_type.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/session_entity_type.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/validation_result.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/validation_result.py index e065363b7a86..ba1469d5ce67 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/validation_result.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/validation_result.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/version.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/version.py index 6400e04455a8..b9a986432c43 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/version.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/version.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/webhook.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/webhook.py index 6dd218aa5c1d..03ee3afe450a 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/webhook.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/webhook.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/__init__.py index 5c390d8e9b0f..68017ce1318b 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/__init__.py index 4de65971c238..e8e1c3845db5 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/__init__.py index 0501fa947495..db2a1a7d2c0c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/async_client.py index 65e38affd679..edbfa0ecf755 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -211,7 +211,7 @@ async def get_agent( ) -> agent.Agent: r"""Retrieves the specified agent. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -316,7 +316,7 @@ async def set_agent( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -418,7 +418,7 @@ async def delete_agent( ) -> None: r"""Deletes the specified agent. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -505,7 +505,7 @@ async def search_agents( Sub-Collections `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -621,7 +621,7 @@ async def train_agent( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -748,7 +748,7 @@ async def export_agent( [ExportAgentResponse][google.cloud.dialogflow.v2beta1.ExportAgentResponse] - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -884,7 +884,7 @@ async def import_agent( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1006,7 +1006,7 @@ async def restore_agent( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1103,7 +1103,7 @@ async def get_validation_result( automatically when training is completed. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/client.py index 8ff2bf88f880..ab84c91edfa8 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -411,8 +411,7 @@ def get_agent( ) -> agent.Agent: r"""Retrieves the specified agent. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -517,8 +516,7 @@ def set_agent( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -620,8 +618,7 @@ def delete_agent( ) -> None: r"""Deletes the specified agent. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -708,8 +705,7 @@ def search_agents( Sub-Collections `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -825,8 +821,7 @@ def train_agent( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -953,8 +948,7 @@ def export_agent( [ExportAgentResponse][google.cloud.dialogflow.v2beta1.ExportAgentResponse] - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1090,8 +1084,7 @@ def import_agent( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1214,8 +1207,7 @@ def restore_agent( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1313,8 +1305,7 @@ def get_validation_result( automatically when training is completed. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/pagers.py index ee5753a3dd49..ff86418249e0 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/transports/__init__.py index ceadcd3aacb3..703a3046be7b 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/transports/base.py index 5239c1050cf4..1a7ac1c19b18 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/transports/grpc.py index 22c87c32aecb..2e49fc3ba984 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/transports/grpc_asyncio.py index 09b44e41beb5..72c19d00fe9a 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/agents/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/__init__.py index 25960120e18f..6fb08a96ff0a 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/async_client.py index 576f3f77afcb..4bda53685cc0 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -221,7 +221,7 @@ async def get_answer_record( Retrieves a specific answer record. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -327,7 +327,7 @@ async def list_answer_records( specified project in reverse chronological order. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -428,7 +428,7 @@ async def update_answer_record( ) -> gcd_answer_record.AnswerRecord: r"""Updates the specified answer record. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/client.py index e9988d1c4ef2..33dad169ba65 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -413,8 +413,7 @@ def get_answer_record( Retrieves a specific answer record. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -520,8 +519,7 @@ def list_answer_records( specified project in reverse chronological order. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -622,8 +620,7 @@ def update_answer_record( ) -> gcd_answer_record.AnswerRecord: r"""Updates the specified answer record. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/pagers.py index 252faa0c2310..ea984e470a89 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/transports/__init__.py index e97f4f57dadd..889c9420deb6 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/transports/base.py index e6d672be3976..b35677491096 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/transports/grpc.py index 1b3b88c7257f..5f485de8c48f 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/transports/grpc_asyncio.py index 80ebd5ded0a4..a37eb7035e0c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/__init__.py index 4c5791dcf005..4f3cbf86928e 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/async_client.py index 448356e4aade..4d66e3968082 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -212,7 +212,7 @@ async def list_contexts( session. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -322,7 +322,7 @@ async def get_context( ) -> context.Context: r"""Retrieves the specified context. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -442,7 +442,7 @@ async def create_context( context. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -567,7 +567,7 @@ async def update_context( ) -> gcd_context.Context: r"""Updates the specified context. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -682,7 +682,7 @@ async def delete_context( ) -> None: r"""Deletes the specified context. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -772,7 +772,7 @@ async def delete_all_contexts( ) -> None: r"""Deletes all active contexts in the specified session. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/client.py index 478e494169c6..2c60baffb26e 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -415,8 +415,7 @@ def list_contexts( session. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -526,8 +525,7 @@ def get_context( ) -> context.Context: r"""Retrieves the specified context. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -647,8 +645,7 @@ def create_context( context. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -773,8 +770,7 @@ def update_context( ) -> gcd_context.Context: r"""Updates the specified context. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -889,8 +885,7 @@ def delete_context( ) -> None: r"""Deletes the specified context. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -980,8 +975,7 @@ def delete_all_contexts( ) -> None: r"""Deletes all active contexts in the specified session. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/pagers.py index f4c2f6c32ad4..49b845fb4af3 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/transports/__init__.py index d25eca3aaec7..412097665e34 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/transports/base.py index 000467d5a20d..0b2294f3d93e 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/transports/grpc.py index 18e2099b75fb..4ddd623e334d 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/transports/grpc_asyncio.py index d05a1124171b..31d84e674c45 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/contexts/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/__init__.py index c0cb1cd03856..ba1e4487dc42 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/async_client.py index 1485f099c7db..0938c8deb4ea 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -250,7 +250,7 @@ async def list_conversation_profiles( specified project. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -351,7 +351,7 @@ async def get_conversation_profile( ) -> conversation_profile.ConversationProfile: r"""Retrieves the specified conversation profile. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -452,7 +452,7 @@ async def create_conversation_profile( API. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -566,7 +566,7 @@ async def update_conversation_profile( API. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -672,7 +672,7 @@ async def delete_conversation_profile( ) -> None: r"""Deletes the specified conversation profile. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/client.py index 120f0b8f813e..83a15c5d7871 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -502,8 +502,7 @@ def list_conversation_profiles( specified project. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -608,8 +607,7 @@ def get_conversation_profile( ) -> conversation_profile.ConversationProfile: r"""Retrieves the specified conversation profile. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -710,8 +708,7 @@ def create_conversation_profile( API. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -829,8 +826,7 @@ def update_conversation_profile( API. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -940,8 +936,7 @@ def delete_conversation_profile( ) -> None: r"""Deletes the specified conversation profile. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/pagers.py index 883594f06bab..591a85aea369 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/transports/__init__.py index f2a4e22037c5..75117ebe9caf 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/transports/base.py index 2baa96bb67ba..3845f1da3a2a 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/transports/grpc.py index cc20e4431240..aa793de8354a 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/transports/grpc_asyncio.py index 6f13d7e85e97..2dc97503cdc1 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversation_profiles/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/__init__.py index f6f6b90ff3eb..3869363a87e1 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/async_client.py index aa18baff34a3..1d59211fa439 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -248,7 +248,7 @@ async def create_conversation( is triggered, conversation will transfer to Assist Stage. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -357,7 +357,7 @@ async def list_conversations( specified project. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -458,7 +458,7 @@ async def get_conversation( ) -> conversation.Conversation: r"""Retrieves the specific conversation. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -556,7 +556,7 @@ async def complete_conversation( days. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -655,7 +655,7 @@ async def batch_create_messages( conversation. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -756,7 +756,7 @@ async def list_messages( and empty page_token. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/client.py index 7b34940df1d0..ae9baad8b21d 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -466,8 +466,7 @@ def create_conversation( is triggered, conversation will transfer to Assist Stage. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -576,8 +575,7 @@ def list_conversations( specified project. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -678,8 +676,7 @@ def get_conversation( ) -> conversation.Conversation: r"""Retrieves the specific conversation. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -777,8 +774,7 @@ def complete_conversation( days. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -877,8 +873,7 @@ def batch_create_messages( conversation. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -979,8 +974,7 @@ def list_messages( and empty page_token. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/pagers.py index 5c21ec71d6d9..0208e3a0b64c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/transports/__init__.py index 2989914f7938..f94552209491 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/transports/base.py index 772f62656ba8..ea7404dd1f04 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/transports/grpc.py index d32e5370cf4b..e1edcb826248 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/transports/grpc_asyncio.py index 8a006a272c7b..6e14ab27cfba 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/__init__.py index f610c36b0b2f..26fc1b45432a 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/async_client.py index 6899be334865..7a2f697eb182 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -219,7 +219,7 @@ async def list_documents( is deprecated; only use ``projects.knowledgeBases.documents``. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -324,7 +324,7 @@ async def get_document( is deprecated; only use ``projects.knowledgeBases.documents``. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -436,7 +436,7 @@ async def create_document( is deprecated; only use ``projects.knowledgeBases.documents``. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -576,7 +576,7 @@ async def import_documents( [ImportDocumentsResponse][google.cloud.dialogflow.v2beta1.ImportDocumentsResponse] - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -684,7 +684,7 @@ async def delete_document( is deprecated; only use ``projects.knowledgeBases.documents``. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -814,7 +814,7 @@ async def update_document( is deprecated; only use ``projects.knowledgeBases.documents``. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -966,7 +966,7 @@ async def reload_document( is deprecated; only use ``projects.knowledgeBases.documents``. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/client.py index 2eed96b09142..cbe42d85faa9 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -420,8 +420,7 @@ def list_documents( is deprecated; only use ``projects.knowledgeBases.documents``. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -526,8 +525,7 @@ def get_document( is deprecated; only use ``projects.knowledgeBases.documents``. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -639,8 +637,7 @@ def create_document( is deprecated; only use ``projects.knowledgeBases.documents``. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -780,8 +777,7 @@ def import_documents( [ImportDocumentsResponse][google.cloud.dialogflow.v2beta1.ImportDocumentsResponse] - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -890,8 +886,7 @@ def delete_document( is deprecated; only use ``projects.knowledgeBases.documents``. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1021,8 +1016,7 @@ def update_document( is deprecated; only use ``projects.knowledgeBases.documents``. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1174,8 +1168,7 @@ def reload_document( is deprecated; only use ``projects.knowledgeBases.documents``. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/pagers.py index 3b87f0cc5d98..73ad5328ebbb 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/transports/__init__.py index 5d4948aa0054..2e363c1e2151 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/transports/base.py index 9081ec7864ec..9f7519a76d3c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/transports/grpc.py index a266ed6a4032..4ab99778e3e6 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/transports/grpc_asyncio.py index cd4dfdaeb770..c7267088b0b8 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/documents/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/__init__.py index 77cd53e9c1f1..b0093027afbc 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/async_client.py index ec102b0ed3c3..e2bc2d1747a6 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -220,7 +220,7 @@ async def list_entity_types( agent. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -336,7 +336,7 @@ async def get_entity_type( ) -> entity_type.EntityType: r"""Retrieves the specified entity type. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -461,7 +461,7 @@ async def create_entity_type( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -598,7 +598,7 @@ async def update_entity_type( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -731,7 +731,7 @@ async def delete_entity_type( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -828,7 +828,7 @@ async def batch_update_entity_types( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -930,7 +930,7 @@ async def batch_delete_entity_types( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1075,7 +1075,7 @@ async def batch_create_entities( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1235,7 +1235,7 @@ async def batch_update_entities( message `__ - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1395,7 +1395,7 @@ async def batch_delete_entities( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/client.py index 96365a3780a9..5d8919aef1f6 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -418,8 +418,7 @@ def list_entity_types( agent. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -535,8 +534,7 @@ def get_entity_type( ) -> entity_type.EntityType: r"""Retrieves the specified entity type. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -661,8 +659,7 @@ def create_entity_type( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -799,8 +796,7 @@ def update_entity_type( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -933,8 +929,7 @@ def delete_entity_type( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1031,8 +1026,7 @@ def batch_update_entity_types( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1137,8 +1131,7 @@ def batch_delete_entity_types( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1285,8 +1278,7 @@ def batch_create_entities( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1446,8 +1438,7 @@ def batch_update_entities( message `__ - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1607,8 +1598,7 @@ def batch_delete_entities( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/pagers.py index 73baab3fb491..23bb0ea60a05 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/transports/__init__.py index 07ea82e1b45f..2a22d6640edb 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/transports/base.py index 49fff8629a20..9cbf1684a206 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/transports/grpc.py index 8c4aa57f0d80..9ba8ad86eb01 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/transports/grpc_asyncio.py index 5b306d84a8ac..77f2bdae6248 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/entity_types/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/__init__.py index 0c2be9484d25..2283376579f4 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/async_client.py index 3b2a639135f8..d8bd28de193a 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -219,7 +219,7 @@ async def list_environments( specified agent. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -321,7 +321,7 @@ async def get_environment( ) -> environment.Environment: r"""Retrieves the specified agent environment. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -408,7 +408,7 @@ async def create_environment( ) -> environment.Environment: r"""Creates an agent environment. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -509,7 +509,7 @@ async def update_environment( draft to a version before calling this function. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -597,7 +597,7 @@ async def delete_environment( ) -> None: r"""Deletes the specified agent environment. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -655,7 +655,7 @@ async def get_environment_history( ) -> pagers.GetEnvironmentHistoryAsyncPager: r"""Gets the history of the specified environment. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/client.py index 09c207ba82ce..7bc91d9d907a 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -439,8 +439,7 @@ def list_environments( specified agent. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -542,8 +541,7 @@ def get_environment( ) -> environment.Environment: r"""Retrieves the specified agent environment. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -631,8 +629,7 @@ def create_environment( ) -> environment.Environment: r"""Creates an agent environment. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -734,8 +731,7 @@ def update_environment( draft to a version before calling this function. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -824,8 +820,7 @@ def delete_environment( ) -> None: r"""Deletes the specified agent environment. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -884,8 +879,7 @@ def get_environment_history( ) -> pagers.GetEnvironmentHistoryPager: r"""Gets the history of the specified environment. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/pagers.py index 3f547999fe69..571e9d93b955 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/transports/__init__.py index c72efee48830..0ecefb6122d1 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/transports/base.py index c70b2fb6e5d3..0bfdf8a66aae 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/transports/grpc.py index 39fbb331f3bd..ef8b085e9f56 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/transports/grpc_asyncio.py index 20cbe81e2f6d..f1c4283f400b 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/environments/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/__init__.py index 6bade52ddb4c..abd353a6df5c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/async_client.py index 4e186d6a63dc..920433611c62 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -212,7 +212,7 @@ async def get_fulfillment( ) -> fulfillment.Fulfillment: r"""Retrieves the fulfillment. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -316,7 +316,7 @@ async def update_fulfillment( ) -> gcd_fulfillment.Fulfillment: r"""Updates the fulfillment. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/client.py index cdfc36bf0a05..6efafc510768 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -406,8 +406,7 @@ def get_fulfillment( ) -> fulfillment.Fulfillment: r"""Retrieves the fulfillment. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -511,8 +510,7 @@ def update_fulfillment( ) -> gcd_fulfillment.Fulfillment: r"""Updates the fulfillment. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/transports/__init__.py index d822b662beac..425287bb074f 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/transports/base.py index 40d6c6f17261..5724fee71d53 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/transports/grpc.py index dbf30686e1bb..602e04419514 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/transports/grpc_asyncio.py index 1ad5a7b19f16..dbda3e3b6152 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/fulfillments/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/__init__.py index 5a2c263cff80..283553c4a1d7 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/async_client.py index 4ca5d52eebfb..8040219701d8 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -219,7 +219,7 @@ async def list_intents( agent. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -341,7 +341,7 @@ async def get_intent( ) -> intent.Intent: r"""Retrieves the specified intent. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -461,7 +461,7 @@ async def create_intent( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -593,7 +593,7 @@ async def update_intent( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -722,7 +722,7 @@ async def delete_intent( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -825,7 +825,7 @@ async def batch_update_intents( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -973,7 +973,7 @@ async def batch_delete_intents( documentation `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/client.py index a199ad32fdcd..af7d12e6cb8f 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -433,8 +433,7 @@ def list_intents( agent. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -556,8 +555,7 @@ def get_intent( ) -> intent.Intent: r"""Retrieves the specified intent. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -677,8 +675,7 @@ def create_intent( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -810,8 +807,7 @@ def update_intent( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -940,8 +936,7 @@ def delete_intent( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1044,8 +1039,7 @@ def batch_update_intents( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1193,8 +1187,7 @@ def batch_delete_intents( documentation `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/pagers.py index e7c0edf18b52..5c1f3fe1a345 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/transports/__init__.py index 974a58103548..876b5cd146eb 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/transports/base.py index 7e8a223663ee..9cdfe6384163 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/transports/grpc.py index 2eedfb90f96e..35476d934454 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/transports/grpc_asyncio.py index 9ae79d942aee..ada377a4b61c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/intents/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/__init__.py index 24204c98218b..e1715313993f 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/async_client.py index 65c55855932c..81b6c1603c52 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -223,7 +223,7 @@ async def list_knowledge_bases( deprecated; only use ``projects.knowledgeBases``. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -328,7 +328,7 @@ async def get_knowledge_base( deprecated; only use ``projects.knowledgeBases``. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -434,7 +434,7 @@ async def create_knowledge_base( deprecated; only use ``projects.knowledgeBases``. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -552,7 +552,7 @@ async def delete_knowledge_base( deprecated; only use ``projects.knowledgeBases``. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -638,7 +638,7 @@ async def update_knowledge_base( deprecated; only use ``projects.knowledgeBases``. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/client.py index f61f607a0dfd..940b08e17edb 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -417,8 +417,7 @@ def list_knowledge_bases( deprecated; only use ``projects.knowledgeBases``. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -523,8 +522,7 @@ def get_knowledge_base( deprecated; only use ``projects.knowledgeBases``. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -630,8 +628,7 @@ def create_knowledge_base( deprecated; only use ``projects.knowledgeBases``. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -749,8 +746,7 @@ def delete_knowledge_base( deprecated; only use ``projects.knowledgeBases``. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -836,8 +832,7 @@ def update_knowledge_base( deprecated; only use ``projects.knowledgeBases``. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/pagers.py index e14b747829bb..b0adf1b17aae 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/transports/__init__.py index 38da4326dc5c..f3bf2daa6d7f 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/transports/base.py index c714b03dcd63..57f6c6cdbcfe 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/transports/grpc.py index b6c49a3bca07..5ae699fb8b80 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/transports/grpc_asyncio.py index b778c34ecbab..751d6624b6d8 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/knowledge_bases/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/__init__.py index 942327781d1b..b3b91ad6ab2b 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/async_client.py index df4b0d781aca..80facb54c8af 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -230,7 +230,7 @@ async def create_participant( ) -> gcd_participant.Participant: r"""Creates a new participant in a conversation. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -328,7 +328,7 @@ async def get_participant( ) -> participant.Participant: r"""Retrieves a conversation participant. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -420,7 +420,7 @@ async def list_participants( conversation. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -522,7 +522,7 @@ async def update_participant( ) -> gcd_participant.Participant: r"""Updates the specified participant. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -628,7 +628,7 @@ async def analyze_content( environments `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -755,7 +755,7 @@ async def suggest_articles( conversation context in the real time. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -848,7 +848,7 @@ async def suggest_faq_answers( specific historical messages. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -941,7 +941,7 @@ async def suggest_smart_replies( specific historical messages. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1051,7 +1051,7 @@ async def list_suggestions( and empty page_token. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1147,7 +1147,7 @@ async def compile_suggestion( conversation context in the real time. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/client.py index bf2685e485f1..4bc18b650d62 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -507,8 +507,7 @@ def create_participant( ) -> gcd_participant.Participant: r"""Creates a new participant in a conversation. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -606,8 +605,7 @@ def get_participant( ) -> participant.Participant: r"""Retrieves a conversation participant. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -699,8 +697,7 @@ def list_participants( conversation. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -802,8 +799,7 @@ def update_participant( ) -> gcd_participant.Participant: r"""Updates the specified participant. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -909,8 +905,7 @@ def analyze_content( environments `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1028,8 +1023,7 @@ def suggest_articles( conversation context in the real time. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1122,8 +1116,7 @@ def suggest_faq_answers( specific historical messages. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1216,8 +1209,7 @@ def suggest_smart_replies( specific historical messages. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1327,8 +1319,7 @@ def list_suggestions( and empty page_token. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -1425,8 +1416,7 @@ def compile_suggestion( conversation context in the real time. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/pagers.py index 1bb2d78e6171..eee428acb943 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/transports/__init__.py index 522813c1cd2e..146083f8075c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/transports/base.py index dc19b588a231..c77d1e819906 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/transports/grpc.py index e3f8e49117a7..5d78809b5e7e 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/transports/grpc_asyncio.py index d05d355f7c8e..88f07f1bbf45 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/__init__.py index cbd406b49249..a8d58e178c04 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/async_client.py index 7e2dbb4877d3..84d648a84aca 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -230,7 +230,7 @@ async def list_session_entity_types( use session entities with Google Assistant integration. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -344,7 +344,7 @@ async def get_session_entity_type( use session entities with Google Assistant integration. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -462,7 +462,7 @@ async def create_session_entity_type( use session entities with Google Assistant integration. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -586,7 +586,7 @@ async def update_session_entity_type( use session entities with Google Assistant integration. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -698,7 +698,7 @@ async def delete_session_entity_type( use session entities with Google Assistant integration. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/client.py index 4c3f20983682..085fcf97ea8c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -424,8 +424,7 @@ def list_session_entity_types( use session entities with Google Assistant integration. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -541,8 +540,7 @@ def get_session_entity_type( use session entities with Google Assistant integration. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -660,8 +658,7 @@ def create_session_entity_type( use session entities with Google Assistant integration. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -789,8 +786,7 @@ def update_session_entity_type( use session entities with Google Assistant integration. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -906,8 +902,7 @@ def delete_session_entity_type( use session entities with Google Assistant integration. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/pagers.py index 42feb80116a7..8840081b9b4d 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/transports/__init__.py index 633fd32cbee4..44e2a8d4388c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/transports/base.py index 132f54ba1ee4..f5bc8b5a5e2e 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/transports/grpc.py index c6599adaeac2..2a308e2851c9 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/transports/grpc_asyncio.py index 4e7c534ee157..fc3860dc3f7f 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/session_entity_types/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/__init__.py index 0adeafb97d75..49b86a28bb6f 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/async_client.py index 0e5a301669a9..4c2f55e687e8 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -247,7 +247,7 @@ async def detect_intent( environments `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -400,7 +400,7 @@ def streaming_detect_intent( environments `__. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/client.py index 725aab3fcce1..f018de69b4c2 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -490,8 +490,7 @@ def detect_intent( environments `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -635,8 +634,7 @@ def streaming_detect_intent( environments `__. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/transports/__init__.py index db0f7d045411..ce00ff37674e 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/transports/base.py index 44b487807ab5..6803b6db2ee7 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/transports/grpc.py index a35924e801bf..98c3684e9e3d 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/transports/grpc_asyncio.py index 2f2dd65eef5c..50e7a4aacb1f 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/sessions/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/__init__.py index 586be1818c01..78f73aa31a8d 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/async_client.py index f4f262d9d4e1..37358b6168bc 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -212,7 +212,7 @@ async def list_versions( agent. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -315,7 +315,7 @@ async def get_version( ) -> version.Version: r"""Retrieves the specified agent version. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -430,7 +430,7 @@ async def create_version( "default" environment. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -555,7 +555,7 @@ async def update_version( version resource. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -676,7 +676,7 @@ async def delete_version( ) -> None: r"""Delete the specified agent version. - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/client.py index 2027032ca0a5..581c42c161df 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -414,8 +414,7 @@ def list_versions( agent. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -518,8 +517,7 @@ def get_version( ) -> version.Version: r"""Retrieves the specified agent version. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -634,8 +632,7 @@ def create_version( "default" environment. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -760,8 +757,7 @@ def update_version( version resource. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 @@ -882,8 +878,7 @@ def delete_version( ) -> None: r"""Delete the specified agent version. - - .. code-block:: + .. code-block:: python from google.cloud import dialogflow_v2beta1 diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/pagers.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/pagers.py index ba6de490a79b..06738af1fe2b 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/pagers.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/transports/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/transports/__init__.py index c5a42a0e8fea..ab80b3b575df 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/transports/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/transports/base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/transports/base.py index a438209745fc..8200a7b30801 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/transports/base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/transports/grpc.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/transports/grpc.py index a19ee770382d..62711c2da1e9 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/transports/grpc.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/transports/grpc_asyncio.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/transports/grpc_asyncio.py index be3e53207bea..c0c965757e3b 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/transports/grpc_asyncio.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/versions/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/__init__.py index c09d039ae32a..7fd7edeb37b2 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/agent.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/agent.py index 08b9b7a57cc7..985a64f1201b 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/agent.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/agent.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/answer_record.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/answer_record.py index 8d81ebef7bab..e9632ed52f94 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/answer_record.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/answer_record.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/audio_config.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/audio_config.py index 32e1fd7104e5..6561ee090d4d 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/audio_config.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/audio_config.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/context.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/context.py index 8b4d02a29e37..6cd15ea5c006 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/context.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/context.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation.py index 19dd0363cd4b..ca5d0dce5799 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation_event.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation_event.py index 27ff0c52cb26..305e306ed30f 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation_event.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation_event.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation_profile.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation_profile.py index a77470e5ad16..a4ab318e032b 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation_profile.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation_profile.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/document.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/document.py index 89aae80274d1..f0641dc82d05 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/document.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/document.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/entity_type.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/entity_type.py index 8eaad0152690..0375c68518e5 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/entity_type.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/entity_type.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/environment.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/environment.py index f24d1e574fad..15d9947e4ce0 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/environment.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/environment.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/fulfillment.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/fulfillment.py index 206a47109231..aeb74854bee3 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/fulfillment.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/fulfillment.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/gcs.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/gcs.py index 99cf2bad4668..8e30d919c761 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/gcs.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/gcs.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/human_agent_assistant_event.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/human_agent_assistant_event.py index b66735d32f3a..ecb797222af9 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/human_agent_assistant_event.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/human_agent_assistant_event.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/intent.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/intent.py index 99714cb0254d..a1da67089368 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/intent.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/intent.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/knowledge_base.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/knowledge_base.py index bc167796ba85..21ee4db4372b 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/knowledge_base.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/knowledge_base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/participant.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/participant.py index fbc196b2a643..e9fa92536773 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/participant.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/participant.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/session.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/session.py index b63535a6d49e..858df3bb62db 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/session.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/session.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/session_entity_type.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/session_entity_type.py index a3d4a28388e0..c01267a63c0e 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/session_entity_type.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/session_entity_type.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/validation_result.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/validation_result.py index 05c1cd38ef5b..1fba6c69044b 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/validation_result.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/validation_result.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/version.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/version.py index 623c33e1e5b6..30cd29a640fa 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/version.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/version.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/webhook.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/webhook.py index b494938f24f1..ea4d9535d8a8 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/webhook.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/webhook.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_delete_agent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_delete_agent_async.py new file mode 100644 index 000000000000..333f9137691c --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_delete_agent_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_DeleteAgent_async] +from google.cloud import dialogflow_v2 + + +async def sample_delete_agent(): + # Create a client + client = dialogflow_v2.AgentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteAgentRequest( + parent="parent_value", + ) + + # Make the request + await client.delete_agent(request=request) + + +# [END dialogflow_v2_generated_Agents_DeleteAgent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_delete_agent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_delete_agent_sync.py new file mode 100644 index 000000000000..bcff562f58a7 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_delete_agent_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_DeleteAgent_sync] +from google.cloud import dialogflow_v2 + + +def sample_delete_agent(): + # Create a client + client = dialogflow_v2.AgentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteAgentRequest( + parent="parent_value", + ) + + # Make the request + client.delete_agent(request=request) + + +# [END dialogflow_v2_generated_Agents_DeleteAgent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_export_agent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_export_agent_async.py new file mode 100644 index 000000000000..13ae15ef5481 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_export_agent_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ExportAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_ExportAgent_async] +from google.cloud import dialogflow_v2 + + +async def sample_export_agent(): + # Create a client + client = dialogflow_v2.AgentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ExportAgentRequest( + parent="parent_value", + agent_uri="agent_uri_value", + ) + + # Make the request + operation = client.export_agent(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Agents_ExportAgent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_export_agent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_export_agent_sync.py new file mode 100644 index 000000000000..f3c310641523 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_export_agent_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ExportAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_ExportAgent_sync] +from google.cloud import dialogflow_v2 + + +def sample_export_agent(): + # Create a client + client = dialogflow_v2.AgentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ExportAgentRequest( + parent="parent_value", + agent_uri="agent_uri_value", + ) + + # Make the request + operation = client.export_agent(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Agents_ExportAgent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_get_agent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_get_agent_async.py new file mode 100644 index 000000000000..831bf9194897 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_get_agent_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_GetAgent_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_agent(): + # Create a client + client = dialogflow_v2.AgentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetAgentRequest( + parent="parent_value", + ) + + # Make the request + response = await client.get_agent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Agents_GetAgent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_get_agent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_get_agent_sync.py new file mode 100644 index 000000000000..5e086a9e3f43 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_get_agent_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_GetAgent_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_agent(): + # Create a client + client = dialogflow_v2.AgentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetAgentRequest( + parent="parent_value", + ) + + # Make the request + response = client.get_agent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Agents_GetAgent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_get_validation_result_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_get_validation_result_async.py new file mode 100644 index 000000000000..39b4cdc2b9ca --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_get_validation_result_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetValidationResult +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_GetValidationResult_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_validation_result(): + # Create a client + client = dialogflow_v2.AgentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetValidationResultRequest( + parent="parent_value", + ) + + # Make the request + response = await client.get_validation_result(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Agents_GetValidationResult_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_get_validation_result_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_get_validation_result_sync.py new file mode 100644 index 000000000000..f3b4d929d209 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_get_validation_result_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetValidationResult +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_GetValidationResult_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_validation_result(): + # Create a client + client = dialogflow_v2.AgentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetValidationResultRequest( + parent="parent_value", + ) + + # Make the request + response = client.get_validation_result(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Agents_GetValidationResult_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_import_agent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_import_agent_async.py new file mode 100644 index 000000000000..fee947f27063 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_import_agent_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ImportAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_ImportAgent_async] +from google.cloud import dialogflow_v2 + + +async def sample_import_agent(): + # Create a client + client = dialogflow_v2.AgentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ImportAgentRequest( + agent_uri="agent_uri_value", + parent="parent_value", + ) + + # Make the request + operation = client.import_agent(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Agents_ImportAgent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_import_agent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_import_agent_sync.py new file mode 100644 index 000000000000..a2682864e373 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_import_agent_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ImportAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_ImportAgent_sync] +from google.cloud import dialogflow_v2 + + +def sample_import_agent(): + # Create a client + client = dialogflow_v2.AgentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ImportAgentRequest( + agent_uri="agent_uri_value", + parent="parent_value", + ) + + # Make the request + operation = client.import_agent(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Agents_ImportAgent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_restore_agent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_restore_agent_async.py new file mode 100644 index 000000000000..1520b5903c76 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_restore_agent_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RestoreAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_RestoreAgent_async] +from google.cloud import dialogflow_v2 + + +async def sample_restore_agent(): + # Create a client + client = dialogflow_v2.AgentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.RestoreAgentRequest( + agent_uri="agent_uri_value", + parent="parent_value", + ) + + # Make the request + operation = client.restore_agent(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Agents_RestoreAgent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_restore_agent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_restore_agent_sync.py new file mode 100644 index 000000000000..9d8424f4ac96 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_restore_agent_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RestoreAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_RestoreAgent_sync] +from google.cloud import dialogflow_v2 + + +def sample_restore_agent(): + # Create a client + client = dialogflow_v2.AgentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.RestoreAgentRequest( + agent_uri="agent_uri_value", + parent="parent_value", + ) + + # Make the request + operation = client.restore_agent(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Agents_RestoreAgent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_search_agents_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_search_agents_async.py new file mode 100644 index 000000000000..685758ce29a2 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_search_agents_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SearchAgents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_SearchAgents_async] +from google.cloud import dialogflow_v2 + + +async def sample_search_agents(): + # Create a client + client = dialogflow_v2.AgentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.SearchAgentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.search_agents(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Agents_SearchAgents_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_search_agents_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_search_agents_sync.py new file mode 100644 index 000000000000..f0b88d270db5 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_search_agents_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SearchAgents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_SearchAgents_sync] +from google.cloud import dialogflow_v2 + + +def sample_search_agents(): + # Create a client + client = dialogflow_v2.AgentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.SearchAgentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.search_agents(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Agents_SearchAgents_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_set_agent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_set_agent_async.py new file mode 100644 index 000000000000..d14f152a832b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_set_agent_async.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_SetAgent_async] +from google.cloud import dialogflow_v2 + + +async def sample_set_agent(): + # Create a client + client = dialogflow_v2.AgentsAsyncClient() + + # Initialize request argument(s) + agent = dialogflow_v2.Agent() + agent.parent = "parent_value" + agent.display_name = "display_name_value" + agent.default_language_code = "default_language_code_value" + agent.time_zone = "time_zone_value" + + request = dialogflow_v2.SetAgentRequest( + agent=agent, + ) + + # Make the request + response = await client.set_agent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Agents_SetAgent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_set_agent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_set_agent_sync.py new file mode 100644 index 000000000000..f1a68a7848d0 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_set_agent_sync.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_SetAgent_sync] +from google.cloud import dialogflow_v2 + + +def sample_set_agent(): + # Create a client + client = dialogflow_v2.AgentsClient() + + # Initialize request argument(s) + agent = dialogflow_v2.Agent() + agent.parent = "parent_value" + agent.display_name = "display_name_value" + agent.default_language_code = "default_language_code_value" + agent.time_zone = "time_zone_value" + + request = dialogflow_v2.SetAgentRequest( + agent=agent, + ) + + # Make the request + response = client.set_agent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Agents_SetAgent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_train_agent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_train_agent_async.py new file mode 100644 index 000000000000..4af44b26eda0 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_train_agent_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TrainAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_TrainAgent_async] +from google.cloud import dialogflow_v2 + + +async def sample_train_agent(): + # Create a client + client = dialogflow_v2.AgentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.TrainAgentRequest( + parent="parent_value", + ) + + # Make the request + operation = client.train_agent(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Agents_TrainAgent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_train_agent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_train_agent_sync.py new file mode 100644 index 000000000000..5e44d84be6f1 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_agents_train_agent_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TrainAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Agents_TrainAgent_sync] +from google.cloud import dialogflow_v2 + + +def sample_train_agent(): + # Create a client + client = dialogflow_v2.AgentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.TrainAgentRequest( + parent="parent_value", + ) + + # Make the request + operation = client.train_agent(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Agents_TrainAgent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_answer_records_list_answer_records_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_answer_records_list_answer_records_async.py new file mode 100644 index 000000000000..db270cfefc84 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_answer_records_list_answer_records_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListAnswerRecords +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_async] +from google.cloud import dialogflow_v2 + + +async def sample_list_answer_records(): + # Create a client + client = dialogflow_v2.AnswerRecordsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListAnswerRecordsRequest( + parent="parent_value", + filter="filter_value", + ) + + # Make the request + page_result = client.list_answer_records(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_answer_records_list_answer_records_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_answer_records_list_answer_records_sync.py new file mode 100644 index 000000000000..0baca719df05 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_answer_records_list_answer_records_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListAnswerRecords +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_sync] +from google.cloud import dialogflow_v2 + + +def sample_list_answer_records(): + # Create a client + client = dialogflow_v2.AnswerRecordsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListAnswerRecordsRequest( + parent="parent_value", + filter="filter_value", + ) + + # Make the request + page_result = client.list_answer_records(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_answer_records_update_answer_record_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_answer_records_update_answer_record_async.py new file mode 100644 index 000000000000..350eb0fcbd73 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_answer_records_update_answer_record_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateAnswerRecord +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_async] +from google.cloud import dialogflow_v2 + + +async def sample_update_answer_record(): + # Create a client + client = dialogflow_v2.AnswerRecordsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.UpdateAnswerRecordRequest( + ) + + # Make the request + response = await client.update_answer_record(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_answer_records_update_answer_record_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_answer_records_update_answer_record_sync.py new file mode 100644 index 000000000000..8bf9b2faf7ed --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_answer_records_update_answer_record_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateAnswerRecord +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_sync] +from google.cloud import dialogflow_v2 + + +def sample_update_answer_record(): + # Create a client + client = dialogflow_v2.AnswerRecordsClient() + + # Initialize request argument(s) + request = dialogflow_v2.UpdateAnswerRecordRequest( + ) + + # Make the request + response = client.update_answer_record(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_create_context_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_create_context_async.py new file mode 100644 index 000000000000..fc49cfdbee74 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_create_context_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateContext +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Contexts_CreateContext_async] +from google.cloud import dialogflow_v2 + + +async def sample_create_context(): + # Create a client + client = dialogflow_v2.ContextsAsyncClient() + + # Initialize request argument(s) + context = dialogflow_v2.Context() + context.name = "name_value" + + request = dialogflow_v2.CreateContextRequest( + parent="parent_value", + context=context, + ) + + # Make the request + response = await client.create_context(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Contexts_CreateContext_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_create_context_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_create_context_sync.py new file mode 100644 index 000000000000..66d2504bc4e3 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_create_context_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateContext +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Contexts_CreateContext_sync] +from google.cloud import dialogflow_v2 + + +def sample_create_context(): + # Create a client + client = dialogflow_v2.ContextsClient() + + # Initialize request argument(s) + context = dialogflow_v2.Context() + context.name = "name_value" + + request = dialogflow_v2.CreateContextRequest( + parent="parent_value", + context=context, + ) + + # Make the request + response = client.create_context(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Contexts_CreateContext_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_delete_all_contexts_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_delete_all_contexts_async.py new file mode 100644 index 000000000000..a861e34fb2eb --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_delete_all_contexts_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteAllContexts +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Contexts_DeleteAllContexts_async] +from google.cloud import dialogflow_v2 + + +async def sample_delete_all_contexts(): + # Create a client + client = dialogflow_v2.ContextsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteAllContextsRequest( + parent="parent_value", + ) + + # Make the request + await client.delete_all_contexts(request=request) + + +# [END dialogflow_v2_generated_Contexts_DeleteAllContexts_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_delete_all_contexts_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_delete_all_contexts_sync.py new file mode 100644 index 000000000000..ed7ddd708005 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_delete_all_contexts_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteAllContexts +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Contexts_DeleteAllContexts_sync] +from google.cloud import dialogflow_v2 + + +def sample_delete_all_contexts(): + # Create a client + client = dialogflow_v2.ContextsClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteAllContextsRequest( + parent="parent_value", + ) + + # Make the request + client.delete_all_contexts(request=request) + + +# [END dialogflow_v2_generated_Contexts_DeleteAllContexts_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_delete_context_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_delete_context_async.py new file mode 100644 index 000000000000..70206174b48f --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_delete_context_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteContext +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Contexts_DeleteContext_async] +from google.cloud import dialogflow_v2 + + +async def sample_delete_context(): + # Create a client + client = dialogflow_v2.ContextsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteContextRequest( + name="name_value", + ) + + # Make the request + await client.delete_context(request=request) + + +# [END dialogflow_v2_generated_Contexts_DeleteContext_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_delete_context_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_delete_context_sync.py new file mode 100644 index 000000000000..956a5239da9f --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_delete_context_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteContext +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Contexts_DeleteContext_sync] +from google.cloud import dialogflow_v2 + + +def sample_delete_context(): + # Create a client + client = dialogflow_v2.ContextsClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteContextRequest( + name="name_value", + ) + + # Make the request + client.delete_context(request=request) + + +# [END dialogflow_v2_generated_Contexts_DeleteContext_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_get_context_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_get_context_async.py new file mode 100644 index 000000000000..37e58679486b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_get_context_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetContext +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Contexts_GetContext_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_context(): + # Create a client + client = dialogflow_v2.ContextsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetContextRequest( + name="name_value", + ) + + # Make the request + response = await client.get_context(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Contexts_GetContext_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_get_context_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_get_context_sync.py new file mode 100644 index 000000000000..9ab42930ad97 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_get_context_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetContext +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Contexts_GetContext_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_context(): + # Create a client + client = dialogflow_v2.ContextsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetContextRequest( + name="name_value", + ) + + # Make the request + response = client.get_context(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Contexts_GetContext_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_list_contexts_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_list_contexts_async.py new file mode 100644 index 000000000000..d3de87b06ca3 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_list_contexts_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListContexts +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Contexts_ListContexts_async] +from google.cloud import dialogflow_v2 + + +async def sample_list_contexts(): + # Create a client + client = dialogflow_v2.ContextsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListContextsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_contexts(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Contexts_ListContexts_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_list_contexts_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_list_contexts_sync.py new file mode 100644 index 000000000000..24169bc03cee --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_list_contexts_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListContexts +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Contexts_ListContexts_sync] +from google.cloud import dialogflow_v2 + + +def sample_list_contexts(): + # Create a client + client = dialogflow_v2.ContextsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListContextsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_contexts(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Contexts_ListContexts_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_update_context_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_update_context_async.py new file mode 100644 index 000000000000..b714be4bb2d2 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_update_context_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateContext +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Contexts_UpdateContext_async] +from google.cloud import dialogflow_v2 + + +async def sample_update_context(): + # Create a client + client = dialogflow_v2.ContextsAsyncClient() + + # Initialize request argument(s) + context = dialogflow_v2.Context() + context.name = "name_value" + + request = dialogflow_v2.UpdateContextRequest( + context=context, + ) + + # Make the request + response = await client.update_context(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Contexts_UpdateContext_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_update_context_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_update_context_sync.py new file mode 100644 index 000000000000..19aa72165dd0 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_contexts_update_context_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateContext +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Contexts_UpdateContext_sync] +from google.cloud import dialogflow_v2 + + +def sample_update_context(): + # Create a client + client = dialogflow_v2.ContextsClient() + + # Initialize request argument(s) + context = dialogflow_v2.Context() + context.name = "name_value" + + request = dialogflow_v2.UpdateContextRequest( + context=context, + ) + + # Make the request + response = client.update_context(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Contexts_UpdateContext_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_create_conversation_dataset_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_create_conversation_dataset_async.py new file mode 100644 index 000000000000..b991819579db --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_create_conversation_dataset_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateConversationDataset +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationDatasets_CreateConversationDataset_async] +from google.cloud import dialogflow_v2 + + +async def sample_create_conversation_dataset(): + # Create a client + client = dialogflow_v2.ConversationDatasetsAsyncClient() + + # Initialize request argument(s) + conversation_dataset = dialogflow_v2.ConversationDataset() + conversation_dataset.display_name = "display_name_value" + + request = dialogflow_v2.CreateConversationDatasetRequest( + parent="parent_value", + conversation_dataset=conversation_dataset, + ) + + # Make the request + operation = client.create_conversation_dataset(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationDatasets_CreateConversationDataset_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_create_conversation_dataset_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_create_conversation_dataset_sync.py new file mode 100644 index 000000000000..42fc46046425 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_create_conversation_dataset_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateConversationDataset +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationDatasets_CreateConversationDataset_sync] +from google.cloud import dialogflow_v2 + + +def sample_create_conversation_dataset(): + # Create a client + client = dialogflow_v2.ConversationDatasetsClient() + + # Initialize request argument(s) + conversation_dataset = dialogflow_v2.ConversationDataset() + conversation_dataset.display_name = "display_name_value" + + request = dialogflow_v2.CreateConversationDatasetRequest( + parent="parent_value", + conversation_dataset=conversation_dataset, + ) + + # Make the request + operation = client.create_conversation_dataset(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationDatasets_CreateConversationDataset_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_delete_conversation_dataset_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_delete_conversation_dataset_async.py new file mode 100644 index 000000000000..db43e1fea019 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_delete_conversation_dataset_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteConversationDataset +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationDatasets_DeleteConversationDataset_async] +from google.cloud import dialogflow_v2 + + +async def sample_delete_conversation_dataset(): + # Create a client + client = dialogflow_v2.ConversationDatasetsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteConversationDatasetRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_conversation_dataset(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationDatasets_DeleteConversationDataset_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_delete_conversation_dataset_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_delete_conversation_dataset_sync.py new file mode 100644 index 000000000000..f722e7a2cae5 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_delete_conversation_dataset_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteConversationDataset +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationDatasets_DeleteConversationDataset_sync] +from google.cloud import dialogflow_v2 + + +def sample_delete_conversation_dataset(): + # Create a client + client = dialogflow_v2.ConversationDatasetsClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteConversationDatasetRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_conversation_dataset(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationDatasets_DeleteConversationDataset_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_get_conversation_dataset_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_get_conversation_dataset_async.py new file mode 100644 index 000000000000..ecb2eef27703 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_get_conversation_dataset_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetConversationDataset +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationDatasets_GetConversationDataset_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_conversation_dataset(): + # Create a client + client = dialogflow_v2.ConversationDatasetsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetConversationDatasetRequest( + name="name_value", + ) + + # Make the request + response = await client.get_conversation_dataset(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationDatasets_GetConversationDataset_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_get_conversation_dataset_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_get_conversation_dataset_sync.py new file mode 100644 index 000000000000..24aff91e8f2e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_get_conversation_dataset_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetConversationDataset +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationDatasets_GetConversationDataset_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_conversation_dataset(): + # Create a client + client = dialogflow_v2.ConversationDatasetsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetConversationDatasetRequest( + name="name_value", + ) + + # Make the request + response = client.get_conversation_dataset(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationDatasets_GetConversationDataset_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_import_conversation_data_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_import_conversation_data_async.py new file mode 100644 index 000000000000..499aebd71a93 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_import_conversation_data_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ImportConversationData +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationDatasets_ImportConversationData_async] +from google.cloud import dialogflow_v2 + + +async def sample_import_conversation_data(): + # Create a client + client = dialogflow_v2.ConversationDatasetsAsyncClient() + + # Initialize request argument(s) + input_config = dialogflow_v2.InputConfig() + input_config.gcs_source.uris = ['uris_value_1', 'uris_value_2'] + + request = dialogflow_v2.ImportConversationDataRequest( + name="name_value", + input_config=input_config, + ) + + # Make the request + operation = client.import_conversation_data(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationDatasets_ImportConversationData_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_import_conversation_data_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_import_conversation_data_sync.py new file mode 100644 index 000000000000..2cd9964d384f --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_import_conversation_data_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ImportConversationData +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationDatasets_ImportConversationData_sync] +from google.cloud import dialogflow_v2 + + +def sample_import_conversation_data(): + # Create a client + client = dialogflow_v2.ConversationDatasetsClient() + + # Initialize request argument(s) + input_config = dialogflow_v2.InputConfig() + input_config.gcs_source.uris = ['uris_value_1', 'uris_value_2'] + + request = dialogflow_v2.ImportConversationDataRequest( + name="name_value", + input_config=input_config, + ) + + # Make the request + operation = client.import_conversation_data(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationDatasets_ImportConversationData_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_list_conversation_datasets_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_list_conversation_datasets_async.py new file mode 100644 index 000000000000..79d12766b242 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_list_conversation_datasets_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListConversationDatasets +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationDatasets_ListConversationDatasets_async] +from google.cloud import dialogflow_v2 + + +async def sample_list_conversation_datasets(): + # Create a client + client = dialogflow_v2.ConversationDatasetsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListConversationDatasetsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversation_datasets(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_ConversationDatasets_ListConversationDatasets_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_list_conversation_datasets_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_list_conversation_datasets_sync.py new file mode 100644 index 000000000000..cb2bb3fe42c9 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_datasets_list_conversation_datasets_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListConversationDatasets +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationDatasets_ListConversationDatasets_sync] +from google.cloud import dialogflow_v2 + + +def sample_list_conversation_datasets(): + # Create a client + client = dialogflow_v2.ConversationDatasetsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListConversationDatasetsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversation_datasets(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_ConversationDatasets_ListConversationDatasets_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_create_conversation_model_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_create_conversation_model_async.py new file mode 100644 index 000000000000..589747cd5b33 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_create_conversation_model_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateConversationModel +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_CreateConversationModel_async] +from google.cloud import dialogflow_v2 + + +async def sample_create_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsAsyncClient() + + # Initialize request argument(s) + conversation_model = dialogflow_v2.ConversationModel() + conversation_model.display_name = "display_name_value" + conversation_model.datasets.dataset = "dataset_value" + + request = dialogflow_v2.CreateConversationModelRequest( + conversation_model=conversation_model, + ) + + # Make the request + operation = client.create_conversation_model(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationModels_CreateConversationModel_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_create_conversation_model_evaluation_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_create_conversation_model_evaluation_async.py new file mode 100644 index 000000000000..a7edcc6e31a2 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_create_conversation_model_evaluation_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateConversationModelEvaluation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_CreateConversationModelEvaluation_async] +from google.cloud import dialogflow_v2 + + +async def sample_create_conversation_model_evaluation(): + # Create a client + client = dialogflow_v2.ConversationModelsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.CreateConversationModelEvaluationRequest( + parent="parent_value", + ) + + # Make the request + operation = client.create_conversation_model_evaluation(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationModels_CreateConversationModelEvaluation_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_create_conversation_model_evaluation_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_create_conversation_model_evaluation_sync.py new file mode 100644 index 000000000000..34f6e8006947 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_create_conversation_model_evaluation_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateConversationModelEvaluation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_CreateConversationModelEvaluation_sync] +from google.cloud import dialogflow_v2 + + +def sample_create_conversation_model_evaluation(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.CreateConversationModelEvaluationRequest( + parent="parent_value", + ) + + # Make the request + operation = client.create_conversation_model_evaluation(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationModels_CreateConversationModelEvaluation_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_create_conversation_model_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_create_conversation_model_sync.py new file mode 100644 index 000000000000..4a31ff9f04ea --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_create_conversation_model_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateConversationModel +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_CreateConversationModel_sync] +from google.cloud import dialogflow_v2 + + +def sample_create_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + conversation_model = dialogflow_v2.ConversationModel() + conversation_model.display_name = "display_name_value" + conversation_model.datasets.dataset = "dataset_value" + + request = dialogflow_v2.CreateConversationModelRequest( + conversation_model=conversation_model, + ) + + # Make the request + operation = client.create_conversation_model(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationModels_CreateConversationModel_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_delete_conversation_model_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_delete_conversation_model_async.py new file mode 100644 index 000000000000..df9ff6867792 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_delete_conversation_model_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteConversationModel +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_DeleteConversationModel_async] +from google.cloud import dialogflow_v2 + + +async def sample_delete_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteConversationModelRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_conversation_model(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationModels_DeleteConversationModel_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_delete_conversation_model_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_delete_conversation_model_sync.py new file mode 100644 index 000000000000..f827007f0959 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_delete_conversation_model_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteConversationModel +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_DeleteConversationModel_sync] +from google.cloud import dialogflow_v2 + + +def sample_delete_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteConversationModelRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_conversation_model(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationModels_DeleteConversationModel_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_deploy_conversation_model_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_deploy_conversation_model_async.py new file mode 100644 index 000000000000..650d1b186ca2 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_deploy_conversation_model_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeployConversationModel +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_DeployConversationModel_async] +from google.cloud import dialogflow_v2 + + +async def sample_deploy_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeployConversationModelRequest( + name="name_value", + ) + + # Make the request + operation = client.deploy_conversation_model(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationModels_DeployConversationModel_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_deploy_conversation_model_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_deploy_conversation_model_sync.py new file mode 100644 index 000000000000..0c407c885e03 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_deploy_conversation_model_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeployConversationModel +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_DeployConversationModel_sync] +from google.cloud import dialogflow_v2 + + +def sample_deploy_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeployConversationModelRequest( + name="name_value", + ) + + # Make the request + operation = client.deploy_conversation_model(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationModels_DeployConversationModel_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_get_conversation_model_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_get_conversation_model_async.py new file mode 100644 index 000000000000..ba6b5a3f2116 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_get_conversation_model_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetConversationModel +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_GetConversationModel_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetConversationModelRequest( + name="name_value", + ) + + # Make the request + response = await client.get_conversation_model(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationModels_GetConversationModel_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_get_conversation_model_evaluation_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_get_conversation_model_evaluation_async.py new file mode 100644 index 000000000000..214f72cc76da --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_get_conversation_model_evaluation_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetConversationModelEvaluation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_GetConversationModelEvaluation_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_conversation_model_evaluation(): + # Create a client + client = dialogflow_v2.ConversationModelsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetConversationModelEvaluationRequest( + name="name_value", + ) + + # Make the request + response = await client.get_conversation_model_evaluation(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationModels_GetConversationModelEvaluation_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_get_conversation_model_evaluation_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_get_conversation_model_evaluation_sync.py new file mode 100644 index 000000000000..7831df8cc8f2 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_get_conversation_model_evaluation_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetConversationModelEvaluation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_GetConversationModelEvaluation_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_conversation_model_evaluation(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetConversationModelEvaluationRequest( + name="name_value", + ) + + # Make the request + response = client.get_conversation_model_evaluation(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationModels_GetConversationModelEvaluation_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_get_conversation_model_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_get_conversation_model_sync.py new file mode 100644 index 000000000000..bfba2c3cc845 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_get_conversation_model_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetConversationModel +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_GetConversationModel_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetConversationModelRequest( + name="name_value", + ) + + # Make the request + response = client.get_conversation_model(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationModels_GetConversationModel_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_list_conversation_model_evaluations_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_list_conversation_model_evaluations_async.py new file mode 100644 index 000000000000..6149290a979b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_list_conversation_model_evaluations_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListConversationModelEvaluations +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_ListConversationModelEvaluations_async] +from google.cloud import dialogflow_v2 + + +async def sample_list_conversation_model_evaluations(): + # Create a client + client = dialogflow_v2.ConversationModelsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListConversationModelEvaluationsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversation_model_evaluations(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_ConversationModels_ListConversationModelEvaluations_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_list_conversation_model_evaluations_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_list_conversation_model_evaluations_sync.py new file mode 100644 index 000000000000..e35d31e9b186 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_list_conversation_model_evaluations_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListConversationModelEvaluations +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_ListConversationModelEvaluations_sync] +from google.cloud import dialogflow_v2 + + +def sample_list_conversation_model_evaluations(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListConversationModelEvaluationsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversation_model_evaluations(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_ConversationModels_ListConversationModelEvaluations_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_list_conversation_models_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_list_conversation_models_async.py new file mode 100644 index 000000000000..d8ae53847b50 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_list_conversation_models_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListConversationModels +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_ListConversationModels_async] +from google.cloud import dialogflow_v2 + + +async def sample_list_conversation_models(): + # Create a client + client = dialogflow_v2.ConversationModelsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListConversationModelsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversation_models(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_ConversationModels_ListConversationModels_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_list_conversation_models_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_list_conversation_models_sync.py new file mode 100644 index 000000000000..17535ea39083 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_list_conversation_models_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListConversationModels +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_ListConversationModels_sync] +from google.cloud import dialogflow_v2 + + +def sample_list_conversation_models(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListConversationModelsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversation_models(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_ConversationModels_ListConversationModels_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_undeploy_conversation_model_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_undeploy_conversation_model_async.py new file mode 100644 index 000000000000..95481d2980e2 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_undeploy_conversation_model_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UndeployConversationModel +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_UndeployConversationModel_async] +from google.cloud import dialogflow_v2 + + +async def sample_undeploy_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.UndeployConversationModelRequest( + name="name_value", + ) + + # Make the request + operation = client.undeploy_conversation_model(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationModels_UndeployConversationModel_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_undeploy_conversation_model_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_undeploy_conversation_model_sync.py new file mode 100644 index 000000000000..1e5df5d2341d --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_models_undeploy_conversation_model_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UndeployConversationModel +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationModels_UndeployConversationModel_sync] +from google.cloud import dialogflow_v2 + + +def sample_undeploy_conversation_model(): + # Create a client + client = dialogflow_v2.ConversationModelsClient() + + # Initialize request argument(s) + request = dialogflow_v2.UndeployConversationModelRequest( + name="name_value", + ) + + # Make the request + operation = client.undeploy_conversation_model(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationModels_UndeployConversationModel_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_clear_suggestion_feature_config_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_clear_suggestion_feature_config_async.py new file mode 100644 index 000000000000..bfd3322e97b9 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_clear_suggestion_feature_config_async.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ClearSuggestionFeatureConfig +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationProfiles_ClearSuggestionFeatureConfig_async] +from google.cloud import dialogflow_v2 + + +async def sample_clear_suggestion_feature_config(): + # Create a client + client = dialogflow_v2.ConversationProfilesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ClearSuggestionFeatureConfigRequest( + conversation_profile="conversation_profile_value", + participant_role="END_USER", + suggestion_feature_type="SMART_REPLY", + ) + + # Make the request + operation = client.clear_suggestion_feature_config(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationProfiles_ClearSuggestionFeatureConfig_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_clear_suggestion_feature_config_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_clear_suggestion_feature_config_sync.py new file mode 100644 index 000000000000..41f5cc1931dd --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_clear_suggestion_feature_config_sync.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ClearSuggestionFeatureConfig +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationProfiles_ClearSuggestionFeatureConfig_sync] +from google.cloud import dialogflow_v2 + + +def sample_clear_suggestion_feature_config(): + # Create a client + client = dialogflow_v2.ConversationProfilesClient() + + # Initialize request argument(s) + request = dialogflow_v2.ClearSuggestionFeatureConfigRequest( + conversation_profile="conversation_profile_value", + participant_role="END_USER", + suggestion_feature_type="SMART_REPLY", + ) + + # Make the request + operation = client.clear_suggestion_feature_config(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationProfiles_ClearSuggestionFeatureConfig_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_create_conversation_profile_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_create_conversation_profile_async.py new file mode 100644 index 000000000000..ec34829ffaab --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_create_conversation_profile_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateConversationProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_async] +from google.cloud import dialogflow_v2 + + +async def sample_create_conversation_profile(): + # Create a client + client = dialogflow_v2.ConversationProfilesAsyncClient() + + # Initialize request argument(s) + conversation_profile = dialogflow_v2.ConversationProfile() + conversation_profile.display_name = "display_name_value" + + request = dialogflow_v2.CreateConversationProfileRequest( + parent="parent_value", + conversation_profile=conversation_profile, + ) + + # Make the request + response = await client.create_conversation_profile(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_create_conversation_profile_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_create_conversation_profile_sync.py new file mode 100644 index 000000000000..d99283176cde --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_create_conversation_profile_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateConversationProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_sync] +from google.cloud import dialogflow_v2 + + +def sample_create_conversation_profile(): + # Create a client + client = dialogflow_v2.ConversationProfilesClient() + + # Initialize request argument(s) + conversation_profile = dialogflow_v2.ConversationProfile() + conversation_profile.display_name = "display_name_value" + + request = dialogflow_v2.CreateConversationProfileRequest( + parent="parent_value", + conversation_profile=conversation_profile, + ) + + # Make the request + response = client.create_conversation_profile(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_delete_conversation_profile_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_delete_conversation_profile_async.py new file mode 100644 index 000000000000..fab8234f2b5a --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_delete_conversation_profile_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteConversationProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_async] +from google.cloud import dialogflow_v2 + + +async def sample_delete_conversation_profile(): + # Create a client + client = dialogflow_v2.ConversationProfilesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteConversationProfileRequest( + name="name_value", + ) + + # Make the request + await client.delete_conversation_profile(request=request) + + +# [END dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_delete_conversation_profile_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_delete_conversation_profile_sync.py new file mode 100644 index 000000000000..956cd6bce466 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_delete_conversation_profile_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteConversationProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_sync] +from google.cloud import dialogflow_v2 + + +def sample_delete_conversation_profile(): + # Create a client + client = dialogflow_v2.ConversationProfilesClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteConversationProfileRequest( + name="name_value", + ) + + # Make the request + client.delete_conversation_profile(request=request) + + +# [END dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_get_conversation_profile_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_get_conversation_profile_async.py new file mode 100644 index 000000000000..32da4d9c6c7b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_get_conversation_profile_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetConversationProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_conversation_profile(): + # Create a client + client = dialogflow_v2.ConversationProfilesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetConversationProfileRequest( + name="name_value", + ) + + # Make the request + response = await client.get_conversation_profile(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_get_conversation_profile_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_get_conversation_profile_sync.py new file mode 100644 index 000000000000..faed7e112b9b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_get_conversation_profile_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetConversationProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_conversation_profile(): + # Create a client + client = dialogflow_v2.ConversationProfilesClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetConversationProfileRequest( + name="name_value", + ) + + # Make the request + response = client.get_conversation_profile(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_list_conversation_profiles_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_list_conversation_profiles_async.py new file mode 100644 index 000000000000..d2c13300ca91 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_list_conversation_profiles_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListConversationProfiles +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_async] +from google.cloud import dialogflow_v2 + + +async def sample_list_conversation_profiles(): + # Create a client + client = dialogflow_v2.ConversationProfilesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListConversationProfilesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversation_profiles(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_list_conversation_profiles_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_list_conversation_profiles_sync.py new file mode 100644 index 000000000000..c26b4901cf20 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_list_conversation_profiles_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListConversationProfiles +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_sync] +from google.cloud import dialogflow_v2 + + +def sample_list_conversation_profiles(): + # Create a client + client = dialogflow_v2.ConversationProfilesClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListConversationProfilesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversation_profiles(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_set_suggestion_feature_config_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_set_suggestion_feature_config_async.py new file mode 100644 index 000000000000..7fba8661c1ca --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_set_suggestion_feature_config_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetSuggestionFeatureConfig +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationProfiles_SetSuggestionFeatureConfig_async] +from google.cloud import dialogflow_v2 + + +async def sample_set_suggestion_feature_config(): + # Create a client + client = dialogflow_v2.ConversationProfilesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.SetSuggestionFeatureConfigRequest( + conversation_profile="conversation_profile_value", + participant_role="END_USER", + ) + + # Make the request + operation = client.set_suggestion_feature_config(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationProfiles_SetSuggestionFeatureConfig_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_set_suggestion_feature_config_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_set_suggestion_feature_config_sync.py new file mode 100644 index 000000000000..4b0bb7701819 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_set_suggestion_feature_config_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetSuggestionFeatureConfig +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationProfiles_SetSuggestionFeatureConfig_sync] +from google.cloud import dialogflow_v2 + + +def sample_set_suggestion_feature_config(): + # Create a client + client = dialogflow_v2.ConversationProfilesClient() + + # Initialize request argument(s) + request = dialogflow_v2.SetSuggestionFeatureConfigRequest( + conversation_profile="conversation_profile_value", + participant_role="END_USER", + ) + + # Make the request + operation = client.set_suggestion_feature_config(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationProfiles_SetSuggestionFeatureConfig_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_update_conversation_profile_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_update_conversation_profile_async.py new file mode 100644 index 000000000000..0666c79d9f3b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_update_conversation_profile_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateConversationProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_async] +from google.cloud import dialogflow_v2 + + +async def sample_update_conversation_profile(): + # Create a client + client = dialogflow_v2.ConversationProfilesAsyncClient() + + # Initialize request argument(s) + conversation_profile = dialogflow_v2.ConversationProfile() + conversation_profile.display_name = "display_name_value" + + request = dialogflow_v2.UpdateConversationProfileRequest( + conversation_profile=conversation_profile, + ) + + # Make the request + response = await client.update_conversation_profile(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_update_conversation_profile_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_update_conversation_profile_sync.py new file mode 100644 index 000000000000..1c160cc7a87b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversation_profiles_update_conversation_profile_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateConversationProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_sync] +from google.cloud import dialogflow_v2 + + +def sample_update_conversation_profile(): + # Create a client + client = dialogflow_v2.ConversationProfilesClient() + + # Initialize request argument(s) + conversation_profile = dialogflow_v2.ConversationProfile() + conversation_profile.display_name = "display_name_value" + + request = dialogflow_v2.UpdateConversationProfileRequest( + conversation_profile=conversation_profile, + ) + + # Make the request + response = client.update_conversation_profile(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_complete_conversation_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_complete_conversation_async.py new file mode 100644 index 000000000000..47d162a96f26 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_complete_conversation_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CompleteConversation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Conversations_CompleteConversation_async] +from google.cloud import dialogflow_v2 + + +async def sample_complete_conversation(): + # Create a client + client = dialogflow_v2.ConversationsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.CompleteConversationRequest( + name="name_value", + ) + + # Make the request + response = await client.complete_conversation(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Conversations_CompleteConversation_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_complete_conversation_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_complete_conversation_sync.py new file mode 100644 index 000000000000..ea409a8a4023 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_complete_conversation_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CompleteConversation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Conversations_CompleteConversation_sync] +from google.cloud import dialogflow_v2 + + +def sample_complete_conversation(): + # Create a client + client = dialogflow_v2.ConversationsClient() + + # Initialize request argument(s) + request = dialogflow_v2.CompleteConversationRequest( + name="name_value", + ) + + # Make the request + response = client.complete_conversation(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Conversations_CompleteConversation_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_create_conversation_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_create_conversation_async.py new file mode 100644 index 000000000000..f0d084d70fcd --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_create_conversation_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateConversation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Conversations_CreateConversation_async] +from google.cloud import dialogflow_v2 + + +async def sample_create_conversation(): + # Create a client + client = dialogflow_v2.ConversationsAsyncClient() + + # Initialize request argument(s) + conversation = dialogflow_v2.Conversation() + conversation.conversation_profile = "conversation_profile_value" + + request = dialogflow_v2.CreateConversationRequest( + parent="parent_value", + conversation=conversation, + ) + + # Make the request + response = await client.create_conversation(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Conversations_CreateConversation_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_create_conversation_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_create_conversation_sync.py new file mode 100644 index 000000000000..ad76939929ee --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_create_conversation_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateConversation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Conversations_CreateConversation_sync] +from google.cloud import dialogflow_v2 + + +def sample_create_conversation(): + # Create a client + client = dialogflow_v2.ConversationsClient() + + # Initialize request argument(s) + conversation = dialogflow_v2.Conversation() + conversation.conversation_profile = "conversation_profile_value" + + request = dialogflow_v2.CreateConversationRequest( + parent="parent_value", + conversation=conversation, + ) + + # Make the request + response = client.create_conversation(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Conversations_CreateConversation_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_get_conversation_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_get_conversation_async.py new file mode 100644 index 000000000000..9719e62711d8 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_get_conversation_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetConversation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Conversations_GetConversation_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_conversation(): + # Create a client + client = dialogflow_v2.ConversationsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetConversationRequest( + name="name_value", + ) + + # Make the request + response = await client.get_conversation(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Conversations_GetConversation_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_get_conversation_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_get_conversation_sync.py new file mode 100644 index 000000000000..f4d68bcfbb92 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_get_conversation_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetConversation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Conversations_GetConversation_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_conversation(): + # Create a client + client = dialogflow_v2.ConversationsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetConversationRequest( + name="name_value", + ) + + # Make the request + response = client.get_conversation(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Conversations_GetConversation_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_list_conversations_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_list_conversations_async.py new file mode 100644 index 000000000000..85895f630025 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_list_conversations_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListConversations +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Conversations_ListConversations_async] +from google.cloud import dialogflow_v2 + + +async def sample_list_conversations(): + # Create a client + client = dialogflow_v2.ConversationsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListConversationsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversations(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Conversations_ListConversations_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_list_conversations_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_list_conversations_sync.py new file mode 100644 index 000000000000..fabb8a56562a --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_list_conversations_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListConversations +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Conversations_ListConversations_sync] +from google.cloud import dialogflow_v2 + + +def sample_list_conversations(): + # Create a client + client = dialogflow_v2.ConversationsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListConversationsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversations(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Conversations_ListConversations_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_list_messages_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_list_messages_async.py new file mode 100644 index 000000000000..fe2af0a86721 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_list_messages_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListMessages +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Conversations_ListMessages_async] +from google.cloud import dialogflow_v2 + + +async def sample_list_messages(): + # Create a client + client = dialogflow_v2.ConversationsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListMessagesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_messages(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Conversations_ListMessages_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_list_messages_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_list_messages_sync.py new file mode 100644 index 000000000000..737ecbd9d5c4 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_conversations_list_messages_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListMessages +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Conversations_ListMessages_sync] +from google.cloud import dialogflow_v2 + + +def sample_list_messages(): + # Create a client + client = dialogflow_v2.ConversationsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListMessagesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_messages(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Conversations_ListMessages_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_create_document_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_create_document_async.py new file mode 100644 index 000000000000..68eb9d01ca14 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_create_document_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Documents_CreateDocument_async] +from google.cloud import dialogflow_v2 + + +async def sample_create_document(): + # Create a client + client = dialogflow_v2.DocumentsAsyncClient() + + # Initialize request argument(s) + document = dialogflow_v2.Document() + document.content_uri = "content_uri_value" + document.display_name = "display_name_value" + document.mime_type = "mime_type_value" + document.knowledge_types = "AGENT_FACING_SMART_REPLY" + + request = dialogflow_v2.CreateDocumentRequest( + parent="parent_value", + document=document, + ) + + # Make the request + operation = client.create_document(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Documents_CreateDocument_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_create_document_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_create_document_sync.py new file mode 100644 index 000000000000..1a2ea31bf032 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_create_document_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Documents_CreateDocument_sync] +from google.cloud import dialogflow_v2 + + +def sample_create_document(): + # Create a client + client = dialogflow_v2.DocumentsClient() + + # Initialize request argument(s) + document = dialogflow_v2.Document() + document.content_uri = "content_uri_value" + document.display_name = "display_name_value" + document.mime_type = "mime_type_value" + document.knowledge_types = "AGENT_FACING_SMART_REPLY" + + request = dialogflow_v2.CreateDocumentRequest( + parent="parent_value", + document=document, + ) + + # Make the request + operation = client.create_document(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Documents_CreateDocument_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_delete_document_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_delete_document_async.py new file mode 100644 index 000000000000..aaf55b1ea9f1 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_delete_document_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Documents_DeleteDocument_async] +from google.cloud import dialogflow_v2 + + +async def sample_delete_document(): + # Create a client + client = dialogflow_v2.DocumentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteDocumentRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_document(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Documents_DeleteDocument_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_delete_document_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_delete_document_sync.py new file mode 100644 index 000000000000..a76d30a6cab0 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_delete_document_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Documents_DeleteDocument_sync] +from google.cloud import dialogflow_v2 + + +def sample_delete_document(): + # Create a client + client = dialogflow_v2.DocumentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteDocumentRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_document(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Documents_DeleteDocument_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_export_document_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_export_document_async.py new file mode 100644 index 000000000000..0965dd874484 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_export_document_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ExportDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Documents_ExportDocument_async] +from google.cloud import dialogflow_v2 + + +async def sample_export_document(): + # Create a client + client = dialogflow_v2.DocumentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ExportDocumentRequest( + name="name_value", + ) + + # Make the request + operation = client.export_document(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Documents_ExportDocument_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_export_document_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_export_document_sync.py new file mode 100644 index 000000000000..ba9ea636958d --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_export_document_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ExportDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Documents_ExportDocument_sync] +from google.cloud import dialogflow_v2 + + +def sample_export_document(): + # Create a client + client = dialogflow_v2.DocumentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ExportDocumentRequest( + name="name_value", + ) + + # Make the request + operation = client.export_document(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Documents_ExportDocument_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_get_document_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_get_document_async.py new file mode 100644 index 000000000000..b0891d275e0e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_get_document_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Documents_GetDocument_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_document(): + # Create a client + client = dialogflow_v2.DocumentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetDocumentRequest( + name="name_value", + ) + + # Make the request + response = await client.get_document(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Documents_GetDocument_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_get_document_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_get_document_sync.py new file mode 100644 index 000000000000..dbebfe467ded --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_get_document_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Documents_GetDocument_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_document(): + # Create a client + client = dialogflow_v2.DocumentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetDocumentRequest( + name="name_value", + ) + + # Make the request + response = client.get_document(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Documents_GetDocument_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_import_documents_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_import_documents_async.py new file mode 100644 index 000000000000..34fa8a7a033c --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_import_documents_async.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ImportDocuments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Documents_ImportDocuments_async] +from google.cloud import dialogflow_v2 + + +async def sample_import_documents(): + # Create a client + client = dialogflow_v2.DocumentsAsyncClient() + + # Initialize request argument(s) + gcs_source = dialogflow_v2.GcsSources() + gcs_source.uris = ['uris_value_1', 'uris_value_2'] + + document_template = dialogflow_v2.ImportDocumentTemplate() + document_template.mime_type = "mime_type_value" + document_template.knowledge_types = "AGENT_FACING_SMART_REPLY" + + request = dialogflow_v2.ImportDocumentsRequest( + gcs_source=gcs_source, + parent="parent_value", + document_template=document_template, + ) + + # Make the request + operation = client.import_documents(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Documents_ImportDocuments_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_import_documents_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_import_documents_sync.py new file mode 100644 index 000000000000..e587532ae7de --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_import_documents_sync.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ImportDocuments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Documents_ImportDocuments_sync] +from google.cloud import dialogflow_v2 + + +def sample_import_documents(): + # Create a client + client = dialogflow_v2.DocumentsClient() + + # Initialize request argument(s) + gcs_source = dialogflow_v2.GcsSources() + gcs_source.uris = ['uris_value_1', 'uris_value_2'] + + document_template = dialogflow_v2.ImportDocumentTemplate() + document_template.mime_type = "mime_type_value" + document_template.knowledge_types = "AGENT_FACING_SMART_REPLY" + + request = dialogflow_v2.ImportDocumentsRequest( + gcs_source=gcs_source, + parent="parent_value", + document_template=document_template, + ) + + # Make the request + operation = client.import_documents(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Documents_ImportDocuments_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_list_documents_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_list_documents_async.py new file mode 100644 index 000000000000..81050af66759 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_list_documents_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListDocuments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Documents_ListDocuments_async] +from google.cloud import dialogflow_v2 + + +async def sample_list_documents(): + # Create a client + client = dialogflow_v2.DocumentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListDocumentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_documents(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Documents_ListDocuments_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_list_documents_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_list_documents_sync.py new file mode 100644 index 000000000000..44b69be332fc --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_list_documents_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListDocuments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Documents_ListDocuments_sync] +from google.cloud import dialogflow_v2 + + +def sample_list_documents(): + # Create a client + client = dialogflow_v2.DocumentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListDocumentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_documents(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Documents_ListDocuments_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_reload_document_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_reload_document_async.py new file mode 100644 index 000000000000..0bea1f135514 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_reload_document_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ReloadDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Documents_ReloadDocument_async] +from google.cloud import dialogflow_v2 + + +async def sample_reload_document(): + # Create a client + client = dialogflow_v2.DocumentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ReloadDocumentRequest( + content_uri="content_uri_value", + name="name_value", + ) + + # Make the request + operation = client.reload_document(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Documents_ReloadDocument_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_reload_document_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_reload_document_sync.py new file mode 100644 index 000000000000..d6576b385cba --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_reload_document_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ReloadDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Documents_ReloadDocument_sync] +from google.cloud import dialogflow_v2 + + +def sample_reload_document(): + # Create a client + client = dialogflow_v2.DocumentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ReloadDocumentRequest( + content_uri="content_uri_value", + name="name_value", + ) + + # Make the request + operation = client.reload_document(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Documents_ReloadDocument_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_update_document_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_update_document_async.py new file mode 100644 index 000000000000..3a77af16365a --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_update_document_async.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Documents_UpdateDocument_async] +from google.cloud import dialogflow_v2 + + +async def sample_update_document(): + # Create a client + client = dialogflow_v2.DocumentsAsyncClient() + + # Initialize request argument(s) + document = dialogflow_v2.Document() + document.content_uri = "content_uri_value" + document.display_name = "display_name_value" + document.mime_type = "mime_type_value" + document.knowledge_types = "AGENT_FACING_SMART_REPLY" + + request = dialogflow_v2.UpdateDocumentRequest( + document=document, + ) + + # Make the request + operation = client.update_document(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Documents_UpdateDocument_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_update_document_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_update_document_sync.py new file mode 100644 index 000000000000..4202b8881ae8 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_documents_update_document_sync.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Documents_UpdateDocument_sync] +from google.cloud import dialogflow_v2 + + +def sample_update_document(): + # Create a client + client = dialogflow_v2.DocumentsClient() + + # Initialize request argument(s) + document = dialogflow_v2.Document() + document.content_uri = "content_uri_value" + document.display_name = "display_name_value" + document.mime_type = "mime_type_value" + document.knowledge_types = "AGENT_FACING_SMART_REPLY" + + request = dialogflow_v2.UpdateDocumentRequest( + document=document, + ) + + # Make the request + operation = client.update_document(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Documents_UpdateDocument_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_create_entities_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_create_entities_async.py new file mode 100644 index 000000000000..d1a55b948592 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_create_entities_async.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchCreateEntities +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_BatchCreateEntities_async] +from google.cloud import dialogflow_v2 + + +async def sample_batch_create_entities(): + # Create a client + client = dialogflow_v2.EntityTypesAsyncClient() + + # Initialize request argument(s) + entities = dialogflow_v2.Entity() + entities.value = "value_value" + entities.synonyms = ['synonyms_value_1', 'synonyms_value_2'] + + request = dialogflow_v2.BatchCreateEntitiesRequest( + parent="parent_value", + entities=entities, + ) + + # Make the request + operation = client.batch_create_entities(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_EntityTypes_BatchCreateEntities_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_create_entities_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_create_entities_sync.py new file mode 100644 index 000000000000..7df001468a3a --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_create_entities_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchCreateEntities +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_BatchCreateEntities_sync] +from google.cloud import dialogflow_v2 + + +def sample_batch_create_entities(): + # Create a client + client = dialogflow_v2.EntityTypesClient() + + # Initialize request argument(s) + entities = dialogflow_v2.Entity() + entities.value = "value_value" + entities.synonyms = ['synonyms_value_1', 'synonyms_value_2'] + + request = dialogflow_v2.BatchCreateEntitiesRequest( + parent="parent_value", + entities=entities, + ) + + # Make the request + operation = client.batch_create_entities(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_EntityTypes_BatchCreateEntities_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_delete_entities_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_delete_entities_async.py new file mode 100644 index 000000000000..a15aa7c5cd45 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_delete_entities_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchDeleteEntities +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_async] +from google.cloud import dialogflow_v2 + + +async def sample_batch_delete_entities(): + # Create a client + client = dialogflow_v2.EntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.BatchDeleteEntitiesRequest( + parent="parent_value", + entity_values=['entity_values_value_1', 'entity_values_value_2'], + ) + + # Make the request + operation = client.batch_delete_entities(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_delete_entities_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_delete_entities_sync.py new file mode 100644 index 000000000000..44cb0a2ec0ca --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_delete_entities_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchDeleteEntities +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_sync] +from google.cloud import dialogflow_v2 + + +def sample_batch_delete_entities(): + # Create a client + client = dialogflow_v2.EntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2.BatchDeleteEntitiesRequest( + parent="parent_value", + entity_values=['entity_values_value_1', 'entity_values_value_2'], + ) + + # Make the request + operation = client.batch_delete_entities(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_delete_entity_types_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_delete_entity_types_async.py new file mode 100644 index 000000000000..d211d3a7ee28 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_delete_entity_types_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchDeleteEntityTypes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_async] +from google.cloud import dialogflow_v2 + + +async def sample_batch_delete_entity_types(): + # Create a client + client = dialogflow_v2.EntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.BatchDeleteEntityTypesRequest( + parent="parent_value", + entity_type_names=['entity_type_names_value_1', 'entity_type_names_value_2'], + ) + + # Make the request + operation = client.batch_delete_entity_types(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_delete_entity_types_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_delete_entity_types_sync.py new file mode 100644 index 000000000000..e3736de19086 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_delete_entity_types_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchDeleteEntityTypes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_sync] +from google.cloud import dialogflow_v2 + + +def sample_batch_delete_entity_types(): + # Create a client + client = dialogflow_v2.EntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2.BatchDeleteEntityTypesRequest( + parent="parent_value", + entity_type_names=['entity_type_names_value_1', 'entity_type_names_value_2'], + ) + + # Make the request + operation = client.batch_delete_entity_types(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_update_entities_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_update_entities_async.py new file mode 100644 index 000000000000..f7d21592623f --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_update_entities_async.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchUpdateEntities +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_async] +from google.cloud import dialogflow_v2 + + +async def sample_batch_update_entities(): + # Create a client + client = dialogflow_v2.EntityTypesAsyncClient() + + # Initialize request argument(s) + entities = dialogflow_v2.Entity() + entities.value = "value_value" + entities.synonyms = ['synonyms_value_1', 'synonyms_value_2'] + + request = dialogflow_v2.BatchUpdateEntitiesRequest( + parent="parent_value", + entities=entities, + ) + + # Make the request + operation = client.batch_update_entities(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_update_entities_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_update_entities_sync.py new file mode 100644 index 000000000000..d56ed3193060 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_update_entities_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchUpdateEntities +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_sync] +from google.cloud import dialogflow_v2 + + +def sample_batch_update_entities(): + # Create a client + client = dialogflow_v2.EntityTypesClient() + + # Initialize request argument(s) + entities = dialogflow_v2.Entity() + entities.value = "value_value" + entities.synonyms = ['synonyms_value_1', 'synonyms_value_2'] + + request = dialogflow_v2.BatchUpdateEntitiesRequest( + parent="parent_value", + entities=entities, + ) + + # Make the request + operation = client.batch_update_entities(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_update_entity_types_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_update_entity_types_async.py new file mode 100644 index 000000000000..2439af49617f --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_update_entity_types_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchUpdateEntityTypes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_async] +from google.cloud import dialogflow_v2 + + +async def sample_batch_update_entity_types(): + # Create a client + client = dialogflow_v2.EntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.BatchUpdateEntityTypesRequest( + entity_type_batch_uri="entity_type_batch_uri_value", + parent="parent_value", + ) + + # Make the request + operation = client.batch_update_entity_types(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_update_entity_types_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_update_entity_types_sync.py new file mode 100644 index 000000000000..0e45cdab9648 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_batch_update_entity_types_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchUpdateEntityTypes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_sync] +from google.cloud import dialogflow_v2 + + +def sample_batch_update_entity_types(): + # Create a client + client = dialogflow_v2.EntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2.BatchUpdateEntityTypesRequest( + entity_type_batch_uri="entity_type_batch_uri_value", + parent="parent_value", + ) + + # Make the request + operation = client.batch_update_entity_types(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_create_entity_type_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_create_entity_type_async.py new file mode 100644 index 000000000000..e42e7bd2a346 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_create_entity_type_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_CreateEntityType_async] +from google.cloud import dialogflow_v2 + + +async def sample_create_entity_type(): + # Create a client + client = dialogflow_v2.EntityTypesAsyncClient() + + # Initialize request argument(s) + entity_type = dialogflow_v2.EntityType() + entity_type.display_name = "display_name_value" + entity_type.kind = "KIND_REGEXP" + + request = dialogflow_v2.CreateEntityTypeRequest( + parent="parent_value", + entity_type=entity_type, + ) + + # Make the request + response = await client.create_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_EntityTypes_CreateEntityType_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_create_entity_type_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_create_entity_type_sync.py new file mode 100644 index 000000000000..e371575c3282 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_create_entity_type_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_CreateEntityType_sync] +from google.cloud import dialogflow_v2 + + +def sample_create_entity_type(): + # Create a client + client = dialogflow_v2.EntityTypesClient() + + # Initialize request argument(s) + entity_type = dialogflow_v2.EntityType() + entity_type.display_name = "display_name_value" + entity_type.kind = "KIND_REGEXP" + + request = dialogflow_v2.CreateEntityTypeRequest( + parent="parent_value", + entity_type=entity_type, + ) + + # Make the request + response = client.create_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_EntityTypes_CreateEntityType_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_delete_entity_type_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_delete_entity_type_async.py new file mode 100644 index 000000000000..19ab1d56cf32 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_delete_entity_type_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_DeleteEntityType_async] +from google.cloud import dialogflow_v2 + + +async def sample_delete_entity_type(): + # Create a client + client = dialogflow_v2.EntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteEntityTypeRequest( + name="name_value", + ) + + # Make the request + await client.delete_entity_type(request=request) + + +# [END dialogflow_v2_generated_EntityTypes_DeleteEntityType_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_delete_entity_type_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_delete_entity_type_sync.py new file mode 100644 index 000000000000..a925380059d7 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_delete_entity_type_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_DeleteEntityType_sync] +from google.cloud import dialogflow_v2 + + +def sample_delete_entity_type(): + # Create a client + client = dialogflow_v2.EntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteEntityTypeRequest( + name="name_value", + ) + + # Make the request + client.delete_entity_type(request=request) + + +# [END dialogflow_v2_generated_EntityTypes_DeleteEntityType_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_get_entity_type_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_get_entity_type_async.py new file mode 100644 index 000000000000..560aca4ae0ff --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_get_entity_type_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_GetEntityType_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_entity_type(): + # Create a client + client = dialogflow_v2.EntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetEntityTypeRequest( + name="name_value", + ) + + # Make the request + response = await client.get_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_EntityTypes_GetEntityType_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_get_entity_type_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_get_entity_type_sync.py new file mode 100644 index 000000000000..db822347de4a --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_get_entity_type_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_GetEntityType_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_entity_type(): + # Create a client + client = dialogflow_v2.EntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetEntityTypeRequest( + name="name_value", + ) + + # Make the request + response = client.get_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_EntityTypes_GetEntityType_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_list_entity_types_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_list_entity_types_async.py new file mode 100644 index 000000000000..2db72fd4e820 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_list_entity_types_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListEntityTypes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_ListEntityTypes_async] +from google.cloud import dialogflow_v2 + + +async def sample_list_entity_types(): + # Create a client + client = dialogflow_v2.EntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListEntityTypesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_entity_types(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_EntityTypes_ListEntityTypes_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_list_entity_types_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_list_entity_types_sync.py new file mode 100644 index 000000000000..0c45abd3d3fe --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_list_entity_types_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListEntityTypes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_ListEntityTypes_sync] +from google.cloud import dialogflow_v2 + + +def sample_list_entity_types(): + # Create a client + client = dialogflow_v2.EntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListEntityTypesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_entity_types(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_EntityTypes_ListEntityTypes_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_update_entity_type_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_update_entity_type_async.py new file mode 100644 index 000000000000..6f5e0f616d17 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_update_entity_type_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_UpdateEntityType_async] +from google.cloud import dialogflow_v2 + + +async def sample_update_entity_type(): + # Create a client + client = dialogflow_v2.EntityTypesAsyncClient() + + # Initialize request argument(s) + entity_type = dialogflow_v2.EntityType() + entity_type.display_name = "display_name_value" + entity_type.kind = "KIND_REGEXP" + + request = dialogflow_v2.UpdateEntityTypeRequest( + entity_type=entity_type, + ) + + # Make the request + response = await client.update_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_EntityTypes_UpdateEntityType_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_update_entity_type_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_update_entity_type_sync.py new file mode 100644 index 000000000000..f78af456636e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_entity_types_update_entity_type_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_EntityTypes_UpdateEntityType_sync] +from google.cloud import dialogflow_v2 + + +def sample_update_entity_type(): + # Create a client + client = dialogflow_v2.EntityTypesClient() + + # Initialize request argument(s) + entity_type = dialogflow_v2.EntityType() + entity_type.display_name = "display_name_value" + entity_type.kind = "KIND_REGEXP" + + request = dialogflow_v2.UpdateEntityTypeRequest( + entity_type=entity_type, + ) + + # Make the request + response = client.update_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_EntityTypes_UpdateEntityType_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_create_environment_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_create_environment_async.py new file mode 100644 index 000000000000..595c5607e247 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_create_environment_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateEnvironment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Environments_CreateEnvironment_async] +from google.cloud import dialogflow_v2 + + +async def sample_create_environment(): + # Create a client + client = dialogflow_v2.EnvironmentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.CreateEnvironmentRequest( + parent="parent_value", + environment_id="environment_id_value", + ) + + # Make the request + response = await client.create_environment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Environments_CreateEnvironment_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_create_environment_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_create_environment_sync.py new file mode 100644 index 000000000000..e5433980ea07 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_create_environment_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateEnvironment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Environments_CreateEnvironment_sync] +from google.cloud import dialogflow_v2 + + +def sample_create_environment(): + # Create a client + client = dialogflow_v2.EnvironmentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.CreateEnvironmentRequest( + parent="parent_value", + environment_id="environment_id_value", + ) + + # Make the request + response = client.create_environment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Environments_CreateEnvironment_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_delete_environment_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_delete_environment_async.py new file mode 100644 index 000000000000..303a277e75a0 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_delete_environment_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteEnvironment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Environments_DeleteEnvironment_async] +from google.cloud import dialogflow_v2 + + +async def sample_delete_environment(): + # Create a client + client = dialogflow_v2.EnvironmentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteEnvironmentRequest( + name="name_value", + ) + + # Make the request + await client.delete_environment(request=request) + + +# [END dialogflow_v2_generated_Environments_DeleteEnvironment_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_delete_environment_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_delete_environment_sync.py new file mode 100644 index 000000000000..ad880a41b61c --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_delete_environment_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteEnvironment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Environments_DeleteEnvironment_sync] +from google.cloud import dialogflow_v2 + + +def sample_delete_environment(): + # Create a client + client = dialogflow_v2.EnvironmentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteEnvironmentRequest( + name="name_value", + ) + + # Make the request + client.delete_environment(request=request) + + +# [END dialogflow_v2_generated_Environments_DeleteEnvironment_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_get_environment_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_get_environment_async.py new file mode 100644 index 000000000000..4471cadad942 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_get_environment_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetEnvironment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Environments_GetEnvironment_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_environment(): + # Create a client + client = dialogflow_v2.EnvironmentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetEnvironmentRequest( + name="name_value", + ) + + # Make the request + response = await client.get_environment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Environments_GetEnvironment_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_get_environment_history_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_get_environment_history_async.py new file mode 100644 index 000000000000..209d6de71ff5 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_get_environment_history_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetEnvironmentHistory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Environments_GetEnvironmentHistory_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_environment_history(): + # Create a client + client = dialogflow_v2.EnvironmentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetEnvironmentHistoryRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.get_environment_history(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Environments_GetEnvironmentHistory_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_get_environment_history_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_get_environment_history_sync.py new file mode 100644 index 000000000000..5ee567b72747 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_get_environment_history_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetEnvironmentHistory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Environments_GetEnvironmentHistory_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_environment_history(): + # Create a client + client = dialogflow_v2.EnvironmentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetEnvironmentHistoryRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.get_environment_history(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Environments_GetEnvironmentHistory_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_get_environment_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_get_environment_sync.py new file mode 100644 index 000000000000..b4e67af9bb33 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_get_environment_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetEnvironment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Environments_GetEnvironment_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_environment(): + # Create a client + client = dialogflow_v2.EnvironmentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetEnvironmentRequest( + name="name_value", + ) + + # Make the request + response = client.get_environment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Environments_GetEnvironment_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_list_environments_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_list_environments_async.py new file mode 100644 index 000000000000..67515f7f3e87 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_list_environments_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListEnvironments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Environments_ListEnvironments_async] +from google.cloud import dialogflow_v2 + + +async def sample_list_environments(): + # Create a client + client = dialogflow_v2.EnvironmentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListEnvironmentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_environments(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Environments_ListEnvironments_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_list_environments_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_list_environments_sync.py new file mode 100644 index 000000000000..635be574d6a6 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_list_environments_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListEnvironments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Environments_ListEnvironments_sync] +from google.cloud import dialogflow_v2 + + +def sample_list_environments(): + # Create a client + client = dialogflow_v2.EnvironmentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListEnvironmentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_environments(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Environments_ListEnvironments_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_update_environment_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_update_environment_async.py new file mode 100644 index 000000000000..8b101f6dbf22 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_update_environment_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateEnvironment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Environments_UpdateEnvironment_async] +from google.cloud import dialogflow_v2 + + +async def sample_update_environment(): + # Create a client + client = dialogflow_v2.EnvironmentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.UpdateEnvironmentRequest( + ) + + # Make the request + response = await client.update_environment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Environments_UpdateEnvironment_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_update_environment_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_update_environment_sync.py new file mode 100644 index 000000000000..ae0ee2038183 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_environments_update_environment_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateEnvironment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Environments_UpdateEnvironment_sync] +from google.cloud import dialogflow_v2 + + +def sample_update_environment(): + # Create a client + client = dialogflow_v2.EnvironmentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.UpdateEnvironmentRequest( + ) + + # Make the request + response = client.update_environment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Environments_UpdateEnvironment_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_fulfillments_get_fulfillment_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_fulfillments_get_fulfillment_async.py new file mode 100644 index 000000000000..fdc08e7fc1df --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_fulfillments_get_fulfillment_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetFulfillment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Fulfillments_GetFulfillment_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_fulfillment(): + # Create a client + client = dialogflow_v2.FulfillmentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetFulfillmentRequest( + name="name_value", + ) + + # Make the request + response = await client.get_fulfillment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Fulfillments_GetFulfillment_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_fulfillments_get_fulfillment_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_fulfillments_get_fulfillment_sync.py new file mode 100644 index 000000000000..4c4b7594367c --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_fulfillments_get_fulfillment_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetFulfillment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Fulfillments_GetFulfillment_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_fulfillment(): + # Create a client + client = dialogflow_v2.FulfillmentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetFulfillmentRequest( + name="name_value", + ) + + # Make the request + response = client.get_fulfillment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Fulfillments_GetFulfillment_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_fulfillments_update_fulfillment_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_fulfillments_update_fulfillment_async.py new file mode 100644 index 000000000000..e2af53916d55 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_fulfillments_update_fulfillment_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateFulfillment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Fulfillments_UpdateFulfillment_async] +from google.cloud import dialogflow_v2 + + +async def sample_update_fulfillment(): + # Create a client + client = dialogflow_v2.FulfillmentsAsyncClient() + + # Initialize request argument(s) + fulfillment = dialogflow_v2.Fulfillment() + fulfillment.generic_web_service.uri = "uri_value" + fulfillment.name = "name_value" + + request = dialogflow_v2.UpdateFulfillmentRequest( + fulfillment=fulfillment, + ) + + # Make the request + response = await client.update_fulfillment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Fulfillments_UpdateFulfillment_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_fulfillments_update_fulfillment_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_fulfillments_update_fulfillment_sync.py new file mode 100644 index 000000000000..a29eba691868 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_fulfillments_update_fulfillment_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateFulfillment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Fulfillments_UpdateFulfillment_sync] +from google.cloud import dialogflow_v2 + + +def sample_update_fulfillment(): + # Create a client + client = dialogflow_v2.FulfillmentsClient() + + # Initialize request argument(s) + fulfillment = dialogflow_v2.Fulfillment() + fulfillment.generic_web_service.uri = "uri_value" + fulfillment.name = "name_value" + + request = dialogflow_v2.UpdateFulfillmentRequest( + fulfillment=fulfillment, + ) + + # Make the request + response = client.update_fulfillment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Fulfillments_UpdateFulfillment_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_batch_delete_intents_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_batch_delete_intents_async.py new file mode 100644 index 000000000000..4eecde23db97 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_batch_delete_intents_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchDeleteIntents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Intents_BatchDeleteIntents_async] +from google.cloud import dialogflow_v2 + + +async def sample_batch_delete_intents(): + # Create a client + client = dialogflow_v2.IntentsAsyncClient() + + # Initialize request argument(s) + intents = dialogflow_v2.Intent() + intents.display_name = "display_name_value" + + request = dialogflow_v2.BatchDeleteIntentsRequest( + parent="parent_value", + intents=intents, + ) + + # Make the request + operation = client.batch_delete_intents(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Intents_BatchDeleteIntents_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_batch_delete_intents_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_batch_delete_intents_sync.py new file mode 100644 index 000000000000..520561d9bee4 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_batch_delete_intents_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchDeleteIntents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Intents_BatchDeleteIntents_sync] +from google.cloud import dialogflow_v2 + + +def sample_batch_delete_intents(): + # Create a client + client = dialogflow_v2.IntentsClient() + + # Initialize request argument(s) + intents = dialogflow_v2.Intent() + intents.display_name = "display_name_value" + + request = dialogflow_v2.BatchDeleteIntentsRequest( + parent="parent_value", + intents=intents, + ) + + # Make the request + operation = client.batch_delete_intents(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Intents_BatchDeleteIntents_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_batch_update_intents_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_batch_update_intents_async.py new file mode 100644 index 000000000000..f876c0182adc --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_batch_update_intents_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchUpdateIntents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Intents_BatchUpdateIntents_async] +from google.cloud import dialogflow_v2 + + +async def sample_batch_update_intents(): + # Create a client + client = dialogflow_v2.IntentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.BatchUpdateIntentsRequest( + intent_batch_uri="intent_batch_uri_value", + parent="parent_value", + ) + + # Make the request + operation = client.batch_update_intents(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Intents_BatchUpdateIntents_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_batch_update_intents_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_batch_update_intents_sync.py new file mode 100644 index 000000000000..83d7877e624f --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_batch_update_intents_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchUpdateIntents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Intents_BatchUpdateIntents_sync] +from google.cloud import dialogflow_v2 + + +def sample_batch_update_intents(): + # Create a client + client = dialogflow_v2.IntentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.BatchUpdateIntentsRequest( + intent_batch_uri="intent_batch_uri_value", + parent="parent_value", + ) + + # Make the request + operation = client.batch_update_intents(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Intents_BatchUpdateIntents_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_create_intent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_create_intent_async.py new file mode 100644 index 000000000000..df9b016d49d3 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_create_intent_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Intents_CreateIntent_async] +from google.cloud import dialogflow_v2 + + +async def sample_create_intent(): + # Create a client + client = dialogflow_v2.IntentsAsyncClient() + + # Initialize request argument(s) + intent = dialogflow_v2.Intent() + intent.display_name = "display_name_value" + + request = dialogflow_v2.CreateIntentRequest( + parent="parent_value", + intent=intent, + ) + + # Make the request + response = await client.create_intent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Intents_CreateIntent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_create_intent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_create_intent_sync.py new file mode 100644 index 000000000000..d6b763cbbcb7 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_create_intent_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Intents_CreateIntent_sync] +from google.cloud import dialogflow_v2 + + +def sample_create_intent(): + # Create a client + client = dialogflow_v2.IntentsClient() + + # Initialize request argument(s) + intent = dialogflow_v2.Intent() + intent.display_name = "display_name_value" + + request = dialogflow_v2.CreateIntentRequest( + parent="parent_value", + intent=intent, + ) + + # Make the request + response = client.create_intent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Intents_CreateIntent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_delete_intent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_delete_intent_async.py new file mode 100644 index 000000000000..7bc748c48afc --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_delete_intent_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Intents_DeleteIntent_async] +from google.cloud import dialogflow_v2 + + +async def sample_delete_intent(): + # Create a client + client = dialogflow_v2.IntentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteIntentRequest( + name="name_value", + ) + + # Make the request + await client.delete_intent(request=request) + + +# [END dialogflow_v2_generated_Intents_DeleteIntent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_delete_intent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_delete_intent_sync.py new file mode 100644 index 000000000000..6a01c49a741c --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_delete_intent_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Intents_DeleteIntent_sync] +from google.cloud import dialogflow_v2 + + +def sample_delete_intent(): + # Create a client + client = dialogflow_v2.IntentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteIntentRequest( + name="name_value", + ) + + # Make the request + client.delete_intent(request=request) + + +# [END dialogflow_v2_generated_Intents_DeleteIntent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_get_intent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_get_intent_async.py new file mode 100644 index 000000000000..a0c725446e79 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_get_intent_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Intents_GetIntent_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_intent(): + # Create a client + client = dialogflow_v2.IntentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetIntentRequest( + name="name_value", + ) + + # Make the request + response = await client.get_intent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Intents_GetIntent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_get_intent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_get_intent_sync.py new file mode 100644 index 000000000000..978abb4e9b92 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_get_intent_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Intents_GetIntent_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_intent(): + # Create a client + client = dialogflow_v2.IntentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetIntentRequest( + name="name_value", + ) + + # Make the request + response = client.get_intent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Intents_GetIntent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_list_intents_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_list_intents_async.py new file mode 100644 index 000000000000..f69f04adb076 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_list_intents_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListIntents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Intents_ListIntents_async] +from google.cloud import dialogflow_v2 + + +async def sample_list_intents(): + # Create a client + client = dialogflow_v2.IntentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListIntentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_intents(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Intents_ListIntents_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_list_intents_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_list_intents_sync.py new file mode 100644 index 000000000000..f18798968e6c --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_list_intents_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListIntents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Intents_ListIntents_sync] +from google.cloud import dialogflow_v2 + + +def sample_list_intents(): + # Create a client + client = dialogflow_v2.IntentsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListIntentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_intents(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Intents_ListIntents_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_update_intent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_update_intent_async.py new file mode 100644 index 000000000000..4113c5cf8621 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_update_intent_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Intents_UpdateIntent_async] +from google.cloud import dialogflow_v2 + + +async def sample_update_intent(): + # Create a client + client = dialogflow_v2.IntentsAsyncClient() + + # Initialize request argument(s) + intent = dialogflow_v2.Intent() + intent.display_name = "display_name_value" + + request = dialogflow_v2.UpdateIntentRequest( + intent=intent, + ) + + # Make the request + response = await client.update_intent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Intents_UpdateIntent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_update_intent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_update_intent_sync.py new file mode 100644 index 000000000000..42119d9cad83 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_intents_update_intent_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Intents_UpdateIntent_sync] +from google.cloud import dialogflow_v2 + + +def sample_update_intent(): + # Create a client + client = dialogflow_v2.IntentsClient() + + # Initialize request argument(s) + intent = dialogflow_v2.Intent() + intent.display_name = "display_name_value" + + request = dialogflow_v2.UpdateIntentRequest( + intent=intent, + ) + + # Make the request + response = client.update_intent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Intents_UpdateIntent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_create_knowledge_base_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_create_knowledge_base_async.py new file mode 100644 index 000000000000..ff86b5ac1185 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_create_knowledge_base_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateKnowledgeBase +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_async] +from google.cloud import dialogflow_v2 + + +async def sample_create_knowledge_base(): + # Create a client + client = dialogflow_v2.KnowledgeBasesAsyncClient() + + # Initialize request argument(s) + knowledge_base = dialogflow_v2.KnowledgeBase() + knowledge_base.display_name = "display_name_value" + + request = dialogflow_v2.CreateKnowledgeBaseRequest( + parent="parent_value", + knowledge_base=knowledge_base, + ) + + # Make the request + response = await client.create_knowledge_base(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_create_knowledge_base_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_create_knowledge_base_sync.py new file mode 100644 index 000000000000..bdf9b7e865c7 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_create_knowledge_base_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateKnowledgeBase +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_sync] +from google.cloud import dialogflow_v2 + + +def sample_create_knowledge_base(): + # Create a client + client = dialogflow_v2.KnowledgeBasesClient() + + # Initialize request argument(s) + knowledge_base = dialogflow_v2.KnowledgeBase() + knowledge_base.display_name = "display_name_value" + + request = dialogflow_v2.CreateKnowledgeBaseRequest( + parent="parent_value", + knowledge_base=knowledge_base, + ) + + # Make the request + response = client.create_knowledge_base(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_delete_knowledge_base_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_delete_knowledge_base_async.py new file mode 100644 index 000000000000..d939d6146443 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_delete_knowledge_base_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteKnowledgeBase +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_async] +from google.cloud import dialogflow_v2 + + +async def sample_delete_knowledge_base(): + # Create a client + client = dialogflow_v2.KnowledgeBasesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteKnowledgeBaseRequest( + name="name_value", + ) + + # Make the request + await client.delete_knowledge_base(request=request) + + +# [END dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_delete_knowledge_base_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_delete_knowledge_base_sync.py new file mode 100644 index 000000000000..bb5b3ee46520 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_delete_knowledge_base_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteKnowledgeBase +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_sync] +from google.cloud import dialogflow_v2 + + +def sample_delete_knowledge_base(): + # Create a client + client = dialogflow_v2.KnowledgeBasesClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteKnowledgeBaseRequest( + name="name_value", + ) + + # Make the request + client.delete_knowledge_base(request=request) + + +# [END dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_get_knowledge_base_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_get_knowledge_base_async.py new file mode 100644 index 000000000000..93cc578fefa7 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_get_knowledge_base_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetKnowledgeBase +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_knowledge_base(): + # Create a client + client = dialogflow_v2.KnowledgeBasesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetKnowledgeBaseRequest( + name="name_value", + ) + + # Make the request + response = await client.get_knowledge_base(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_get_knowledge_base_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_get_knowledge_base_sync.py new file mode 100644 index 000000000000..a282ce65f52b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_get_knowledge_base_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetKnowledgeBase +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_knowledge_base(): + # Create a client + client = dialogflow_v2.KnowledgeBasesClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetKnowledgeBaseRequest( + name="name_value", + ) + + # Make the request + response = client.get_knowledge_base(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_list_knowledge_bases_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_list_knowledge_bases_async.py new file mode 100644 index 000000000000..cedc4d077a19 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_list_knowledge_bases_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListKnowledgeBases +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_async] +from google.cloud import dialogflow_v2 + + +async def sample_list_knowledge_bases(): + # Create a client + client = dialogflow_v2.KnowledgeBasesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListKnowledgeBasesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_knowledge_bases(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_list_knowledge_bases_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_list_knowledge_bases_sync.py new file mode 100644 index 000000000000..61248b5bacdb --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_list_knowledge_bases_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListKnowledgeBases +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_sync] +from google.cloud import dialogflow_v2 + + +def sample_list_knowledge_bases(): + # Create a client + client = dialogflow_v2.KnowledgeBasesClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListKnowledgeBasesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_knowledge_bases(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_update_knowledge_base_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_update_knowledge_base_async.py new file mode 100644 index 000000000000..80c92a4f67e7 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_update_knowledge_base_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateKnowledgeBase +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_async] +from google.cloud import dialogflow_v2 + + +async def sample_update_knowledge_base(): + # Create a client + client = dialogflow_v2.KnowledgeBasesAsyncClient() + + # Initialize request argument(s) + knowledge_base = dialogflow_v2.KnowledgeBase() + knowledge_base.display_name = "display_name_value" + + request = dialogflow_v2.UpdateKnowledgeBaseRequest( + knowledge_base=knowledge_base, + ) + + # Make the request + response = await client.update_knowledge_base(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_update_knowledge_base_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_update_knowledge_base_sync.py new file mode 100644 index 000000000000..3947e60ce7d4 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_knowledge_bases_update_knowledge_base_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateKnowledgeBase +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_sync] +from google.cloud import dialogflow_v2 + + +def sample_update_knowledge_base(): + # Create a client + client = dialogflow_v2.KnowledgeBasesClient() + + # Initialize request argument(s) + knowledge_base = dialogflow_v2.KnowledgeBase() + knowledge_base.display_name = "display_name_value" + + request = dialogflow_v2.UpdateKnowledgeBaseRequest( + knowledge_base=knowledge_base, + ) + + # Make the request + response = client.update_knowledge_base(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_analyze_content_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_analyze_content_async.py new file mode 100644 index 000000000000..27d32e9ba69d --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_analyze_content_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnalyzeContent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Participants_AnalyzeContent_async] +from google.cloud import dialogflow_v2 + + +async def sample_analyze_content(): + # Create a client + client = dialogflow_v2.ParticipantsAsyncClient() + + # Initialize request argument(s) + text_input = dialogflow_v2.TextInput() + text_input.text = "text_value" + text_input.language_code = "language_code_value" + + request = dialogflow_v2.AnalyzeContentRequest( + text_input=text_input, + participant="participant_value", + ) + + # Make the request + response = await client.analyze_content(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Participants_AnalyzeContent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_analyze_content_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_analyze_content_sync.py new file mode 100644 index 000000000000..b5a26c5859e2 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_analyze_content_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnalyzeContent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Participants_AnalyzeContent_sync] +from google.cloud import dialogflow_v2 + + +def sample_analyze_content(): + # Create a client + client = dialogflow_v2.ParticipantsClient() + + # Initialize request argument(s) + text_input = dialogflow_v2.TextInput() + text_input.text = "text_value" + text_input.language_code = "language_code_value" + + request = dialogflow_v2.AnalyzeContentRequest( + text_input=text_input, + participant="participant_value", + ) + + # Make the request + response = client.analyze_content(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Participants_AnalyzeContent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_create_participant_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_create_participant_async.py new file mode 100644 index 000000000000..a8004563e055 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_create_participant_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateParticipant +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Participants_CreateParticipant_async] +from google.cloud import dialogflow_v2 + + +async def sample_create_participant(): + # Create a client + client = dialogflow_v2.ParticipantsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.CreateParticipantRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_participant(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Participants_CreateParticipant_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_create_participant_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_create_participant_sync.py new file mode 100644 index 000000000000..1e18c8a591eb --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_create_participant_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateParticipant +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Participants_CreateParticipant_sync] +from google.cloud import dialogflow_v2 + + +def sample_create_participant(): + # Create a client + client = dialogflow_v2.ParticipantsClient() + + # Initialize request argument(s) + request = dialogflow_v2.CreateParticipantRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_participant(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Participants_CreateParticipant_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_get_participant_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_get_participant_async.py new file mode 100644 index 000000000000..0f5161e4087d --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_get_participant_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetParticipant +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Participants_GetParticipant_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_participant(): + # Create a client + client = dialogflow_v2.ParticipantsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetParticipantRequest( + name="name_value", + ) + + # Make the request + response = await client.get_participant(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Participants_GetParticipant_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_get_participant_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_get_participant_sync.py new file mode 100644 index 000000000000..a96e74ce3918 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_get_participant_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetParticipant +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Participants_GetParticipant_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_participant(): + # Create a client + client = dialogflow_v2.ParticipantsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetParticipantRequest( + name="name_value", + ) + + # Make the request + response = client.get_participant(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Participants_GetParticipant_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_list_participants_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_list_participants_async.py new file mode 100644 index 000000000000..9f001764a0f4 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_list_participants_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListParticipants +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Participants_ListParticipants_async] +from google.cloud import dialogflow_v2 + + +async def sample_list_participants(): + # Create a client + client = dialogflow_v2.ParticipantsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListParticipantsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_participants(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Participants_ListParticipants_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_list_participants_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_list_participants_sync.py new file mode 100644 index 000000000000..6b84b8ab0b6d --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_list_participants_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListParticipants +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Participants_ListParticipants_sync] +from google.cloud import dialogflow_v2 + + +def sample_list_participants(): + # Create a client + client = dialogflow_v2.ParticipantsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListParticipantsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_participants(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Participants_ListParticipants_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_articles_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_articles_async.py new file mode 100644 index 000000000000..2dea6d0a7ad9 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_articles_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SuggestArticles +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Participants_SuggestArticles_async] +from google.cloud import dialogflow_v2 + + +async def sample_suggest_articles(): + # Create a client + client = dialogflow_v2.ParticipantsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.SuggestArticlesRequest( + parent="parent_value", + ) + + # Make the request + response = await client.suggest_articles(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Participants_SuggestArticles_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_articles_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_articles_sync.py new file mode 100644 index 000000000000..e3e5c2aee6b6 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_articles_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SuggestArticles +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Participants_SuggestArticles_sync] +from google.cloud import dialogflow_v2 + + +def sample_suggest_articles(): + # Create a client + client = dialogflow_v2.ParticipantsClient() + + # Initialize request argument(s) + request = dialogflow_v2.SuggestArticlesRequest( + parent="parent_value", + ) + + # Make the request + response = client.suggest_articles(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Participants_SuggestArticles_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_faq_answers_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_faq_answers_async.py new file mode 100644 index 000000000000..8c088efb14b8 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_faq_answers_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SuggestFaqAnswers +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Participants_SuggestFaqAnswers_async] +from google.cloud import dialogflow_v2 + + +async def sample_suggest_faq_answers(): + # Create a client + client = dialogflow_v2.ParticipantsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.SuggestFaqAnswersRequest( + parent="parent_value", + ) + + # Make the request + response = await client.suggest_faq_answers(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Participants_SuggestFaqAnswers_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_faq_answers_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_faq_answers_sync.py new file mode 100644 index 000000000000..23272a9e3add --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_faq_answers_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SuggestFaqAnswers +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Participants_SuggestFaqAnswers_sync] +from google.cloud import dialogflow_v2 + + +def sample_suggest_faq_answers(): + # Create a client + client = dialogflow_v2.ParticipantsClient() + + # Initialize request argument(s) + request = dialogflow_v2.SuggestFaqAnswersRequest( + parent="parent_value", + ) + + # Make the request + response = client.suggest_faq_answers(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Participants_SuggestFaqAnswers_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_smart_replies_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_smart_replies_async.py new file mode 100644 index 000000000000..d3f53f096798 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_smart_replies_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SuggestSmartReplies +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Participants_SuggestSmartReplies_async] +from google.cloud import dialogflow_v2 + + +async def sample_suggest_smart_replies(): + # Create a client + client = dialogflow_v2.ParticipantsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.SuggestSmartRepliesRequest( + parent="parent_value", + ) + + # Make the request + response = await client.suggest_smart_replies(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Participants_SuggestSmartReplies_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_smart_replies_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_smart_replies_sync.py new file mode 100644 index 000000000000..f16879eef9d2 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_suggest_smart_replies_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SuggestSmartReplies +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Participants_SuggestSmartReplies_sync] +from google.cloud import dialogflow_v2 + + +def sample_suggest_smart_replies(): + # Create a client + client = dialogflow_v2.ParticipantsClient() + + # Initialize request argument(s) + request = dialogflow_v2.SuggestSmartRepliesRequest( + parent="parent_value", + ) + + # Make the request + response = client.suggest_smart_replies(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Participants_SuggestSmartReplies_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_update_participant_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_update_participant_async.py new file mode 100644 index 000000000000..7f6b70a07126 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_update_participant_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateParticipant +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Participants_UpdateParticipant_async] +from google.cloud import dialogflow_v2 + + +async def sample_update_participant(): + # Create a client + client = dialogflow_v2.ParticipantsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.UpdateParticipantRequest( + ) + + # Make the request + response = await client.update_participant(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Participants_UpdateParticipant_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_update_participant_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_update_participant_sync.py new file mode 100644 index 000000000000..f1e71dccf520 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_participants_update_participant_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateParticipant +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Participants_UpdateParticipant_sync] +from google.cloud import dialogflow_v2 + + +def sample_update_participant(): + # Create a client + client = dialogflow_v2.ParticipantsClient() + + # Initialize request argument(s) + request = dialogflow_v2.UpdateParticipantRequest( + ) + + # Make the request + response = client.update_participant(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Participants_UpdateParticipant_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_create_session_entity_type_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_create_session_entity_type_async.py new file mode 100644 index 000000000000..9ea04bffecff --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_create_session_entity_type_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateSessionEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_async] +from google.cloud import dialogflow_v2 + + +async def sample_create_session_entity_type(): + # Create a client + client = dialogflow_v2.SessionEntityTypesAsyncClient() + + # Initialize request argument(s) + session_entity_type = dialogflow_v2.SessionEntityType() + session_entity_type.name = "name_value" + session_entity_type.entity_override_mode = "ENTITY_OVERRIDE_MODE_SUPPLEMENT" + session_entity_type.entities.value = "value_value" + session_entity_type.entities.synonyms = ['synonyms_value_1', 'synonyms_value_2'] + + request = dialogflow_v2.CreateSessionEntityTypeRequest( + parent="parent_value", + session_entity_type=session_entity_type, + ) + + # Make the request + response = await client.create_session_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_create_session_entity_type_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_create_session_entity_type_sync.py new file mode 100644 index 000000000000..7131321a4aa6 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_create_session_entity_type_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateSessionEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_sync] +from google.cloud import dialogflow_v2 + + +def sample_create_session_entity_type(): + # Create a client + client = dialogflow_v2.SessionEntityTypesClient() + + # Initialize request argument(s) + session_entity_type = dialogflow_v2.SessionEntityType() + session_entity_type.name = "name_value" + session_entity_type.entity_override_mode = "ENTITY_OVERRIDE_MODE_SUPPLEMENT" + session_entity_type.entities.value = "value_value" + session_entity_type.entities.synonyms = ['synonyms_value_1', 'synonyms_value_2'] + + request = dialogflow_v2.CreateSessionEntityTypeRequest( + parent="parent_value", + session_entity_type=session_entity_type, + ) + + # Make the request + response = client.create_session_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_delete_session_entity_type_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_delete_session_entity_type_async.py new file mode 100644 index 000000000000..aaf526492c01 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_delete_session_entity_type_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteSessionEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_async] +from google.cloud import dialogflow_v2 + + +async def sample_delete_session_entity_type(): + # Create a client + client = dialogflow_v2.SessionEntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteSessionEntityTypeRequest( + name="name_value", + ) + + # Make the request + await client.delete_session_entity_type(request=request) + + +# [END dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_delete_session_entity_type_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_delete_session_entity_type_sync.py new file mode 100644 index 000000000000..d22b1c2f5f50 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_delete_session_entity_type_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteSessionEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_sync] +from google.cloud import dialogflow_v2 + + +def sample_delete_session_entity_type(): + # Create a client + client = dialogflow_v2.SessionEntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteSessionEntityTypeRequest( + name="name_value", + ) + + # Make the request + client.delete_session_entity_type(request=request) + + +# [END dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_get_session_entity_type_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_get_session_entity_type_async.py new file mode 100644 index 000000000000..dfca1efc0b7d --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_get_session_entity_type_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSessionEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_session_entity_type(): + # Create a client + client = dialogflow_v2.SessionEntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetSessionEntityTypeRequest( + name="name_value", + ) + + # Make the request + response = await client.get_session_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_get_session_entity_type_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_get_session_entity_type_sync.py new file mode 100644 index 000000000000..2bead611338b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_get_session_entity_type_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSessionEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_session_entity_type(): + # Create a client + client = dialogflow_v2.SessionEntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetSessionEntityTypeRequest( + name="name_value", + ) + + # Make the request + response = client.get_session_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_list_session_entity_types_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_list_session_entity_types_async.py new file mode 100644 index 000000000000..e192f3c5138b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_list_session_entity_types_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListSessionEntityTypes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_async] +from google.cloud import dialogflow_v2 + + +async def sample_list_session_entity_types(): + # Create a client + client = dialogflow_v2.SessionEntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListSessionEntityTypesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_session_entity_types(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_list_session_entity_types_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_list_session_entity_types_sync.py new file mode 100644 index 000000000000..1f8511c77b0b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_list_session_entity_types_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListSessionEntityTypes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_sync] +from google.cloud import dialogflow_v2 + + +def sample_list_session_entity_types(): + # Create a client + client = dialogflow_v2.SessionEntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListSessionEntityTypesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_session_entity_types(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_update_session_entity_type_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_update_session_entity_type_async.py new file mode 100644 index 000000000000..daf141a971b4 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_update_session_entity_type_async.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateSessionEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_async] +from google.cloud import dialogflow_v2 + + +async def sample_update_session_entity_type(): + # Create a client + client = dialogflow_v2.SessionEntityTypesAsyncClient() + + # Initialize request argument(s) + session_entity_type = dialogflow_v2.SessionEntityType() + session_entity_type.name = "name_value" + session_entity_type.entity_override_mode = "ENTITY_OVERRIDE_MODE_SUPPLEMENT" + session_entity_type.entities.value = "value_value" + session_entity_type.entities.synonyms = ['synonyms_value_1', 'synonyms_value_2'] + + request = dialogflow_v2.UpdateSessionEntityTypeRequest( + session_entity_type=session_entity_type, + ) + + # Make the request + response = await client.update_session_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_update_session_entity_type_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_update_session_entity_type_sync.py new file mode 100644 index 000000000000..be6324227f0b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_session_entity_types_update_session_entity_type_sync.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateSessionEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_sync] +from google.cloud import dialogflow_v2 + + +def sample_update_session_entity_type(): + # Create a client + client = dialogflow_v2.SessionEntityTypesClient() + + # Initialize request argument(s) + session_entity_type = dialogflow_v2.SessionEntityType() + session_entity_type.name = "name_value" + session_entity_type.entity_override_mode = "ENTITY_OVERRIDE_MODE_SUPPLEMENT" + session_entity_type.entities.value = "value_value" + session_entity_type.entities.synonyms = ['synonyms_value_1', 'synonyms_value_2'] + + request = dialogflow_v2.UpdateSessionEntityTypeRequest( + session_entity_type=session_entity_type, + ) + + # Make the request + response = client.update_session_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_sessions_detect_intent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_sessions_detect_intent_async.py new file mode 100644 index 000000000000..c5cf3059f1d2 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_sessions_detect_intent_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DetectIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Sessions_DetectIntent_async] +from google.cloud import dialogflow_v2 + + +async def sample_detect_intent(): + # Create a client + client = dialogflow_v2.SessionsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.DetectIntentRequest( + session="session_value", + ) + + # Make the request + response = await client.detect_intent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Sessions_DetectIntent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_sessions_detect_intent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_sessions_detect_intent_sync.py new file mode 100644 index 000000000000..51c2a5c10c6d --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_sessions_detect_intent_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DetectIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Sessions_DetectIntent_sync] +from google.cloud import dialogflow_v2 + + +def sample_detect_intent(): + # Create a client + client = dialogflow_v2.SessionsClient() + + # Initialize request argument(s) + request = dialogflow_v2.DetectIntentRequest( + session="session_value", + ) + + # Make the request + response = client.detect_intent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Sessions_DetectIntent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_sessions_streaming_detect_intent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_sessions_streaming_detect_intent_async.py new file mode 100644 index 000000000000..8da2c0bd87d8 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_sessions_streaming_detect_intent_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for StreamingDetectIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Sessions_StreamingDetectIntent_async] +from google.cloud import dialogflow_v2 + + +async def sample_streaming_detect_intent(): + # Create a client + client = dialogflow_v2.SessionsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.StreamingDetectIntentRequest( + session="session_value", + ) + + # This method expects an iterator which contains + # 'dialogflow_v2.StreamingDetectIntentRequest' objects + # Here we create a generator that yields a single `request` for + # demonstrative purposes. + requests = [request] + + def request_generator(): + for request in requests: + yield request + + # Make the request + stream = await client.streaming_detect_intent(requests=request_generator()) + + # Handle the response + async for response in stream: + print(response) + +# [END dialogflow_v2_generated_Sessions_StreamingDetectIntent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_sessions_streaming_detect_intent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_sessions_streaming_detect_intent_sync.py new file mode 100644 index 000000000000..e69a61f31f13 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_sessions_streaming_detect_intent_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for StreamingDetectIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Sessions_StreamingDetectIntent_sync] +from google.cloud import dialogflow_v2 + + +def sample_streaming_detect_intent(): + # Create a client + client = dialogflow_v2.SessionsClient() + + # Initialize request argument(s) + request = dialogflow_v2.StreamingDetectIntentRequest( + session="session_value", + ) + + # This method expects an iterator which contains + # 'dialogflow_v2.StreamingDetectIntentRequest' objects + # Here we create a generator that yields a single `request` for + # demonstrative purposes. + requests = [request] + + def request_generator(): + for request in requests: + yield request + + # Make the request + stream = client.streaming_detect_intent(requests=request_generator()) + + # Handle the response + for response in stream: + print(response) + +# [END dialogflow_v2_generated_Sessions_StreamingDetectIntent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_create_version_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_create_version_async.py new file mode 100644 index 000000000000..ed5c151b54bc --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_create_version_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Versions_CreateVersion_async] +from google.cloud import dialogflow_v2 + + +async def sample_create_version(): + # Create a client + client = dialogflow_v2.VersionsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.CreateVersionRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_version(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Versions_CreateVersion_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_create_version_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_create_version_sync.py new file mode 100644 index 000000000000..4fd2262885b9 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_create_version_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Versions_CreateVersion_sync] +from google.cloud import dialogflow_v2 + + +def sample_create_version(): + # Create a client + client = dialogflow_v2.VersionsClient() + + # Initialize request argument(s) + request = dialogflow_v2.CreateVersionRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_version(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Versions_CreateVersion_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_delete_version_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_delete_version_async.py new file mode 100644 index 000000000000..f8cae304356c --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_delete_version_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Versions_DeleteVersion_async] +from google.cloud import dialogflow_v2 + + +async def sample_delete_version(): + # Create a client + client = dialogflow_v2.VersionsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteVersionRequest( + name="name_value", + ) + + # Make the request + await client.delete_version(request=request) + + +# [END dialogflow_v2_generated_Versions_DeleteVersion_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_delete_version_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_delete_version_sync.py new file mode 100644 index 000000000000..db21ea985121 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_delete_version_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Versions_DeleteVersion_sync] +from google.cloud import dialogflow_v2 + + +def sample_delete_version(): + # Create a client + client = dialogflow_v2.VersionsClient() + + # Initialize request argument(s) + request = dialogflow_v2.DeleteVersionRequest( + name="name_value", + ) + + # Make the request + client.delete_version(request=request) + + +# [END dialogflow_v2_generated_Versions_DeleteVersion_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_get_version_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_get_version_async.py new file mode 100644 index 000000000000..1c4753eff116 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_get_version_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Versions_GetVersion_async] +from google.cloud import dialogflow_v2 + + +async def sample_get_version(): + # Create a client + client = dialogflow_v2.VersionsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetVersionRequest( + name="name_value", + ) + + # Make the request + response = await client.get_version(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Versions_GetVersion_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_get_version_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_get_version_sync.py new file mode 100644 index 000000000000..968031d3a05d --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_get_version_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Versions_GetVersion_sync] +from google.cloud import dialogflow_v2 + + +def sample_get_version(): + # Create a client + client = dialogflow_v2.VersionsClient() + + # Initialize request argument(s) + request = dialogflow_v2.GetVersionRequest( + name="name_value", + ) + + # Make the request + response = client.get_version(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Versions_GetVersion_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_list_versions_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_list_versions_async.py new file mode 100644 index 000000000000..4f7e52a7c781 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_list_versions_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListVersions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Versions_ListVersions_async] +from google.cloud import dialogflow_v2 + + +async def sample_list_versions(): + # Create a client + client = dialogflow_v2.VersionsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListVersionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_versions(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Versions_ListVersions_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_list_versions_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_list_versions_sync.py new file mode 100644 index 000000000000..eb0b434dd595 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_list_versions_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListVersions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Versions_ListVersions_sync] +from google.cloud import dialogflow_v2 + + +def sample_list_versions(): + # Create a client + client = dialogflow_v2.VersionsClient() + + # Initialize request argument(s) + request = dialogflow_v2.ListVersionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_versions(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2_generated_Versions_ListVersions_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_update_version_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_update_version_async.py new file mode 100644 index 000000000000..2f439fdd9a06 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_update_version_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Versions_UpdateVersion_async] +from google.cloud import dialogflow_v2 + + +async def sample_update_version(): + # Create a client + client = dialogflow_v2.VersionsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2.UpdateVersionRequest( + ) + + # Make the request + response = await client.update_version(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Versions_UpdateVersion_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_update_version_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_update_version_sync.py new file mode 100644 index 000000000000..a279d5137cca --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2_generated_versions_update_version_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2_generated_Versions_UpdateVersion_sync] +from google.cloud import dialogflow_v2 + + +def sample_update_version(): + # Create a client + client = dialogflow_v2.VersionsClient() + + # Initialize request argument(s) + request = dialogflow_v2.UpdateVersionRequest( + ) + + # Make the request + response = client.update_version(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2_generated_Versions_UpdateVersion_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_delete_agent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_delete_agent_async.py new file mode 100644 index 000000000000..92ae15af90ca --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_delete_agent_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_DeleteAgent_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_delete_agent(): + # Create a client + client = dialogflow_v2beta1.AgentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteAgentRequest( + parent="parent_value", + ) + + # Make the request + await client.delete_agent(request=request) + + +# [END dialogflow_v2beta1_generated_Agents_DeleteAgent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_delete_agent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_delete_agent_sync.py new file mode 100644 index 000000000000..9bf7d422d0fc --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_delete_agent_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_DeleteAgent_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_delete_agent(): + # Create a client + client = dialogflow_v2beta1.AgentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteAgentRequest( + parent="parent_value", + ) + + # Make the request + client.delete_agent(request=request) + + +# [END dialogflow_v2beta1_generated_Agents_DeleteAgent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_export_agent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_export_agent_async.py new file mode 100644 index 000000000000..c6a237ffeea6 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_export_agent_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ExportAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_ExportAgent_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_export_agent(): + # Create a client + client = dialogflow_v2beta1.AgentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ExportAgentRequest( + parent="parent_value", + ) + + # Make the request + operation = client.export_agent(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Agents_ExportAgent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_export_agent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_export_agent_sync.py new file mode 100644 index 000000000000..0dfd0404ffbc --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_export_agent_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ExportAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_ExportAgent_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_export_agent(): + # Create a client + client = dialogflow_v2beta1.AgentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ExportAgentRequest( + parent="parent_value", + ) + + # Make the request + operation = client.export_agent(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Agents_ExportAgent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_get_agent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_get_agent_async.py new file mode 100644 index 000000000000..88299740344d --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_get_agent_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_GetAgent_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_get_agent(): + # Create a client + client = dialogflow_v2beta1.AgentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetAgentRequest( + parent="parent_value", + ) + + # Make the request + response = await client.get_agent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Agents_GetAgent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_get_agent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_get_agent_sync.py new file mode 100644 index 000000000000..68050207202b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_get_agent_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_GetAgent_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_get_agent(): + # Create a client + client = dialogflow_v2beta1.AgentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetAgentRequest( + parent="parent_value", + ) + + # Make the request + response = client.get_agent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Agents_GetAgent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_get_validation_result_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_get_validation_result_async.py new file mode 100644 index 000000000000..ff441e8a7d59 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_get_validation_result_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetValidationResult +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_GetValidationResult_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_get_validation_result(): + # Create a client + client = dialogflow_v2beta1.AgentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetValidationResultRequest( + parent="parent_value", + ) + + # Make the request + response = await client.get_validation_result(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Agents_GetValidationResult_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_get_validation_result_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_get_validation_result_sync.py new file mode 100644 index 000000000000..892f2806be65 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_get_validation_result_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetValidationResult +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_GetValidationResult_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_get_validation_result(): + # Create a client + client = dialogflow_v2beta1.AgentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetValidationResultRequest( + parent="parent_value", + ) + + # Make the request + response = client.get_validation_result(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Agents_GetValidationResult_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_import_agent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_import_agent_async.py new file mode 100644 index 000000000000..e886815df611 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_import_agent_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ImportAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_ImportAgent_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_import_agent(): + # Create a client + client = dialogflow_v2beta1.AgentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ImportAgentRequest( + agent_uri="agent_uri_value", + parent="parent_value", + ) + + # Make the request + operation = client.import_agent(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Agents_ImportAgent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_import_agent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_import_agent_sync.py new file mode 100644 index 000000000000..a7cfd910d87b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_import_agent_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ImportAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_ImportAgent_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_import_agent(): + # Create a client + client = dialogflow_v2beta1.AgentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ImportAgentRequest( + agent_uri="agent_uri_value", + parent="parent_value", + ) + + # Make the request + operation = client.import_agent(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Agents_ImportAgent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_restore_agent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_restore_agent_async.py new file mode 100644 index 000000000000..65cf67a1dae9 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_restore_agent_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RestoreAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_RestoreAgent_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_restore_agent(): + # Create a client + client = dialogflow_v2beta1.AgentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.RestoreAgentRequest( + agent_uri="agent_uri_value", + parent="parent_value", + ) + + # Make the request + operation = client.restore_agent(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Agents_RestoreAgent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_restore_agent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_restore_agent_sync.py new file mode 100644 index 000000000000..73c662cd42f6 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_restore_agent_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RestoreAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_RestoreAgent_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_restore_agent(): + # Create a client + client = dialogflow_v2beta1.AgentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.RestoreAgentRequest( + agent_uri="agent_uri_value", + parent="parent_value", + ) + + # Make the request + operation = client.restore_agent(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Agents_RestoreAgent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_search_agents_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_search_agents_async.py new file mode 100644 index 000000000000..5ad7f101d594 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_search_agents_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SearchAgents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_SearchAgents_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_search_agents(): + # Create a client + client = dialogflow_v2beta1.AgentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.SearchAgentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.search_agents(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Agents_SearchAgents_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_search_agents_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_search_agents_sync.py new file mode 100644 index 000000000000..a663c8722e8c --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_search_agents_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SearchAgents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_SearchAgents_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_search_agents(): + # Create a client + client = dialogflow_v2beta1.AgentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.SearchAgentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.search_agents(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Agents_SearchAgents_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_set_agent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_set_agent_async.py new file mode 100644 index 000000000000..267ce2454eb7 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_set_agent_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_SetAgent_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_set_agent(): + # Create a client + client = dialogflow_v2beta1.AgentsAsyncClient() + + # Initialize request argument(s) + agent = dialogflow_v2beta1.Agent() + agent.parent = "parent_value" + + request = dialogflow_v2beta1.SetAgentRequest( + agent=agent, + ) + + # Make the request + response = await client.set_agent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Agents_SetAgent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_set_agent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_set_agent_sync.py new file mode 100644 index 000000000000..4ea54befb55c --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_set_agent_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_SetAgent_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_set_agent(): + # Create a client + client = dialogflow_v2beta1.AgentsClient() + + # Initialize request argument(s) + agent = dialogflow_v2beta1.Agent() + agent.parent = "parent_value" + + request = dialogflow_v2beta1.SetAgentRequest( + agent=agent, + ) + + # Make the request + response = client.set_agent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Agents_SetAgent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_train_agent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_train_agent_async.py new file mode 100644 index 000000000000..e881161e914e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_train_agent_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TrainAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_TrainAgent_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_train_agent(): + # Create a client + client = dialogflow_v2beta1.AgentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.TrainAgentRequest( + parent="parent_value", + ) + + # Make the request + operation = client.train_agent(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Agents_TrainAgent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_train_agent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_train_agent_sync.py new file mode 100644 index 000000000000..9e941da2cd1c --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_agents_train_agent_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TrainAgent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Agents_TrainAgent_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_train_agent(): + # Create a client + client = dialogflow_v2beta1.AgentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.TrainAgentRequest( + parent="parent_value", + ) + + # Make the request + operation = client.train_agent(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Agents_TrainAgent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_get_answer_record_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_get_answer_record_async.py new file mode 100644 index 000000000000..8f184b9063c6 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_get_answer_record_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetAnswerRecord +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_AnswerRecords_GetAnswerRecord_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_get_answer_record(): + # Create a client + client = dialogflow_v2beta1.AnswerRecordsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetAnswerRecordRequest( + ) + + # Make the request + response = await client.get_answer_record(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_AnswerRecords_GetAnswerRecord_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_get_answer_record_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_get_answer_record_sync.py new file mode 100644 index 000000000000..164fd9bf5839 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_get_answer_record_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetAnswerRecord +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_AnswerRecords_GetAnswerRecord_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_get_answer_record(): + # Create a client + client = dialogflow_v2beta1.AnswerRecordsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetAnswerRecordRequest( + ) + + # Make the request + response = client.get_answer_record(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_AnswerRecords_GetAnswerRecord_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_list_answer_records_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_list_answer_records_async.py new file mode 100644 index 000000000000..198f98e2d96a --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_list_answer_records_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListAnswerRecords +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_AnswerRecords_ListAnswerRecords_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_list_answer_records(): + # Create a client + client = dialogflow_v2beta1.AnswerRecordsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListAnswerRecordsRequest( + ) + + # Make the request + page_result = client.list_answer_records(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_AnswerRecords_ListAnswerRecords_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_list_answer_records_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_list_answer_records_sync.py new file mode 100644 index 000000000000..97cb51c86f15 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_list_answer_records_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListAnswerRecords +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_AnswerRecords_ListAnswerRecords_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_list_answer_records(): + # Create a client + client = dialogflow_v2beta1.AnswerRecordsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListAnswerRecordsRequest( + ) + + # Make the request + page_result = client.list_answer_records(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_AnswerRecords_ListAnswerRecords_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_update_answer_record_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_update_answer_record_async.py new file mode 100644 index 000000000000..b0fc6eccfdfe --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_update_answer_record_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateAnswerRecord +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_AnswerRecords_UpdateAnswerRecord_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_update_answer_record(): + # Create a client + client = dialogflow_v2beta1.AnswerRecordsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.UpdateAnswerRecordRequest( + ) + + # Make the request + response = await client.update_answer_record(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_AnswerRecords_UpdateAnswerRecord_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_update_answer_record_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_update_answer_record_sync.py new file mode 100644 index 000000000000..b8a3785a3fb8 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_answer_records_update_answer_record_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateAnswerRecord +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_AnswerRecords_UpdateAnswerRecord_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_update_answer_record(): + # Create a client + client = dialogflow_v2beta1.AnswerRecordsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.UpdateAnswerRecordRequest( + ) + + # Make the request + response = client.update_answer_record(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_AnswerRecords_UpdateAnswerRecord_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_create_context_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_create_context_async.py new file mode 100644 index 000000000000..2c708037cf2e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_create_context_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateContext +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Contexts_CreateContext_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_create_context(): + # Create a client + client = dialogflow_v2beta1.ContextsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.CreateContextRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_context(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Contexts_CreateContext_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_create_context_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_create_context_sync.py new file mode 100644 index 000000000000..ec26ae4b1ca9 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_create_context_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateContext +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Contexts_CreateContext_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_create_context(): + # Create a client + client = dialogflow_v2beta1.ContextsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.CreateContextRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_context(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Contexts_CreateContext_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_delete_all_contexts_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_delete_all_contexts_async.py new file mode 100644 index 000000000000..5de7396462ce --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_delete_all_contexts_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteAllContexts +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Contexts_DeleteAllContexts_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_delete_all_contexts(): + # Create a client + client = dialogflow_v2beta1.ContextsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteAllContextsRequest( + parent="parent_value", + ) + + # Make the request + await client.delete_all_contexts(request=request) + + +# [END dialogflow_v2beta1_generated_Contexts_DeleteAllContexts_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_delete_all_contexts_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_delete_all_contexts_sync.py new file mode 100644 index 000000000000..1374e32c7e37 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_delete_all_contexts_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteAllContexts +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Contexts_DeleteAllContexts_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_delete_all_contexts(): + # Create a client + client = dialogflow_v2beta1.ContextsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteAllContextsRequest( + parent="parent_value", + ) + + # Make the request + client.delete_all_contexts(request=request) + + +# [END dialogflow_v2beta1_generated_Contexts_DeleteAllContexts_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_delete_context_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_delete_context_async.py new file mode 100644 index 000000000000..2975fe58f36b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_delete_context_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteContext +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Contexts_DeleteContext_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_delete_context(): + # Create a client + client = dialogflow_v2beta1.ContextsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteContextRequest( + name="name_value", + ) + + # Make the request + await client.delete_context(request=request) + + +# [END dialogflow_v2beta1_generated_Contexts_DeleteContext_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_delete_context_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_delete_context_sync.py new file mode 100644 index 000000000000..16be65f0a785 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_delete_context_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteContext +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Contexts_DeleteContext_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_delete_context(): + # Create a client + client = dialogflow_v2beta1.ContextsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteContextRequest( + name="name_value", + ) + + # Make the request + client.delete_context(request=request) + + +# [END dialogflow_v2beta1_generated_Contexts_DeleteContext_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_get_context_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_get_context_async.py new file mode 100644 index 000000000000..7a75416b9646 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_get_context_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetContext +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Contexts_GetContext_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_get_context(): + # Create a client + client = dialogflow_v2beta1.ContextsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetContextRequest( + name="name_value", + ) + + # Make the request + response = await client.get_context(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Contexts_GetContext_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_get_context_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_get_context_sync.py new file mode 100644 index 000000000000..56fcc93ff5f0 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_get_context_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetContext +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Contexts_GetContext_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_get_context(): + # Create a client + client = dialogflow_v2beta1.ContextsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetContextRequest( + name="name_value", + ) + + # Make the request + response = client.get_context(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Contexts_GetContext_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_list_contexts_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_list_contexts_async.py new file mode 100644 index 000000000000..f01d3360462e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_list_contexts_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListContexts +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Contexts_ListContexts_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_list_contexts(): + # Create a client + client = dialogflow_v2beta1.ContextsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListContextsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_contexts(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Contexts_ListContexts_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_list_contexts_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_list_contexts_sync.py new file mode 100644 index 000000000000..8cd34679ced6 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_list_contexts_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListContexts +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Contexts_ListContexts_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_list_contexts(): + # Create a client + client = dialogflow_v2beta1.ContextsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListContextsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_contexts(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Contexts_ListContexts_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_update_context_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_update_context_async.py new file mode 100644 index 000000000000..71db8805378a --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_update_context_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateContext +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Contexts_UpdateContext_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_update_context(): + # Create a client + client = dialogflow_v2beta1.ContextsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.UpdateContextRequest( + ) + + # Make the request + response = await client.update_context(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Contexts_UpdateContext_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_update_context_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_update_context_sync.py new file mode 100644 index 000000000000..f1fa717e0753 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_contexts_update_context_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateContext +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Contexts_UpdateContext_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_update_context(): + # Create a client + client = dialogflow_v2beta1.ContextsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.UpdateContextRequest( + ) + + # Make the request + response = client.update_context(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Contexts_UpdateContext_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_create_conversation_profile_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_create_conversation_profile_async.py new file mode 100644 index 000000000000..bf2917353ef5 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_create_conversation_profile_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateConversationProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_ConversationProfiles_CreateConversationProfile_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_create_conversation_profile(): + # Create a client + client = dialogflow_v2beta1.ConversationProfilesAsyncClient() + + # Initialize request argument(s) + conversation_profile = dialogflow_v2beta1.ConversationProfile() + conversation_profile.display_name = "display_name_value" + + request = dialogflow_v2beta1.CreateConversationProfileRequest( + parent="parent_value", + conversation_profile=conversation_profile, + ) + + # Make the request + response = await client.create_conversation_profile(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_ConversationProfiles_CreateConversationProfile_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_create_conversation_profile_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_create_conversation_profile_sync.py new file mode 100644 index 000000000000..a0d6bec0e64c --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_create_conversation_profile_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateConversationProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_ConversationProfiles_CreateConversationProfile_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_create_conversation_profile(): + # Create a client + client = dialogflow_v2beta1.ConversationProfilesClient() + + # Initialize request argument(s) + conversation_profile = dialogflow_v2beta1.ConversationProfile() + conversation_profile.display_name = "display_name_value" + + request = dialogflow_v2beta1.CreateConversationProfileRequest( + parent="parent_value", + conversation_profile=conversation_profile, + ) + + # Make the request + response = client.create_conversation_profile(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_ConversationProfiles_CreateConversationProfile_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_delete_conversation_profile_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_delete_conversation_profile_async.py new file mode 100644 index 000000000000..384657f4c03e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_delete_conversation_profile_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteConversationProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_ConversationProfiles_DeleteConversationProfile_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_delete_conversation_profile(): + # Create a client + client = dialogflow_v2beta1.ConversationProfilesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteConversationProfileRequest( + name="name_value", + ) + + # Make the request + await client.delete_conversation_profile(request=request) + + +# [END dialogflow_v2beta1_generated_ConversationProfiles_DeleteConversationProfile_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_delete_conversation_profile_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_delete_conversation_profile_sync.py new file mode 100644 index 000000000000..12861e13bf35 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_delete_conversation_profile_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteConversationProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_ConversationProfiles_DeleteConversationProfile_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_delete_conversation_profile(): + # Create a client + client = dialogflow_v2beta1.ConversationProfilesClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteConversationProfileRequest( + name="name_value", + ) + + # Make the request + client.delete_conversation_profile(request=request) + + +# [END dialogflow_v2beta1_generated_ConversationProfiles_DeleteConversationProfile_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_get_conversation_profile_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_get_conversation_profile_async.py new file mode 100644 index 000000000000..1e736812cd8e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_get_conversation_profile_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetConversationProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_ConversationProfiles_GetConversationProfile_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_get_conversation_profile(): + # Create a client + client = dialogflow_v2beta1.ConversationProfilesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetConversationProfileRequest( + name="name_value", + ) + + # Make the request + response = await client.get_conversation_profile(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_ConversationProfiles_GetConversationProfile_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_get_conversation_profile_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_get_conversation_profile_sync.py new file mode 100644 index 000000000000..105b529a4f43 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_get_conversation_profile_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetConversationProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_ConversationProfiles_GetConversationProfile_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_get_conversation_profile(): + # Create a client + client = dialogflow_v2beta1.ConversationProfilesClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetConversationProfileRequest( + name="name_value", + ) + + # Make the request + response = client.get_conversation_profile(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_ConversationProfiles_GetConversationProfile_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_list_conversation_profiles_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_list_conversation_profiles_async.py new file mode 100644 index 000000000000..3ac8daf3a12b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_list_conversation_profiles_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListConversationProfiles +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_ConversationProfiles_ListConversationProfiles_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_list_conversation_profiles(): + # Create a client + client = dialogflow_v2beta1.ConversationProfilesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListConversationProfilesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversation_profiles(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_ConversationProfiles_ListConversationProfiles_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_list_conversation_profiles_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_list_conversation_profiles_sync.py new file mode 100644 index 000000000000..b2aa7a4ded3b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_list_conversation_profiles_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListConversationProfiles +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_ConversationProfiles_ListConversationProfiles_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_list_conversation_profiles(): + # Create a client + client = dialogflow_v2beta1.ConversationProfilesClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListConversationProfilesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversation_profiles(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_ConversationProfiles_ListConversationProfiles_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_update_conversation_profile_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_update_conversation_profile_async.py new file mode 100644 index 000000000000..399ed21ee7b6 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_update_conversation_profile_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateConversationProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_ConversationProfiles_UpdateConversationProfile_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_update_conversation_profile(): + # Create a client + client = dialogflow_v2beta1.ConversationProfilesAsyncClient() + + # Initialize request argument(s) + conversation_profile = dialogflow_v2beta1.ConversationProfile() + conversation_profile.display_name = "display_name_value" + + request = dialogflow_v2beta1.UpdateConversationProfileRequest( + conversation_profile=conversation_profile, + ) + + # Make the request + response = await client.update_conversation_profile(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_ConversationProfiles_UpdateConversationProfile_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_update_conversation_profile_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_update_conversation_profile_sync.py new file mode 100644 index 000000000000..e6325a793119 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversation_profiles_update_conversation_profile_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateConversationProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_ConversationProfiles_UpdateConversationProfile_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_update_conversation_profile(): + # Create a client + client = dialogflow_v2beta1.ConversationProfilesClient() + + # Initialize request argument(s) + conversation_profile = dialogflow_v2beta1.ConversationProfile() + conversation_profile.display_name = "display_name_value" + + request = dialogflow_v2beta1.UpdateConversationProfileRequest( + conversation_profile=conversation_profile, + ) + + # Make the request + response = client.update_conversation_profile(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_ConversationProfiles_UpdateConversationProfile_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_batch_create_messages_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_batch_create_messages_async.py new file mode 100644 index 000000000000..77ccfaeae3b9 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_batch_create_messages_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchCreateMessages +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Conversations_BatchCreateMessages_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_batch_create_messages(): + # Create a client + client = dialogflow_v2beta1.ConversationsAsyncClient() + + # Initialize request argument(s) + requests = dialogflow_v2beta1.CreateMessageRequest() + requests.parent = "parent_value" + requests.message.content = "content_value" + + request = dialogflow_v2beta1.BatchCreateMessagesRequest( + parent="parent_value", + requests=requests, + ) + + # Make the request + response = await client.batch_create_messages(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Conversations_BatchCreateMessages_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_batch_create_messages_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_batch_create_messages_sync.py new file mode 100644 index 000000000000..1d944ff7e278 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_batch_create_messages_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchCreateMessages +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Conversations_BatchCreateMessages_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_batch_create_messages(): + # Create a client + client = dialogflow_v2beta1.ConversationsClient() + + # Initialize request argument(s) + requests = dialogflow_v2beta1.CreateMessageRequest() + requests.parent = "parent_value" + requests.message.content = "content_value" + + request = dialogflow_v2beta1.BatchCreateMessagesRequest( + parent="parent_value", + requests=requests, + ) + + # Make the request + response = client.batch_create_messages(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Conversations_BatchCreateMessages_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_complete_conversation_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_complete_conversation_async.py new file mode 100644 index 000000000000..533cc694fc0a --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_complete_conversation_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CompleteConversation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Conversations_CompleteConversation_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_complete_conversation(): + # Create a client + client = dialogflow_v2beta1.ConversationsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.CompleteConversationRequest( + name="name_value", + ) + + # Make the request + response = await client.complete_conversation(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Conversations_CompleteConversation_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_complete_conversation_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_complete_conversation_sync.py new file mode 100644 index 000000000000..f447d7c26441 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_complete_conversation_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CompleteConversation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Conversations_CompleteConversation_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_complete_conversation(): + # Create a client + client = dialogflow_v2beta1.ConversationsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.CompleteConversationRequest( + name="name_value", + ) + + # Make the request + response = client.complete_conversation(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Conversations_CompleteConversation_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_create_conversation_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_create_conversation_async.py new file mode 100644 index 000000000000..81aa334caa4f --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_create_conversation_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateConversation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Conversations_CreateConversation_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_create_conversation(): + # Create a client + client = dialogflow_v2beta1.ConversationsAsyncClient() + + # Initialize request argument(s) + conversation = dialogflow_v2beta1.Conversation() + conversation.conversation_profile = "conversation_profile_value" + + request = dialogflow_v2beta1.CreateConversationRequest( + parent="parent_value", + conversation=conversation, + ) + + # Make the request + response = await client.create_conversation(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Conversations_CreateConversation_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_create_conversation_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_create_conversation_sync.py new file mode 100644 index 000000000000..8231a5abb2b0 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_create_conversation_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateConversation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Conversations_CreateConversation_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_create_conversation(): + # Create a client + client = dialogflow_v2beta1.ConversationsClient() + + # Initialize request argument(s) + conversation = dialogflow_v2beta1.Conversation() + conversation.conversation_profile = "conversation_profile_value" + + request = dialogflow_v2beta1.CreateConversationRequest( + parent="parent_value", + conversation=conversation, + ) + + # Make the request + response = client.create_conversation(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Conversations_CreateConversation_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_get_conversation_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_get_conversation_async.py new file mode 100644 index 000000000000..4c93668dec44 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_get_conversation_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetConversation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Conversations_GetConversation_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_get_conversation(): + # Create a client + client = dialogflow_v2beta1.ConversationsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetConversationRequest( + name="name_value", + ) + + # Make the request + response = await client.get_conversation(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Conversations_GetConversation_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_get_conversation_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_get_conversation_sync.py new file mode 100644 index 000000000000..2b5dbaa7aaa1 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_get_conversation_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetConversation +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Conversations_GetConversation_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_get_conversation(): + # Create a client + client = dialogflow_v2beta1.ConversationsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetConversationRequest( + name="name_value", + ) + + # Make the request + response = client.get_conversation(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Conversations_GetConversation_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_list_conversations_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_list_conversations_async.py new file mode 100644 index 000000000000..7f0edf342f3d --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_list_conversations_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListConversations +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Conversations_ListConversations_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_list_conversations(): + # Create a client + client = dialogflow_v2beta1.ConversationsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListConversationsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversations(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Conversations_ListConversations_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_list_conversations_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_list_conversations_sync.py new file mode 100644 index 000000000000..dbd79e8a0809 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_list_conversations_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListConversations +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Conversations_ListConversations_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_list_conversations(): + # Create a client + client = dialogflow_v2beta1.ConversationsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListConversationsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_conversations(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Conversations_ListConversations_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_list_messages_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_list_messages_async.py new file mode 100644 index 000000000000..336724657f13 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_list_messages_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListMessages +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Conversations_ListMessages_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_list_messages(): + # Create a client + client = dialogflow_v2beta1.ConversationsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListMessagesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_messages(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Conversations_ListMessages_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_list_messages_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_list_messages_sync.py new file mode 100644 index 000000000000..9eeb7ad97d85 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_conversations_list_messages_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListMessages +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Conversations_ListMessages_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_list_messages(): + # Create a client + client = dialogflow_v2beta1.ConversationsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListMessagesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_messages(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Conversations_ListMessages_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_create_document_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_create_document_async.py new file mode 100644 index 000000000000..318e924f86b8 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_create_document_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Documents_CreateDocument_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_create_document(): + # Create a client + client = dialogflow_v2beta1.DocumentsAsyncClient() + + # Initialize request argument(s) + document = dialogflow_v2beta1.Document() + document.content_uri = "content_uri_value" + document.display_name = "display_name_value" + document.mime_type = "mime_type_value" + document.knowledge_types = "SMART_REPLY" + + request = dialogflow_v2beta1.CreateDocumentRequest( + parent="parent_value", + document=document, + ) + + # Make the request + operation = client.create_document(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Documents_CreateDocument_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_create_document_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_create_document_sync.py new file mode 100644 index 000000000000..e9864e930ab3 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_create_document_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Documents_CreateDocument_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_create_document(): + # Create a client + client = dialogflow_v2beta1.DocumentsClient() + + # Initialize request argument(s) + document = dialogflow_v2beta1.Document() + document.content_uri = "content_uri_value" + document.display_name = "display_name_value" + document.mime_type = "mime_type_value" + document.knowledge_types = "SMART_REPLY" + + request = dialogflow_v2beta1.CreateDocumentRequest( + parent="parent_value", + document=document, + ) + + # Make the request + operation = client.create_document(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Documents_CreateDocument_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_delete_document_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_delete_document_async.py new file mode 100644 index 000000000000..48b917cb9eec --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_delete_document_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Documents_DeleteDocument_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_delete_document(): + # Create a client + client = dialogflow_v2beta1.DocumentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteDocumentRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_document(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Documents_DeleteDocument_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_delete_document_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_delete_document_sync.py new file mode 100644 index 000000000000..1656713b30b4 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_delete_document_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Documents_DeleteDocument_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_delete_document(): + # Create a client + client = dialogflow_v2beta1.DocumentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteDocumentRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_document(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Documents_DeleteDocument_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_get_document_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_get_document_async.py new file mode 100644 index 000000000000..86c322e6f74e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_get_document_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Documents_GetDocument_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_get_document(): + # Create a client + client = dialogflow_v2beta1.DocumentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetDocumentRequest( + name="name_value", + ) + + # Make the request + response = await client.get_document(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Documents_GetDocument_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_get_document_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_get_document_sync.py new file mode 100644 index 000000000000..cdedc5f143d8 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_get_document_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Documents_GetDocument_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_get_document(): + # Create a client + client = dialogflow_v2beta1.DocumentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetDocumentRequest( + name="name_value", + ) + + # Make the request + response = client.get_document(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Documents_GetDocument_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_import_documents_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_import_documents_async.py new file mode 100644 index 000000000000..8fcf1178f80e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_import_documents_async.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ImportDocuments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Documents_ImportDocuments_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_import_documents(): + # Create a client + client = dialogflow_v2beta1.DocumentsAsyncClient() + + # Initialize request argument(s) + gcs_source = dialogflow_v2beta1.GcsSources() + gcs_source.uris = ['uris_value_1', 'uris_value_2'] + + document_template = dialogflow_v2beta1.ImportDocumentTemplate() + document_template.mime_type = "mime_type_value" + document_template.knowledge_types = "SMART_REPLY" + + request = dialogflow_v2beta1.ImportDocumentsRequest( + gcs_source=gcs_source, + parent="parent_value", + document_template=document_template, + ) + + # Make the request + operation = client.import_documents(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Documents_ImportDocuments_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_import_documents_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_import_documents_sync.py new file mode 100644 index 000000000000..4905eeaf555b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_import_documents_sync.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ImportDocuments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Documents_ImportDocuments_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_import_documents(): + # Create a client + client = dialogflow_v2beta1.DocumentsClient() + + # Initialize request argument(s) + gcs_source = dialogflow_v2beta1.GcsSources() + gcs_source.uris = ['uris_value_1', 'uris_value_2'] + + document_template = dialogflow_v2beta1.ImportDocumentTemplate() + document_template.mime_type = "mime_type_value" + document_template.knowledge_types = "SMART_REPLY" + + request = dialogflow_v2beta1.ImportDocumentsRequest( + gcs_source=gcs_source, + parent="parent_value", + document_template=document_template, + ) + + # Make the request + operation = client.import_documents(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Documents_ImportDocuments_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_list_documents_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_list_documents_async.py new file mode 100644 index 000000000000..13c19c05fbd2 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_list_documents_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListDocuments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Documents_ListDocuments_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_list_documents(): + # Create a client + client = dialogflow_v2beta1.DocumentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListDocumentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_documents(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Documents_ListDocuments_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_list_documents_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_list_documents_sync.py new file mode 100644 index 000000000000..ed50c8039f3a --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_list_documents_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListDocuments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Documents_ListDocuments_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_list_documents(): + # Create a client + client = dialogflow_v2beta1.DocumentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListDocumentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_documents(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Documents_ListDocuments_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_reload_document_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_reload_document_async.py new file mode 100644 index 000000000000..a2e392cd58e2 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_reload_document_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ReloadDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Documents_ReloadDocument_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_reload_document(): + # Create a client + client = dialogflow_v2beta1.DocumentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ReloadDocumentRequest( + name="name_value", + ) + + # Make the request + operation = client.reload_document(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Documents_ReloadDocument_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_reload_document_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_reload_document_sync.py new file mode 100644 index 000000000000..44342194ebed --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_reload_document_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ReloadDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Documents_ReloadDocument_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_reload_document(): + # Create a client + client = dialogflow_v2beta1.DocumentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ReloadDocumentRequest( + name="name_value", + ) + + # Make the request + operation = client.reload_document(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Documents_ReloadDocument_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_update_document_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_update_document_async.py new file mode 100644 index 000000000000..00007c04abce --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_update_document_async.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Documents_UpdateDocument_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_update_document(): + # Create a client + client = dialogflow_v2beta1.DocumentsAsyncClient() + + # Initialize request argument(s) + document = dialogflow_v2beta1.Document() + document.content_uri = "content_uri_value" + document.display_name = "display_name_value" + document.mime_type = "mime_type_value" + document.knowledge_types = "SMART_REPLY" + + request = dialogflow_v2beta1.UpdateDocumentRequest( + document=document, + ) + + # Make the request + operation = client.update_document(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Documents_UpdateDocument_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_update_document_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_update_document_sync.py new file mode 100644 index 000000000000..881ffd3020e4 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_documents_update_document_sync.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateDocument +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Documents_UpdateDocument_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_update_document(): + # Create a client + client = dialogflow_v2beta1.DocumentsClient() + + # Initialize request argument(s) + document = dialogflow_v2beta1.Document() + document.content_uri = "content_uri_value" + document.display_name = "display_name_value" + document.mime_type = "mime_type_value" + document.knowledge_types = "SMART_REPLY" + + request = dialogflow_v2beta1.UpdateDocumentRequest( + document=document, + ) + + # Make the request + operation = client.update_document(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Documents_UpdateDocument_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_create_entities_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_create_entities_async.py new file mode 100644 index 000000000000..bf719f6422f7 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_create_entities_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchCreateEntities +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_BatchCreateEntities_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_batch_create_entities(): + # Create a client + client = dialogflow_v2beta1.EntityTypesAsyncClient() + + # Initialize request argument(s) + entities = dialogflow_v2beta1.Entity() + entities.value = "value_value" + + request = dialogflow_v2beta1.BatchCreateEntitiesRequest( + parent="parent_value", + entities=entities, + ) + + # Make the request + operation = client.batch_create_entities(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_BatchCreateEntities_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_create_entities_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_create_entities_sync.py new file mode 100644 index 000000000000..fdc41fa55d3e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_create_entities_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchCreateEntities +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_BatchCreateEntities_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_batch_create_entities(): + # Create a client + client = dialogflow_v2beta1.EntityTypesClient() + + # Initialize request argument(s) + entities = dialogflow_v2beta1.Entity() + entities.value = "value_value" + + request = dialogflow_v2beta1.BatchCreateEntitiesRequest( + parent="parent_value", + entities=entities, + ) + + # Make the request + operation = client.batch_create_entities(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_BatchCreateEntities_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_delete_entities_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_delete_entities_async.py new file mode 100644 index 000000000000..21e6ba2af508 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_delete_entities_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchDeleteEntities +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntities_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_batch_delete_entities(): + # Create a client + client = dialogflow_v2beta1.EntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.BatchDeleteEntitiesRequest( + parent="parent_value", + entity_values=['entity_values_value_1', 'entity_values_value_2'], + ) + + # Make the request + operation = client.batch_delete_entities(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntities_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_delete_entities_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_delete_entities_sync.py new file mode 100644 index 000000000000..e772d7544b4d --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_delete_entities_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchDeleteEntities +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntities_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_batch_delete_entities(): + # Create a client + client = dialogflow_v2beta1.EntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.BatchDeleteEntitiesRequest( + parent="parent_value", + entity_values=['entity_values_value_1', 'entity_values_value_2'], + ) + + # Make the request + operation = client.batch_delete_entities(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntities_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_delete_entity_types_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_delete_entity_types_async.py new file mode 100644 index 000000000000..10cd37dd51bf --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_delete_entity_types_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchDeleteEntityTypes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntityTypes_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_batch_delete_entity_types(): + # Create a client + client = dialogflow_v2beta1.EntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.BatchDeleteEntityTypesRequest( + parent="parent_value", + entity_type_names=['entity_type_names_value_1', 'entity_type_names_value_2'], + ) + + # Make the request + operation = client.batch_delete_entity_types(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntityTypes_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_delete_entity_types_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_delete_entity_types_sync.py new file mode 100644 index 000000000000..712aeb028b01 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_delete_entity_types_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchDeleteEntityTypes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntityTypes_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_batch_delete_entity_types(): + # Create a client + client = dialogflow_v2beta1.EntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.BatchDeleteEntityTypesRequest( + parent="parent_value", + entity_type_names=['entity_type_names_value_1', 'entity_type_names_value_2'], + ) + + # Make the request + operation = client.batch_delete_entity_types(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntityTypes_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_update_entities_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_update_entities_async.py new file mode 100644 index 000000000000..c7469f9f975e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_update_entities_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchUpdateEntities +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntities_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_batch_update_entities(): + # Create a client + client = dialogflow_v2beta1.EntityTypesAsyncClient() + + # Initialize request argument(s) + entities = dialogflow_v2beta1.Entity() + entities.value = "value_value" + + request = dialogflow_v2beta1.BatchUpdateEntitiesRequest( + parent="parent_value", + entities=entities, + ) + + # Make the request + operation = client.batch_update_entities(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntities_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_update_entities_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_update_entities_sync.py new file mode 100644 index 000000000000..732fadb297ce --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_update_entities_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchUpdateEntities +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntities_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_batch_update_entities(): + # Create a client + client = dialogflow_v2beta1.EntityTypesClient() + + # Initialize request argument(s) + entities = dialogflow_v2beta1.Entity() + entities.value = "value_value" + + request = dialogflow_v2beta1.BatchUpdateEntitiesRequest( + parent="parent_value", + entities=entities, + ) + + # Make the request + operation = client.batch_update_entities(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntities_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_update_entity_types_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_update_entity_types_async.py new file mode 100644 index 000000000000..4efc694288c3 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_update_entity_types_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchUpdateEntityTypes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntityTypes_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_batch_update_entity_types(): + # Create a client + client = dialogflow_v2beta1.EntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.BatchUpdateEntityTypesRequest( + entity_type_batch_uri="entity_type_batch_uri_value", + parent="parent_value", + ) + + # Make the request + operation = client.batch_update_entity_types(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntityTypes_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_update_entity_types_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_update_entity_types_sync.py new file mode 100644 index 000000000000..4b9043e05f0c --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_batch_update_entity_types_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchUpdateEntityTypes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntityTypes_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_batch_update_entity_types(): + # Create a client + client = dialogflow_v2beta1.EntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.BatchUpdateEntityTypesRequest( + entity_type_batch_uri="entity_type_batch_uri_value", + parent="parent_value", + ) + + # Make the request + operation = client.batch_update_entity_types(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntityTypes_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_create_entity_type_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_create_entity_type_async.py new file mode 100644 index 000000000000..fa4e46dc040b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_create_entity_type_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_CreateEntityType_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_create_entity_type(): + # Create a client + client = dialogflow_v2beta1.EntityTypesAsyncClient() + + # Initialize request argument(s) + entity_type = dialogflow_v2beta1.EntityType() + entity_type.display_name = "display_name_value" + entity_type.kind = "KIND_REGEXP" + + request = dialogflow_v2beta1.CreateEntityTypeRequest( + parent="parent_value", + entity_type=entity_type, + ) + + # Make the request + response = await client.create_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_CreateEntityType_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_create_entity_type_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_create_entity_type_sync.py new file mode 100644 index 000000000000..ea60fce689d2 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_create_entity_type_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_CreateEntityType_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_create_entity_type(): + # Create a client + client = dialogflow_v2beta1.EntityTypesClient() + + # Initialize request argument(s) + entity_type = dialogflow_v2beta1.EntityType() + entity_type.display_name = "display_name_value" + entity_type.kind = "KIND_REGEXP" + + request = dialogflow_v2beta1.CreateEntityTypeRequest( + parent="parent_value", + entity_type=entity_type, + ) + + # Make the request + response = client.create_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_CreateEntityType_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_delete_entity_type_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_delete_entity_type_async.py new file mode 100644 index 000000000000..45f38f8a7a74 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_delete_entity_type_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_DeleteEntityType_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_delete_entity_type(): + # Create a client + client = dialogflow_v2beta1.EntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteEntityTypeRequest( + name="name_value", + ) + + # Make the request + await client.delete_entity_type(request=request) + + +# [END dialogflow_v2beta1_generated_EntityTypes_DeleteEntityType_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_delete_entity_type_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_delete_entity_type_sync.py new file mode 100644 index 000000000000..8d3a5e2c4c90 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_delete_entity_type_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_DeleteEntityType_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_delete_entity_type(): + # Create a client + client = dialogflow_v2beta1.EntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteEntityTypeRequest( + name="name_value", + ) + + # Make the request + client.delete_entity_type(request=request) + + +# [END dialogflow_v2beta1_generated_EntityTypes_DeleteEntityType_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_get_entity_type_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_get_entity_type_async.py new file mode 100644 index 000000000000..b8ed3206e98a --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_get_entity_type_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_GetEntityType_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_get_entity_type(): + # Create a client + client = dialogflow_v2beta1.EntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetEntityTypeRequest( + name="name_value", + ) + + # Make the request + response = await client.get_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_GetEntityType_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_get_entity_type_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_get_entity_type_sync.py new file mode 100644 index 000000000000..304b41c92768 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_get_entity_type_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_GetEntityType_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_get_entity_type(): + # Create a client + client = dialogflow_v2beta1.EntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetEntityTypeRequest( + name="name_value", + ) + + # Make the request + response = client.get_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_GetEntityType_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_list_entity_types_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_list_entity_types_async.py new file mode 100644 index 000000000000..0109d87b4bf5 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_list_entity_types_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListEntityTypes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_ListEntityTypes_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_list_entity_types(): + # Create a client + client = dialogflow_v2beta1.EntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListEntityTypesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_entity_types(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_ListEntityTypes_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_list_entity_types_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_list_entity_types_sync.py new file mode 100644 index 000000000000..3da8154f80df --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_list_entity_types_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListEntityTypes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_ListEntityTypes_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_list_entity_types(): + # Create a client + client = dialogflow_v2beta1.EntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListEntityTypesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_entity_types(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_ListEntityTypes_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_update_entity_type_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_update_entity_type_async.py new file mode 100644 index 000000000000..57fd11147545 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_update_entity_type_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_UpdateEntityType_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_update_entity_type(): + # Create a client + client = dialogflow_v2beta1.EntityTypesAsyncClient() + + # Initialize request argument(s) + entity_type = dialogflow_v2beta1.EntityType() + entity_type.display_name = "display_name_value" + entity_type.kind = "KIND_REGEXP" + + request = dialogflow_v2beta1.UpdateEntityTypeRequest( + entity_type=entity_type, + ) + + # Make the request + response = await client.update_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_UpdateEntityType_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_update_entity_type_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_update_entity_type_sync.py new file mode 100644 index 000000000000..40b2c2137789 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_entity_types_update_entity_type_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_EntityTypes_UpdateEntityType_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_update_entity_type(): + # Create a client + client = dialogflow_v2beta1.EntityTypesClient() + + # Initialize request argument(s) + entity_type = dialogflow_v2beta1.EntityType() + entity_type.display_name = "display_name_value" + entity_type.kind = "KIND_REGEXP" + + request = dialogflow_v2beta1.UpdateEntityTypeRequest( + entity_type=entity_type, + ) + + # Make the request + response = client.update_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_EntityTypes_UpdateEntityType_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_create_environment_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_create_environment_async.py new file mode 100644 index 000000000000..df677f15a307 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_create_environment_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateEnvironment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Environments_CreateEnvironment_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_create_environment(): + # Create a client + client = dialogflow_v2beta1.EnvironmentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.CreateEnvironmentRequest( + parent="parent_value", + environment_id="environment_id_value", + ) + + # Make the request + response = await client.create_environment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Environments_CreateEnvironment_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_create_environment_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_create_environment_sync.py new file mode 100644 index 000000000000..74ea62393359 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_create_environment_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateEnvironment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Environments_CreateEnvironment_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_create_environment(): + # Create a client + client = dialogflow_v2beta1.EnvironmentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.CreateEnvironmentRequest( + parent="parent_value", + environment_id="environment_id_value", + ) + + # Make the request + response = client.create_environment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Environments_CreateEnvironment_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_delete_environment_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_delete_environment_async.py new file mode 100644 index 000000000000..9585af009be4 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_delete_environment_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteEnvironment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Environments_DeleteEnvironment_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_delete_environment(): + # Create a client + client = dialogflow_v2beta1.EnvironmentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteEnvironmentRequest( + name="name_value", + ) + + # Make the request + await client.delete_environment(request=request) + + +# [END dialogflow_v2beta1_generated_Environments_DeleteEnvironment_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_delete_environment_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_delete_environment_sync.py new file mode 100644 index 000000000000..1960336e3f54 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_delete_environment_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteEnvironment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Environments_DeleteEnvironment_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_delete_environment(): + # Create a client + client = dialogflow_v2beta1.EnvironmentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteEnvironmentRequest( + name="name_value", + ) + + # Make the request + client.delete_environment(request=request) + + +# [END dialogflow_v2beta1_generated_Environments_DeleteEnvironment_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_get_environment_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_get_environment_async.py new file mode 100644 index 000000000000..ad8fd85b4179 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_get_environment_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetEnvironment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Environments_GetEnvironment_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_get_environment(): + # Create a client + client = dialogflow_v2beta1.EnvironmentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetEnvironmentRequest( + name="name_value", + ) + + # Make the request + response = await client.get_environment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Environments_GetEnvironment_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_get_environment_history_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_get_environment_history_async.py new file mode 100644 index 000000000000..2dfd49d18c74 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_get_environment_history_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetEnvironmentHistory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Environments_GetEnvironmentHistory_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_get_environment_history(): + # Create a client + client = dialogflow_v2beta1.EnvironmentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetEnvironmentHistoryRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.get_environment_history(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Environments_GetEnvironmentHistory_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_get_environment_history_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_get_environment_history_sync.py new file mode 100644 index 000000000000..d3679e5eff25 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_get_environment_history_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetEnvironmentHistory +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Environments_GetEnvironmentHistory_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_get_environment_history(): + # Create a client + client = dialogflow_v2beta1.EnvironmentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetEnvironmentHistoryRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.get_environment_history(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Environments_GetEnvironmentHistory_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_get_environment_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_get_environment_sync.py new file mode 100644 index 000000000000..b4c0e84c040d --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_get_environment_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetEnvironment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Environments_GetEnvironment_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_get_environment(): + # Create a client + client = dialogflow_v2beta1.EnvironmentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetEnvironmentRequest( + name="name_value", + ) + + # Make the request + response = client.get_environment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Environments_GetEnvironment_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_list_environments_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_list_environments_async.py new file mode 100644 index 000000000000..664e92ab80d0 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_list_environments_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListEnvironments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Environments_ListEnvironments_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_list_environments(): + # Create a client + client = dialogflow_v2beta1.EnvironmentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListEnvironmentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_environments(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Environments_ListEnvironments_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_list_environments_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_list_environments_sync.py new file mode 100644 index 000000000000..da35bf05c063 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_list_environments_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListEnvironments +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Environments_ListEnvironments_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_list_environments(): + # Create a client + client = dialogflow_v2beta1.EnvironmentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListEnvironmentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_environments(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Environments_ListEnvironments_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_update_environment_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_update_environment_async.py new file mode 100644 index 000000000000..f555064e2dd7 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_update_environment_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateEnvironment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Environments_UpdateEnvironment_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_update_environment(): + # Create a client + client = dialogflow_v2beta1.EnvironmentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.UpdateEnvironmentRequest( + ) + + # Make the request + response = await client.update_environment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Environments_UpdateEnvironment_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_update_environment_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_update_environment_sync.py new file mode 100644 index 000000000000..c4996f9469a0 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_environments_update_environment_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateEnvironment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Environments_UpdateEnvironment_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_update_environment(): + # Create a client + client = dialogflow_v2beta1.EnvironmentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.UpdateEnvironmentRequest( + ) + + # Make the request + response = client.update_environment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Environments_UpdateEnvironment_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_fulfillments_get_fulfillment_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_fulfillments_get_fulfillment_async.py new file mode 100644 index 000000000000..99d992444037 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_fulfillments_get_fulfillment_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetFulfillment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Fulfillments_GetFulfillment_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_get_fulfillment(): + # Create a client + client = dialogflow_v2beta1.FulfillmentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetFulfillmentRequest( + name="name_value", + ) + + # Make the request + response = await client.get_fulfillment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Fulfillments_GetFulfillment_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_fulfillments_get_fulfillment_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_fulfillments_get_fulfillment_sync.py new file mode 100644 index 000000000000..137a231e0085 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_fulfillments_get_fulfillment_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetFulfillment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Fulfillments_GetFulfillment_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_get_fulfillment(): + # Create a client + client = dialogflow_v2beta1.FulfillmentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetFulfillmentRequest( + name="name_value", + ) + + # Make the request + response = client.get_fulfillment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Fulfillments_GetFulfillment_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_fulfillments_update_fulfillment_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_fulfillments_update_fulfillment_async.py new file mode 100644 index 000000000000..2b782e0b46d0 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_fulfillments_update_fulfillment_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateFulfillment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Fulfillments_UpdateFulfillment_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_update_fulfillment(): + # Create a client + client = dialogflow_v2beta1.FulfillmentsAsyncClient() + + # Initialize request argument(s) + fulfillment = dialogflow_v2beta1.Fulfillment() + fulfillment.generic_web_service.uri = "uri_value" + fulfillment.name = "name_value" + + request = dialogflow_v2beta1.UpdateFulfillmentRequest( + fulfillment=fulfillment, + ) + + # Make the request + response = await client.update_fulfillment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Fulfillments_UpdateFulfillment_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_fulfillments_update_fulfillment_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_fulfillments_update_fulfillment_sync.py new file mode 100644 index 000000000000..2669c9cda768 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_fulfillments_update_fulfillment_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateFulfillment +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Fulfillments_UpdateFulfillment_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_update_fulfillment(): + # Create a client + client = dialogflow_v2beta1.FulfillmentsClient() + + # Initialize request argument(s) + fulfillment = dialogflow_v2beta1.Fulfillment() + fulfillment.generic_web_service.uri = "uri_value" + fulfillment.name = "name_value" + + request = dialogflow_v2beta1.UpdateFulfillmentRequest( + fulfillment=fulfillment, + ) + + # Make the request + response = client.update_fulfillment(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Fulfillments_UpdateFulfillment_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_batch_delete_intents_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_batch_delete_intents_async.py new file mode 100644 index 000000000000..5906135f6e4e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_batch_delete_intents_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchDeleteIntents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Intents_BatchDeleteIntents_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_batch_delete_intents(): + # Create a client + client = dialogflow_v2beta1.IntentsAsyncClient() + + # Initialize request argument(s) + intents = dialogflow_v2beta1.Intent() + intents.display_name = "display_name_value" + + request = dialogflow_v2beta1.BatchDeleteIntentsRequest( + parent="parent_value", + intents=intents, + ) + + # Make the request + operation = client.batch_delete_intents(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Intents_BatchDeleteIntents_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_batch_delete_intents_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_batch_delete_intents_sync.py new file mode 100644 index 000000000000..12e5471870f2 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_batch_delete_intents_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchDeleteIntents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Intents_BatchDeleteIntents_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_batch_delete_intents(): + # Create a client + client = dialogflow_v2beta1.IntentsClient() + + # Initialize request argument(s) + intents = dialogflow_v2beta1.Intent() + intents.display_name = "display_name_value" + + request = dialogflow_v2beta1.BatchDeleteIntentsRequest( + parent="parent_value", + intents=intents, + ) + + # Make the request + operation = client.batch_delete_intents(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Intents_BatchDeleteIntents_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_batch_update_intents_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_batch_update_intents_async.py new file mode 100644 index 000000000000..d509f6cfa08f --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_batch_update_intents_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchUpdateIntents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Intents_BatchUpdateIntents_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_batch_update_intents(): + # Create a client + client = dialogflow_v2beta1.IntentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.BatchUpdateIntentsRequest( + intent_batch_uri="intent_batch_uri_value", + parent="parent_value", + ) + + # Make the request + operation = client.batch_update_intents(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Intents_BatchUpdateIntents_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_batch_update_intents_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_batch_update_intents_sync.py new file mode 100644 index 000000000000..ac3cb5a252be --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_batch_update_intents_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchUpdateIntents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Intents_BatchUpdateIntents_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_batch_update_intents(): + # Create a client + client = dialogflow_v2beta1.IntentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.BatchUpdateIntentsRequest( + intent_batch_uri="intent_batch_uri_value", + parent="parent_value", + ) + + # Make the request + operation = client.batch_update_intents(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Intents_BatchUpdateIntents_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_create_intent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_create_intent_async.py new file mode 100644 index 000000000000..12e004f252d8 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_create_intent_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Intents_CreateIntent_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_create_intent(): + # Create a client + client = dialogflow_v2beta1.IntentsAsyncClient() + + # Initialize request argument(s) + intent = dialogflow_v2beta1.Intent() + intent.display_name = "display_name_value" + + request = dialogflow_v2beta1.CreateIntentRequest( + parent="parent_value", + intent=intent, + ) + + # Make the request + response = await client.create_intent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Intents_CreateIntent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_create_intent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_create_intent_sync.py new file mode 100644 index 000000000000..3985efd5a7d8 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_create_intent_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Intents_CreateIntent_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_create_intent(): + # Create a client + client = dialogflow_v2beta1.IntentsClient() + + # Initialize request argument(s) + intent = dialogflow_v2beta1.Intent() + intent.display_name = "display_name_value" + + request = dialogflow_v2beta1.CreateIntentRequest( + parent="parent_value", + intent=intent, + ) + + # Make the request + response = client.create_intent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Intents_CreateIntent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_delete_intent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_delete_intent_async.py new file mode 100644 index 000000000000..1861f0faa0de --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_delete_intent_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Intents_DeleteIntent_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_delete_intent(): + # Create a client + client = dialogflow_v2beta1.IntentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteIntentRequest( + name="name_value", + ) + + # Make the request + await client.delete_intent(request=request) + + +# [END dialogflow_v2beta1_generated_Intents_DeleteIntent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_delete_intent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_delete_intent_sync.py new file mode 100644 index 000000000000..c1a31b086f15 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_delete_intent_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Intents_DeleteIntent_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_delete_intent(): + # Create a client + client = dialogflow_v2beta1.IntentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteIntentRequest( + name="name_value", + ) + + # Make the request + client.delete_intent(request=request) + + +# [END dialogflow_v2beta1_generated_Intents_DeleteIntent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_get_intent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_get_intent_async.py new file mode 100644 index 000000000000..8bf7afe50876 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_get_intent_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Intents_GetIntent_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_get_intent(): + # Create a client + client = dialogflow_v2beta1.IntentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetIntentRequest( + name="name_value", + ) + + # Make the request + response = await client.get_intent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Intents_GetIntent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_get_intent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_get_intent_sync.py new file mode 100644 index 000000000000..5e40161ae71e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_get_intent_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Intents_GetIntent_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_get_intent(): + # Create a client + client = dialogflow_v2beta1.IntentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetIntentRequest( + name="name_value", + ) + + # Make the request + response = client.get_intent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Intents_GetIntent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_list_intents_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_list_intents_async.py new file mode 100644 index 000000000000..5cf051a88efa --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_list_intents_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListIntents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Intents_ListIntents_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_list_intents(): + # Create a client + client = dialogflow_v2beta1.IntentsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListIntentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_intents(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Intents_ListIntents_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_list_intents_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_list_intents_sync.py new file mode 100644 index 000000000000..0372e2887c00 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_list_intents_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListIntents +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Intents_ListIntents_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_list_intents(): + # Create a client + client = dialogflow_v2beta1.IntentsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListIntentsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_intents(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Intents_ListIntents_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_update_intent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_update_intent_async.py new file mode 100644 index 000000000000..c4d544cadb42 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_update_intent_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Intents_UpdateIntent_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_update_intent(): + # Create a client + client = dialogflow_v2beta1.IntentsAsyncClient() + + # Initialize request argument(s) + intent = dialogflow_v2beta1.Intent() + intent.display_name = "display_name_value" + + request = dialogflow_v2beta1.UpdateIntentRequest( + intent=intent, + ) + + # Make the request + response = await client.update_intent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Intents_UpdateIntent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_update_intent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_update_intent_sync.py new file mode 100644 index 000000000000..5b96bca6fbd5 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_intents_update_intent_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Intents_UpdateIntent_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_update_intent(): + # Create a client + client = dialogflow_v2beta1.IntentsClient() + + # Initialize request argument(s) + intent = dialogflow_v2beta1.Intent() + intent.display_name = "display_name_value" + + request = dialogflow_v2beta1.UpdateIntentRequest( + intent=intent, + ) + + # Make the request + response = client.update_intent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Intents_UpdateIntent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_create_knowledge_base_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_create_knowledge_base_async.py new file mode 100644 index 000000000000..5cdc435c44e7 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_create_knowledge_base_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateKnowledgeBase +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_KnowledgeBases_CreateKnowledgeBase_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_create_knowledge_base(): + # Create a client + client = dialogflow_v2beta1.KnowledgeBasesAsyncClient() + + # Initialize request argument(s) + knowledge_base = dialogflow_v2beta1.KnowledgeBase() + knowledge_base.display_name = "display_name_value" + + request = dialogflow_v2beta1.CreateKnowledgeBaseRequest( + parent="parent_value", + knowledge_base=knowledge_base, + ) + + # Make the request + response = await client.create_knowledge_base(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_KnowledgeBases_CreateKnowledgeBase_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_create_knowledge_base_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_create_knowledge_base_sync.py new file mode 100644 index 000000000000..88640260baaa --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_create_knowledge_base_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateKnowledgeBase +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_KnowledgeBases_CreateKnowledgeBase_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_create_knowledge_base(): + # Create a client + client = dialogflow_v2beta1.KnowledgeBasesClient() + + # Initialize request argument(s) + knowledge_base = dialogflow_v2beta1.KnowledgeBase() + knowledge_base.display_name = "display_name_value" + + request = dialogflow_v2beta1.CreateKnowledgeBaseRequest( + parent="parent_value", + knowledge_base=knowledge_base, + ) + + # Make the request + response = client.create_knowledge_base(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_KnowledgeBases_CreateKnowledgeBase_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_delete_knowledge_base_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_delete_knowledge_base_async.py new file mode 100644 index 000000000000..e0d6ae0df321 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_delete_knowledge_base_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteKnowledgeBase +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_KnowledgeBases_DeleteKnowledgeBase_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_delete_knowledge_base(): + # Create a client + client = dialogflow_v2beta1.KnowledgeBasesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteKnowledgeBaseRequest( + name="name_value", + ) + + # Make the request + await client.delete_knowledge_base(request=request) + + +# [END dialogflow_v2beta1_generated_KnowledgeBases_DeleteKnowledgeBase_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_delete_knowledge_base_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_delete_knowledge_base_sync.py new file mode 100644 index 000000000000..4fcffbdf61ab --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_delete_knowledge_base_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteKnowledgeBase +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_KnowledgeBases_DeleteKnowledgeBase_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_delete_knowledge_base(): + # Create a client + client = dialogflow_v2beta1.KnowledgeBasesClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteKnowledgeBaseRequest( + name="name_value", + ) + + # Make the request + client.delete_knowledge_base(request=request) + + +# [END dialogflow_v2beta1_generated_KnowledgeBases_DeleteKnowledgeBase_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_get_knowledge_base_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_get_knowledge_base_async.py new file mode 100644 index 000000000000..dd6d3795bf2b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_get_knowledge_base_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetKnowledgeBase +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_KnowledgeBases_GetKnowledgeBase_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_get_knowledge_base(): + # Create a client + client = dialogflow_v2beta1.KnowledgeBasesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetKnowledgeBaseRequest( + name="name_value", + ) + + # Make the request + response = await client.get_knowledge_base(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_KnowledgeBases_GetKnowledgeBase_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_get_knowledge_base_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_get_knowledge_base_sync.py new file mode 100644 index 000000000000..d68c1de4f5ec --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_get_knowledge_base_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetKnowledgeBase +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_KnowledgeBases_GetKnowledgeBase_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_get_knowledge_base(): + # Create a client + client = dialogflow_v2beta1.KnowledgeBasesClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetKnowledgeBaseRequest( + name="name_value", + ) + + # Make the request + response = client.get_knowledge_base(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_KnowledgeBases_GetKnowledgeBase_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_list_knowledge_bases_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_list_knowledge_bases_async.py new file mode 100644 index 000000000000..80a331b81129 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_list_knowledge_bases_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListKnowledgeBases +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_KnowledgeBases_ListKnowledgeBases_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_list_knowledge_bases(): + # Create a client + client = dialogflow_v2beta1.KnowledgeBasesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListKnowledgeBasesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_knowledge_bases(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_KnowledgeBases_ListKnowledgeBases_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_list_knowledge_bases_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_list_knowledge_bases_sync.py new file mode 100644 index 000000000000..b99a7711905b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_list_knowledge_bases_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListKnowledgeBases +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_KnowledgeBases_ListKnowledgeBases_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_list_knowledge_bases(): + # Create a client + client = dialogflow_v2beta1.KnowledgeBasesClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListKnowledgeBasesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_knowledge_bases(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_KnowledgeBases_ListKnowledgeBases_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_update_knowledge_base_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_update_knowledge_base_async.py new file mode 100644 index 000000000000..1cbf4da59d32 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_update_knowledge_base_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateKnowledgeBase +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_KnowledgeBases_UpdateKnowledgeBase_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_update_knowledge_base(): + # Create a client + client = dialogflow_v2beta1.KnowledgeBasesAsyncClient() + + # Initialize request argument(s) + knowledge_base = dialogflow_v2beta1.KnowledgeBase() + knowledge_base.display_name = "display_name_value" + + request = dialogflow_v2beta1.UpdateKnowledgeBaseRequest( + knowledge_base=knowledge_base, + ) + + # Make the request + response = await client.update_knowledge_base(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_KnowledgeBases_UpdateKnowledgeBase_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_update_knowledge_base_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_update_knowledge_base_sync.py new file mode 100644 index 000000000000..2756317e7646 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_knowledge_bases_update_knowledge_base_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateKnowledgeBase +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_KnowledgeBases_UpdateKnowledgeBase_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_update_knowledge_base(): + # Create a client + client = dialogflow_v2beta1.KnowledgeBasesClient() + + # Initialize request argument(s) + knowledge_base = dialogflow_v2beta1.KnowledgeBase() + knowledge_base.display_name = "display_name_value" + + request = dialogflow_v2beta1.UpdateKnowledgeBaseRequest( + knowledge_base=knowledge_base, + ) + + # Make the request + response = client.update_knowledge_base(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_KnowledgeBases_UpdateKnowledgeBase_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_analyze_content_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_analyze_content_async.py new file mode 100644 index 000000000000..0fcf97261482 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_analyze_content_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnalyzeContent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_AnalyzeContent_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_analyze_content(): + # Create a client + client = dialogflow_v2beta1.ParticipantsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.AnalyzeContentRequest( + participant="participant_value", + ) + + # Make the request + response = await client.analyze_content(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Participants_AnalyzeContent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_analyze_content_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_analyze_content_sync.py new file mode 100644 index 000000000000..ddf1f72e32e2 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_analyze_content_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnalyzeContent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_AnalyzeContent_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_analyze_content(): + # Create a client + client = dialogflow_v2beta1.ParticipantsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.AnalyzeContentRequest( + participant="participant_value", + ) + + # Make the request + response = client.analyze_content(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Participants_AnalyzeContent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_compile_suggestion_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_compile_suggestion_async.py new file mode 100644 index 000000000000..88f4e42a8e05 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_compile_suggestion_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CompileSuggestion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_CompileSuggestion_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_compile_suggestion(): + # Create a client + client = dialogflow_v2beta1.ParticipantsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.CompileSuggestionRequest( + ) + + # Make the request + response = await client.compile_suggestion(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Participants_CompileSuggestion_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_compile_suggestion_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_compile_suggestion_sync.py new file mode 100644 index 000000000000..4ed8e046f546 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_compile_suggestion_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CompileSuggestion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_CompileSuggestion_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_compile_suggestion(): + # Create a client + client = dialogflow_v2beta1.ParticipantsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.CompileSuggestionRequest( + ) + + # Make the request + response = client.compile_suggestion(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Participants_CompileSuggestion_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_create_participant_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_create_participant_async.py new file mode 100644 index 000000000000..b3baaca70077 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_create_participant_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateParticipant +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_CreateParticipant_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_create_participant(): + # Create a client + client = dialogflow_v2beta1.ParticipantsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.CreateParticipantRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_participant(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Participants_CreateParticipant_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_create_participant_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_create_participant_sync.py new file mode 100644 index 000000000000..03bd2e98dbe2 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_create_participant_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateParticipant +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_CreateParticipant_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_create_participant(): + # Create a client + client = dialogflow_v2beta1.ParticipantsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.CreateParticipantRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_participant(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Participants_CreateParticipant_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_get_participant_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_get_participant_async.py new file mode 100644 index 000000000000..aa50976989ea --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_get_participant_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetParticipant +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_GetParticipant_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_get_participant(): + # Create a client + client = dialogflow_v2beta1.ParticipantsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetParticipantRequest( + name="name_value", + ) + + # Make the request + response = await client.get_participant(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Participants_GetParticipant_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_get_participant_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_get_participant_sync.py new file mode 100644 index 000000000000..ff7bc549e79c --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_get_participant_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetParticipant +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_GetParticipant_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_get_participant(): + # Create a client + client = dialogflow_v2beta1.ParticipantsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetParticipantRequest( + name="name_value", + ) + + # Make the request + response = client.get_participant(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Participants_GetParticipant_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_list_participants_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_list_participants_async.py new file mode 100644 index 000000000000..7d7301e53b73 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_list_participants_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListParticipants +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_ListParticipants_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_list_participants(): + # Create a client + client = dialogflow_v2beta1.ParticipantsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListParticipantsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_participants(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Participants_ListParticipants_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_list_participants_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_list_participants_sync.py new file mode 100644 index 000000000000..855054d07ac7 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_list_participants_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListParticipants +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_ListParticipants_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_list_participants(): + # Create a client + client = dialogflow_v2beta1.ParticipantsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListParticipantsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_participants(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Participants_ListParticipants_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_list_suggestions_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_list_suggestions_async.py new file mode 100644 index 000000000000..d22b1cdfe46e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_list_suggestions_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListSuggestions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_ListSuggestions_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_list_suggestions(): + # Create a client + client = dialogflow_v2beta1.ParticipantsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListSuggestionsRequest( + ) + + # Make the request + page_result = client.list_suggestions(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Participants_ListSuggestions_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_list_suggestions_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_list_suggestions_sync.py new file mode 100644 index 000000000000..6dd34c8be9e7 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_list_suggestions_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListSuggestions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_ListSuggestions_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_list_suggestions(): + # Create a client + client = dialogflow_v2beta1.ParticipantsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListSuggestionsRequest( + ) + + # Make the request + page_result = client.list_suggestions(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Participants_ListSuggestions_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_articles_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_articles_async.py new file mode 100644 index 000000000000..b735b7f5dff5 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_articles_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SuggestArticles +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_SuggestArticles_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_suggest_articles(): + # Create a client + client = dialogflow_v2beta1.ParticipantsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.SuggestArticlesRequest( + parent="parent_value", + ) + + # Make the request + response = await client.suggest_articles(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Participants_SuggestArticles_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_articles_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_articles_sync.py new file mode 100644 index 000000000000..1c4dda6eb277 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_articles_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SuggestArticles +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_SuggestArticles_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_suggest_articles(): + # Create a client + client = dialogflow_v2beta1.ParticipantsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.SuggestArticlesRequest( + parent="parent_value", + ) + + # Make the request + response = client.suggest_articles(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Participants_SuggestArticles_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_faq_answers_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_faq_answers_async.py new file mode 100644 index 000000000000..fb8f22aa9095 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_faq_answers_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SuggestFaqAnswers +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_SuggestFaqAnswers_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_suggest_faq_answers(): + # Create a client + client = dialogflow_v2beta1.ParticipantsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.SuggestFaqAnswersRequest( + parent="parent_value", + ) + + # Make the request + response = await client.suggest_faq_answers(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Participants_SuggestFaqAnswers_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_faq_answers_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_faq_answers_sync.py new file mode 100644 index 000000000000..1efd87cc5344 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_faq_answers_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SuggestFaqAnswers +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_SuggestFaqAnswers_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_suggest_faq_answers(): + # Create a client + client = dialogflow_v2beta1.ParticipantsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.SuggestFaqAnswersRequest( + parent="parent_value", + ) + + # Make the request + response = client.suggest_faq_answers(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Participants_SuggestFaqAnswers_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_smart_replies_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_smart_replies_async.py new file mode 100644 index 000000000000..fab0c00699b4 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_smart_replies_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SuggestSmartReplies +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_SuggestSmartReplies_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_suggest_smart_replies(): + # Create a client + client = dialogflow_v2beta1.ParticipantsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.SuggestSmartRepliesRequest( + parent="parent_value", + ) + + # Make the request + response = await client.suggest_smart_replies(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Participants_SuggestSmartReplies_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_smart_replies_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_smart_replies_sync.py new file mode 100644 index 000000000000..2ca8d81721c8 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_suggest_smart_replies_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SuggestSmartReplies +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_SuggestSmartReplies_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_suggest_smart_replies(): + # Create a client + client = dialogflow_v2beta1.ParticipantsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.SuggestSmartRepliesRequest( + parent="parent_value", + ) + + # Make the request + response = client.suggest_smart_replies(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Participants_SuggestSmartReplies_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_update_participant_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_update_participant_async.py new file mode 100644 index 000000000000..fff4927c8477 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_update_participant_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateParticipant +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_UpdateParticipant_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_update_participant(): + # Create a client + client = dialogflow_v2beta1.ParticipantsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.UpdateParticipantRequest( + ) + + # Make the request + response = await client.update_participant(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Participants_UpdateParticipant_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_update_participant_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_update_participant_sync.py new file mode 100644 index 000000000000..ecd0ea3f9938 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_participants_update_participant_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateParticipant +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Participants_UpdateParticipant_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_update_participant(): + # Create a client + client = dialogflow_v2beta1.ParticipantsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.UpdateParticipantRequest( + ) + + # Make the request + response = client.update_participant(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Participants_UpdateParticipant_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_create_session_entity_type_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_create_session_entity_type_async.py new file mode 100644 index 000000000000..cf530503384b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_create_session_entity_type_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateSessionEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_SessionEntityTypes_CreateSessionEntityType_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_create_session_entity_type(): + # Create a client + client = dialogflow_v2beta1.SessionEntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.CreateSessionEntityTypeRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_session_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_SessionEntityTypes_CreateSessionEntityType_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_create_session_entity_type_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_create_session_entity_type_sync.py new file mode 100644 index 000000000000..b76969b04414 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_create_session_entity_type_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateSessionEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_SessionEntityTypes_CreateSessionEntityType_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_create_session_entity_type(): + # Create a client + client = dialogflow_v2beta1.SessionEntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.CreateSessionEntityTypeRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_session_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_SessionEntityTypes_CreateSessionEntityType_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_delete_session_entity_type_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_delete_session_entity_type_async.py new file mode 100644 index 000000000000..4ddc40ea41b5 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_delete_session_entity_type_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteSessionEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_SessionEntityTypes_DeleteSessionEntityType_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_delete_session_entity_type(): + # Create a client + client = dialogflow_v2beta1.SessionEntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteSessionEntityTypeRequest( + name="name_value", + ) + + # Make the request + await client.delete_session_entity_type(request=request) + + +# [END dialogflow_v2beta1_generated_SessionEntityTypes_DeleteSessionEntityType_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_delete_session_entity_type_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_delete_session_entity_type_sync.py new file mode 100644 index 000000000000..785dba003c54 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_delete_session_entity_type_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteSessionEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_SessionEntityTypes_DeleteSessionEntityType_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_delete_session_entity_type(): + # Create a client + client = dialogflow_v2beta1.SessionEntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteSessionEntityTypeRequest( + name="name_value", + ) + + # Make the request + client.delete_session_entity_type(request=request) + + +# [END dialogflow_v2beta1_generated_SessionEntityTypes_DeleteSessionEntityType_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_get_session_entity_type_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_get_session_entity_type_async.py new file mode 100644 index 000000000000..1d4a9ada62ff --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_get_session_entity_type_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSessionEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_SessionEntityTypes_GetSessionEntityType_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_get_session_entity_type(): + # Create a client + client = dialogflow_v2beta1.SessionEntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetSessionEntityTypeRequest( + name="name_value", + ) + + # Make the request + response = await client.get_session_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_SessionEntityTypes_GetSessionEntityType_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_get_session_entity_type_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_get_session_entity_type_sync.py new file mode 100644 index 000000000000..6bc0325e555e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_get_session_entity_type_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSessionEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_SessionEntityTypes_GetSessionEntityType_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_get_session_entity_type(): + # Create a client + client = dialogflow_v2beta1.SessionEntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetSessionEntityTypeRequest( + name="name_value", + ) + + # Make the request + response = client.get_session_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_SessionEntityTypes_GetSessionEntityType_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_list_session_entity_types_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_list_session_entity_types_async.py new file mode 100644 index 000000000000..5f8ba1ccf950 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_list_session_entity_types_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListSessionEntityTypes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_SessionEntityTypes_ListSessionEntityTypes_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_list_session_entity_types(): + # Create a client + client = dialogflow_v2beta1.SessionEntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListSessionEntityTypesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_session_entity_types(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_SessionEntityTypes_ListSessionEntityTypes_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_list_session_entity_types_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_list_session_entity_types_sync.py new file mode 100644 index 000000000000..7f5872ac424f --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_list_session_entity_types_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListSessionEntityTypes +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_SessionEntityTypes_ListSessionEntityTypes_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_list_session_entity_types(): + # Create a client + client = dialogflow_v2beta1.SessionEntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListSessionEntityTypesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_session_entity_types(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_SessionEntityTypes_ListSessionEntityTypes_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_update_session_entity_type_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_update_session_entity_type_async.py new file mode 100644 index 000000000000..dfa13e9c25ac --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_update_session_entity_type_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateSessionEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_SessionEntityTypes_UpdateSessionEntityType_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_update_session_entity_type(): + # Create a client + client = dialogflow_v2beta1.SessionEntityTypesAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.UpdateSessionEntityTypeRequest( + ) + + # Make the request + response = await client.update_session_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_SessionEntityTypes_UpdateSessionEntityType_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_update_session_entity_type_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_update_session_entity_type_sync.py new file mode 100644 index 000000000000..6875cde15b8f --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_session_entity_types_update_session_entity_type_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateSessionEntityType +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_SessionEntityTypes_UpdateSessionEntityType_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_update_session_entity_type(): + # Create a client + client = dialogflow_v2beta1.SessionEntityTypesClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.UpdateSessionEntityTypeRequest( + ) + + # Make the request + response = client.update_session_entity_type(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_SessionEntityTypes_UpdateSessionEntityType_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_sessions_detect_intent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_sessions_detect_intent_async.py new file mode 100644 index 000000000000..732b5606f1d0 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_sessions_detect_intent_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DetectIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Sessions_DetectIntent_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_detect_intent(): + # Create a client + client = dialogflow_v2beta1.SessionsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DetectIntentRequest( + session="session_value", + ) + + # Make the request + response = await client.detect_intent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Sessions_DetectIntent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_sessions_detect_intent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_sessions_detect_intent_sync.py new file mode 100644 index 000000000000..f252a1f86134 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_sessions_detect_intent_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DetectIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Sessions_DetectIntent_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_detect_intent(): + # Create a client + client = dialogflow_v2beta1.SessionsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DetectIntentRequest( + session="session_value", + ) + + # Make the request + response = client.detect_intent(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Sessions_DetectIntent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_sessions_streaming_detect_intent_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_sessions_streaming_detect_intent_async.py new file mode 100644 index 000000000000..ad5eeb5cba2e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_sessions_streaming_detect_intent_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for StreamingDetectIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Sessions_StreamingDetectIntent_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_streaming_detect_intent(): + # Create a client + client = dialogflow_v2beta1.SessionsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.StreamingDetectIntentRequest( + session="session_value", + ) + + # This method expects an iterator which contains + # 'dialogflow_v2beta1.StreamingDetectIntentRequest' objects + # Here we create a generator that yields a single `request` for + # demonstrative purposes. + requests = [request] + + def request_generator(): + for request in requests: + yield request + + # Make the request + stream = await client.streaming_detect_intent(requests=request_generator()) + + # Handle the response + async for response in stream: + print(response) + +# [END dialogflow_v2beta1_generated_Sessions_StreamingDetectIntent_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_sessions_streaming_detect_intent_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_sessions_streaming_detect_intent_sync.py new file mode 100644 index 000000000000..64f1a4a8d7e3 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_sessions_streaming_detect_intent_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for StreamingDetectIntent +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Sessions_StreamingDetectIntent_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_streaming_detect_intent(): + # Create a client + client = dialogflow_v2beta1.SessionsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.StreamingDetectIntentRequest( + session="session_value", + ) + + # This method expects an iterator which contains + # 'dialogflow_v2beta1.StreamingDetectIntentRequest' objects + # Here we create a generator that yields a single `request` for + # demonstrative purposes. + requests = [request] + + def request_generator(): + for request in requests: + yield request + + # Make the request + stream = client.streaming_detect_intent(requests=request_generator()) + + # Handle the response + for response in stream: + print(response) + +# [END dialogflow_v2beta1_generated_Sessions_StreamingDetectIntent_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_create_version_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_create_version_async.py new file mode 100644 index 000000000000..c0a4ab63b4d4 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_create_version_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Versions_CreateVersion_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_create_version(): + # Create a client + client = dialogflow_v2beta1.VersionsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.CreateVersionRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_version(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Versions_CreateVersion_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_create_version_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_create_version_sync.py new file mode 100644 index 000000000000..35b2fa45d778 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_create_version_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Versions_CreateVersion_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_create_version(): + # Create a client + client = dialogflow_v2beta1.VersionsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.CreateVersionRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_version(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Versions_CreateVersion_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_delete_version_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_delete_version_async.py new file mode 100644 index 000000000000..9fc436ec2fc3 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_delete_version_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Versions_DeleteVersion_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_delete_version(): + # Create a client + client = dialogflow_v2beta1.VersionsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteVersionRequest( + name="name_value", + ) + + # Make the request + await client.delete_version(request=request) + + +# [END dialogflow_v2beta1_generated_Versions_DeleteVersion_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_delete_version_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_delete_version_sync.py new file mode 100644 index 000000000000..4fc2659a441c --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_delete_version_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Versions_DeleteVersion_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_delete_version(): + # Create a client + client = dialogflow_v2beta1.VersionsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.DeleteVersionRequest( + name="name_value", + ) + + # Make the request + client.delete_version(request=request) + + +# [END dialogflow_v2beta1_generated_Versions_DeleteVersion_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_get_version_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_get_version_async.py new file mode 100644 index 000000000000..d8e0104b452e --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_get_version_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Versions_GetVersion_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_get_version(): + # Create a client + client = dialogflow_v2beta1.VersionsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetVersionRequest( + name="name_value", + ) + + # Make the request + response = await client.get_version(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Versions_GetVersion_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_get_version_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_get_version_sync.py new file mode 100644 index 000000000000..c4d6b74ce823 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_get_version_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Versions_GetVersion_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_get_version(): + # Create a client + client = dialogflow_v2beta1.VersionsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.GetVersionRequest( + name="name_value", + ) + + # Make the request + response = client.get_version(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Versions_GetVersion_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_list_versions_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_list_versions_async.py new file mode 100644 index 000000000000..f2818d3e2bed --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_list_versions_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListVersions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Versions_ListVersions_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_list_versions(): + # Create a client + client = dialogflow_v2beta1.VersionsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListVersionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_versions(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Versions_ListVersions_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_list_versions_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_list_versions_sync.py new file mode 100644 index 000000000000..d7a041777aa3 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_list_versions_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListVersions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Versions_ListVersions_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_list_versions(): + # Create a client + client = dialogflow_v2beta1.VersionsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.ListVersionsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_versions(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END dialogflow_v2beta1_generated_Versions_ListVersions_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_update_version_async.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_update_version_async.py new file mode 100644 index 000000000000..4f0724a70889 --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_update_version_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Versions_UpdateVersion_async] +from google.cloud import dialogflow_v2beta1 + + +async def sample_update_version(): + # Create a client + client = dialogflow_v2beta1.VersionsAsyncClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.UpdateVersionRequest( + ) + + # Make the request + response = await client.update_version(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Versions_UpdateVersion_async] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_update_version_sync.py b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_update_version_sync.py new file mode 100644 index 000000000000..55253b66918b --- /dev/null +++ b/packages/google-cloud-dialogflow/samples/generated_samples/dialogflow_v2beta1_generated_versions_update_version_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateVersion +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-dialogflow + + +# [START dialogflow_v2beta1_generated_Versions_UpdateVersion_sync] +from google.cloud import dialogflow_v2beta1 + + +def sample_update_version(): + # Create a client + client = dialogflow_v2beta1.VersionsClient() + + # Initialize request argument(s) + request = dialogflow_v2beta1.UpdateVersionRequest( + ) + + # Make the request + response = client.update_version(request=request) + + # Handle the response + print(response) + +# [END dialogflow_v2beta1_generated_Versions_UpdateVersion_sync] diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/snippet_metadata_dialogflow_v2.json b/packages/google-cloud-dialogflow/samples/generated_samples/snippet_metadata_dialogflow_v2.json index 3209701df9fd..90414cfed73d 100644 --- a/packages/google-cloud-dialogflow/samples/generated_samples/snippet_metadata_dialogflow_v2.json +++ b/packages/google-cloud-dialogflow/samples/generated_samples/snippet_metadata_dialogflow_v2.json @@ -10,8 +10,8 @@ "shortName": "DeleteAgent" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_delete_agent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_DeleteAgent_async", + "file": "dialogflow_v2_generated_agents_delete_agent_async.py", + "regionTag": "dialogflow_v2_generated_Agents_DeleteAgent_async", "segments": [ { "end": 42, @@ -52,8 +52,8 @@ "shortName": "DeleteAgent" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_delete_agent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_DeleteAgent_sync", + "file": "dialogflow_v2_generated_agents_delete_agent_sync.py", + "regionTag": "dialogflow_v2_generated_Agents_DeleteAgent_sync", "segments": [ { "end": 42, @@ -95,8 +95,8 @@ "shortName": "ExportAgent" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_export_agent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_ExportAgent_async", + "file": "dialogflow_v2_generated_agents_export_agent_async.py", + "regionTag": "dialogflow_v2_generated_Agents_ExportAgent_async", "segments": [ { "end": 49, @@ -139,8 +139,8 @@ "shortName": "ExportAgent" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_export_agent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_ExportAgent_sync", + "file": "dialogflow_v2_generated_agents_export_agent_sync.py", + "regionTag": "dialogflow_v2_generated_Agents_ExportAgent_sync", "segments": [ { "end": 49, @@ -184,8 +184,8 @@ "shortName": "GetAgent" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_get_agent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_GetAgent_async", + "file": "dialogflow_v2_generated_agents_get_agent_async.py", + "regionTag": "dialogflow_v2_generated_Agents_GetAgent_async", "segments": [ { "end": 44, @@ -228,8 +228,8 @@ "shortName": "GetAgent" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_get_agent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_GetAgent_sync", + "file": "dialogflow_v2_generated_agents_get_agent_sync.py", + "regionTag": "dialogflow_v2_generated_Agents_GetAgent_sync", "segments": [ { "end": 44, @@ -273,8 +273,8 @@ "shortName": "GetValidationResult" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_get_validation_result_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_GetValidationResult_async", + "file": "dialogflow_v2_generated_agents_get_validation_result_async.py", + "regionTag": "dialogflow_v2_generated_Agents_GetValidationResult_async", "segments": [ { "end": 44, @@ -317,8 +317,8 @@ "shortName": "GetValidationResult" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_get_validation_result_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_GetValidationResult_sync", + "file": "dialogflow_v2_generated_agents_get_validation_result_sync.py", + "regionTag": "dialogflow_v2_generated_Agents_GetValidationResult_sync", "segments": [ { "end": 44, @@ -362,8 +362,8 @@ "shortName": "ImportAgent" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_import_agent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_ImportAgent_async", + "file": "dialogflow_v2_generated_agents_import_agent_async.py", + "regionTag": "dialogflow_v2_generated_Agents_ImportAgent_async", "segments": [ { "end": 49, @@ -406,8 +406,8 @@ "shortName": "ImportAgent" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_import_agent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_ImportAgent_sync", + "file": "dialogflow_v2_generated_agents_import_agent_sync.py", + "regionTag": "dialogflow_v2_generated_Agents_ImportAgent_sync", "segments": [ { "end": 49, @@ -451,8 +451,8 @@ "shortName": "RestoreAgent" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_restore_agent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_RestoreAgent_async", + "file": "dialogflow_v2_generated_agents_restore_agent_async.py", + "regionTag": "dialogflow_v2_generated_Agents_RestoreAgent_async", "segments": [ { "end": 49, @@ -495,8 +495,8 @@ "shortName": "RestoreAgent" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_restore_agent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_RestoreAgent_sync", + "file": "dialogflow_v2_generated_agents_restore_agent_sync.py", + "regionTag": "dialogflow_v2_generated_Agents_RestoreAgent_sync", "segments": [ { "end": 49, @@ -540,8 +540,8 @@ "shortName": "SearchAgents" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_search_agents_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_SearchAgents_async", + "file": "dialogflow_v2_generated_agents_search_agents_async.py", + "regionTag": "dialogflow_v2_generated_Agents_SearchAgents_async", "segments": [ { "end": 45, @@ -584,8 +584,8 @@ "shortName": "SearchAgents" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_search_agents_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_SearchAgents_sync", + "file": "dialogflow_v2_generated_agents_search_agents_sync.py", + "regionTag": "dialogflow_v2_generated_Agents_SearchAgents_sync", "segments": [ { "end": 45, @@ -629,8 +629,8 @@ "shortName": "SetAgent" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_set_agent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_SetAgent_async", + "file": "dialogflow_v2_generated_agents_set_agent_async.py", + "regionTag": "dialogflow_v2_generated_Agents_SetAgent_async", "segments": [ { "end": 50, @@ -673,8 +673,8 @@ "shortName": "SetAgent" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_set_agent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_SetAgent_sync", + "file": "dialogflow_v2_generated_agents_set_agent_sync.py", + "regionTag": "dialogflow_v2_generated_Agents_SetAgent_sync", "segments": [ { "end": 50, @@ -718,8 +718,8 @@ "shortName": "TrainAgent" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_train_agent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_TrainAgent_async", + "file": "dialogflow_v2_generated_agents_train_agent_async.py", + "regionTag": "dialogflow_v2_generated_Agents_TrainAgent_async", "segments": [ { "end": 48, @@ -762,8 +762,8 @@ "shortName": "TrainAgent" } }, - "file": "dialogflow_generated_dialogflow_v2_agents_train_agent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Agents_TrainAgent_sync", + "file": "dialogflow_v2_generated_agents_train_agent_sync.py", + "regionTag": "dialogflow_v2_generated_Agents_TrainAgent_sync", "segments": [ { "end": 48, @@ -807,8 +807,8 @@ "shortName": "ListAnswerRecords" } }, - "file": "dialogflow_generated_dialogflow_v2_answer_records_list_answer_records_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_AnswerRecords_ListAnswerRecords_async", + "file": "dialogflow_v2_generated_answer_records_list_answer_records_async.py", + "regionTag": "dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_async", "segments": [ { "end": 46, @@ -851,8 +851,8 @@ "shortName": "ListAnswerRecords" } }, - "file": "dialogflow_generated_dialogflow_v2_answer_records_list_answer_records_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_AnswerRecords_ListAnswerRecords_sync", + "file": "dialogflow_v2_generated_answer_records_list_answer_records_sync.py", + "regionTag": "dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_sync", "segments": [ { "end": 46, @@ -896,8 +896,8 @@ "shortName": "UpdateAnswerRecord" } }, - "file": "dialogflow_generated_dialogflow_v2_answer_records_update_answer_record_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_AnswerRecords_UpdateAnswerRecord_async", + "file": "dialogflow_v2_generated_answer_records_update_answer_record_async.py", + "regionTag": "dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_async", "segments": [ { "end": 43, @@ -940,8 +940,8 @@ "shortName": "UpdateAnswerRecord" } }, - "file": "dialogflow_generated_dialogflow_v2_answer_records_update_answer_record_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_AnswerRecords_UpdateAnswerRecord_sync", + "file": "dialogflow_v2_generated_answer_records_update_answer_record_sync.py", + "regionTag": "dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_sync", "segments": [ { "end": 43, @@ -985,8 +985,8 @@ "shortName": "CreateContext" } }, - "file": "dialogflow_generated_dialogflow_v2_contexts_create_context_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Contexts_CreateContext_async", + "file": "dialogflow_v2_generated_contexts_create_context_async.py", + "regionTag": "dialogflow_v2_generated_Contexts_CreateContext_async", "segments": [ { "end": 48, @@ -1029,8 +1029,8 @@ "shortName": "CreateContext" } }, - "file": "dialogflow_generated_dialogflow_v2_contexts_create_context_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Contexts_CreateContext_sync", + "file": "dialogflow_v2_generated_contexts_create_context_sync.py", + "regionTag": "dialogflow_v2_generated_Contexts_CreateContext_sync", "segments": [ { "end": 48, @@ -1074,8 +1074,8 @@ "shortName": "DeleteAllContexts" } }, - "file": "dialogflow_generated_dialogflow_v2_contexts_delete_all_contexts_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Contexts_DeleteAllContexts_async", + "file": "dialogflow_v2_generated_contexts_delete_all_contexts_async.py", + "regionTag": "dialogflow_v2_generated_Contexts_DeleteAllContexts_async", "segments": [ { "end": 42, @@ -1116,8 +1116,8 @@ "shortName": "DeleteAllContexts" } }, - "file": "dialogflow_generated_dialogflow_v2_contexts_delete_all_contexts_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Contexts_DeleteAllContexts_sync", + "file": "dialogflow_v2_generated_contexts_delete_all_contexts_sync.py", + "regionTag": "dialogflow_v2_generated_Contexts_DeleteAllContexts_sync", "segments": [ { "end": 42, @@ -1159,8 +1159,8 @@ "shortName": "DeleteContext" } }, - "file": "dialogflow_generated_dialogflow_v2_contexts_delete_context_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Contexts_DeleteContext_async", + "file": "dialogflow_v2_generated_contexts_delete_context_async.py", + "regionTag": "dialogflow_v2_generated_Contexts_DeleteContext_async", "segments": [ { "end": 42, @@ -1201,8 +1201,8 @@ "shortName": "DeleteContext" } }, - "file": "dialogflow_generated_dialogflow_v2_contexts_delete_context_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Contexts_DeleteContext_sync", + "file": "dialogflow_v2_generated_contexts_delete_context_sync.py", + "regionTag": "dialogflow_v2_generated_Contexts_DeleteContext_sync", "segments": [ { "end": 42, @@ -1244,8 +1244,8 @@ "shortName": "GetContext" } }, - "file": "dialogflow_generated_dialogflow_v2_contexts_get_context_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Contexts_GetContext_async", + "file": "dialogflow_v2_generated_contexts_get_context_async.py", + "regionTag": "dialogflow_v2_generated_Contexts_GetContext_async", "segments": [ { "end": 44, @@ -1288,8 +1288,8 @@ "shortName": "GetContext" } }, - "file": "dialogflow_generated_dialogflow_v2_contexts_get_context_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Contexts_GetContext_sync", + "file": "dialogflow_v2_generated_contexts_get_context_sync.py", + "regionTag": "dialogflow_v2_generated_Contexts_GetContext_sync", "segments": [ { "end": 44, @@ -1333,8 +1333,8 @@ "shortName": "ListContexts" } }, - "file": "dialogflow_generated_dialogflow_v2_contexts_list_contexts_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Contexts_ListContexts_async", + "file": "dialogflow_v2_generated_contexts_list_contexts_async.py", + "regionTag": "dialogflow_v2_generated_Contexts_ListContexts_async", "segments": [ { "end": 45, @@ -1377,8 +1377,8 @@ "shortName": "ListContexts" } }, - "file": "dialogflow_generated_dialogflow_v2_contexts_list_contexts_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Contexts_ListContexts_sync", + "file": "dialogflow_v2_generated_contexts_list_contexts_sync.py", + "regionTag": "dialogflow_v2_generated_Contexts_ListContexts_sync", "segments": [ { "end": 45, @@ -1422,8 +1422,8 @@ "shortName": "UpdateContext" } }, - "file": "dialogflow_generated_dialogflow_v2_contexts_update_context_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Contexts_UpdateContext_async", + "file": "dialogflow_v2_generated_contexts_update_context_async.py", + "regionTag": "dialogflow_v2_generated_Contexts_UpdateContext_async", "segments": [ { "end": 47, @@ -1466,8 +1466,8 @@ "shortName": "UpdateContext" } }, - "file": "dialogflow_generated_dialogflow_v2_contexts_update_context_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Contexts_UpdateContext_sync", + "file": "dialogflow_v2_generated_contexts_update_context_sync.py", + "regionTag": "dialogflow_v2_generated_Contexts_UpdateContext_sync", "segments": [ { "end": 47, @@ -1501,6 +1501,1341 @@ } ] }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ConversationDatasets" + }, + "shortName": "CreateConversationDataset" + } + }, + "file": "dialogflow_v2_generated_conversation_datasets_create_conversation_dataset_async.py", + "regionTag": "dialogflow_v2_generated_ConversationDatasets_CreateConversationDataset_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ConversationDatasets" + }, + "shortName": "CreateConversationDataset" + } + }, + "file": "dialogflow_v2_generated_conversation_datasets_create_conversation_dataset_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationDatasets_CreateConversationDataset_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ConversationDatasets" + }, + "shortName": "DeleteConversationDataset" + } + }, + "file": "dialogflow_v2_generated_conversation_datasets_delete_conversation_dataset_async.py", + "regionTag": "dialogflow_v2_generated_ConversationDatasets_DeleteConversationDataset_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ConversationDatasets" + }, + "shortName": "DeleteConversationDataset" + } + }, + "file": "dialogflow_v2_generated_conversation_datasets_delete_conversation_dataset_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationDatasets_DeleteConversationDataset_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ConversationDatasets" + }, + "shortName": "GetConversationDataset" + } + }, + "file": "dialogflow_v2_generated_conversation_datasets_get_conversation_dataset_async.py", + "regionTag": "dialogflow_v2_generated_ConversationDatasets_GetConversationDataset_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ConversationDatasets" + }, + "shortName": "GetConversationDataset" + } + }, + "file": "dialogflow_v2_generated_conversation_datasets_get_conversation_dataset_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationDatasets_GetConversationDataset_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ConversationDatasets" + }, + "shortName": "ImportConversationData" + } + }, + "file": "dialogflow_v2_generated_conversation_datasets_import_conversation_data_async.py", + "regionTag": "dialogflow_v2_generated_ConversationDatasets_ImportConversationData_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ConversationDatasets" + }, + "shortName": "ImportConversationData" + } + }, + "file": "dialogflow_v2_generated_conversation_datasets_import_conversation_data_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationDatasets_ImportConversationData_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ConversationDatasets" + }, + "shortName": "ListConversationDatasets" + } + }, + "file": "dialogflow_v2_generated_conversation_datasets_list_conversation_datasets_async.py", + "regionTag": "dialogflow_v2_generated_ConversationDatasets_ListConversationDatasets_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ConversationDatasets" + }, + "shortName": "ListConversationDatasets" + } + }, + "file": "dialogflow_v2_generated_conversation_datasets_list_conversation_datasets_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationDatasets_ListConversationDatasets_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "CreateConversationModelEvaluation" + } + }, + "file": "dialogflow_v2_generated_conversation_models_create_conversation_model_evaluation_async.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_CreateConversationModelEvaluation_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "CreateConversationModelEvaluation" + } + }, + "file": "dialogflow_v2_generated_conversation_models_create_conversation_model_evaluation_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_CreateConversationModelEvaluation_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "CreateConversationModel" + } + }, + "file": "dialogflow_v2_generated_conversation_models_create_conversation_model_async.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_CreateConversationModel_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "CreateConversationModel" + } + }, + "file": "dialogflow_v2_generated_conversation_models_create_conversation_model_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_CreateConversationModel_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "DeleteConversationModel" + } + }, + "file": "dialogflow_v2_generated_conversation_models_delete_conversation_model_async.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_DeleteConversationModel_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "DeleteConversationModel" + } + }, + "file": "dialogflow_v2_generated_conversation_models_delete_conversation_model_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_DeleteConversationModel_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "DeployConversationModel" + } + }, + "file": "dialogflow_v2_generated_conversation_models_deploy_conversation_model_async.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_DeployConversationModel_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "DeployConversationModel" + } + }, + "file": "dialogflow_v2_generated_conversation_models_deploy_conversation_model_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_DeployConversationModel_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "GetConversationModelEvaluation" + } + }, + "file": "dialogflow_v2_generated_conversation_models_get_conversation_model_evaluation_async.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_GetConversationModelEvaluation_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "GetConversationModelEvaluation" + } + }, + "file": "dialogflow_v2_generated_conversation_models_get_conversation_model_evaluation_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_GetConversationModelEvaluation_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "GetConversationModel" + } + }, + "file": "dialogflow_v2_generated_conversation_models_get_conversation_model_async.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_GetConversationModel_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "GetConversationModel" + } + }, + "file": "dialogflow_v2_generated_conversation_models_get_conversation_model_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_GetConversationModel_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "ListConversationModelEvaluations" + } + }, + "file": "dialogflow_v2_generated_conversation_models_list_conversation_model_evaluations_async.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_ListConversationModelEvaluations_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "ListConversationModelEvaluations" + } + }, + "file": "dialogflow_v2_generated_conversation_models_list_conversation_model_evaluations_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_ListConversationModelEvaluations_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "ListConversationModels" + } + }, + "file": "dialogflow_v2_generated_conversation_models_list_conversation_models_async.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_ListConversationModels_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "ListConversationModels" + } + }, + "file": "dialogflow_v2_generated_conversation_models_list_conversation_models_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_ListConversationModels_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "UndeployConversationModel" + } + }, + "file": "dialogflow_v2_generated_conversation_models_undeploy_conversation_model_async.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_UndeployConversationModel_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ConversationModels" + }, + "shortName": "UndeployConversationModel" + } + }, + "file": "dialogflow_v2_generated_conversation_models_undeploy_conversation_model_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationModels_UndeployConversationModel_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ConversationProfiles" + }, + "shortName": "ClearSuggestionFeatureConfig" + } + }, + "file": "dialogflow_v2_generated_conversation_profiles_clear_suggestion_feature_config_async.py", + "regionTag": "dialogflow_v2_generated_ConversationProfiles_ClearSuggestionFeatureConfig_async", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 40, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ConversationProfiles" + }, + "shortName": "ClearSuggestionFeatureConfig" + } + }, + "file": "dialogflow_v2_generated_conversation_profiles_clear_suggestion_feature_config_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationProfiles_ClearSuggestionFeatureConfig_sync", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 40, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ] + }, { "clientMethod": { "async": true, @@ -1511,8 +2846,8 @@ "shortName": "CreateConversationProfile" } }, - "file": "dialogflow_generated_dialogflow_v2_conversation_profiles_create_conversation_profile_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_ConversationProfiles_CreateConversationProfile_async", + "file": "dialogflow_v2_generated_conversation_profiles_create_conversation_profile_async.py", + "regionTag": "dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_async", "segments": [ { "end": 48, @@ -1555,8 +2890,8 @@ "shortName": "CreateConversationProfile" } }, - "file": "dialogflow_generated_dialogflow_v2_conversation_profiles_create_conversation_profile_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_ConversationProfiles_CreateConversationProfile_sync", + "file": "dialogflow_v2_generated_conversation_profiles_create_conversation_profile_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_sync", "segments": [ { "end": 48, @@ -1600,8 +2935,8 @@ "shortName": "DeleteConversationProfile" } }, - "file": "dialogflow_generated_dialogflow_v2_conversation_profiles_delete_conversation_profile_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_ConversationProfiles_DeleteConversationProfile_async", + "file": "dialogflow_v2_generated_conversation_profiles_delete_conversation_profile_async.py", + "regionTag": "dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_async", "segments": [ { "end": 42, @@ -1642,8 +2977,8 @@ "shortName": "DeleteConversationProfile" } }, - "file": "dialogflow_generated_dialogflow_v2_conversation_profiles_delete_conversation_profile_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_ConversationProfiles_DeleteConversationProfile_sync", + "file": "dialogflow_v2_generated_conversation_profiles_delete_conversation_profile_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_sync", "segments": [ { "end": 42, @@ -1685,8 +3020,8 @@ "shortName": "GetConversationProfile" } }, - "file": "dialogflow_generated_dialogflow_v2_conversation_profiles_get_conversation_profile_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_ConversationProfiles_GetConversationProfile_async", + "file": "dialogflow_v2_generated_conversation_profiles_get_conversation_profile_async.py", + "regionTag": "dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_async", "segments": [ { "end": 44, @@ -1729,8 +3064,8 @@ "shortName": "GetConversationProfile" } }, - "file": "dialogflow_generated_dialogflow_v2_conversation_profiles_get_conversation_profile_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_ConversationProfiles_GetConversationProfile_sync", + "file": "dialogflow_v2_generated_conversation_profiles_get_conversation_profile_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_sync", "segments": [ { "end": 44, @@ -1774,8 +3109,8 @@ "shortName": "ListConversationProfiles" } }, - "file": "dialogflow_generated_dialogflow_v2_conversation_profiles_list_conversation_profiles_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_ConversationProfiles_ListConversationProfiles_async", + "file": "dialogflow_v2_generated_conversation_profiles_list_conversation_profiles_async.py", + "regionTag": "dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_async", "segments": [ { "end": 45, @@ -1818,8 +3153,8 @@ "shortName": "ListConversationProfiles" } }, - "file": "dialogflow_generated_dialogflow_v2_conversation_profiles_list_conversation_profiles_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_ConversationProfiles_ListConversationProfiles_sync", + "file": "dialogflow_v2_generated_conversation_profiles_list_conversation_profiles_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_sync", "segments": [ { "end": 45, @@ -1853,6 +3188,95 @@ } ] }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "ConversationProfiles" + }, + "shortName": "SetSuggestionFeatureConfig" + } + }, + "file": "dialogflow_v2_generated_conversation_profiles_set_suggestion_feature_config_async.py", + "regionTag": "dialogflow_v2_generated_ConversationProfiles_SetSuggestionFeatureConfig_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "ConversationProfiles" + }, + "shortName": "SetSuggestionFeatureConfig" + } + }, + "file": "dialogflow_v2_generated_conversation_profiles_set_suggestion_feature_config_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationProfiles_SetSuggestionFeatureConfig_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, { "clientMethod": { "async": true, @@ -1863,8 +3287,8 @@ "shortName": "UpdateConversationProfile" } }, - "file": "dialogflow_generated_dialogflow_v2_conversation_profiles_update_conversation_profile_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_ConversationProfiles_UpdateConversationProfile_async", + "file": "dialogflow_v2_generated_conversation_profiles_update_conversation_profile_async.py", + "regionTag": "dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_async", "segments": [ { "end": 47, @@ -1907,8 +3331,8 @@ "shortName": "UpdateConversationProfile" } }, - "file": "dialogflow_generated_dialogflow_v2_conversation_profiles_update_conversation_profile_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_ConversationProfiles_UpdateConversationProfile_sync", + "file": "dialogflow_v2_generated_conversation_profiles_update_conversation_profile_sync.py", + "regionTag": "dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_sync", "segments": [ { "end": 47, @@ -1952,8 +3376,8 @@ "shortName": "CompleteConversation" } }, - "file": "dialogflow_generated_dialogflow_v2_conversations_complete_conversation_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Conversations_CompleteConversation_async", + "file": "dialogflow_v2_generated_conversations_complete_conversation_async.py", + "regionTag": "dialogflow_v2_generated_Conversations_CompleteConversation_async", "segments": [ { "end": 44, @@ -1996,8 +3420,8 @@ "shortName": "CompleteConversation" } }, - "file": "dialogflow_generated_dialogflow_v2_conversations_complete_conversation_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Conversations_CompleteConversation_sync", + "file": "dialogflow_v2_generated_conversations_complete_conversation_sync.py", + "regionTag": "dialogflow_v2_generated_Conversations_CompleteConversation_sync", "segments": [ { "end": 44, @@ -2041,8 +3465,8 @@ "shortName": "CreateConversation" } }, - "file": "dialogflow_generated_dialogflow_v2_conversations_create_conversation_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Conversations_CreateConversation_async", + "file": "dialogflow_v2_generated_conversations_create_conversation_async.py", + "regionTag": "dialogflow_v2_generated_Conversations_CreateConversation_async", "segments": [ { "end": 48, @@ -2085,8 +3509,8 @@ "shortName": "CreateConversation" } }, - "file": "dialogflow_generated_dialogflow_v2_conversations_create_conversation_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Conversations_CreateConversation_sync", + "file": "dialogflow_v2_generated_conversations_create_conversation_sync.py", + "regionTag": "dialogflow_v2_generated_Conversations_CreateConversation_sync", "segments": [ { "end": 48, @@ -2130,8 +3554,8 @@ "shortName": "GetConversation" } }, - "file": "dialogflow_generated_dialogflow_v2_conversations_get_conversation_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Conversations_GetConversation_async", + "file": "dialogflow_v2_generated_conversations_get_conversation_async.py", + "regionTag": "dialogflow_v2_generated_Conversations_GetConversation_async", "segments": [ { "end": 44, @@ -2174,8 +3598,8 @@ "shortName": "GetConversation" } }, - "file": "dialogflow_generated_dialogflow_v2_conversations_get_conversation_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Conversations_GetConversation_sync", + "file": "dialogflow_v2_generated_conversations_get_conversation_sync.py", + "regionTag": "dialogflow_v2_generated_Conversations_GetConversation_sync", "segments": [ { "end": 44, @@ -2219,8 +3643,8 @@ "shortName": "ListConversations" } }, - "file": "dialogflow_generated_dialogflow_v2_conversations_list_conversations_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Conversations_ListConversations_async", + "file": "dialogflow_v2_generated_conversations_list_conversations_async.py", + "regionTag": "dialogflow_v2_generated_Conversations_ListConversations_async", "segments": [ { "end": 45, @@ -2263,8 +3687,8 @@ "shortName": "ListConversations" } }, - "file": "dialogflow_generated_dialogflow_v2_conversations_list_conversations_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Conversations_ListConversations_sync", + "file": "dialogflow_v2_generated_conversations_list_conversations_sync.py", + "regionTag": "dialogflow_v2_generated_Conversations_ListConversations_sync", "segments": [ { "end": 45, @@ -2308,8 +3732,8 @@ "shortName": "ListMessages" } }, - "file": "dialogflow_generated_dialogflow_v2_conversations_list_messages_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Conversations_ListMessages_async", + "file": "dialogflow_v2_generated_conversations_list_messages_async.py", + "regionTag": "dialogflow_v2_generated_Conversations_ListMessages_async", "segments": [ { "end": 45, @@ -2352,8 +3776,8 @@ "shortName": "ListMessages" } }, - "file": "dialogflow_generated_dialogflow_v2_conversations_list_messages_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Conversations_ListMessages_sync", + "file": "dialogflow_v2_generated_conversations_list_messages_sync.py", + "regionTag": "dialogflow_v2_generated_Conversations_ListMessages_sync", "segments": [ { "end": 45, @@ -2397,8 +3821,8 @@ "shortName": "CreateDocument" } }, - "file": "dialogflow_generated_dialogflow_v2_documents_create_document_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Documents_CreateDocument_async", + "file": "dialogflow_v2_generated_documents_create_document_async.py", + "regionTag": "dialogflow_v2_generated_Documents_CreateDocument_async", "segments": [ { "end": 55, @@ -2441,8 +3865,8 @@ "shortName": "CreateDocument" } }, - "file": "dialogflow_generated_dialogflow_v2_documents_create_document_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Documents_CreateDocument_sync", + "file": "dialogflow_v2_generated_documents_create_document_sync.py", + "regionTag": "dialogflow_v2_generated_Documents_CreateDocument_sync", "segments": [ { "end": 55, @@ -2486,8 +3910,8 @@ "shortName": "DeleteDocument" } }, - "file": "dialogflow_generated_dialogflow_v2_documents_delete_document_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Documents_DeleteDocument_async", + "file": "dialogflow_v2_generated_documents_delete_document_async.py", + "regionTag": "dialogflow_v2_generated_Documents_DeleteDocument_async", "segments": [ { "end": 48, @@ -2530,8 +3954,8 @@ "shortName": "DeleteDocument" } }, - "file": "dialogflow_generated_dialogflow_v2_documents_delete_document_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Documents_DeleteDocument_sync", + "file": "dialogflow_v2_generated_documents_delete_document_sync.py", + "regionTag": "dialogflow_v2_generated_Documents_DeleteDocument_sync", "segments": [ { "end": 48, @@ -2575,8 +3999,8 @@ "shortName": "ExportDocument" } }, - "file": "dialogflow_generated_dialogflow_v2_documents_export_document_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Documents_ExportDocument_async", + "file": "dialogflow_v2_generated_documents_export_document_async.py", + "regionTag": "dialogflow_v2_generated_Documents_ExportDocument_async", "segments": [ { "end": 48, @@ -2619,8 +4043,8 @@ "shortName": "ExportDocument" } }, - "file": "dialogflow_generated_dialogflow_v2_documents_export_document_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Documents_ExportDocument_sync", + "file": "dialogflow_v2_generated_documents_export_document_sync.py", + "regionTag": "dialogflow_v2_generated_Documents_ExportDocument_sync", "segments": [ { "end": 48, @@ -2664,8 +4088,8 @@ "shortName": "GetDocument" } }, - "file": "dialogflow_generated_dialogflow_v2_documents_get_document_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Documents_GetDocument_async", + "file": "dialogflow_v2_generated_documents_get_document_async.py", + "regionTag": "dialogflow_v2_generated_Documents_GetDocument_async", "segments": [ { "end": 44, @@ -2708,8 +4132,8 @@ "shortName": "GetDocument" } }, - "file": "dialogflow_generated_dialogflow_v2_documents_get_document_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Documents_GetDocument_sync", + "file": "dialogflow_v2_generated_documents_get_document_sync.py", + "regionTag": "dialogflow_v2_generated_Documents_GetDocument_sync", "segments": [ { "end": 44, @@ -2753,8 +4177,8 @@ "shortName": "ImportDocuments" } }, - "file": "dialogflow_generated_dialogflow_v2_documents_import_documents_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Documents_ImportDocuments_async", + "file": "dialogflow_v2_generated_documents_import_documents_async.py", + "regionTag": "dialogflow_v2_generated_Documents_ImportDocuments_async", "segments": [ { "end": 57, @@ -2797,8 +4221,8 @@ "shortName": "ImportDocuments" } }, - "file": "dialogflow_generated_dialogflow_v2_documents_import_documents_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Documents_ImportDocuments_sync", + "file": "dialogflow_v2_generated_documents_import_documents_sync.py", + "regionTag": "dialogflow_v2_generated_Documents_ImportDocuments_sync", "segments": [ { "end": 57, @@ -2842,8 +4266,8 @@ "shortName": "ListDocuments" } }, - "file": "dialogflow_generated_dialogflow_v2_documents_list_documents_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Documents_ListDocuments_async", + "file": "dialogflow_v2_generated_documents_list_documents_async.py", + "regionTag": "dialogflow_v2_generated_Documents_ListDocuments_async", "segments": [ { "end": 45, @@ -2886,8 +4310,8 @@ "shortName": "ListDocuments" } }, - "file": "dialogflow_generated_dialogflow_v2_documents_list_documents_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Documents_ListDocuments_sync", + "file": "dialogflow_v2_generated_documents_list_documents_sync.py", + "regionTag": "dialogflow_v2_generated_Documents_ListDocuments_sync", "segments": [ { "end": 45, @@ -2931,8 +4355,8 @@ "shortName": "ReloadDocument" } }, - "file": "dialogflow_generated_dialogflow_v2_documents_reload_document_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Documents_ReloadDocument_async", + "file": "dialogflow_v2_generated_documents_reload_document_async.py", + "regionTag": "dialogflow_v2_generated_Documents_ReloadDocument_async", "segments": [ { "end": 49, @@ -2975,8 +4399,8 @@ "shortName": "ReloadDocument" } }, - "file": "dialogflow_generated_dialogflow_v2_documents_reload_document_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Documents_ReloadDocument_sync", + "file": "dialogflow_v2_generated_documents_reload_document_sync.py", + "regionTag": "dialogflow_v2_generated_Documents_ReloadDocument_sync", "segments": [ { "end": 49, @@ -3020,8 +4444,8 @@ "shortName": "UpdateDocument" } }, - "file": "dialogflow_generated_dialogflow_v2_documents_update_document_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Documents_UpdateDocument_async", + "file": "dialogflow_v2_generated_documents_update_document_async.py", + "regionTag": "dialogflow_v2_generated_Documents_UpdateDocument_async", "segments": [ { "end": 54, @@ -3064,8 +4488,8 @@ "shortName": "UpdateDocument" } }, - "file": "dialogflow_generated_dialogflow_v2_documents_update_document_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Documents_UpdateDocument_sync", + "file": "dialogflow_v2_generated_documents_update_document_sync.py", + "regionTag": "dialogflow_v2_generated_Documents_UpdateDocument_sync", "segments": [ { "end": 54, @@ -3109,8 +4533,8 @@ "shortName": "BatchCreateEntities" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_batch_create_entities_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_BatchCreateEntities_async", + "file": "dialogflow_v2_generated_entity_types_batch_create_entities_async.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_BatchCreateEntities_async", "segments": [ { "end": 53, @@ -3153,8 +4577,8 @@ "shortName": "BatchCreateEntities" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_batch_create_entities_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_BatchCreateEntities_sync", + "file": "dialogflow_v2_generated_entity_types_batch_create_entities_sync.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_BatchCreateEntities_sync", "segments": [ { "end": 53, @@ -3198,8 +4622,8 @@ "shortName": "BatchDeleteEntities" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_batch_delete_entities_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_BatchDeleteEntities_async", + "file": "dialogflow_v2_generated_entity_types_batch_delete_entities_async.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_async", "segments": [ { "end": 49, @@ -3242,8 +4666,8 @@ "shortName": "BatchDeleteEntities" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_batch_delete_entities_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_BatchDeleteEntities_sync", + "file": "dialogflow_v2_generated_entity_types_batch_delete_entities_sync.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_sync", "segments": [ { "end": 49, @@ -3287,8 +4711,8 @@ "shortName": "BatchDeleteEntityTypes" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_batch_delete_entity_types_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_BatchDeleteEntityTypes_async", + "file": "dialogflow_v2_generated_entity_types_batch_delete_entity_types_async.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_async", "segments": [ { "end": 49, @@ -3331,8 +4755,8 @@ "shortName": "BatchDeleteEntityTypes" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_batch_delete_entity_types_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_BatchDeleteEntityTypes_sync", + "file": "dialogflow_v2_generated_entity_types_batch_delete_entity_types_sync.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_sync", "segments": [ { "end": 49, @@ -3376,8 +4800,8 @@ "shortName": "BatchUpdateEntities" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_batch_update_entities_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_BatchUpdateEntities_async", + "file": "dialogflow_v2_generated_entity_types_batch_update_entities_async.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_async", "segments": [ { "end": 53, @@ -3420,8 +4844,8 @@ "shortName": "BatchUpdateEntities" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_batch_update_entities_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_BatchUpdateEntities_sync", + "file": "dialogflow_v2_generated_entity_types_batch_update_entities_sync.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_sync", "segments": [ { "end": 53, @@ -3465,8 +4889,8 @@ "shortName": "BatchUpdateEntityTypes" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_batch_update_entity_types_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_BatchUpdateEntityTypes_async", + "file": "dialogflow_v2_generated_entity_types_batch_update_entity_types_async.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_async", "segments": [ { "end": 49, @@ -3509,8 +4933,8 @@ "shortName": "BatchUpdateEntityTypes" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_batch_update_entity_types_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_BatchUpdateEntityTypes_sync", + "file": "dialogflow_v2_generated_entity_types_batch_update_entity_types_sync.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_sync", "segments": [ { "end": 49, @@ -3554,8 +4978,8 @@ "shortName": "CreateEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_create_entity_type_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_CreateEntityType_async", + "file": "dialogflow_v2_generated_entity_types_create_entity_type_async.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_CreateEntityType_async", "segments": [ { "end": 49, @@ -3598,8 +5022,8 @@ "shortName": "CreateEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_create_entity_type_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_CreateEntityType_sync", + "file": "dialogflow_v2_generated_entity_types_create_entity_type_sync.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_CreateEntityType_sync", "segments": [ { "end": 49, @@ -3643,8 +5067,8 @@ "shortName": "DeleteEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_delete_entity_type_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_DeleteEntityType_async", + "file": "dialogflow_v2_generated_entity_types_delete_entity_type_async.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_DeleteEntityType_async", "segments": [ { "end": 42, @@ -3685,8 +5109,8 @@ "shortName": "DeleteEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_delete_entity_type_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_DeleteEntityType_sync", + "file": "dialogflow_v2_generated_entity_types_delete_entity_type_sync.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_DeleteEntityType_sync", "segments": [ { "end": 42, @@ -3728,8 +5152,8 @@ "shortName": "GetEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_get_entity_type_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_GetEntityType_async", + "file": "dialogflow_v2_generated_entity_types_get_entity_type_async.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_GetEntityType_async", "segments": [ { "end": 44, @@ -3772,8 +5196,8 @@ "shortName": "GetEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_get_entity_type_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_GetEntityType_sync", + "file": "dialogflow_v2_generated_entity_types_get_entity_type_sync.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_GetEntityType_sync", "segments": [ { "end": 44, @@ -3817,8 +5241,8 @@ "shortName": "ListEntityTypes" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_list_entity_types_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_ListEntityTypes_async", + "file": "dialogflow_v2_generated_entity_types_list_entity_types_async.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_ListEntityTypes_async", "segments": [ { "end": 45, @@ -3861,8 +5285,8 @@ "shortName": "ListEntityTypes" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_list_entity_types_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_ListEntityTypes_sync", + "file": "dialogflow_v2_generated_entity_types_list_entity_types_sync.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_ListEntityTypes_sync", "segments": [ { "end": 45, @@ -3906,8 +5330,8 @@ "shortName": "UpdateEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_update_entity_type_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_UpdateEntityType_async", + "file": "dialogflow_v2_generated_entity_types_update_entity_type_async.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_UpdateEntityType_async", "segments": [ { "end": 48, @@ -3950,8 +5374,8 @@ "shortName": "UpdateEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2_entity_types_update_entity_type_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_EntityTypes_UpdateEntityType_sync", + "file": "dialogflow_v2_generated_entity_types_update_entity_type_sync.py", + "regionTag": "dialogflow_v2_generated_EntityTypes_UpdateEntityType_sync", "segments": [ { "end": 48, @@ -3995,8 +5419,8 @@ "shortName": "CreateEnvironment" } }, - "file": "dialogflow_generated_dialogflow_v2_environments_create_environment_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Environments_CreateEnvironment_async", + "file": "dialogflow_v2_generated_environments_create_environment_async.py", + "regionTag": "dialogflow_v2_generated_Environments_CreateEnvironment_async", "segments": [ { "end": 45, @@ -4039,8 +5463,8 @@ "shortName": "CreateEnvironment" } }, - "file": "dialogflow_generated_dialogflow_v2_environments_create_environment_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Environments_CreateEnvironment_sync", + "file": "dialogflow_v2_generated_environments_create_environment_sync.py", + "regionTag": "dialogflow_v2_generated_Environments_CreateEnvironment_sync", "segments": [ { "end": 45, @@ -4084,8 +5508,8 @@ "shortName": "DeleteEnvironment" } }, - "file": "dialogflow_generated_dialogflow_v2_environments_delete_environment_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Environments_DeleteEnvironment_async", + "file": "dialogflow_v2_generated_environments_delete_environment_async.py", + "regionTag": "dialogflow_v2_generated_Environments_DeleteEnvironment_async", "segments": [ { "end": 42, @@ -4126,8 +5550,8 @@ "shortName": "DeleteEnvironment" } }, - "file": "dialogflow_generated_dialogflow_v2_environments_delete_environment_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Environments_DeleteEnvironment_sync", + "file": "dialogflow_v2_generated_environments_delete_environment_sync.py", + "regionTag": "dialogflow_v2_generated_Environments_DeleteEnvironment_sync", "segments": [ { "end": 42, @@ -4169,8 +5593,8 @@ "shortName": "GetEnvironmentHistory" } }, - "file": "dialogflow_generated_dialogflow_v2_environments_get_environment_history_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Environments_GetEnvironmentHistory_async", + "file": "dialogflow_v2_generated_environments_get_environment_history_async.py", + "regionTag": "dialogflow_v2_generated_Environments_GetEnvironmentHistory_async", "segments": [ { "end": 45, @@ -4213,8 +5637,8 @@ "shortName": "GetEnvironmentHistory" } }, - "file": "dialogflow_generated_dialogflow_v2_environments_get_environment_history_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Environments_GetEnvironmentHistory_sync", + "file": "dialogflow_v2_generated_environments_get_environment_history_sync.py", + "regionTag": "dialogflow_v2_generated_Environments_GetEnvironmentHistory_sync", "segments": [ { "end": 45, @@ -4258,8 +5682,8 @@ "shortName": "GetEnvironment" } }, - "file": "dialogflow_generated_dialogflow_v2_environments_get_environment_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Environments_GetEnvironment_async", + "file": "dialogflow_v2_generated_environments_get_environment_async.py", + "regionTag": "dialogflow_v2_generated_Environments_GetEnvironment_async", "segments": [ { "end": 44, @@ -4302,8 +5726,8 @@ "shortName": "GetEnvironment" } }, - "file": "dialogflow_generated_dialogflow_v2_environments_get_environment_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Environments_GetEnvironment_sync", + "file": "dialogflow_v2_generated_environments_get_environment_sync.py", + "regionTag": "dialogflow_v2_generated_Environments_GetEnvironment_sync", "segments": [ { "end": 44, @@ -4347,8 +5771,8 @@ "shortName": "ListEnvironments" } }, - "file": "dialogflow_generated_dialogflow_v2_environments_list_environments_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Environments_ListEnvironments_async", + "file": "dialogflow_v2_generated_environments_list_environments_async.py", + "regionTag": "dialogflow_v2_generated_Environments_ListEnvironments_async", "segments": [ { "end": 45, @@ -4391,8 +5815,8 @@ "shortName": "ListEnvironments" } }, - "file": "dialogflow_generated_dialogflow_v2_environments_list_environments_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Environments_ListEnvironments_sync", + "file": "dialogflow_v2_generated_environments_list_environments_sync.py", + "regionTag": "dialogflow_v2_generated_Environments_ListEnvironments_sync", "segments": [ { "end": 45, @@ -4436,8 +5860,8 @@ "shortName": "UpdateEnvironment" } }, - "file": "dialogflow_generated_dialogflow_v2_environments_update_environment_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Environments_UpdateEnvironment_async", + "file": "dialogflow_v2_generated_environments_update_environment_async.py", + "regionTag": "dialogflow_v2_generated_Environments_UpdateEnvironment_async", "segments": [ { "end": 43, @@ -4480,8 +5904,8 @@ "shortName": "UpdateEnvironment" } }, - "file": "dialogflow_generated_dialogflow_v2_environments_update_environment_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Environments_UpdateEnvironment_sync", + "file": "dialogflow_v2_generated_environments_update_environment_sync.py", + "regionTag": "dialogflow_v2_generated_Environments_UpdateEnvironment_sync", "segments": [ { "end": 43, @@ -4525,8 +5949,8 @@ "shortName": "GetFulfillment" } }, - "file": "dialogflow_generated_dialogflow_v2_fulfillments_get_fulfillment_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Fulfillments_GetFulfillment_async", + "file": "dialogflow_v2_generated_fulfillments_get_fulfillment_async.py", + "regionTag": "dialogflow_v2_generated_Fulfillments_GetFulfillment_async", "segments": [ { "end": 44, @@ -4569,8 +5993,8 @@ "shortName": "GetFulfillment" } }, - "file": "dialogflow_generated_dialogflow_v2_fulfillments_get_fulfillment_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Fulfillments_GetFulfillment_sync", + "file": "dialogflow_v2_generated_fulfillments_get_fulfillment_sync.py", + "regionTag": "dialogflow_v2_generated_Fulfillments_GetFulfillment_sync", "segments": [ { "end": 44, @@ -4614,8 +6038,8 @@ "shortName": "UpdateFulfillment" } }, - "file": "dialogflow_generated_dialogflow_v2_fulfillments_update_fulfillment_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Fulfillments_UpdateFulfillment_async", + "file": "dialogflow_v2_generated_fulfillments_update_fulfillment_async.py", + "regionTag": "dialogflow_v2_generated_Fulfillments_UpdateFulfillment_async", "segments": [ { "end": 48, @@ -4658,8 +6082,8 @@ "shortName": "UpdateFulfillment" } }, - "file": "dialogflow_generated_dialogflow_v2_fulfillments_update_fulfillment_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Fulfillments_UpdateFulfillment_sync", + "file": "dialogflow_v2_generated_fulfillments_update_fulfillment_sync.py", + "regionTag": "dialogflow_v2_generated_Fulfillments_UpdateFulfillment_sync", "segments": [ { "end": 48, @@ -4703,8 +6127,8 @@ "shortName": "BatchDeleteIntents" } }, - "file": "dialogflow_generated_dialogflow_v2_intents_batch_delete_intents_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Intents_BatchDeleteIntents_async", + "file": "dialogflow_v2_generated_intents_batch_delete_intents_async.py", + "regionTag": "dialogflow_v2_generated_Intents_BatchDeleteIntents_async", "segments": [ { "end": 52, @@ -4747,8 +6171,8 @@ "shortName": "BatchDeleteIntents" } }, - "file": "dialogflow_generated_dialogflow_v2_intents_batch_delete_intents_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Intents_BatchDeleteIntents_sync", + "file": "dialogflow_v2_generated_intents_batch_delete_intents_sync.py", + "regionTag": "dialogflow_v2_generated_Intents_BatchDeleteIntents_sync", "segments": [ { "end": 52, @@ -4792,8 +6216,8 @@ "shortName": "BatchUpdateIntents" } }, - "file": "dialogflow_generated_dialogflow_v2_intents_batch_update_intents_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Intents_BatchUpdateIntents_async", + "file": "dialogflow_v2_generated_intents_batch_update_intents_async.py", + "regionTag": "dialogflow_v2_generated_Intents_BatchUpdateIntents_async", "segments": [ { "end": 49, @@ -4836,8 +6260,8 @@ "shortName": "BatchUpdateIntents" } }, - "file": "dialogflow_generated_dialogflow_v2_intents_batch_update_intents_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Intents_BatchUpdateIntents_sync", + "file": "dialogflow_v2_generated_intents_batch_update_intents_sync.py", + "regionTag": "dialogflow_v2_generated_Intents_BatchUpdateIntents_sync", "segments": [ { "end": 49, @@ -4881,8 +6305,8 @@ "shortName": "CreateIntent" } }, - "file": "dialogflow_generated_dialogflow_v2_intents_create_intent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Intents_CreateIntent_async", + "file": "dialogflow_v2_generated_intents_create_intent_async.py", + "regionTag": "dialogflow_v2_generated_Intents_CreateIntent_async", "segments": [ { "end": 48, @@ -4925,8 +6349,8 @@ "shortName": "CreateIntent" } }, - "file": "dialogflow_generated_dialogflow_v2_intents_create_intent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Intents_CreateIntent_sync", + "file": "dialogflow_v2_generated_intents_create_intent_sync.py", + "regionTag": "dialogflow_v2_generated_Intents_CreateIntent_sync", "segments": [ { "end": 48, @@ -4970,8 +6394,8 @@ "shortName": "DeleteIntent" } }, - "file": "dialogflow_generated_dialogflow_v2_intents_delete_intent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Intents_DeleteIntent_async", + "file": "dialogflow_v2_generated_intents_delete_intent_async.py", + "regionTag": "dialogflow_v2_generated_Intents_DeleteIntent_async", "segments": [ { "end": 42, @@ -5012,8 +6436,8 @@ "shortName": "DeleteIntent" } }, - "file": "dialogflow_generated_dialogflow_v2_intents_delete_intent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Intents_DeleteIntent_sync", + "file": "dialogflow_v2_generated_intents_delete_intent_sync.py", + "regionTag": "dialogflow_v2_generated_Intents_DeleteIntent_sync", "segments": [ { "end": 42, @@ -5055,8 +6479,8 @@ "shortName": "GetIntent" } }, - "file": "dialogflow_generated_dialogflow_v2_intents_get_intent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Intents_GetIntent_async", + "file": "dialogflow_v2_generated_intents_get_intent_async.py", + "regionTag": "dialogflow_v2_generated_Intents_GetIntent_async", "segments": [ { "end": 44, @@ -5099,8 +6523,8 @@ "shortName": "GetIntent" } }, - "file": "dialogflow_generated_dialogflow_v2_intents_get_intent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Intents_GetIntent_sync", + "file": "dialogflow_v2_generated_intents_get_intent_sync.py", + "regionTag": "dialogflow_v2_generated_Intents_GetIntent_sync", "segments": [ { "end": 44, @@ -5144,8 +6568,8 @@ "shortName": "ListIntents" } }, - "file": "dialogflow_generated_dialogflow_v2_intents_list_intents_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Intents_ListIntents_async", + "file": "dialogflow_v2_generated_intents_list_intents_async.py", + "regionTag": "dialogflow_v2_generated_Intents_ListIntents_async", "segments": [ { "end": 45, @@ -5188,8 +6612,8 @@ "shortName": "ListIntents" } }, - "file": "dialogflow_generated_dialogflow_v2_intents_list_intents_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Intents_ListIntents_sync", + "file": "dialogflow_v2_generated_intents_list_intents_sync.py", + "regionTag": "dialogflow_v2_generated_Intents_ListIntents_sync", "segments": [ { "end": 45, @@ -5233,8 +6657,8 @@ "shortName": "UpdateIntent" } }, - "file": "dialogflow_generated_dialogflow_v2_intents_update_intent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Intents_UpdateIntent_async", + "file": "dialogflow_v2_generated_intents_update_intent_async.py", + "regionTag": "dialogflow_v2_generated_Intents_UpdateIntent_async", "segments": [ { "end": 47, @@ -5277,8 +6701,8 @@ "shortName": "UpdateIntent" } }, - "file": "dialogflow_generated_dialogflow_v2_intents_update_intent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Intents_UpdateIntent_sync", + "file": "dialogflow_v2_generated_intents_update_intent_sync.py", + "regionTag": "dialogflow_v2_generated_Intents_UpdateIntent_sync", "segments": [ { "end": 47, @@ -5322,8 +6746,8 @@ "shortName": "CreateKnowledgeBase" } }, - "file": "dialogflow_generated_dialogflow_v2_knowledge_bases_create_knowledge_base_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_KnowledgeBases_CreateKnowledgeBase_async", + "file": "dialogflow_v2_generated_knowledge_bases_create_knowledge_base_async.py", + "regionTag": "dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_async", "segments": [ { "end": 48, @@ -5366,8 +6790,8 @@ "shortName": "CreateKnowledgeBase" } }, - "file": "dialogflow_generated_dialogflow_v2_knowledge_bases_create_knowledge_base_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_KnowledgeBases_CreateKnowledgeBase_sync", + "file": "dialogflow_v2_generated_knowledge_bases_create_knowledge_base_sync.py", + "regionTag": "dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_sync", "segments": [ { "end": 48, @@ -5411,8 +6835,8 @@ "shortName": "DeleteKnowledgeBase" } }, - "file": "dialogflow_generated_dialogflow_v2_knowledge_bases_delete_knowledge_base_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_KnowledgeBases_DeleteKnowledgeBase_async", + "file": "dialogflow_v2_generated_knowledge_bases_delete_knowledge_base_async.py", + "regionTag": "dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_async", "segments": [ { "end": 42, @@ -5453,8 +6877,8 @@ "shortName": "DeleteKnowledgeBase" } }, - "file": "dialogflow_generated_dialogflow_v2_knowledge_bases_delete_knowledge_base_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_KnowledgeBases_DeleteKnowledgeBase_sync", + "file": "dialogflow_v2_generated_knowledge_bases_delete_knowledge_base_sync.py", + "regionTag": "dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_sync", "segments": [ { "end": 42, @@ -5496,8 +6920,8 @@ "shortName": "GetKnowledgeBase" } }, - "file": "dialogflow_generated_dialogflow_v2_knowledge_bases_get_knowledge_base_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_KnowledgeBases_GetKnowledgeBase_async", + "file": "dialogflow_v2_generated_knowledge_bases_get_knowledge_base_async.py", + "regionTag": "dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_async", "segments": [ { "end": 44, @@ -5540,8 +6964,8 @@ "shortName": "GetKnowledgeBase" } }, - "file": "dialogflow_generated_dialogflow_v2_knowledge_bases_get_knowledge_base_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_KnowledgeBases_GetKnowledgeBase_sync", + "file": "dialogflow_v2_generated_knowledge_bases_get_knowledge_base_sync.py", + "regionTag": "dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_sync", "segments": [ { "end": 44, @@ -5585,8 +7009,8 @@ "shortName": "ListKnowledgeBases" } }, - "file": "dialogflow_generated_dialogflow_v2_knowledge_bases_list_knowledge_bases_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_KnowledgeBases_ListKnowledgeBases_async", + "file": "dialogflow_v2_generated_knowledge_bases_list_knowledge_bases_async.py", + "regionTag": "dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_async", "segments": [ { "end": 45, @@ -5629,8 +7053,8 @@ "shortName": "ListKnowledgeBases" } }, - "file": "dialogflow_generated_dialogflow_v2_knowledge_bases_list_knowledge_bases_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_KnowledgeBases_ListKnowledgeBases_sync", + "file": "dialogflow_v2_generated_knowledge_bases_list_knowledge_bases_sync.py", + "regionTag": "dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_sync", "segments": [ { "end": 45, @@ -5674,8 +7098,8 @@ "shortName": "UpdateKnowledgeBase" } }, - "file": "dialogflow_generated_dialogflow_v2_knowledge_bases_update_knowledge_base_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_KnowledgeBases_UpdateKnowledgeBase_async", + "file": "dialogflow_v2_generated_knowledge_bases_update_knowledge_base_async.py", + "regionTag": "dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_async", "segments": [ { "end": 47, @@ -5718,8 +7142,8 @@ "shortName": "UpdateKnowledgeBase" } }, - "file": "dialogflow_generated_dialogflow_v2_knowledge_bases_update_knowledge_base_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_KnowledgeBases_UpdateKnowledgeBase_sync", + "file": "dialogflow_v2_generated_knowledge_bases_update_knowledge_base_sync.py", + "regionTag": "dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_sync", "segments": [ { "end": 47, @@ -5763,8 +7187,8 @@ "shortName": "AnalyzeContent" } }, - "file": "dialogflow_generated_dialogflow_v2_participants_analyze_content_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Participants_AnalyzeContent_async", + "file": "dialogflow_v2_generated_participants_analyze_content_async.py", + "regionTag": "dialogflow_v2_generated_Participants_AnalyzeContent_async", "segments": [ { "end": 49, @@ -5807,8 +7231,8 @@ "shortName": "AnalyzeContent" } }, - "file": "dialogflow_generated_dialogflow_v2_participants_analyze_content_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Participants_AnalyzeContent_sync", + "file": "dialogflow_v2_generated_participants_analyze_content_sync.py", + "regionTag": "dialogflow_v2_generated_Participants_AnalyzeContent_sync", "segments": [ { "end": 49, @@ -5852,8 +7276,8 @@ "shortName": "CreateParticipant" } }, - "file": "dialogflow_generated_dialogflow_v2_participants_create_participant_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Participants_CreateParticipant_async", + "file": "dialogflow_v2_generated_participants_create_participant_async.py", + "regionTag": "dialogflow_v2_generated_Participants_CreateParticipant_async", "segments": [ { "end": 44, @@ -5896,8 +7320,8 @@ "shortName": "CreateParticipant" } }, - "file": "dialogflow_generated_dialogflow_v2_participants_create_participant_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Participants_CreateParticipant_sync", + "file": "dialogflow_v2_generated_participants_create_participant_sync.py", + "regionTag": "dialogflow_v2_generated_Participants_CreateParticipant_sync", "segments": [ { "end": 44, @@ -5941,8 +7365,8 @@ "shortName": "GetParticipant" } }, - "file": "dialogflow_generated_dialogflow_v2_participants_get_participant_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Participants_GetParticipant_async", + "file": "dialogflow_v2_generated_participants_get_participant_async.py", + "regionTag": "dialogflow_v2_generated_Participants_GetParticipant_async", "segments": [ { "end": 44, @@ -5985,8 +7409,8 @@ "shortName": "GetParticipant" } }, - "file": "dialogflow_generated_dialogflow_v2_participants_get_participant_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Participants_GetParticipant_sync", + "file": "dialogflow_v2_generated_participants_get_participant_sync.py", + "regionTag": "dialogflow_v2_generated_Participants_GetParticipant_sync", "segments": [ { "end": 44, @@ -6030,8 +7454,8 @@ "shortName": "ListParticipants" } }, - "file": "dialogflow_generated_dialogflow_v2_participants_list_participants_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Participants_ListParticipants_async", + "file": "dialogflow_v2_generated_participants_list_participants_async.py", + "regionTag": "dialogflow_v2_generated_Participants_ListParticipants_async", "segments": [ { "end": 45, @@ -6074,8 +7498,8 @@ "shortName": "ListParticipants" } }, - "file": "dialogflow_generated_dialogflow_v2_participants_list_participants_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Participants_ListParticipants_sync", + "file": "dialogflow_v2_generated_participants_list_participants_sync.py", + "regionTag": "dialogflow_v2_generated_Participants_ListParticipants_sync", "segments": [ { "end": 45, @@ -6119,8 +7543,8 @@ "shortName": "SuggestArticles" } }, - "file": "dialogflow_generated_dialogflow_v2_participants_suggest_articles_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Participants_SuggestArticles_async", + "file": "dialogflow_v2_generated_participants_suggest_articles_async.py", + "regionTag": "dialogflow_v2_generated_Participants_SuggestArticles_async", "segments": [ { "end": 44, @@ -6163,8 +7587,8 @@ "shortName": "SuggestArticles" } }, - "file": "dialogflow_generated_dialogflow_v2_participants_suggest_articles_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Participants_SuggestArticles_sync", + "file": "dialogflow_v2_generated_participants_suggest_articles_sync.py", + "regionTag": "dialogflow_v2_generated_Participants_SuggestArticles_sync", "segments": [ { "end": 44, @@ -6208,8 +7632,8 @@ "shortName": "SuggestFaqAnswers" } }, - "file": "dialogflow_generated_dialogflow_v2_participants_suggest_faq_answers_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Participants_SuggestFaqAnswers_async", + "file": "dialogflow_v2_generated_participants_suggest_faq_answers_async.py", + "regionTag": "dialogflow_v2_generated_Participants_SuggestFaqAnswers_async", "segments": [ { "end": 44, @@ -6252,8 +7676,8 @@ "shortName": "SuggestFaqAnswers" } }, - "file": "dialogflow_generated_dialogflow_v2_participants_suggest_faq_answers_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Participants_SuggestFaqAnswers_sync", + "file": "dialogflow_v2_generated_participants_suggest_faq_answers_sync.py", + "regionTag": "dialogflow_v2_generated_Participants_SuggestFaqAnswers_sync", "segments": [ { "end": 44, @@ -6297,8 +7721,8 @@ "shortName": "SuggestSmartReplies" } }, - "file": "dialogflow_generated_dialogflow_v2_participants_suggest_smart_replies_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Participants_SuggestSmartReplies_async", + "file": "dialogflow_v2_generated_participants_suggest_smart_replies_async.py", + "regionTag": "dialogflow_v2_generated_Participants_SuggestSmartReplies_async", "segments": [ { "end": 44, @@ -6341,8 +7765,8 @@ "shortName": "SuggestSmartReplies" } }, - "file": "dialogflow_generated_dialogflow_v2_participants_suggest_smart_replies_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Participants_SuggestSmartReplies_sync", + "file": "dialogflow_v2_generated_participants_suggest_smart_replies_sync.py", + "regionTag": "dialogflow_v2_generated_Participants_SuggestSmartReplies_sync", "segments": [ { "end": 44, @@ -6386,8 +7810,8 @@ "shortName": "UpdateParticipant" } }, - "file": "dialogflow_generated_dialogflow_v2_participants_update_participant_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Participants_UpdateParticipant_async", + "file": "dialogflow_v2_generated_participants_update_participant_async.py", + "regionTag": "dialogflow_v2_generated_Participants_UpdateParticipant_async", "segments": [ { "end": 43, @@ -6430,8 +7854,8 @@ "shortName": "UpdateParticipant" } }, - "file": "dialogflow_generated_dialogflow_v2_participants_update_participant_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Participants_UpdateParticipant_sync", + "file": "dialogflow_v2_generated_participants_update_participant_sync.py", + "regionTag": "dialogflow_v2_generated_Participants_UpdateParticipant_sync", "segments": [ { "end": 43, @@ -6475,8 +7899,8 @@ "shortName": "CreateSessionEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2_session_entity_types_create_session_entity_type_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_SessionEntityTypes_CreateSessionEntityType_async", + "file": "dialogflow_v2_generated_session_entity_types_create_session_entity_type_async.py", + "regionTag": "dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_async", "segments": [ { "end": 51, @@ -6519,8 +7943,8 @@ "shortName": "CreateSessionEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2_session_entity_types_create_session_entity_type_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_SessionEntityTypes_CreateSessionEntityType_sync", + "file": "dialogflow_v2_generated_session_entity_types_create_session_entity_type_sync.py", + "regionTag": "dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_sync", "segments": [ { "end": 51, @@ -6564,8 +7988,8 @@ "shortName": "DeleteSessionEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2_session_entity_types_delete_session_entity_type_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_SessionEntityTypes_DeleteSessionEntityType_async", + "file": "dialogflow_v2_generated_session_entity_types_delete_session_entity_type_async.py", + "regionTag": "dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_async", "segments": [ { "end": 42, @@ -6606,8 +8030,8 @@ "shortName": "DeleteSessionEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2_session_entity_types_delete_session_entity_type_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_SessionEntityTypes_DeleteSessionEntityType_sync", + "file": "dialogflow_v2_generated_session_entity_types_delete_session_entity_type_sync.py", + "regionTag": "dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_sync", "segments": [ { "end": 42, @@ -6649,8 +8073,8 @@ "shortName": "GetSessionEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2_session_entity_types_get_session_entity_type_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_SessionEntityTypes_GetSessionEntityType_async", + "file": "dialogflow_v2_generated_session_entity_types_get_session_entity_type_async.py", + "regionTag": "dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_async", "segments": [ { "end": 44, @@ -6693,8 +8117,8 @@ "shortName": "GetSessionEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2_session_entity_types_get_session_entity_type_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_SessionEntityTypes_GetSessionEntityType_sync", + "file": "dialogflow_v2_generated_session_entity_types_get_session_entity_type_sync.py", + "regionTag": "dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_sync", "segments": [ { "end": 44, @@ -6738,8 +8162,8 @@ "shortName": "ListSessionEntityTypes" } }, - "file": "dialogflow_generated_dialogflow_v2_session_entity_types_list_session_entity_types_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_SessionEntityTypes_ListSessionEntityTypes_async", + "file": "dialogflow_v2_generated_session_entity_types_list_session_entity_types_async.py", + "regionTag": "dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_async", "segments": [ { "end": 45, @@ -6782,8 +8206,8 @@ "shortName": "ListSessionEntityTypes" } }, - "file": "dialogflow_generated_dialogflow_v2_session_entity_types_list_session_entity_types_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_SessionEntityTypes_ListSessionEntityTypes_sync", + "file": "dialogflow_v2_generated_session_entity_types_list_session_entity_types_sync.py", + "regionTag": "dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_sync", "segments": [ { "end": 45, @@ -6827,8 +8251,8 @@ "shortName": "UpdateSessionEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2_session_entity_types_update_session_entity_type_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_SessionEntityTypes_UpdateSessionEntityType_async", + "file": "dialogflow_v2_generated_session_entity_types_update_session_entity_type_async.py", + "regionTag": "dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_async", "segments": [ { "end": 50, @@ -6871,8 +8295,8 @@ "shortName": "UpdateSessionEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2_session_entity_types_update_session_entity_type_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_SessionEntityTypes_UpdateSessionEntityType_sync", + "file": "dialogflow_v2_generated_session_entity_types_update_session_entity_type_sync.py", + "regionTag": "dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_sync", "segments": [ { "end": 50, @@ -6916,8 +8340,8 @@ "shortName": "DetectIntent" } }, - "file": "dialogflow_generated_dialogflow_v2_sessions_detect_intent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Sessions_DetectIntent_async", + "file": "dialogflow_v2_generated_sessions_detect_intent_async.py", + "regionTag": "dialogflow_v2_generated_Sessions_DetectIntent_async", "segments": [ { "end": 44, @@ -6960,8 +8384,8 @@ "shortName": "DetectIntent" } }, - "file": "dialogflow_generated_dialogflow_v2_sessions_detect_intent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Sessions_DetectIntent_sync", + "file": "dialogflow_v2_generated_sessions_detect_intent_sync.py", + "regionTag": "dialogflow_v2_generated_Sessions_DetectIntent_sync", "segments": [ { "end": 44, @@ -7005,8 +8429,8 @@ "shortName": "StreamingDetectIntent" } }, - "file": "dialogflow_generated_dialogflow_v2_sessions_streaming_detect_intent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Sessions_StreamingDetectIntent_async", + "file": "dialogflow_v2_generated_sessions_streaming_detect_intent_async.py", + "regionTag": "dialogflow_v2_generated_Sessions_StreamingDetectIntent_async", "segments": [ { "end": 55, @@ -7049,8 +8473,8 @@ "shortName": "StreamingDetectIntent" } }, - "file": "dialogflow_generated_dialogflow_v2_sessions_streaming_detect_intent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Sessions_StreamingDetectIntent_sync", + "file": "dialogflow_v2_generated_sessions_streaming_detect_intent_sync.py", + "regionTag": "dialogflow_v2_generated_Sessions_StreamingDetectIntent_sync", "segments": [ { "end": 55, @@ -7094,8 +8518,8 @@ "shortName": "CreateVersion" } }, - "file": "dialogflow_generated_dialogflow_v2_versions_create_version_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Versions_CreateVersion_async", + "file": "dialogflow_v2_generated_versions_create_version_async.py", + "regionTag": "dialogflow_v2_generated_Versions_CreateVersion_async", "segments": [ { "end": 44, @@ -7138,8 +8562,8 @@ "shortName": "CreateVersion" } }, - "file": "dialogflow_generated_dialogflow_v2_versions_create_version_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Versions_CreateVersion_sync", + "file": "dialogflow_v2_generated_versions_create_version_sync.py", + "regionTag": "dialogflow_v2_generated_Versions_CreateVersion_sync", "segments": [ { "end": 44, @@ -7183,8 +8607,8 @@ "shortName": "DeleteVersion" } }, - "file": "dialogflow_generated_dialogflow_v2_versions_delete_version_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Versions_DeleteVersion_async", + "file": "dialogflow_v2_generated_versions_delete_version_async.py", + "regionTag": "dialogflow_v2_generated_Versions_DeleteVersion_async", "segments": [ { "end": 42, @@ -7225,8 +8649,8 @@ "shortName": "DeleteVersion" } }, - "file": "dialogflow_generated_dialogflow_v2_versions_delete_version_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Versions_DeleteVersion_sync", + "file": "dialogflow_v2_generated_versions_delete_version_sync.py", + "regionTag": "dialogflow_v2_generated_Versions_DeleteVersion_sync", "segments": [ { "end": 42, @@ -7268,8 +8692,8 @@ "shortName": "GetVersion" } }, - "file": "dialogflow_generated_dialogflow_v2_versions_get_version_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Versions_GetVersion_async", + "file": "dialogflow_v2_generated_versions_get_version_async.py", + "regionTag": "dialogflow_v2_generated_Versions_GetVersion_async", "segments": [ { "end": 44, @@ -7312,8 +8736,8 @@ "shortName": "GetVersion" } }, - "file": "dialogflow_generated_dialogflow_v2_versions_get_version_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Versions_GetVersion_sync", + "file": "dialogflow_v2_generated_versions_get_version_sync.py", + "regionTag": "dialogflow_v2_generated_Versions_GetVersion_sync", "segments": [ { "end": 44, @@ -7357,8 +8781,8 @@ "shortName": "ListVersions" } }, - "file": "dialogflow_generated_dialogflow_v2_versions_list_versions_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Versions_ListVersions_async", + "file": "dialogflow_v2_generated_versions_list_versions_async.py", + "regionTag": "dialogflow_v2_generated_Versions_ListVersions_async", "segments": [ { "end": 45, @@ -7401,8 +8825,8 @@ "shortName": "ListVersions" } }, - "file": "dialogflow_generated_dialogflow_v2_versions_list_versions_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Versions_ListVersions_sync", + "file": "dialogflow_v2_generated_versions_list_versions_sync.py", + "regionTag": "dialogflow_v2_generated_Versions_ListVersions_sync", "segments": [ { "end": 45, @@ -7446,8 +8870,8 @@ "shortName": "UpdateVersion" } }, - "file": "dialogflow_generated_dialogflow_v2_versions_update_version_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Versions_UpdateVersion_async", + "file": "dialogflow_v2_generated_versions_update_version_async.py", + "regionTag": "dialogflow_v2_generated_Versions_UpdateVersion_async", "segments": [ { "end": 43, @@ -7490,8 +8914,8 @@ "shortName": "UpdateVersion" } }, - "file": "dialogflow_generated_dialogflow_v2_versions_update_version_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2_Versions_UpdateVersion_sync", + "file": "dialogflow_v2_generated_versions_update_version_sync.py", + "regionTag": "dialogflow_v2_generated_Versions_UpdateVersion_sync", "segments": [ { "end": 43, diff --git a/packages/google-cloud-dialogflow/samples/generated_samples/snippet_metadata_dialogflow_v2beta1.json b/packages/google-cloud-dialogflow/samples/generated_samples/snippet_metadata_dialogflow_v2beta1.json index eec0e1264901..15868b215bca 100644 --- a/packages/google-cloud-dialogflow/samples/generated_samples/snippet_metadata_dialogflow_v2beta1.json +++ b/packages/google-cloud-dialogflow/samples/generated_samples/snippet_metadata_dialogflow_v2beta1.json @@ -10,8 +10,8 @@ "shortName": "DeleteAgent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_delete_agent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_DeleteAgent_async", + "file": "dialogflow_v2beta1_generated_agents_delete_agent_async.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_DeleteAgent_async", "segments": [ { "end": 42, @@ -52,8 +52,8 @@ "shortName": "DeleteAgent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_delete_agent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_DeleteAgent_sync", + "file": "dialogflow_v2beta1_generated_agents_delete_agent_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_DeleteAgent_sync", "segments": [ { "end": 42, @@ -95,8 +95,8 @@ "shortName": "ExportAgent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_export_agent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_ExportAgent_async", + "file": "dialogflow_v2beta1_generated_agents_export_agent_async.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_ExportAgent_async", "segments": [ { "end": 48, @@ -139,8 +139,8 @@ "shortName": "ExportAgent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_export_agent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_ExportAgent_sync", + "file": "dialogflow_v2beta1_generated_agents_export_agent_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_ExportAgent_sync", "segments": [ { "end": 48, @@ -184,8 +184,8 @@ "shortName": "GetAgent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_get_agent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_GetAgent_async", + "file": "dialogflow_v2beta1_generated_agents_get_agent_async.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_GetAgent_async", "segments": [ { "end": 44, @@ -228,8 +228,8 @@ "shortName": "GetAgent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_get_agent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_GetAgent_sync", + "file": "dialogflow_v2beta1_generated_agents_get_agent_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_GetAgent_sync", "segments": [ { "end": 44, @@ -273,8 +273,8 @@ "shortName": "GetValidationResult" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_get_validation_result_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_GetValidationResult_async", + "file": "dialogflow_v2beta1_generated_agents_get_validation_result_async.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_GetValidationResult_async", "segments": [ { "end": 44, @@ -317,8 +317,8 @@ "shortName": "GetValidationResult" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_get_validation_result_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_GetValidationResult_sync", + "file": "dialogflow_v2beta1_generated_agents_get_validation_result_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_GetValidationResult_sync", "segments": [ { "end": 44, @@ -362,8 +362,8 @@ "shortName": "ImportAgent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_import_agent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_ImportAgent_async", + "file": "dialogflow_v2beta1_generated_agents_import_agent_async.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_ImportAgent_async", "segments": [ { "end": 49, @@ -406,8 +406,8 @@ "shortName": "ImportAgent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_import_agent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_ImportAgent_sync", + "file": "dialogflow_v2beta1_generated_agents_import_agent_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_ImportAgent_sync", "segments": [ { "end": 49, @@ -451,8 +451,8 @@ "shortName": "RestoreAgent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_restore_agent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_RestoreAgent_async", + "file": "dialogflow_v2beta1_generated_agents_restore_agent_async.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_RestoreAgent_async", "segments": [ { "end": 49, @@ -495,8 +495,8 @@ "shortName": "RestoreAgent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_restore_agent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_RestoreAgent_sync", + "file": "dialogflow_v2beta1_generated_agents_restore_agent_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_RestoreAgent_sync", "segments": [ { "end": 49, @@ -540,8 +540,8 @@ "shortName": "SearchAgents" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_search_agents_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_SearchAgents_async", + "file": "dialogflow_v2beta1_generated_agents_search_agents_async.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_SearchAgents_async", "segments": [ { "end": 45, @@ -584,8 +584,8 @@ "shortName": "SearchAgents" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_search_agents_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_SearchAgents_sync", + "file": "dialogflow_v2beta1_generated_agents_search_agents_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_SearchAgents_sync", "segments": [ { "end": 45, @@ -629,8 +629,8 @@ "shortName": "SetAgent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_set_agent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_SetAgent_async", + "file": "dialogflow_v2beta1_generated_agents_set_agent_async.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_SetAgent_async", "segments": [ { "end": 47, @@ -673,8 +673,8 @@ "shortName": "SetAgent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_set_agent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_SetAgent_sync", + "file": "dialogflow_v2beta1_generated_agents_set_agent_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_SetAgent_sync", "segments": [ { "end": 47, @@ -718,8 +718,8 @@ "shortName": "TrainAgent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_train_agent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_TrainAgent_async", + "file": "dialogflow_v2beta1_generated_agents_train_agent_async.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_TrainAgent_async", "segments": [ { "end": 48, @@ -762,8 +762,8 @@ "shortName": "TrainAgent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_agents_train_agent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Agents_TrainAgent_sync", + "file": "dialogflow_v2beta1_generated_agents_train_agent_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Agents_TrainAgent_sync", "segments": [ { "end": 48, @@ -807,8 +807,8 @@ "shortName": "GetAnswerRecord" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_answer_records_get_answer_record_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_AnswerRecords_GetAnswerRecord_async", + "file": "dialogflow_v2beta1_generated_answer_records_get_answer_record_async.py", + "regionTag": "dialogflow_v2beta1_generated_AnswerRecords_GetAnswerRecord_async", "segments": [ { "end": 43, @@ -851,8 +851,8 @@ "shortName": "GetAnswerRecord" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_answer_records_get_answer_record_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_AnswerRecords_GetAnswerRecord_sync", + "file": "dialogflow_v2beta1_generated_answer_records_get_answer_record_sync.py", + "regionTag": "dialogflow_v2beta1_generated_AnswerRecords_GetAnswerRecord_sync", "segments": [ { "end": 43, @@ -896,8 +896,8 @@ "shortName": "ListAnswerRecords" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_answer_records_list_answer_records_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_AnswerRecords_ListAnswerRecords_async", + "file": "dialogflow_v2beta1_generated_answer_records_list_answer_records_async.py", + "regionTag": "dialogflow_v2beta1_generated_AnswerRecords_ListAnswerRecords_async", "segments": [ { "end": 44, @@ -940,8 +940,8 @@ "shortName": "ListAnswerRecords" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_answer_records_list_answer_records_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_AnswerRecords_ListAnswerRecords_sync", + "file": "dialogflow_v2beta1_generated_answer_records_list_answer_records_sync.py", + "regionTag": "dialogflow_v2beta1_generated_AnswerRecords_ListAnswerRecords_sync", "segments": [ { "end": 44, @@ -985,8 +985,8 @@ "shortName": "UpdateAnswerRecord" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_answer_records_update_answer_record_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_AnswerRecords_UpdateAnswerRecord_async", + "file": "dialogflow_v2beta1_generated_answer_records_update_answer_record_async.py", + "regionTag": "dialogflow_v2beta1_generated_AnswerRecords_UpdateAnswerRecord_async", "segments": [ { "end": 43, @@ -1029,8 +1029,8 @@ "shortName": "UpdateAnswerRecord" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_answer_records_update_answer_record_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_AnswerRecords_UpdateAnswerRecord_sync", + "file": "dialogflow_v2beta1_generated_answer_records_update_answer_record_sync.py", + "regionTag": "dialogflow_v2beta1_generated_AnswerRecords_UpdateAnswerRecord_sync", "segments": [ { "end": 43, @@ -1074,8 +1074,8 @@ "shortName": "CreateContext" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_contexts_create_context_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Contexts_CreateContext_async", + "file": "dialogflow_v2beta1_generated_contexts_create_context_async.py", + "regionTag": "dialogflow_v2beta1_generated_Contexts_CreateContext_async", "segments": [ { "end": 44, @@ -1118,8 +1118,8 @@ "shortName": "CreateContext" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_contexts_create_context_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Contexts_CreateContext_sync", + "file": "dialogflow_v2beta1_generated_contexts_create_context_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Contexts_CreateContext_sync", "segments": [ { "end": 44, @@ -1163,8 +1163,8 @@ "shortName": "DeleteAllContexts" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_contexts_delete_all_contexts_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Contexts_DeleteAllContexts_async", + "file": "dialogflow_v2beta1_generated_contexts_delete_all_contexts_async.py", + "regionTag": "dialogflow_v2beta1_generated_Contexts_DeleteAllContexts_async", "segments": [ { "end": 42, @@ -1205,8 +1205,8 @@ "shortName": "DeleteAllContexts" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_contexts_delete_all_contexts_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Contexts_DeleteAllContexts_sync", + "file": "dialogflow_v2beta1_generated_contexts_delete_all_contexts_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Contexts_DeleteAllContexts_sync", "segments": [ { "end": 42, @@ -1248,8 +1248,8 @@ "shortName": "DeleteContext" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_contexts_delete_context_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Contexts_DeleteContext_async", + "file": "dialogflow_v2beta1_generated_contexts_delete_context_async.py", + "regionTag": "dialogflow_v2beta1_generated_Contexts_DeleteContext_async", "segments": [ { "end": 42, @@ -1290,8 +1290,8 @@ "shortName": "DeleteContext" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_contexts_delete_context_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Contexts_DeleteContext_sync", + "file": "dialogflow_v2beta1_generated_contexts_delete_context_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Contexts_DeleteContext_sync", "segments": [ { "end": 42, @@ -1333,8 +1333,8 @@ "shortName": "GetContext" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_contexts_get_context_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Contexts_GetContext_async", + "file": "dialogflow_v2beta1_generated_contexts_get_context_async.py", + "regionTag": "dialogflow_v2beta1_generated_Contexts_GetContext_async", "segments": [ { "end": 44, @@ -1377,8 +1377,8 @@ "shortName": "GetContext" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_contexts_get_context_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Contexts_GetContext_sync", + "file": "dialogflow_v2beta1_generated_contexts_get_context_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Contexts_GetContext_sync", "segments": [ { "end": 44, @@ -1422,8 +1422,8 @@ "shortName": "ListContexts" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_contexts_list_contexts_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Contexts_ListContexts_async", + "file": "dialogflow_v2beta1_generated_contexts_list_contexts_async.py", + "regionTag": "dialogflow_v2beta1_generated_Contexts_ListContexts_async", "segments": [ { "end": 45, @@ -1466,8 +1466,8 @@ "shortName": "ListContexts" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_contexts_list_contexts_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Contexts_ListContexts_sync", + "file": "dialogflow_v2beta1_generated_contexts_list_contexts_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Contexts_ListContexts_sync", "segments": [ { "end": 45, @@ -1511,8 +1511,8 @@ "shortName": "UpdateContext" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_contexts_update_context_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Contexts_UpdateContext_async", + "file": "dialogflow_v2beta1_generated_contexts_update_context_async.py", + "regionTag": "dialogflow_v2beta1_generated_Contexts_UpdateContext_async", "segments": [ { "end": 43, @@ -1555,8 +1555,8 @@ "shortName": "UpdateContext" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_contexts_update_context_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Contexts_UpdateContext_sync", + "file": "dialogflow_v2beta1_generated_contexts_update_context_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Contexts_UpdateContext_sync", "segments": [ { "end": 43, @@ -1600,8 +1600,8 @@ "shortName": "CreateConversationProfile" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversation_profiles_create_conversation_profile_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_ConversationProfiles_CreateConversationProfile_async", + "file": "dialogflow_v2beta1_generated_conversation_profiles_create_conversation_profile_async.py", + "regionTag": "dialogflow_v2beta1_generated_ConversationProfiles_CreateConversationProfile_async", "segments": [ { "end": 48, @@ -1644,8 +1644,8 @@ "shortName": "CreateConversationProfile" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversation_profiles_create_conversation_profile_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_ConversationProfiles_CreateConversationProfile_sync", + "file": "dialogflow_v2beta1_generated_conversation_profiles_create_conversation_profile_sync.py", + "regionTag": "dialogflow_v2beta1_generated_ConversationProfiles_CreateConversationProfile_sync", "segments": [ { "end": 48, @@ -1689,8 +1689,8 @@ "shortName": "DeleteConversationProfile" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversation_profiles_delete_conversation_profile_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_ConversationProfiles_DeleteConversationProfile_async", + "file": "dialogflow_v2beta1_generated_conversation_profiles_delete_conversation_profile_async.py", + "regionTag": "dialogflow_v2beta1_generated_ConversationProfiles_DeleteConversationProfile_async", "segments": [ { "end": 42, @@ -1731,8 +1731,8 @@ "shortName": "DeleteConversationProfile" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversation_profiles_delete_conversation_profile_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_ConversationProfiles_DeleteConversationProfile_sync", + "file": "dialogflow_v2beta1_generated_conversation_profiles_delete_conversation_profile_sync.py", + "regionTag": "dialogflow_v2beta1_generated_ConversationProfiles_DeleteConversationProfile_sync", "segments": [ { "end": 42, @@ -1774,8 +1774,8 @@ "shortName": "GetConversationProfile" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversation_profiles_get_conversation_profile_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_ConversationProfiles_GetConversationProfile_async", + "file": "dialogflow_v2beta1_generated_conversation_profiles_get_conversation_profile_async.py", + "regionTag": "dialogflow_v2beta1_generated_ConversationProfiles_GetConversationProfile_async", "segments": [ { "end": 44, @@ -1818,8 +1818,8 @@ "shortName": "GetConversationProfile" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversation_profiles_get_conversation_profile_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_ConversationProfiles_GetConversationProfile_sync", + "file": "dialogflow_v2beta1_generated_conversation_profiles_get_conversation_profile_sync.py", + "regionTag": "dialogflow_v2beta1_generated_ConversationProfiles_GetConversationProfile_sync", "segments": [ { "end": 44, @@ -1863,8 +1863,8 @@ "shortName": "ListConversationProfiles" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversation_profiles_list_conversation_profiles_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_ConversationProfiles_ListConversationProfiles_async", + "file": "dialogflow_v2beta1_generated_conversation_profiles_list_conversation_profiles_async.py", + "regionTag": "dialogflow_v2beta1_generated_ConversationProfiles_ListConversationProfiles_async", "segments": [ { "end": 45, @@ -1907,8 +1907,8 @@ "shortName": "ListConversationProfiles" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversation_profiles_list_conversation_profiles_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_ConversationProfiles_ListConversationProfiles_sync", + "file": "dialogflow_v2beta1_generated_conversation_profiles_list_conversation_profiles_sync.py", + "regionTag": "dialogflow_v2beta1_generated_ConversationProfiles_ListConversationProfiles_sync", "segments": [ { "end": 45, @@ -1952,8 +1952,8 @@ "shortName": "UpdateConversationProfile" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversation_profiles_update_conversation_profile_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_ConversationProfiles_UpdateConversationProfile_async", + "file": "dialogflow_v2beta1_generated_conversation_profiles_update_conversation_profile_async.py", + "regionTag": "dialogflow_v2beta1_generated_ConversationProfiles_UpdateConversationProfile_async", "segments": [ { "end": 47, @@ -1996,8 +1996,8 @@ "shortName": "UpdateConversationProfile" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversation_profiles_update_conversation_profile_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_ConversationProfiles_UpdateConversationProfile_sync", + "file": "dialogflow_v2beta1_generated_conversation_profiles_update_conversation_profile_sync.py", + "regionTag": "dialogflow_v2beta1_generated_ConversationProfiles_UpdateConversationProfile_sync", "segments": [ { "end": 47, @@ -2041,8 +2041,8 @@ "shortName": "BatchCreateMessages" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversations_batch_create_messages_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Conversations_BatchCreateMessages_async", + "file": "dialogflow_v2beta1_generated_conversations_batch_create_messages_async.py", + "regionTag": "dialogflow_v2beta1_generated_Conversations_BatchCreateMessages_async", "segments": [ { "end": 49, @@ -2085,8 +2085,8 @@ "shortName": "BatchCreateMessages" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversations_batch_create_messages_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Conversations_BatchCreateMessages_sync", + "file": "dialogflow_v2beta1_generated_conversations_batch_create_messages_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Conversations_BatchCreateMessages_sync", "segments": [ { "end": 49, @@ -2130,8 +2130,8 @@ "shortName": "CompleteConversation" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversations_complete_conversation_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Conversations_CompleteConversation_async", + "file": "dialogflow_v2beta1_generated_conversations_complete_conversation_async.py", + "regionTag": "dialogflow_v2beta1_generated_Conversations_CompleteConversation_async", "segments": [ { "end": 44, @@ -2174,8 +2174,8 @@ "shortName": "CompleteConversation" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversations_complete_conversation_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Conversations_CompleteConversation_sync", + "file": "dialogflow_v2beta1_generated_conversations_complete_conversation_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Conversations_CompleteConversation_sync", "segments": [ { "end": 44, @@ -2219,8 +2219,8 @@ "shortName": "CreateConversation" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversations_create_conversation_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Conversations_CreateConversation_async", + "file": "dialogflow_v2beta1_generated_conversations_create_conversation_async.py", + "regionTag": "dialogflow_v2beta1_generated_Conversations_CreateConversation_async", "segments": [ { "end": 48, @@ -2263,8 +2263,8 @@ "shortName": "CreateConversation" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversations_create_conversation_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Conversations_CreateConversation_sync", + "file": "dialogflow_v2beta1_generated_conversations_create_conversation_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Conversations_CreateConversation_sync", "segments": [ { "end": 48, @@ -2308,8 +2308,8 @@ "shortName": "GetConversation" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversations_get_conversation_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Conversations_GetConversation_async", + "file": "dialogflow_v2beta1_generated_conversations_get_conversation_async.py", + "regionTag": "dialogflow_v2beta1_generated_Conversations_GetConversation_async", "segments": [ { "end": 44, @@ -2352,8 +2352,8 @@ "shortName": "GetConversation" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversations_get_conversation_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Conversations_GetConversation_sync", + "file": "dialogflow_v2beta1_generated_conversations_get_conversation_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Conversations_GetConversation_sync", "segments": [ { "end": 44, @@ -2397,8 +2397,8 @@ "shortName": "ListConversations" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversations_list_conversations_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Conversations_ListConversations_async", + "file": "dialogflow_v2beta1_generated_conversations_list_conversations_async.py", + "regionTag": "dialogflow_v2beta1_generated_Conversations_ListConversations_async", "segments": [ { "end": 45, @@ -2441,8 +2441,8 @@ "shortName": "ListConversations" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversations_list_conversations_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Conversations_ListConversations_sync", + "file": "dialogflow_v2beta1_generated_conversations_list_conversations_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Conversations_ListConversations_sync", "segments": [ { "end": 45, @@ -2486,8 +2486,8 @@ "shortName": "ListMessages" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversations_list_messages_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Conversations_ListMessages_async", + "file": "dialogflow_v2beta1_generated_conversations_list_messages_async.py", + "regionTag": "dialogflow_v2beta1_generated_Conversations_ListMessages_async", "segments": [ { "end": 45, @@ -2530,8 +2530,8 @@ "shortName": "ListMessages" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_conversations_list_messages_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Conversations_ListMessages_sync", + "file": "dialogflow_v2beta1_generated_conversations_list_messages_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Conversations_ListMessages_sync", "segments": [ { "end": 45, @@ -2575,8 +2575,8 @@ "shortName": "CreateDocument" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_documents_create_document_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Documents_CreateDocument_async", + "file": "dialogflow_v2beta1_generated_documents_create_document_async.py", + "regionTag": "dialogflow_v2beta1_generated_Documents_CreateDocument_async", "segments": [ { "end": 55, @@ -2619,8 +2619,8 @@ "shortName": "CreateDocument" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_documents_create_document_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Documents_CreateDocument_sync", + "file": "dialogflow_v2beta1_generated_documents_create_document_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Documents_CreateDocument_sync", "segments": [ { "end": 55, @@ -2664,8 +2664,8 @@ "shortName": "DeleteDocument" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_documents_delete_document_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Documents_DeleteDocument_async", + "file": "dialogflow_v2beta1_generated_documents_delete_document_async.py", + "regionTag": "dialogflow_v2beta1_generated_Documents_DeleteDocument_async", "segments": [ { "end": 48, @@ -2708,8 +2708,8 @@ "shortName": "DeleteDocument" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_documents_delete_document_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Documents_DeleteDocument_sync", + "file": "dialogflow_v2beta1_generated_documents_delete_document_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Documents_DeleteDocument_sync", "segments": [ { "end": 48, @@ -2753,8 +2753,8 @@ "shortName": "GetDocument" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_documents_get_document_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Documents_GetDocument_async", + "file": "dialogflow_v2beta1_generated_documents_get_document_async.py", + "regionTag": "dialogflow_v2beta1_generated_Documents_GetDocument_async", "segments": [ { "end": 44, @@ -2797,8 +2797,8 @@ "shortName": "GetDocument" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_documents_get_document_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Documents_GetDocument_sync", + "file": "dialogflow_v2beta1_generated_documents_get_document_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Documents_GetDocument_sync", "segments": [ { "end": 44, @@ -2842,8 +2842,8 @@ "shortName": "ImportDocuments" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_documents_import_documents_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Documents_ImportDocuments_async", + "file": "dialogflow_v2beta1_generated_documents_import_documents_async.py", + "regionTag": "dialogflow_v2beta1_generated_Documents_ImportDocuments_async", "segments": [ { "end": 57, @@ -2886,8 +2886,8 @@ "shortName": "ImportDocuments" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_documents_import_documents_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Documents_ImportDocuments_sync", + "file": "dialogflow_v2beta1_generated_documents_import_documents_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Documents_ImportDocuments_sync", "segments": [ { "end": 57, @@ -2931,8 +2931,8 @@ "shortName": "ListDocuments" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_documents_list_documents_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Documents_ListDocuments_async", + "file": "dialogflow_v2beta1_generated_documents_list_documents_async.py", + "regionTag": "dialogflow_v2beta1_generated_Documents_ListDocuments_async", "segments": [ { "end": 45, @@ -2975,8 +2975,8 @@ "shortName": "ListDocuments" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_documents_list_documents_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Documents_ListDocuments_sync", + "file": "dialogflow_v2beta1_generated_documents_list_documents_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Documents_ListDocuments_sync", "segments": [ { "end": 45, @@ -3020,8 +3020,8 @@ "shortName": "ReloadDocument" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_documents_reload_document_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Documents_ReloadDocument_async", + "file": "dialogflow_v2beta1_generated_documents_reload_document_async.py", + "regionTag": "dialogflow_v2beta1_generated_Documents_ReloadDocument_async", "segments": [ { "end": 48, @@ -3064,8 +3064,8 @@ "shortName": "ReloadDocument" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_documents_reload_document_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Documents_ReloadDocument_sync", + "file": "dialogflow_v2beta1_generated_documents_reload_document_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Documents_ReloadDocument_sync", "segments": [ { "end": 48, @@ -3109,8 +3109,8 @@ "shortName": "UpdateDocument" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_documents_update_document_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Documents_UpdateDocument_async", + "file": "dialogflow_v2beta1_generated_documents_update_document_async.py", + "regionTag": "dialogflow_v2beta1_generated_Documents_UpdateDocument_async", "segments": [ { "end": 54, @@ -3153,8 +3153,8 @@ "shortName": "UpdateDocument" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_documents_update_document_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Documents_UpdateDocument_sync", + "file": "dialogflow_v2beta1_generated_documents_update_document_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Documents_UpdateDocument_sync", "segments": [ { "end": 54, @@ -3198,8 +3198,8 @@ "shortName": "BatchCreateEntities" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_batch_create_entities_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_BatchCreateEntities_async", + "file": "dialogflow_v2beta1_generated_entity_types_batch_create_entities_async.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_BatchCreateEntities_async", "segments": [ { "end": 52, @@ -3242,8 +3242,8 @@ "shortName": "BatchCreateEntities" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_batch_create_entities_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_BatchCreateEntities_sync", + "file": "dialogflow_v2beta1_generated_entity_types_batch_create_entities_sync.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_BatchCreateEntities_sync", "segments": [ { "end": 52, @@ -3287,8 +3287,8 @@ "shortName": "BatchDeleteEntities" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_batch_delete_entities_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_BatchDeleteEntities_async", + "file": "dialogflow_v2beta1_generated_entity_types_batch_delete_entities_async.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntities_async", "segments": [ { "end": 49, @@ -3331,8 +3331,8 @@ "shortName": "BatchDeleteEntities" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_batch_delete_entities_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_BatchDeleteEntities_sync", + "file": "dialogflow_v2beta1_generated_entity_types_batch_delete_entities_sync.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntities_sync", "segments": [ { "end": 49, @@ -3376,8 +3376,8 @@ "shortName": "BatchDeleteEntityTypes" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_batch_delete_entity_types_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_BatchDeleteEntityTypes_async", + "file": "dialogflow_v2beta1_generated_entity_types_batch_delete_entity_types_async.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntityTypes_async", "segments": [ { "end": 49, @@ -3420,8 +3420,8 @@ "shortName": "BatchDeleteEntityTypes" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_batch_delete_entity_types_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_BatchDeleteEntityTypes_sync", + "file": "dialogflow_v2beta1_generated_entity_types_batch_delete_entity_types_sync.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntityTypes_sync", "segments": [ { "end": 49, @@ -3465,8 +3465,8 @@ "shortName": "BatchUpdateEntities" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_batch_update_entities_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_BatchUpdateEntities_async", + "file": "dialogflow_v2beta1_generated_entity_types_batch_update_entities_async.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntities_async", "segments": [ { "end": 52, @@ -3509,8 +3509,8 @@ "shortName": "BatchUpdateEntities" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_batch_update_entities_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_BatchUpdateEntities_sync", + "file": "dialogflow_v2beta1_generated_entity_types_batch_update_entities_sync.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntities_sync", "segments": [ { "end": 52, @@ -3554,8 +3554,8 @@ "shortName": "BatchUpdateEntityTypes" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_batch_update_entity_types_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_BatchUpdateEntityTypes_async", + "file": "dialogflow_v2beta1_generated_entity_types_batch_update_entity_types_async.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntityTypes_async", "segments": [ { "end": 49, @@ -3598,8 +3598,8 @@ "shortName": "BatchUpdateEntityTypes" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_batch_update_entity_types_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_BatchUpdateEntityTypes_sync", + "file": "dialogflow_v2beta1_generated_entity_types_batch_update_entity_types_sync.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntityTypes_sync", "segments": [ { "end": 49, @@ -3643,8 +3643,8 @@ "shortName": "CreateEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_create_entity_type_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_CreateEntityType_async", + "file": "dialogflow_v2beta1_generated_entity_types_create_entity_type_async.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_CreateEntityType_async", "segments": [ { "end": 49, @@ -3687,8 +3687,8 @@ "shortName": "CreateEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_create_entity_type_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_CreateEntityType_sync", + "file": "dialogflow_v2beta1_generated_entity_types_create_entity_type_sync.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_CreateEntityType_sync", "segments": [ { "end": 49, @@ -3732,8 +3732,8 @@ "shortName": "DeleteEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_delete_entity_type_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_DeleteEntityType_async", + "file": "dialogflow_v2beta1_generated_entity_types_delete_entity_type_async.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_DeleteEntityType_async", "segments": [ { "end": 42, @@ -3774,8 +3774,8 @@ "shortName": "DeleteEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_delete_entity_type_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_DeleteEntityType_sync", + "file": "dialogflow_v2beta1_generated_entity_types_delete_entity_type_sync.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_DeleteEntityType_sync", "segments": [ { "end": 42, @@ -3817,8 +3817,8 @@ "shortName": "GetEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_get_entity_type_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_GetEntityType_async", + "file": "dialogflow_v2beta1_generated_entity_types_get_entity_type_async.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_GetEntityType_async", "segments": [ { "end": 44, @@ -3861,8 +3861,8 @@ "shortName": "GetEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_get_entity_type_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_GetEntityType_sync", + "file": "dialogflow_v2beta1_generated_entity_types_get_entity_type_sync.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_GetEntityType_sync", "segments": [ { "end": 44, @@ -3906,8 +3906,8 @@ "shortName": "ListEntityTypes" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_list_entity_types_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_ListEntityTypes_async", + "file": "dialogflow_v2beta1_generated_entity_types_list_entity_types_async.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_ListEntityTypes_async", "segments": [ { "end": 45, @@ -3950,8 +3950,8 @@ "shortName": "ListEntityTypes" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_list_entity_types_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_ListEntityTypes_sync", + "file": "dialogflow_v2beta1_generated_entity_types_list_entity_types_sync.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_ListEntityTypes_sync", "segments": [ { "end": 45, @@ -3995,8 +3995,8 @@ "shortName": "UpdateEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_update_entity_type_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_UpdateEntityType_async", + "file": "dialogflow_v2beta1_generated_entity_types_update_entity_type_async.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_UpdateEntityType_async", "segments": [ { "end": 48, @@ -4039,8 +4039,8 @@ "shortName": "UpdateEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_entity_types_update_entity_type_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_EntityTypes_UpdateEntityType_sync", + "file": "dialogflow_v2beta1_generated_entity_types_update_entity_type_sync.py", + "regionTag": "dialogflow_v2beta1_generated_EntityTypes_UpdateEntityType_sync", "segments": [ { "end": 48, @@ -4084,8 +4084,8 @@ "shortName": "CreateEnvironment" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_environments_create_environment_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Environments_CreateEnvironment_async", + "file": "dialogflow_v2beta1_generated_environments_create_environment_async.py", + "regionTag": "dialogflow_v2beta1_generated_Environments_CreateEnvironment_async", "segments": [ { "end": 45, @@ -4128,8 +4128,8 @@ "shortName": "CreateEnvironment" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_environments_create_environment_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Environments_CreateEnvironment_sync", + "file": "dialogflow_v2beta1_generated_environments_create_environment_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Environments_CreateEnvironment_sync", "segments": [ { "end": 45, @@ -4173,8 +4173,8 @@ "shortName": "DeleteEnvironment" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_environments_delete_environment_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Environments_DeleteEnvironment_async", + "file": "dialogflow_v2beta1_generated_environments_delete_environment_async.py", + "regionTag": "dialogflow_v2beta1_generated_Environments_DeleteEnvironment_async", "segments": [ { "end": 42, @@ -4215,8 +4215,8 @@ "shortName": "DeleteEnvironment" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_environments_delete_environment_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Environments_DeleteEnvironment_sync", + "file": "dialogflow_v2beta1_generated_environments_delete_environment_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Environments_DeleteEnvironment_sync", "segments": [ { "end": 42, @@ -4258,8 +4258,8 @@ "shortName": "GetEnvironmentHistory" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_environments_get_environment_history_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Environments_GetEnvironmentHistory_async", + "file": "dialogflow_v2beta1_generated_environments_get_environment_history_async.py", + "regionTag": "dialogflow_v2beta1_generated_Environments_GetEnvironmentHistory_async", "segments": [ { "end": 45, @@ -4302,8 +4302,8 @@ "shortName": "GetEnvironmentHistory" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_environments_get_environment_history_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Environments_GetEnvironmentHistory_sync", + "file": "dialogflow_v2beta1_generated_environments_get_environment_history_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Environments_GetEnvironmentHistory_sync", "segments": [ { "end": 45, @@ -4347,8 +4347,8 @@ "shortName": "GetEnvironment" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_environments_get_environment_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Environments_GetEnvironment_async", + "file": "dialogflow_v2beta1_generated_environments_get_environment_async.py", + "regionTag": "dialogflow_v2beta1_generated_Environments_GetEnvironment_async", "segments": [ { "end": 44, @@ -4391,8 +4391,8 @@ "shortName": "GetEnvironment" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_environments_get_environment_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Environments_GetEnvironment_sync", + "file": "dialogflow_v2beta1_generated_environments_get_environment_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Environments_GetEnvironment_sync", "segments": [ { "end": 44, @@ -4436,8 +4436,8 @@ "shortName": "ListEnvironments" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_environments_list_environments_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Environments_ListEnvironments_async", + "file": "dialogflow_v2beta1_generated_environments_list_environments_async.py", + "regionTag": "dialogflow_v2beta1_generated_Environments_ListEnvironments_async", "segments": [ { "end": 45, @@ -4480,8 +4480,8 @@ "shortName": "ListEnvironments" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_environments_list_environments_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Environments_ListEnvironments_sync", + "file": "dialogflow_v2beta1_generated_environments_list_environments_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Environments_ListEnvironments_sync", "segments": [ { "end": 45, @@ -4525,8 +4525,8 @@ "shortName": "UpdateEnvironment" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_environments_update_environment_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Environments_UpdateEnvironment_async", + "file": "dialogflow_v2beta1_generated_environments_update_environment_async.py", + "regionTag": "dialogflow_v2beta1_generated_Environments_UpdateEnvironment_async", "segments": [ { "end": 43, @@ -4569,8 +4569,8 @@ "shortName": "UpdateEnvironment" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_environments_update_environment_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Environments_UpdateEnvironment_sync", + "file": "dialogflow_v2beta1_generated_environments_update_environment_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Environments_UpdateEnvironment_sync", "segments": [ { "end": 43, @@ -4614,8 +4614,8 @@ "shortName": "GetFulfillment" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_fulfillments_get_fulfillment_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Fulfillments_GetFulfillment_async", + "file": "dialogflow_v2beta1_generated_fulfillments_get_fulfillment_async.py", + "regionTag": "dialogflow_v2beta1_generated_Fulfillments_GetFulfillment_async", "segments": [ { "end": 44, @@ -4658,8 +4658,8 @@ "shortName": "GetFulfillment" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_fulfillments_get_fulfillment_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Fulfillments_GetFulfillment_sync", + "file": "dialogflow_v2beta1_generated_fulfillments_get_fulfillment_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Fulfillments_GetFulfillment_sync", "segments": [ { "end": 44, @@ -4703,8 +4703,8 @@ "shortName": "UpdateFulfillment" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_fulfillments_update_fulfillment_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Fulfillments_UpdateFulfillment_async", + "file": "dialogflow_v2beta1_generated_fulfillments_update_fulfillment_async.py", + "regionTag": "dialogflow_v2beta1_generated_Fulfillments_UpdateFulfillment_async", "segments": [ { "end": 48, @@ -4747,8 +4747,8 @@ "shortName": "UpdateFulfillment" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_fulfillments_update_fulfillment_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Fulfillments_UpdateFulfillment_sync", + "file": "dialogflow_v2beta1_generated_fulfillments_update_fulfillment_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Fulfillments_UpdateFulfillment_sync", "segments": [ { "end": 48, @@ -4792,8 +4792,8 @@ "shortName": "BatchDeleteIntents" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_intents_batch_delete_intents_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Intents_BatchDeleteIntents_async", + "file": "dialogflow_v2beta1_generated_intents_batch_delete_intents_async.py", + "regionTag": "dialogflow_v2beta1_generated_Intents_BatchDeleteIntents_async", "segments": [ { "end": 52, @@ -4836,8 +4836,8 @@ "shortName": "BatchDeleteIntents" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_intents_batch_delete_intents_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Intents_BatchDeleteIntents_sync", + "file": "dialogflow_v2beta1_generated_intents_batch_delete_intents_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Intents_BatchDeleteIntents_sync", "segments": [ { "end": 52, @@ -4881,8 +4881,8 @@ "shortName": "BatchUpdateIntents" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_intents_batch_update_intents_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Intents_BatchUpdateIntents_async", + "file": "dialogflow_v2beta1_generated_intents_batch_update_intents_async.py", + "regionTag": "dialogflow_v2beta1_generated_Intents_BatchUpdateIntents_async", "segments": [ { "end": 49, @@ -4925,8 +4925,8 @@ "shortName": "BatchUpdateIntents" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_intents_batch_update_intents_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Intents_BatchUpdateIntents_sync", + "file": "dialogflow_v2beta1_generated_intents_batch_update_intents_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Intents_BatchUpdateIntents_sync", "segments": [ { "end": 49, @@ -4970,8 +4970,8 @@ "shortName": "CreateIntent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_intents_create_intent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Intents_CreateIntent_async", + "file": "dialogflow_v2beta1_generated_intents_create_intent_async.py", + "regionTag": "dialogflow_v2beta1_generated_Intents_CreateIntent_async", "segments": [ { "end": 48, @@ -5014,8 +5014,8 @@ "shortName": "CreateIntent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_intents_create_intent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Intents_CreateIntent_sync", + "file": "dialogflow_v2beta1_generated_intents_create_intent_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Intents_CreateIntent_sync", "segments": [ { "end": 48, @@ -5059,8 +5059,8 @@ "shortName": "DeleteIntent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_intents_delete_intent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Intents_DeleteIntent_async", + "file": "dialogflow_v2beta1_generated_intents_delete_intent_async.py", + "regionTag": "dialogflow_v2beta1_generated_Intents_DeleteIntent_async", "segments": [ { "end": 42, @@ -5101,8 +5101,8 @@ "shortName": "DeleteIntent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_intents_delete_intent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Intents_DeleteIntent_sync", + "file": "dialogflow_v2beta1_generated_intents_delete_intent_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Intents_DeleteIntent_sync", "segments": [ { "end": 42, @@ -5144,8 +5144,8 @@ "shortName": "GetIntent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_intents_get_intent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Intents_GetIntent_async", + "file": "dialogflow_v2beta1_generated_intents_get_intent_async.py", + "regionTag": "dialogflow_v2beta1_generated_Intents_GetIntent_async", "segments": [ { "end": 44, @@ -5188,8 +5188,8 @@ "shortName": "GetIntent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_intents_get_intent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Intents_GetIntent_sync", + "file": "dialogflow_v2beta1_generated_intents_get_intent_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Intents_GetIntent_sync", "segments": [ { "end": 44, @@ -5233,8 +5233,8 @@ "shortName": "ListIntents" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_intents_list_intents_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Intents_ListIntents_async", + "file": "dialogflow_v2beta1_generated_intents_list_intents_async.py", + "regionTag": "dialogflow_v2beta1_generated_Intents_ListIntents_async", "segments": [ { "end": 45, @@ -5277,8 +5277,8 @@ "shortName": "ListIntents" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_intents_list_intents_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Intents_ListIntents_sync", + "file": "dialogflow_v2beta1_generated_intents_list_intents_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Intents_ListIntents_sync", "segments": [ { "end": 45, @@ -5322,8 +5322,8 @@ "shortName": "UpdateIntent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_intents_update_intent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Intents_UpdateIntent_async", + "file": "dialogflow_v2beta1_generated_intents_update_intent_async.py", + "regionTag": "dialogflow_v2beta1_generated_Intents_UpdateIntent_async", "segments": [ { "end": 47, @@ -5366,8 +5366,8 @@ "shortName": "UpdateIntent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_intents_update_intent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Intents_UpdateIntent_sync", + "file": "dialogflow_v2beta1_generated_intents_update_intent_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Intents_UpdateIntent_sync", "segments": [ { "end": 47, @@ -5411,8 +5411,8 @@ "shortName": "CreateKnowledgeBase" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_knowledge_bases_create_knowledge_base_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_KnowledgeBases_CreateKnowledgeBase_async", + "file": "dialogflow_v2beta1_generated_knowledge_bases_create_knowledge_base_async.py", + "regionTag": "dialogflow_v2beta1_generated_KnowledgeBases_CreateKnowledgeBase_async", "segments": [ { "end": 48, @@ -5455,8 +5455,8 @@ "shortName": "CreateKnowledgeBase" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_knowledge_bases_create_knowledge_base_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_KnowledgeBases_CreateKnowledgeBase_sync", + "file": "dialogflow_v2beta1_generated_knowledge_bases_create_knowledge_base_sync.py", + "regionTag": "dialogflow_v2beta1_generated_KnowledgeBases_CreateKnowledgeBase_sync", "segments": [ { "end": 48, @@ -5500,8 +5500,8 @@ "shortName": "DeleteKnowledgeBase" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_knowledge_bases_delete_knowledge_base_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_KnowledgeBases_DeleteKnowledgeBase_async", + "file": "dialogflow_v2beta1_generated_knowledge_bases_delete_knowledge_base_async.py", + "regionTag": "dialogflow_v2beta1_generated_KnowledgeBases_DeleteKnowledgeBase_async", "segments": [ { "end": 42, @@ -5542,8 +5542,8 @@ "shortName": "DeleteKnowledgeBase" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_knowledge_bases_delete_knowledge_base_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_KnowledgeBases_DeleteKnowledgeBase_sync", + "file": "dialogflow_v2beta1_generated_knowledge_bases_delete_knowledge_base_sync.py", + "regionTag": "dialogflow_v2beta1_generated_KnowledgeBases_DeleteKnowledgeBase_sync", "segments": [ { "end": 42, @@ -5585,8 +5585,8 @@ "shortName": "GetKnowledgeBase" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_knowledge_bases_get_knowledge_base_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_KnowledgeBases_GetKnowledgeBase_async", + "file": "dialogflow_v2beta1_generated_knowledge_bases_get_knowledge_base_async.py", + "regionTag": "dialogflow_v2beta1_generated_KnowledgeBases_GetKnowledgeBase_async", "segments": [ { "end": 44, @@ -5629,8 +5629,8 @@ "shortName": "GetKnowledgeBase" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_knowledge_bases_get_knowledge_base_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_KnowledgeBases_GetKnowledgeBase_sync", + "file": "dialogflow_v2beta1_generated_knowledge_bases_get_knowledge_base_sync.py", + "regionTag": "dialogflow_v2beta1_generated_KnowledgeBases_GetKnowledgeBase_sync", "segments": [ { "end": 44, @@ -5674,8 +5674,8 @@ "shortName": "ListKnowledgeBases" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_knowledge_bases_list_knowledge_bases_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_KnowledgeBases_ListKnowledgeBases_async", + "file": "dialogflow_v2beta1_generated_knowledge_bases_list_knowledge_bases_async.py", + "regionTag": "dialogflow_v2beta1_generated_KnowledgeBases_ListKnowledgeBases_async", "segments": [ { "end": 45, @@ -5718,8 +5718,8 @@ "shortName": "ListKnowledgeBases" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_knowledge_bases_list_knowledge_bases_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_KnowledgeBases_ListKnowledgeBases_sync", + "file": "dialogflow_v2beta1_generated_knowledge_bases_list_knowledge_bases_sync.py", + "regionTag": "dialogflow_v2beta1_generated_KnowledgeBases_ListKnowledgeBases_sync", "segments": [ { "end": 45, @@ -5763,8 +5763,8 @@ "shortName": "UpdateKnowledgeBase" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_knowledge_bases_update_knowledge_base_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_KnowledgeBases_UpdateKnowledgeBase_async", + "file": "dialogflow_v2beta1_generated_knowledge_bases_update_knowledge_base_async.py", + "regionTag": "dialogflow_v2beta1_generated_KnowledgeBases_UpdateKnowledgeBase_async", "segments": [ { "end": 47, @@ -5807,8 +5807,8 @@ "shortName": "UpdateKnowledgeBase" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_knowledge_bases_update_knowledge_base_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_KnowledgeBases_UpdateKnowledgeBase_sync", + "file": "dialogflow_v2beta1_generated_knowledge_bases_update_knowledge_base_sync.py", + "regionTag": "dialogflow_v2beta1_generated_KnowledgeBases_UpdateKnowledgeBase_sync", "segments": [ { "end": 47, @@ -5852,8 +5852,8 @@ "shortName": "AnalyzeContent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_analyze_content_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_AnalyzeContent_async", + "file": "dialogflow_v2beta1_generated_participants_analyze_content_async.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_AnalyzeContent_async", "segments": [ { "end": 44, @@ -5896,8 +5896,8 @@ "shortName": "AnalyzeContent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_analyze_content_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_AnalyzeContent_sync", + "file": "dialogflow_v2beta1_generated_participants_analyze_content_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_AnalyzeContent_sync", "segments": [ { "end": 44, @@ -5941,8 +5941,8 @@ "shortName": "CompileSuggestion" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_compile_suggestion_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_CompileSuggestion_async", + "file": "dialogflow_v2beta1_generated_participants_compile_suggestion_async.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_CompileSuggestion_async", "segments": [ { "end": 43, @@ -5985,8 +5985,8 @@ "shortName": "CompileSuggestion" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_compile_suggestion_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_CompileSuggestion_sync", + "file": "dialogflow_v2beta1_generated_participants_compile_suggestion_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_CompileSuggestion_sync", "segments": [ { "end": 43, @@ -6030,8 +6030,8 @@ "shortName": "CreateParticipant" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_create_participant_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_CreateParticipant_async", + "file": "dialogflow_v2beta1_generated_participants_create_participant_async.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_CreateParticipant_async", "segments": [ { "end": 44, @@ -6074,8 +6074,8 @@ "shortName": "CreateParticipant" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_create_participant_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_CreateParticipant_sync", + "file": "dialogflow_v2beta1_generated_participants_create_participant_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_CreateParticipant_sync", "segments": [ { "end": 44, @@ -6119,8 +6119,8 @@ "shortName": "GetParticipant" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_get_participant_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_GetParticipant_async", + "file": "dialogflow_v2beta1_generated_participants_get_participant_async.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_GetParticipant_async", "segments": [ { "end": 44, @@ -6163,8 +6163,8 @@ "shortName": "GetParticipant" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_get_participant_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_GetParticipant_sync", + "file": "dialogflow_v2beta1_generated_participants_get_participant_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_GetParticipant_sync", "segments": [ { "end": 44, @@ -6208,8 +6208,8 @@ "shortName": "ListParticipants" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_list_participants_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_ListParticipants_async", + "file": "dialogflow_v2beta1_generated_participants_list_participants_async.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_ListParticipants_async", "segments": [ { "end": 45, @@ -6252,8 +6252,8 @@ "shortName": "ListParticipants" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_list_participants_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_ListParticipants_sync", + "file": "dialogflow_v2beta1_generated_participants_list_participants_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_ListParticipants_sync", "segments": [ { "end": 45, @@ -6297,8 +6297,8 @@ "shortName": "ListSuggestions" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_list_suggestions_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_ListSuggestions_async", + "file": "dialogflow_v2beta1_generated_participants_list_suggestions_async.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_ListSuggestions_async", "segments": [ { "end": 44, @@ -6341,8 +6341,8 @@ "shortName": "ListSuggestions" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_list_suggestions_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_ListSuggestions_sync", + "file": "dialogflow_v2beta1_generated_participants_list_suggestions_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_ListSuggestions_sync", "segments": [ { "end": 44, @@ -6386,8 +6386,8 @@ "shortName": "SuggestArticles" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_suggest_articles_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_SuggestArticles_async", + "file": "dialogflow_v2beta1_generated_participants_suggest_articles_async.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_SuggestArticles_async", "segments": [ { "end": 44, @@ -6430,8 +6430,8 @@ "shortName": "SuggestArticles" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_suggest_articles_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_SuggestArticles_sync", + "file": "dialogflow_v2beta1_generated_participants_suggest_articles_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_SuggestArticles_sync", "segments": [ { "end": 44, @@ -6475,8 +6475,8 @@ "shortName": "SuggestFaqAnswers" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_suggest_faq_answers_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_SuggestFaqAnswers_async", + "file": "dialogflow_v2beta1_generated_participants_suggest_faq_answers_async.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_SuggestFaqAnswers_async", "segments": [ { "end": 44, @@ -6519,8 +6519,8 @@ "shortName": "SuggestFaqAnswers" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_suggest_faq_answers_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_SuggestFaqAnswers_sync", + "file": "dialogflow_v2beta1_generated_participants_suggest_faq_answers_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_SuggestFaqAnswers_sync", "segments": [ { "end": 44, @@ -6564,8 +6564,8 @@ "shortName": "SuggestSmartReplies" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_suggest_smart_replies_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_SuggestSmartReplies_async", + "file": "dialogflow_v2beta1_generated_participants_suggest_smart_replies_async.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_SuggestSmartReplies_async", "segments": [ { "end": 44, @@ -6608,8 +6608,8 @@ "shortName": "SuggestSmartReplies" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_suggest_smart_replies_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_SuggestSmartReplies_sync", + "file": "dialogflow_v2beta1_generated_participants_suggest_smart_replies_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_SuggestSmartReplies_sync", "segments": [ { "end": 44, @@ -6653,8 +6653,8 @@ "shortName": "UpdateParticipant" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_update_participant_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_UpdateParticipant_async", + "file": "dialogflow_v2beta1_generated_participants_update_participant_async.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_UpdateParticipant_async", "segments": [ { "end": 43, @@ -6697,8 +6697,8 @@ "shortName": "UpdateParticipant" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_participants_update_participant_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Participants_UpdateParticipant_sync", + "file": "dialogflow_v2beta1_generated_participants_update_participant_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Participants_UpdateParticipant_sync", "segments": [ { "end": 43, @@ -6742,8 +6742,8 @@ "shortName": "CreateSessionEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_session_entity_types_create_session_entity_type_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_SessionEntityTypes_CreateSessionEntityType_async", + "file": "dialogflow_v2beta1_generated_session_entity_types_create_session_entity_type_async.py", + "regionTag": "dialogflow_v2beta1_generated_SessionEntityTypes_CreateSessionEntityType_async", "segments": [ { "end": 44, @@ -6786,8 +6786,8 @@ "shortName": "CreateSessionEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_session_entity_types_create_session_entity_type_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_SessionEntityTypes_CreateSessionEntityType_sync", + "file": "dialogflow_v2beta1_generated_session_entity_types_create_session_entity_type_sync.py", + "regionTag": "dialogflow_v2beta1_generated_SessionEntityTypes_CreateSessionEntityType_sync", "segments": [ { "end": 44, @@ -6831,8 +6831,8 @@ "shortName": "DeleteSessionEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_session_entity_types_delete_session_entity_type_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_SessionEntityTypes_DeleteSessionEntityType_async", + "file": "dialogflow_v2beta1_generated_session_entity_types_delete_session_entity_type_async.py", + "regionTag": "dialogflow_v2beta1_generated_SessionEntityTypes_DeleteSessionEntityType_async", "segments": [ { "end": 42, @@ -6873,8 +6873,8 @@ "shortName": "DeleteSessionEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_session_entity_types_delete_session_entity_type_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_SessionEntityTypes_DeleteSessionEntityType_sync", + "file": "dialogflow_v2beta1_generated_session_entity_types_delete_session_entity_type_sync.py", + "regionTag": "dialogflow_v2beta1_generated_SessionEntityTypes_DeleteSessionEntityType_sync", "segments": [ { "end": 42, @@ -6916,8 +6916,8 @@ "shortName": "GetSessionEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_session_entity_types_get_session_entity_type_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_SessionEntityTypes_GetSessionEntityType_async", + "file": "dialogflow_v2beta1_generated_session_entity_types_get_session_entity_type_async.py", + "regionTag": "dialogflow_v2beta1_generated_SessionEntityTypes_GetSessionEntityType_async", "segments": [ { "end": 44, @@ -6960,8 +6960,8 @@ "shortName": "GetSessionEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_session_entity_types_get_session_entity_type_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_SessionEntityTypes_GetSessionEntityType_sync", + "file": "dialogflow_v2beta1_generated_session_entity_types_get_session_entity_type_sync.py", + "regionTag": "dialogflow_v2beta1_generated_SessionEntityTypes_GetSessionEntityType_sync", "segments": [ { "end": 44, @@ -7005,8 +7005,8 @@ "shortName": "ListSessionEntityTypes" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_session_entity_types_list_session_entity_types_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_SessionEntityTypes_ListSessionEntityTypes_async", + "file": "dialogflow_v2beta1_generated_session_entity_types_list_session_entity_types_async.py", + "regionTag": "dialogflow_v2beta1_generated_SessionEntityTypes_ListSessionEntityTypes_async", "segments": [ { "end": 45, @@ -7049,8 +7049,8 @@ "shortName": "ListSessionEntityTypes" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_session_entity_types_list_session_entity_types_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_SessionEntityTypes_ListSessionEntityTypes_sync", + "file": "dialogflow_v2beta1_generated_session_entity_types_list_session_entity_types_sync.py", + "regionTag": "dialogflow_v2beta1_generated_SessionEntityTypes_ListSessionEntityTypes_sync", "segments": [ { "end": 45, @@ -7094,8 +7094,8 @@ "shortName": "UpdateSessionEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_session_entity_types_update_session_entity_type_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_SessionEntityTypes_UpdateSessionEntityType_async", + "file": "dialogflow_v2beta1_generated_session_entity_types_update_session_entity_type_async.py", + "regionTag": "dialogflow_v2beta1_generated_SessionEntityTypes_UpdateSessionEntityType_async", "segments": [ { "end": 43, @@ -7138,8 +7138,8 @@ "shortName": "UpdateSessionEntityType" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_session_entity_types_update_session_entity_type_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_SessionEntityTypes_UpdateSessionEntityType_sync", + "file": "dialogflow_v2beta1_generated_session_entity_types_update_session_entity_type_sync.py", + "regionTag": "dialogflow_v2beta1_generated_SessionEntityTypes_UpdateSessionEntityType_sync", "segments": [ { "end": 43, @@ -7183,8 +7183,8 @@ "shortName": "DetectIntent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_sessions_detect_intent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Sessions_DetectIntent_async", + "file": "dialogflow_v2beta1_generated_sessions_detect_intent_async.py", + "regionTag": "dialogflow_v2beta1_generated_Sessions_DetectIntent_async", "segments": [ { "end": 44, @@ -7227,8 +7227,8 @@ "shortName": "DetectIntent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_sessions_detect_intent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Sessions_DetectIntent_sync", + "file": "dialogflow_v2beta1_generated_sessions_detect_intent_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Sessions_DetectIntent_sync", "segments": [ { "end": 44, @@ -7272,8 +7272,8 @@ "shortName": "StreamingDetectIntent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_sessions_streaming_detect_intent_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Sessions_StreamingDetectIntent_async", + "file": "dialogflow_v2beta1_generated_sessions_streaming_detect_intent_async.py", + "regionTag": "dialogflow_v2beta1_generated_Sessions_StreamingDetectIntent_async", "segments": [ { "end": 55, @@ -7316,8 +7316,8 @@ "shortName": "StreamingDetectIntent" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_sessions_streaming_detect_intent_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Sessions_StreamingDetectIntent_sync", + "file": "dialogflow_v2beta1_generated_sessions_streaming_detect_intent_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Sessions_StreamingDetectIntent_sync", "segments": [ { "end": 55, @@ -7361,8 +7361,8 @@ "shortName": "CreateVersion" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_versions_create_version_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Versions_CreateVersion_async", + "file": "dialogflow_v2beta1_generated_versions_create_version_async.py", + "regionTag": "dialogflow_v2beta1_generated_Versions_CreateVersion_async", "segments": [ { "end": 44, @@ -7405,8 +7405,8 @@ "shortName": "CreateVersion" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_versions_create_version_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Versions_CreateVersion_sync", + "file": "dialogflow_v2beta1_generated_versions_create_version_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Versions_CreateVersion_sync", "segments": [ { "end": 44, @@ -7450,8 +7450,8 @@ "shortName": "DeleteVersion" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_versions_delete_version_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Versions_DeleteVersion_async", + "file": "dialogflow_v2beta1_generated_versions_delete_version_async.py", + "regionTag": "dialogflow_v2beta1_generated_Versions_DeleteVersion_async", "segments": [ { "end": 42, @@ -7492,8 +7492,8 @@ "shortName": "DeleteVersion" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_versions_delete_version_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Versions_DeleteVersion_sync", + "file": "dialogflow_v2beta1_generated_versions_delete_version_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Versions_DeleteVersion_sync", "segments": [ { "end": 42, @@ -7535,8 +7535,8 @@ "shortName": "GetVersion" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_versions_get_version_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Versions_GetVersion_async", + "file": "dialogflow_v2beta1_generated_versions_get_version_async.py", + "regionTag": "dialogflow_v2beta1_generated_Versions_GetVersion_async", "segments": [ { "end": 44, @@ -7579,8 +7579,8 @@ "shortName": "GetVersion" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_versions_get_version_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Versions_GetVersion_sync", + "file": "dialogflow_v2beta1_generated_versions_get_version_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Versions_GetVersion_sync", "segments": [ { "end": 44, @@ -7624,8 +7624,8 @@ "shortName": "ListVersions" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_versions_list_versions_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Versions_ListVersions_async", + "file": "dialogflow_v2beta1_generated_versions_list_versions_async.py", + "regionTag": "dialogflow_v2beta1_generated_Versions_ListVersions_async", "segments": [ { "end": 45, @@ -7668,8 +7668,8 @@ "shortName": "ListVersions" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_versions_list_versions_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Versions_ListVersions_sync", + "file": "dialogflow_v2beta1_generated_versions_list_versions_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Versions_ListVersions_sync", "segments": [ { "end": 45, @@ -7713,8 +7713,8 @@ "shortName": "UpdateVersion" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_versions_update_version_async.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Versions_UpdateVersion_async", + "file": "dialogflow_v2beta1_generated_versions_update_version_async.py", + "regionTag": "dialogflow_v2beta1_generated_Versions_UpdateVersion_async", "segments": [ { "end": 43, @@ -7757,8 +7757,8 @@ "shortName": "UpdateVersion" } }, - "file": "dialogflow_generated_dialogflow_v2beta1_versions_update_version_sync.py", - "regionTag": "dialogflow_generated_dialogflow_v2beta1_Versions_UpdateVersion_sync", + "file": "dialogflow_v2beta1_generated_versions_update_version_sync.py", + "regionTag": "dialogflow_v2beta1_generated_Versions_UpdateVersion_sync", "segments": [ { "end": 43, diff --git a/packages/google-cloud-dialogflow/scripts/fixup_dialogflow_v2_keywords.py b/packages/google-cloud-dialogflow/scripts/fixup_dialogflow_v2_keywords.py index 7374c76662b4..9b376106e39d 100644 --- a/packages/google-cloud-dialogflow/scripts/fixup_dialogflow_v2_keywords.py +++ b/packages/google-cloud-dialogflow/scripts/fixup_dialogflow_v2_keywords.py @@ -1,6 +1,6 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,9 +47,13 @@ class dialogflowCallTransformer(cst.CSTTransformer): 'batch_update_entities': ('parent', 'entities', 'language_code', 'update_mask', ), 'batch_update_entity_types': ('parent', 'entity_type_batch_uri', 'entity_type_batch_inline', 'language_code', 'update_mask', ), 'batch_update_intents': ('parent', 'intent_batch_uri', 'intent_batch_inline', 'language_code', 'update_mask', 'intent_view', ), + 'clear_suggestion_feature_config': ('conversation_profile', 'participant_role', 'suggestion_feature_type', ), 'complete_conversation': ('name', ), 'create_context': ('parent', 'context', ), 'create_conversation': ('parent', 'conversation', 'conversation_id', ), + 'create_conversation_dataset': ('parent', 'conversation_dataset', ), + 'create_conversation_model': ('conversation_model', 'parent', ), + 'create_conversation_model_evaluation': ('parent', 'conversation_model_evaluation', ), 'create_conversation_profile': ('parent', 'conversation_profile', ), 'create_document': ('parent', 'document', ), 'create_entity_type': ('parent', 'entity_type', 'language_code', ), @@ -62,6 +66,8 @@ class dialogflowCallTransformer(cst.CSTTransformer): 'delete_agent': ('parent', ), 'delete_all_contexts': ('parent', ), 'delete_context': ('name', ), + 'delete_conversation_dataset': ('name', ), + 'delete_conversation_model': ('name', ), 'delete_conversation_profile': ('name', ), 'delete_document': ('name', ), 'delete_entity_type': ('name', ), @@ -70,12 +76,16 @@ class dialogflowCallTransformer(cst.CSTTransformer): 'delete_knowledge_base': ('name', 'force', ), 'delete_session_entity_type': ('name', ), 'delete_version': ('name', ), + 'deploy_conversation_model': ('name', ), 'detect_intent': ('session', 'query_input', 'query_params', 'output_audio_config', 'output_audio_config_mask', 'input_audio', ), 'export_agent': ('parent', 'agent_uri', ), 'export_document': ('name', 'gcs_destination', 'export_full_content', 'smart_messaging_partial_update', ), 'get_agent': ('parent', ), 'get_context': ('name', ), 'get_conversation': ('name', ), + 'get_conversation_dataset': ('name', ), + 'get_conversation_model': ('name', ), + 'get_conversation_model_evaluation': ('name', ), 'get_conversation_profile': ('name', ), 'get_document': ('name', ), 'get_entity_type': ('name', 'language_code', ), @@ -89,9 +99,13 @@ class dialogflowCallTransformer(cst.CSTTransformer): 'get_validation_result': ('parent', 'language_code', ), 'get_version': ('name', ), 'import_agent': ('parent', 'agent_uri', 'agent_content', ), + 'import_conversation_data': ('name', 'input_config', ), 'import_documents': ('parent', 'document_template', 'gcs_source', 'import_gcs_custom_metadata', ), 'list_answer_records': ('parent', 'filter', 'page_size', 'page_token', ), 'list_contexts': ('parent', 'page_size', 'page_token', ), + 'list_conversation_datasets': ('parent', 'page_size', 'page_token', ), + 'list_conversation_model_evaluations': ('parent', 'page_size', 'page_token', ), + 'list_conversation_models': ('parent', 'page_size', 'page_token', ), 'list_conversation_profiles': ('parent', 'page_size', 'page_token', ), 'list_conversations': ('parent', 'page_size', 'page_token', 'filter', ), 'list_documents': ('parent', 'page_size', 'page_token', 'filter', ), @@ -107,11 +121,13 @@ class dialogflowCallTransformer(cst.CSTTransformer): 'restore_agent': ('parent', 'agent_uri', 'agent_content', ), 'search_agents': ('parent', 'page_size', 'page_token', ), 'set_agent': ('agent', 'update_mask', ), + 'set_suggestion_feature_config': ('conversation_profile', 'participant_role', 'suggestion_feature_config', ), 'streaming_detect_intent': ('session', 'query_input', 'query_params', 'single_utterance', 'output_audio_config', 'output_audio_config_mask', 'input_audio', ), 'suggest_articles': ('parent', 'latest_message', 'context_size', 'assist_query_params', ), 'suggest_faq_answers': ('parent', 'latest_message', 'context_size', 'assist_query_params', ), 'suggest_smart_replies': ('parent', 'current_text_input', 'latest_message', 'context_size', ), 'train_agent': ('parent', ), + 'undeploy_conversation_model': ('name', ), 'update_answer_record': ('answer_record', 'update_mask', ), 'update_context': ('context', 'update_mask', ), 'update_conversation_profile': ('conversation_profile', 'update_mask', ), diff --git a/packages/google-cloud-dialogflow/scripts/fixup_dialogflow_v2beta1_keywords.py b/packages/google-cloud-dialogflow/scripts/fixup_dialogflow_v2beta1_keywords.py index a921e3c5167b..7f1d633f1c2e 100644 --- a/packages/google-cloud-dialogflow/scripts/fixup_dialogflow_v2beta1_keywords.py +++ b/packages/google-cloud-dialogflow/scripts/fixup_dialogflow_v2beta1_keywords.py @@ -1,6 +1,6 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/__init__.py b/packages/google-cloud-dialogflow/tests/__init__.py index 4de65971c238..e8e1c3845db5 100644 --- a/packages/google-cloud-dialogflow/tests/__init__.py +++ b/packages/google-cloud-dialogflow/tests/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/__init__.py b/packages/google-cloud-dialogflow/tests/unit/__init__.py index 4de65971c238..e8e1c3845db5 100644 --- a/packages/google-cloud-dialogflow/tests/unit/__init__.py +++ b/packages/google-cloud-dialogflow/tests/unit/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/__init__.py b/packages/google-cloud-dialogflow/tests/unit/gapic/__init__.py index 4de65971c238..e8e1c3845db5 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/__init__.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/__init__.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/__init__.py index 4de65971c238..e8e1c3845db5 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/__init__.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_agents.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_agents.py index e63d25dd2716..199bbdcf2133 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_agents.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_agents.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_answer_records.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_answer_records.py index 93c753a9ee07..bcf66ba5f12d 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_answer_records.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_answer_records.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_contexts.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_contexts.py index 0830165503d3..2ee5811bb342 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_contexts.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_contexts.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversation_datasets.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversation_datasets.py new file mode 100644 index 000000000000..fe1c37172a56 --- /dev/null +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversation_datasets.py @@ -0,0 +1,2615 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +import os +import mock + +import grpc +from grpc.experimental import aio +import math +import pytest +from proto.marshal.rules.dates import DurationRule, TimestampRule + + +from google.api_core import client_options +from google.api_core import exceptions as core_exceptions +from google.api_core import future +from google.api_core import gapic_v1 +from google.api_core import grpc_helpers +from google.api_core import grpc_helpers_async +from google.api_core import operation +from google.api_core import operation_async # type: ignore +from google.api_core import operations_v1 +from google.api_core import path_template +from google.auth import credentials as ga_credentials +from google.auth.exceptions import MutualTLSChannelError +from google.cloud.dialogflow_v2.services.conversation_datasets import ( + ConversationDatasetsAsyncClient, +) +from google.cloud.dialogflow_v2.services.conversation_datasets import ( + ConversationDatasetsClient, +) +from google.cloud.dialogflow_v2.services.conversation_datasets import pagers +from google.cloud.dialogflow_v2.services.conversation_datasets import transports +from google.cloud.dialogflow_v2.types import conversation_dataset +from google.cloud.dialogflow_v2.types import ( + conversation_dataset as gcd_conversation_dataset, +) +from google.cloud.dialogflow_v2.types import gcs +from google.longrunning import operations_pb2 +from google.oauth2 import service_account +from google.protobuf import timestamp_pb2 # type: ignore +import google.auth + + +def client_cert_source_callback(): + return b"cert bytes", b"key bytes" + + +# If default endpoint is localhost, then default mtls endpoint will be the same. +# This method modifies the default endpoint so the client can produce a different +# mtls endpoint for endpoint testing purposes. +def modify_default_endpoint(client): + return ( + "foo.googleapis.com" + if ("localhost" in client.DEFAULT_ENDPOINT) + else client.DEFAULT_ENDPOINT + ) + + +def test__get_default_mtls_endpoint(): + api_endpoint = "example.googleapis.com" + api_mtls_endpoint = "example.mtls.googleapis.com" + sandbox_endpoint = "example.sandbox.googleapis.com" + sandbox_mtls_endpoint = "example.mtls.sandbox.googleapis.com" + non_googleapi = "api.example.com" + + assert ConversationDatasetsClient._get_default_mtls_endpoint(None) is None + assert ( + ConversationDatasetsClient._get_default_mtls_endpoint(api_endpoint) + == api_mtls_endpoint + ) + assert ( + ConversationDatasetsClient._get_default_mtls_endpoint(api_mtls_endpoint) + == api_mtls_endpoint + ) + assert ( + ConversationDatasetsClient._get_default_mtls_endpoint(sandbox_endpoint) + == sandbox_mtls_endpoint + ) + assert ( + ConversationDatasetsClient._get_default_mtls_endpoint(sandbox_mtls_endpoint) + == sandbox_mtls_endpoint + ) + assert ( + ConversationDatasetsClient._get_default_mtls_endpoint(non_googleapi) + == non_googleapi + ) + + +@pytest.mark.parametrize( + "client_class", [ConversationDatasetsClient, ConversationDatasetsAsyncClient,] +) +def test_conversation_datasets_client_from_service_account_info(client_class): + creds = ga_credentials.AnonymousCredentials() + with mock.patch.object( + service_account.Credentials, "from_service_account_info" + ) as factory: + factory.return_value = creds + info = {"valid": True} + client = client_class.from_service_account_info(info) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + assert client.transport._host == "dialogflow.googleapis.com:443" + + +@pytest.mark.parametrize( + "transport_class,transport_name", + [ + (transports.ConversationDatasetsGrpcTransport, "grpc"), + (transports.ConversationDatasetsGrpcAsyncIOTransport, "grpc_asyncio"), + ], +) +def test_conversation_datasets_client_service_account_always_use_jwt( + transport_class, transport_name +): + with mock.patch.object( + service_account.Credentials, "with_always_use_jwt_access", create=True + ) as use_jwt: + creds = service_account.Credentials(None, None, None) + transport = transport_class(credentials=creds, always_use_jwt_access=True) + use_jwt.assert_called_once_with(True) + + with mock.patch.object( + service_account.Credentials, "with_always_use_jwt_access", create=True + ) as use_jwt: + creds = service_account.Credentials(None, None, None) + transport = transport_class(credentials=creds, always_use_jwt_access=False) + use_jwt.assert_not_called() + + +@pytest.mark.parametrize( + "client_class", [ConversationDatasetsClient, ConversationDatasetsAsyncClient,] +) +def test_conversation_datasets_client_from_service_account_file(client_class): + creds = ga_credentials.AnonymousCredentials() + with mock.patch.object( + service_account.Credentials, "from_service_account_file" + ) as factory: + factory.return_value = creds + client = client_class.from_service_account_file("dummy/file/path.json") + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + client = client_class.from_service_account_json("dummy/file/path.json") + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + assert client.transport._host == "dialogflow.googleapis.com:443" + + +def test_conversation_datasets_client_get_transport_class(): + transport = ConversationDatasetsClient.get_transport_class() + available_transports = [ + transports.ConversationDatasetsGrpcTransport, + ] + assert transport in available_transports + + transport = ConversationDatasetsClient.get_transport_class("grpc") + assert transport == transports.ConversationDatasetsGrpcTransport + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name", + [ + ( + ConversationDatasetsClient, + transports.ConversationDatasetsGrpcTransport, + "grpc", + ), + ( + ConversationDatasetsAsyncClient, + transports.ConversationDatasetsGrpcAsyncIOTransport, + "grpc_asyncio", + ), + ], +) +@mock.patch.object( + ConversationDatasetsClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(ConversationDatasetsClient), +) +@mock.patch.object( + ConversationDatasetsAsyncClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(ConversationDatasetsAsyncClient), +) +def test_conversation_datasets_client_client_options( + client_class, transport_class, transport_name +): + # Check that if channel is provided we won't create a new one. + with mock.patch.object(ConversationDatasetsClient, "get_transport_class") as gtc: + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) + client = client_class(transport=transport) + gtc.assert_not_called() + + # Check that if channel is provided via str we will create a new one. + with mock.patch.object(ConversationDatasetsClient, "get_transport_class") as gtc: + client = client_class(transport=transport_name) + gtc.assert_called() + + # Check the case api_endpoint is provided. + options = client_options.ClientOptions(api_endpoint="squid.clam.whelk") + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name, client_options=options) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host="squid.clam.whelk", + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is + # "never". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is + # "always". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_MTLS_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has + # unsupported value. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError): + client = client_class(transport=transport_name) + + # Check the case GOOGLE_API_USE_CLIENT_CERTIFICATE has unsupported value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} + ): + with pytest.raises(ValueError): + client = client_class(transport=transport_name) + + # Check the case quota_project_id is provided + options = client_options.ClientOptions(quota_project_id="octopus") + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id="octopus", + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,use_client_cert_env", + [ + ( + ConversationDatasetsClient, + transports.ConversationDatasetsGrpcTransport, + "grpc", + "true", + ), + ( + ConversationDatasetsAsyncClient, + transports.ConversationDatasetsGrpcAsyncIOTransport, + "grpc_asyncio", + "true", + ), + ( + ConversationDatasetsClient, + transports.ConversationDatasetsGrpcTransport, + "grpc", + "false", + ), + ( + ConversationDatasetsAsyncClient, + transports.ConversationDatasetsGrpcAsyncIOTransport, + "grpc_asyncio", + "false", + ), + ], +) +@mock.patch.object( + ConversationDatasetsClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(ConversationDatasetsClient), +) +@mock.patch.object( + ConversationDatasetsAsyncClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(ConversationDatasetsAsyncClient), +) +@mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}) +def test_conversation_datasets_client_mtls_env_auto( + client_class, transport_class, transport_name, use_client_cert_env +): + # This tests the endpoint autoswitch behavior. Endpoint is autoswitched to the default + # mtls endpoint, if GOOGLE_API_USE_CLIENT_CERTIFICATE is "true" and client cert exists. + + # Check the case client_cert_source is provided. Whether client cert is used depends on + # GOOGLE_API_USE_CLIENT_CERTIFICATE value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + options = client_options.ClientOptions( + client_cert_source=client_cert_source_callback + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + + if use_client_cert_env == "false": + expected_client_cert_source = None + expected_host = client.DEFAULT_ENDPOINT + else: + expected_client_cert_source = client_cert_source_callback + expected_host = client.DEFAULT_MTLS_ENDPOINT + + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=expected_host, + scopes=None, + client_cert_source_for_mtls=expected_client_cert_source, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # Check the case ADC client cert is provided. Whether client cert is used depends on + # GOOGLE_API_USE_CLIENT_CERTIFICATE value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + with mock.patch.object(transport_class, "__init__") as patched: + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=True, + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=client_cert_source_callback, + ): + if use_client_cert_env == "false": + expected_host = client.DEFAULT_ENDPOINT + expected_client_cert_source = None + else: + expected_host = client.DEFAULT_MTLS_ENDPOINT + expected_client_cert_source = client_cert_source_callback + + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=expected_host, + scopes=None, + client_cert_source_for_mtls=expected_client_cert_source, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # Check the case client_cert_source and ADC client cert are not provided. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + with mock.patch.object(transport_class, "__init__") as patched: + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=False, + ): + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + +@pytest.mark.parametrize( + "client_class", [ConversationDatasetsClient, ConversationDatasetsAsyncClient] +) +@mock.patch.object( + ConversationDatasetsClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(ConversationDatasetsClient), +) +@mock.patch.object( + ConversationDatasetsAsyncClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(ConversationDatasetsAsyncClient), +) +def test_conversation_datasets_client_get_mtls_endpoint_and_cert_source(client_class): + mock_client_cert_source = mock.Mock() + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "true". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source == mock_client_cert_source + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "false". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): + mock_client_cert_source = mock.Mock() + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "never". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "always". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert doesn't exist. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=False, + ): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert exists. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=True, + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=mock_client_cert_source, + ): + ( + api_endpoint, + cert_source, + ) = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source == mock_client_cert_source + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name", + [ + ( + ConversationDatasetsClient, + transports.ConversationDatasetsGrpcTransport, + "grpc", + ), + ( + ConversationDatasetsAsyncClient, + transports.ConversationDatasetsGrpcAsyncIOTransport, + "grpc_asyncio", + ), + ], +) +def test_conversation_datasets_client_client_options_scopes( + client_class, transport_class, transport_name +): + # Check the case scopes are provided. + options = client_options.ClientOptions(scopes=["1", "2"],) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=["1", "2"], + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + ConversationDatasetsClient, + transports.ConversationDatasetsGrpcTransport, + "grpc", + grpc_helpers, + ), + ( + ConversationDatasetsAsyncClient, + transports.ConversationDatasetsGrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_conversation_datasets_client_client_options_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + +def test_conversation_datasets_client_client_options_from_dict(): + with mock.patch( + "google.cloud.dialogflow_v2.services.conversation_datasets.transports.ConversationDatasetsGrpcTransport.__init__" + ) as grpc_transport: + grpc_transport.return_value = None + client = ConversationDatasetsClient( + client_options={"api_endpoint": "squid.clam.whelk"} + ) + grpc_transport.assert_called_once_with( + credentials=None, + credentials_file=None, + host="squid.clam.whelk", + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + ConversationDatasetsClient, + transports.ConversationDatasetsGrpcTransport, + "grpc", + grpc_helpers, + ), + ( + ConversationDatasetsAsyncClient, + transports.ConversationDatasetsGrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_conversation_datasets_client_create_channel_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # test that the credentials from file are saved and used as the credentials. + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel" + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() + load_creds.return_value = (file_creds, None) + adc.return_value = (creds, None) + client = client_class(client_options=options, transport=transport_name) + create_channel.assert_called_with( + "dialogflow.googleapis.com:443", + credentials=file_creds, + credentials_file=None, + quota_project_id=None, + default_scopes=( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow", + ), + scopes=None, + default_host="dialogflow.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + +@pytest.mark.parametrize( + "request_type", [gcd_conversation_dataset.CreateConversationDatasetRequest, dict,] +) +def test_create_conversation_dataset(request_type, transport: str = "grpc"): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_dataset), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.create_conversation_dataset(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == gcd_conversation_dataset.CreateConversationDatasetRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_create_conversation_dataset_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_dataset), "__call__" + ) as call: + client.create_conversation_dataset() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == gcd_conversation_dataset.CreateConversationDatasetRequest() + + +@pytest.mark.asyncio +async def test_create_conversation_dataset_async( + transport: str = "grpc_asyncio", + request_type=gcd_conversation_dataset.CreateConversationDatasetRequest, +): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_dataset), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.create_conversation_dataset(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == gcd_conversation_dataset.CreateConversationDatasetRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_create_conversation_dataset_async_from_dict(): + await test_create_conversation_dataset_async(request_type=dict) + + +def test_create_conversation_dataset_field_headers(): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = gcd_conversation_dataset.CreateConversationDatasetRequest() + + request.parent = "parent/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_dataset), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.create_conversation_dataset(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_create_conversation_dataset_field_headers_async(): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = gcd_conversation_dataset.CreateConversationDatasetRequest() + + request.parent = "parent/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_dataset), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.create_conversation_dataset(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + + +def test_create_conversation_dataset_flattened(): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_dataset), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.create_conversation_dataset( + parent="parent_value", + conversation_dataset=gcd_conversation_dataset.ConversationDataset( + name="name_value" + ), + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].conversation_dataset + mock_val = gcd_conversation_dataset.ConversationDataset(name="name_value") + assert arg == mock_val + + +def test_create_conversation_dataset_flattened_error(): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.create_conversation_dataset( + gcd_conversation_dataset.CreateConversationDatasetRequest(), + parent="parent_value", + conversation_dataset=gcd_conversation_dataset.ConversationDataset( + name="name_value" + ), + ) + + +@pytest.mark.asyncio +async def test_create_conversation_dataset_flattened_async(): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_dataset), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.create_conversation_dataset( + parent="parent_value", + conversation_dataset=gcd_conversation_dataset.ConversationDataset( + name="name_value" + ), + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].conversation_dataset + mock_val = gcd_conversation_dataset.ConversationDataset(name="name_value") + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_create_conversation_dataset_flattened_error_async(): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.create_conversation_dataset( + gcd_conversation_dataset.CreateConversationDatasetRequest(), + parent="parent_value", + conversation_dataset=gcd_conversation_dataset.ConversationDataset( + name="name_value" + ), + ) + + +@pytest.mark.parametrize( + "request_type", [conversation_dataset.GetConversationDatasetRequest, dict,] +) +def test_get_conversation_dataset(request_type, transport: str = "grpc"): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_dataset), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = conversation_dataset.ConversationDataset( + name="name_value", + display_name="display_name_value", + description="description_value", + conversation_count=1955, + ) + response = client.get_conversation_dataset(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_dataset.GetConversationDatasetRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, conversation_dataset.ConversationDataset) + assert response.name == "name_value" + assert response.display_name == "display_name_value" + assert response.description == "description_value" + assert response.conversation_count == 1955 + + +def test_get_conversation_dataset_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_dataset), "__call__" + ) as call: + client.get_conversation_dataset() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_dataset.GetConversationDatasetRequest() + + +@pytest.mark.asyncio +async def test_get_conversation_dataset_async( + transport: str = "grpc_asyncio", + request_type=conversation_dataset.GetConversationDatasetRequest, +): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_dataset), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_dataset.ConversationDataset( + name="name_value", + display_name="display_name_value", + description="description_value", + conversation_count=1955, + ) + ) + response = await client.get_conversation_dataset(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_dataset.GetConversationDatasetRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, conversation_dataset.ConversationDataset) + assert response.name == "name_value" + assert response.display_name == "display_name_value" + assert response.description == "description_value" + assert response.conversation_count == 1955 + + +@pytest.mark.asyncio +async def test_get_conversation_dataset_async_from_dict(): + await test_get_conversation_dataset_async(request_type=dict) + + +def test_get_conversation_dataset_field_headers(): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_dataset.GetConversationDatasetRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_dataset), "__call__" + ) as call: + call.return_value = conversation_dataset.ConversationDataset() + client.get_conversation_dataset(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_get_conversation_dataset_field_headers_async(): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_dataset.GetConversationDatasetRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_dataset), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_dataset.ConversationDataset() + ) + await client.get_conversation_dataset(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +def test_get_conversation_dataset_flattened(): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_dataset), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = conversation_dataset.ConversationDataset() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.get_conversation_dataset(name="name_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +def test_get_conversation_dataset_flattened_error(): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get_conversation_dataset( + conversation_dataset.GetConversationDatasetRequest(), name="name_value", + ) + + +@pytest.mark.asyncio +async def test_get_conversation_dataset_flattened_async(): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_dataset), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = conversation_dataset.ConversationDataset() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_dataset.ConversationDataset() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.get_conversation_dataset(name="name_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_get_conversation_dataset_flattened_error_async(): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.get_conversation_dataset( + conversation_dataset.GetConversationDatasetRequest(), name="name_value", + ) + + +@pytest.mark.parametrize( + "request_type", [conversation_dataset.ListConversationDatasetsRequest, dict,] +) +def test_list_conversation_datasets(request_type, transport: str = "grpc"): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_datasets), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = conversation_dataset.ListConversationDatasetsResponse( + next_page_token="next_page_token_value", + ) + response = client.list_conversation_datasets(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_dataset.ListConversationDatasetsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListConversationDatasetsPager) + assert response.next_page_token == "next_page_token_value" + + +def test_list_conversation_datasets_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_datasets), "__call__" + ) as call: + client.list_conversation_datasets() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_dataset.ListConversationDatasetsRequest() + + +@pytest.mark.asyncio +async def test_list_conversation_datasets_async( + transport: str = "grpc_asyncio", + request_type=conversation_dataset.ListConversationDatasetsRequest, +): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_datasets), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_dataset.ListConversationDatasetsResponse( + next_page_token="next_page_token_value", + ) + ) + response = await client.list_conversation_datasets(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_dataset.ListConversationDatasetsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListConversationDatasetsAsyncPager) + assert response.next_page_token == "next_page_token_value" + + +@pytest.mark.asyncio +async def test_list_conversation_datasets_async_from_dict(): + await test_list_conversation_datasets_async(request_type=dict) + + +def test_list_conversation_datasets_field_headers(): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_dataset.ListConversationDatasetsRequest() + + request.parent = "parent/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_datasets), "__call__" + ) as call: + call.return_value = conversation_dataset.ListConversationDatasetsResponse() + client.list_conversation_datasets(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_list_conversation_datasets_field_headers_async(): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_dataset.ListConversationDatasetsRequest() + + request.parent = "parent/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_datasets), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_dataset.ListConversationDatasetsResponse() + ) + await client.list_conversation_datasets(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + + +def test_list_conversation_datasets_flattened(): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_datasets), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = conversation_dataset.ListConversationDatasetsResponse() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.list_conversation_datasets(parent="parent_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + + +def test_list_conversation_datasets_flattened_error(): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.list_conversation_datasets( + conversation_dataset.ListConversationDatasetsRequest(), + parent="parent_value", + ) + + +@pytest.mark.asyncio +async def test_list_conversation_datasets_flattened_async(): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_datasets), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = conversation_dataset.ListConversationDatasetsResponse() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_dataset.ListConversationDatasetsResponse() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.list_conversation_datasets(parent="parent_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_list_conversation_datasets_flattened_error_async(): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.list_conversation_datasets( + conversation_dataset.ListConversationDatasetsRequest(), + parent="parent_value", + ) + + +def test_list_conversation_datasets_pager(transport_name: str = "grpc"): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_datasets), "__call__" + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + conversation_dataset.ListConversationDatasetsResponse( + conversation_datasets=[ + conversation_dataset.ConversationDataset(), + conversation_dataset.ConversationDataset(), + conversation_dataset.ConversationDataset(), + ], + next_page_token="abc", + ), + conversation_dataset.ListConversationDatasetsResponse( + conversation_datasets=[], next_page_token="def", + ), + conversation_dataset.ListConversationDatasetsResponse( + conversation_datasets=[conversation_dataset.ConversationDataset(),], + next_page_token="ghi", + ), + conversation_dataset.ListConversationDatasetsResponse( + conversation_datasets=[ + conversation_dataset.ConversationDataset(), + conversation_dataset.ConversationDataset(), + ], + ), + RuntimeError, + ) + + metadata = () + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", ""),)), + ) + pager = client.list_conversation_datasets(request={}) + + assert pager._metadata == metadata + + results = [i for i in pager] + assert len(results) == 6 + assert all( + isinstance(i, conversation_dataset.ConversationDataset) for i in results + ) + + +def test_list_conversation_datasets_pages(transport_name: str = "grpc"): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_datasets), "__call__" + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + conversation_dataset.ListConversationDatasetsResponse( + conversation_datasets=[ + conversation_dataset.ConversationDataset(), + conversation_dataset.ConversationDataset(), + conversation_dataset.ConversationDataset(), + ], + next_page_token="abc", + ), + conversation_dataset.ListConversationDatasetsResponse( + conversation_datasets=[], next_page_token="def", + ), + conversation_dataset.ListConversationDatasetsResponse( + conversation_datasets=[conversation_dataset.ConversationDataset(),], + next_page_token="ghi", + ), + conversation_dataset.ListConversationDatasetsResponse( + conversation_datasets=[ + conversation_dataset.ConversationDataset(), + conversation_dataset.ConversationDataset(), + ], + ), + RuntimeError, + ) + pages = list(client.list_conversation_datasets(request={}).pages) + for page_, token in zip(pages, ["abc", "def", "ghi", ""]): + assert page_.raw_page.next_page_token == token + + +@pytest.mark.asyncio +async def test_list_conversation_datasets_async_pager(): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_datasets), + "__call__", + new_callable=mock.AsyncMock, + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + conversation_dataset.ListConversationDatasetsResponse( + conversation_datasets=[ + conversation_dataset.ConversationDataset(), + conversation_dataset.ConversationDataset(), + conversation_dataset.ConversationDataset(), + ], + next_page_token="abc", + ), + conversation_dataset.ListConversationDatasetsResponse( + conversation_datasets=[], next_page_token="def", + ), + conversation_dataset.ListConversationDatasetsResponse( + conversation_datasets=[conversation_dataset.ConversationDataset(),], + next_page_token="ghi", + ), + conversation_dataset.ListConversationDatasetsResponse( + conversation_datasets=[ + conversation_dataset.ConversationDataset(), + conversation_dataset.ConversationDataset(), + ], + ), + RuntimeError, + ) + async_pager = await client.list_conversation_datasets(request={},) + assert async_pager.next_page_token == "abc" + responses = [] + async for response in async_pager: + responses.append(response) + + assert len(responses) == 6 + assert all( + isinstance(i, conversation_dataset.ConversationDataset) for i in responses + ) + + +@pytest.mark.asyncio +async def test_list_conversation_datasets_async_pages(): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_datasets), + "__call__", + new_callable=mock.AsyncMock, + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + conversation_dataset.ListConversationDatasetsResponse( + conversation_datasets=[ + conversation_dataset.ConversationDataset(), + conversation_dataset.ConversationDataset(), + conversation_dataset.ConversationDataset(), + ], + next_page_token="abc", + ), + conversation_dataset.ListConversationDatasetsResponse( + conversation_datasets=[], next_page_token="def", + ), + conversation_dataset.ListConversationDatasetsResponse( + conversation_datasets=[conversation_dataset.ConversationDataset(),], + next_page_token="ghi", + ), + conversation_dataset.ListConversationDatasetsResponse( + conversation_datasets=[ + conversation_dataset.ConversationDataset(), + conversation_dataset.ConversationDataset(), + ], + ), + RuntimeError, + ) + pages = [] + async for page_ in (await client.list_conversation_datasets(request={})).pages: + pages.append(page_) + for page_, token in zip(pages, ["abc", "def", "ghi", ""]): + assert page_.raw_page.next_page_token == token + + +@pytest.mark.parametrize( + "request_type", [conversation_dataset.DeleteConversationDatasetRequest, dict,] +) +def test_delete_conversation_dataset(request_type, transport: str = "grpc"): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_conversation_dataset), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.delete_conversation_dataset(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_dataset.DeleteConversationDatasetRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_delete_conversation_dataset_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_conversation_dataset), "__call__" + ) as call: + client.delete_conversation_dataset() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_dataset.DeleteConversationDatasetRequest() + + +@pytest.mark.asyncio +async def test_delete_conversation_dataset_async( + transport: str = "grpc_asyncio", + request_type=conversation_dataset.DeleteConversationDatasetRequest, +): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_conversation_dataset), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.delete_conversation_dataset(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_dataset.DeleteConversationDatasetRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_delete_conversation_dataset_async_from_dict(): + await test_delete_conversation_dataset_async(request_type=dict) + + +def test_delete_conversation_dataset_field_headers(): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_dataset.DeleteConversationDatasetRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_conversation_dataset), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.delete_conversation_dataset(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_delete_conversation_dataset_field_headers_async(): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_dataset.DeleteConversationDatasetRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_conversation_dataset), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.delete_conversation_dataset(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +def test_delete_conversation_dataset_flattened(): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_conversation_dataset), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.delete_conversation_dataset(name="name_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +def test_delete_conversation_dataset_flattened_error(): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.delete_conversation_dataset( + conversation_dataset.DeleteConversationDatasetRequest(), name="name_value", + ) + + +@pytest.mark.asyncio +async def test_delete_conversation_dataset_flattened_async(): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_conversation_dataset), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.delete_conversation_dataset(name="name_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_delete_conversation_dataset_flattened_error_async(): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.delete_conversation_dataset( + conversation_dataset.DeleteConversationDatasetRequest(), name="name_value", + ) + + +@pytest.mark.parametrize( + "request_type", [conversation_dataset.ImportConversationDataRequest, dict,] +) +def test_import_conversation_data(request_type, transport: str = "grpc"): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.import_conversation_data), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.import_conversation_data(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_dataset.ImportConversationDataRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_import_conversation_data_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.import_conversation_data), "__call__" + ) as call: + client.import_conversation_data() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_dataset.ImportConversationDataRequest() + + +@pytest.mark.asyncio +async def test_import_conversation_data_async( + transport: str = "grpc_asyncio", + request_type=conversation_dataset.ImportConversationDataRequest, +): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.import_conversation_data), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.import_conversation_data(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_dataset.ImportConversationDataRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_import_conversation_data_async_from_dict(): + await test_import_conversation_data_async(request_type=dict) + + +def test_import_conversation_data_field_headers(): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_dataset.ImportConversationDataRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.import_conversation_data), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.import_conversation_data(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_import_conversation_data_field_headers_async(): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_dataset.ImportConversationDataRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.import_conversation_data), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.import_conversation_data(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +def test_credentials_transport_error(): + # It is an error to provide credentials and a transport instance. + transport = transports.ConversationDatasetsGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # It is an error to provide a credentials file and a transport instance. + transport = transports.ConversationDatasetsGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = ConversationDatasetsClient( + client_options={"credentials_file": "credentials.json"}, + transport=transport, + ) + + # It is an error to provide an api_key and a transport instance. + transport = transports.ConversationDatasetsGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = ConversationDatasetsClient( + client_options=options, transport=transport, + ) + + # It is an error to provide an api_key and a credential. + options = mock.Mock() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = ConversationDatasetsClient( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + + # It is an error to provide scopes and a transport instance. + transport = transports.ConversationDatasetsGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = ConversationDatasetsClient( + client_options={"scopes": ["1", "2"]}, transport=transport, + ) + + +def test_transport_instance(): + # A client may be instantiated with a custom transport instance. + transport = transports.ConversationDatasetsGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + client = ConversationDatasetsClient(transport=transport) + assert client.transport is transport + + +def test_transport_get_channel(): + # A client may be instantiated with a custom transport instance. + transport = transports.ConversationDatasetsGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + channel = transport.grpc_channel + assert channel + + transport = transports.ConversationDatasetsGrpcAsyncIOTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + channel = transport.grpc_channel + assert channel + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.ConversationDatasetsGrpcTransport, + transports.ConversationDatasetsGrpcAsyncIOTransport, + ], +) +def test_transport_adc(transport_class): + # Test default credentials are used if not provided. + with mock.patch.object(google.auth, "default") as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport_class() + adc.assert_called_once() + + +def test_transport_grpc_default(): + # A client should use the gRPC transport by default. + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance(client.transport, transports.ConversationDatasetsGrpcTransport,) + + +def test_conversation_datasets_base_transport_error(): + # Passing both a credentials object and credentials_file should raise an error + with pytest.raises(core_exceptions.DuplicateCredentialArgs): + transport = transports.ConversationDatasetsTransport( + credentials=ga_credentials.AnonymousCredentials(), + credentials_file="credentials.json", + ) + + +def test_conversation_datasets_base_transport(): + # Instantiate the base transport. + with mock.patch( + "google.cloud.dialogflow_v2.services.conversation_datasets.transports.ConversationDatasetsTransport.__init__" + ) as Transport: + Transport.return_value = None + transport = transports.ConversationDatasetsTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Every method on the transport should just blindly + # raise NotImplementedError. + methods = ( + "create_conversation_dataset", + "get_conversation_dataset", + "list_conversation_datasets", + "delete_conversation_dataset", + "import_conversation_data", + ) + for method in methods: + with pytest.raises(NotImplementedError): + getattr(transport, method)(request=object()) + + with pytest.raises(NotImplementedError): + transport.close() + + # Additionally, the LRO client (a property) should + # also raise NotImplementedError + with pytest.raises(NotImplementedError): + transport.operations_client + + +def test_conversation_datasets_base_transport_with_credentials_file(): + # Instantiate the base transport with a credentials file + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch( + "google.cloud.dialogflow_v2.services.conversation_datasets.transports.ConversationDatasetsTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.ConversationDatasetsTransport( + credentials_file="credentials.json", quota_project_id="octopus", + ) + load_creds.assert_called_once_with( + "credentials.json", + scopes=None, + default_scopes=( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow", + ), + quota_project_id="octopus", + ) + + +def test_conversation_datasets_base_transport_with_adc(): + # Test the default credentials are used if credentials and credentials_file are None. + with mock.patch.object(google.auth, "default", autospec=True) as adc, mock.patch( + "google.cloud.dialogflow_v2.services.conversation_datasets.transports.ConversationDatasetsTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.ConversationDatasetsTransport() + adc.assert_called_once() + + +def test_conversation_datasets_auth_adc(): + # If no credentials are provided, we should use ADC credentials. + with mock.patch.object(google.auth, "default", autospec=True) as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + ConversationDatasetsClient() + adc.assert_called_once_with( + scopes=None, + default_scopes=( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow", + ), + quota_project_id=None, + ) + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.ConversationDatasetsGrpcTransport, + transports.ConversationDatasetsGrpcAsyncIOTransport, + ], +) +def test_conversation_datasets_transport_auth_adc(transport_class): + # If credentials and host are not provided, the transport class should use + # ADC credentials. + with mock.patch.object(google.auth, "default", autospec=True) as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport_class(quota_project_id="octopus", scopes=["1", "2"]) + adc.assert_called_once_with( + scopes=["1", "2"], + default_scopes=( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow", + ), + quota_project_id="octopus", + ) + + +@pytest.mark.parametrize( + "transport_class,grpc_helpers", + [ + (transports.ConversationDatasetsGrpcTransport, grpc_helpers), + (transports.ConversationDatasetsGrpcAsyncIOTransport, grpc_helpers_async), + ], +) +def test_conversation_datasets_transport_create_channel(transport_class, grpc_helpers): + # If credentials and host are not provided, the transport class should use + # ADC credentials. + with mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel", autospec=True + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + adc.return_value = (creds, None) + transport_class(quota_project_id="octopus", scopes=["1", "2"]) + + create_channel.assert_called_with( + "dialogflow.googleapis.com:443", + credentials=creds, + credentials_file=None, + quota_project_id="octopus", + default_scopes=( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow", + ), + scopes=["1", "2"], + default_host="dialogflow.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.ConversationDatasetsGrpcTransport, + transports.ConversationDatasetsGrpcAsyncIOTransport, + ], +) +def test_conversation_datasets_grpc_transport_client_cert_source_for_mtls( + transport_class, +): + cred = ga_credentials.AnonymousCredentials() + + # Check ssl_channel_credentials is used if provided. + with mock.patch.object(transport_class, "create_channel") as mock_create_channel: + mock_ssl_channel_creds = mock.Mock() + transport_class( + host="squid.clam.whelk", + credentials=cred, + ssl_channel_credentials=mock_ssl_channel_creds, + ) + mock_create_channel.assert_called_once_with( + "squid.clam.whelk:443", + credentials=cred, + credentials_file=None, + scopes=None, + ssl_credentials=mock_ssl_channel_creds, + quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + # Check if ssl_channel_credentials is not provided, then client_cert_source_for_mtls + # is used. + with mock.patch.object(transport_class, "create_channel", return_value=mock.Mock()): + with mock.patch("grpc.ssl_channel_credentials") as mock_ssl_cred: + transport_class( + credentials=cred, + client_cert_source_for_mtls=client_cert_source_callback, + ) + expected_cert, expected_key = client_cert_source_callback() + mock_ssl_cred.assert_called_once_with( + certificate_chain=expected_cert, private_key=expected_key + ) + + +def test_conversation_datasets_host_no_port(): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), + client_options=client_options.ClientOptions( + api_endpoint="dialogflow.googleapis.com" + ), + ) + assert client.transport._host == "dialogflow.googleapis.com:443" + + +def test_conversation_datasets_host_with_port(): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), + client_options=client_options.ClientOptions( + api_endpoint="dialogflow.googleapis.com:8000" + ), + ) + assert client.transport._host == "dialogflow.googleapis.com:8000" + + +def test_conversation_datasets_grpc_transport_channel(): + channel = grpc.secure_channel("http://localhost/", grpc.local_channel_credentials()) + + # Check that channel is used if provided. + transport = transports.ConversationDatasetsGrpcTransport( + host="squid.clam.whelk", channel=channel, + ) + assert transport.grpc_channel == channel + assert transport._host == "squid.clam.whelk:443" + assert transport._ssl_channel_credentials == None + + +def test_conversation_datasets_grpc_asyncio_transport_channel(): + channel = aio.secure_channel("http://localhost/", grpc.local_channel_credentials()) + + # Check that channel is used if provided. + transport = transports.ConversationDatasetsGrpcAsyncIOTransport( + host="squid.clam.whelk", channel=channel, + ) + assert transport.grpc_channel == channel + assert transport._host == "squid.clam.whelk:443" + assert transport._ssl_channel_credentials == None + + +# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are +# removed from grpc/grpc_asyncio transport constructor. +@pytest.mark.parametrize( + "transport_class", + [ + transports.ConversationDatasetsGrpcTransport, + transports.ConversationDatasetsGrpcAsyncIOTransport, + ], +) +def test_conversation_datasets_transport_channel_mtls_with_client_cert_source( + transport_class, +): + with mock.patch( + "grpc.ssl_channel_credentials", autospec=True + ) as grpc_ssl_channel_cred: + with mock.patch.object( + transport_class, "create_channel" + ) as grpc_create_channel: + mock_ssl_cred = mock.Mock() + grpc_ssl_channel_cred.return_value = mock_ssl_cred + + mock_grpc_channel = mock.Mock() + grpc_create_channel.return_value = mock_grpc_channel + + cred = ga_credentials.AnonymousCredentials() + with pytest.warns(DeprecationWarning): + with mock.patch.object(google.auth, "default") as adc: + adc.return_value = (cred, None) + transport = transport_class( + host="squid.clam.whelk", + api_mtls_endpoint="mtls.squid.clam.whelk", + client_cert_source=client_cert_source_callback, + ) + adc.assert_called_once() + + grpc_ssl_channel_cred.assert_called_once_with( + certificate_chain=b"cert bytes", private_key=b"key bytes" + ) + grpc_create_channel.assert_called_once_with( + "mtls.squid.clam.whelk:443", + credentials=cred, + credentials_file=None, + scopes=None, + ssl_credentials=mock_ssl_cred, + quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + assert transport.grpc_channel == mock_grpc_channel + assert transport._ssl_channel_credentials == mock_ssl_cred + + +# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are +# removed from grpc/grpc_asyncio transport constructor. +@pytest.mark.parametrize( + "transport_class", + [ + transports.ConversationDatasetsGrpcTransport, + transports.ConversationDatasetsGrpcAsyncIOTransport, + ], +) +def test_conversation_datasets_transport_channel_mtls_with_adc(transport_class): + mock_ssl_cred = mock.Mock() + with mock.patch.multiple( + "google.auth.transport.grpc.SslCredentials", + __init__=mock.Mock(return_value=None), + ssl_credentials=mock.PropertyMock(return_value=mock_ssl_cred), + ): + with mock.patch.object( + transport_class, "create_channel" + ) as grpc_create_channel: + mock_grpc_channel = mock.Mock() + grpc_create_channel.return_value = mock_grpc_channel + mock_cred = mock.Mock() + + with pytest.warns(DeprecationWarning): + transport = transport_class( + host="squid.clam.whelk", + credentials=mock_cred, + api_mtls_endpoint="mtls.squid.clam.whelk", + client_cert_source=None, + ) + + grpc_create_channel.assert_called_once_with( + "mtls.squid.clam.whelk:443", + credentials=mock_cred, + credentials_file=None, + scopes=None, + ssl_credentials=mock_ssl_cred, + quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + assert transport.grpc_channel == mock_grpc_channel + + +def test_conversation_datasets_grpc_lro_client(): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + transport = client.transport + + # Ensure that we have a api-core operations client. + assert isinstance(transport.operations_client, operations_v1.OperationsClient,) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + +def test_conversation_datasets_grpc_lro_async_client(): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + ) + transport = client.transport + + # Ensure that we have a api-core operations client. + assert isinstance(transport.operations_client, operations_v1.OperationsAsyncClient,) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + +def test_conversation_dataset_path(): + project = "squid" + location = "clam" + conversation_dataset = "whelk" + expected = "projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}".format( + project=project, location=location, conversation_dataset=conversation_dataset, + ) + actual = ConversationDatasetsClient.conversation_dataset_path( + project, location, conversation_dataset + ) + assert expected == actual + + +def test_parse_conversation_dataset_path(): + expected = { + "project": "octopus", + "location": "oyster", + "conversation_dataset": "nudibranch", + } + path = ConversationDatasetsClient.conversation_dataset_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationDatasetsClient.parse_conversation_dataset_path(path) + assert expected == actual + + +def test_common_billing_account_path(): + billing_account = "cuttlefish" + expected = "billingAccounts/{billing_account}".format( + billing_account=billing_account, + ) + actual = ConversationDatasetsClient.common_billing_account_path(billing_account) + assert expected == actual + + +def test_parse_common_billing_account_path(): + expected = { + "billing_account": "mussel", + } + path = ConversationDatasetsClient.common_billing_account_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationDatasetsClient.parse_common_billing_account_path(path) + assert expected == actual + + +def test_common_folder_path(): + folder = "winkle" + expected = "folders/{folder}".format(folder=folder,) + actual = ConversationDatasetsClient.common_folder_path(folder) + assert expected == actual + + +def test_parse_common_folder_path(): + expected = { + "folder": "nautilus", + } + path = ConversationDatasetsClient.common_folder_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationDatasetsClient.parse_common_folder_path(path) + assert expected == actual + + +def test_common_organization_path(): + organization = "scallop" + expected = "organizations/{organization}".format(organization=organization,) + actual = ConversationDatasetsClient.common_organization_path(organization) + assert expected == actual + + +def test_parse_common_organization_path(): + expected = { + "organization": "abalone", + } + path = ConversationDatasetsClient.common_organization_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationDatasetsClient.parse_common_organization_path(path) + assert expected == actual + + +def test_common_project_path(): + project = "squid" + expected = "projects/{project}".format(project=project,) + actual = ConversationDatasetsClient.common_project_path(project) + assert expected == actual + + +def test_parse_common_project_path(): + expected = { + "project": "clam", + } + path = ConversationDatasetsClient.common_project_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationDatasetsClient.parse_common_project_path(path) + assert expected == actual + + +def test_common_location_path(): + project = "whelk" + location = "octopus" + expected = "projects/{project}/locations/{location}".format( + project=project, location=location, + ) + actual = ConversationDatasetsClient.common_location_path(project, location) + assert expected == actual + + +def test_parse_common_location_path(): + expected = { + "project": "oyster", + "location": "nudibranch", + } + path = ConversationDatasetsClient.common_location_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationDatasetsClient.parse_common_location_path(path) + assert expected == actual + + +def test_client_with_default_client_info(): + client_info = gapic_v1.client_info.ClientInfo() + + with mock.patch.object( + transports.ConversationDatasetsTransport, "_prep_wrapped_messages" + ) as prep: + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + ) + prep.assert_called_once_with(client_info) + + with mock.patch.object( + transports.ConversationDatasetsTransport, "_prep_wrapped_messages" + ) as prep: + transport_class = ConversationDatasetsClient.get_transport_class() + transport = transport_class( + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + ) + prep.assert_called_once_with(client_info) + + +@pytest.mark.asyncio +async def test_transport_close_async(): + client = ConversationDatasetsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + ) + with mock.patch.object( + type(getattr(client.transport, "grpc_channel")), "close" + ) as close: + async with client: + close.assert_not_called() + close.assert_called_once() + + +def test_transport_close(): + transports = { + "grpc": "_grpc_channel", + } + + for transport, close_name in transports.items(): + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport + ) + with mock.patch.object( + type(getattr(client.transport, close_name)), "close" + ) as close: + with client: + close.assert_not_called() + close.assert_called_once() + + +def test_client_ctx(): + transports = [ + "grpc", + ] + for transport in transports: + client = ConversationDatasetsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport + ) + # Test client calls underlying transport. + with mock.patch.object(type(client.transport), "close") as close: + close.assert_not_called() + with client: + pass + close.assert_called() + + +@pytest.mark.parametrize( + "client_class,transport_class", + [ + (ConversationDatasetsClient, transports.ConversationDatasetsGrpcTransport), + ( + ConversationDatasetsAsyncClient, + transports.ConversationDatasetsGrpcAsyncIOTransport, + ), + ], +) +def test_api_key_credentials(client_class, transport_class): + with mock.patch.object( + google.auth._default, "get_api_key_credentials", create=True + ) as get_api_key_credentials: + mock_cred = mock.Mock() + get_api_key_credentials.return_value = mock_cred + options = client_options.ClientOptions() + options.api_key = "api_key" + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options) + patched.assert_called_once_with( + credentials=mock_cred, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversation_models.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversation_models.py new file mode 100644 index 000000000000..337c9455e701 --- /dev/null +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversation_models.py @@ -0,0 +1,3737 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +import os +import mock + +import grpc +from grpc.experimental import aio +import math +import pytest +from proto.marshal.rules.dates import DurationRule, TimestampRule + + +from google.api_core import client_options +from google.api_core import exceptions as core_exceptions +from google.api_core import future +from google.api_core import gapic_v1 +from google.api_core import grpc_helpers +from google.api_core import grpc_helpers_async +from google.api_core import operation +from google.api_core import operation_async # type: ignore +from google.api_core import operations_v1 +from google.api_core import path_template +from google.auth import credentials as ga_credentials +from google.auth.exceptions import MutualTLSChannelError +from google.cloud.dialogflow_v2.services.conversation_models import ( + ConversationModelsAsyncClient, +) +from google.cloud.dialogflow_v2.services.conversation_models import ( + ConversationModelsClient, +) +from google.cloud.dialogflow_v2.services.conversation_models import pagers +from google.cloud.dialogflow_v2.services.conversation_models import transports +from google.cloud.dialogflow_v2.types import conversation_model +from google.cloud.dialogflow_v2.types import ( + conversation_model as gcd_conversation_model, +) +from google.longrunning import operations_pb2 +from google.oauth2 import service_account +from google.protobuf import timestamp_pb2 # type: ignore +import google.auth + + +def client_cert_source_callback(): + return b"cert bytes", b"key bytes" + + +# If default endpoint is localhost, then default mtls endpoint will be the same. +# This method modifies the default endpoint so the client can produce a different +# mtls endpoint for endpoint testing purposes. +def modify_default_endpoint(client): + return ( + "foo.googleapis.com" + if ("localhost" in client.DEFAULT_ENDPOINT) + else client.DEFAULT_ENDPOINT + ) + + +def test__get_default_mtls_endpoint(): + api_endpoint = "example.googleapis.com" + api_mtls_endpoint = "example.mtls.googleapis.com" + sandbox_endpoint = "example.sandbox.googleapis.com" + sandbox_mtls_endpoint = "example.mtls.sandbox.googleapis.com" + non_googleapi = "api.example.com" + + assert ConversationModelsClient._get_default_mtls_endpoint(None) is None + assert ( + ConversationModelsClient._get_default_mtls_endpoint(api_endpoint) + == api_mtls_endpoint + ) + assert ( + ConversationModelsClient._get_default_mtls_endpoint(api_mtls_endpoint) + == api_mtls_endpoint + ) + assert ( + ConversationModelsClient._get_default_mtls_endpoint(sandbox_endpoint) + == sandbox_mtls_endpoint + ) + assert ( + ConversationModelsClient._get_default_mtls_endpoint(sandbox_mtls_endpoint) + == sandbox_mtls_endpoint + ) + assert ( + ConversationModelsClient._get_default_mtls_endpoint(non_googleapi) + == non_googleapi + ) + + +@pytest.mark.parametrize( + "client_class", [ConversationModelsClient, ConversationModelsAsyncClient,] +) +def test_conversation_models_client_from_service_account_info(client_class): + creds = ga_credentials.AnonymousCredentials() + with mock.patch.object( + service_account.Credentials, "from_service_account_info" + ) as factory: + factory.return_value = creds + info = {"valid": True} + client = client_class.from_service_account_info(info) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + assert client.transport._host == "dialogflow.googleapis.com:443" + + +@pytest.mark.parametrize( + "transport_class,transport_name", + [ + (transports.ConversationModelsGrpcTransport, "grpc"), + (transports.ConversationModelsGrpcAsyncIOTransport, "grpc_asyncio"), + ], +) +def test_conversation_models_client_service_account_always_use_jwt( + transport_class, transport_name +): + with mock.patch.object( + service_account.Credentials, "with_always_use_jwt_access", create=True + ) as use_jwt: + creds = service_account.Credentials(None, None, None) + transport = transport_class(credentials=creds, always_use_jwt_access=True) + use_jwt.assert_called_once_with(True) + + with mock.patch.object( + service_account.Credentials, "with_always_use_jwt_access", create=True + ) as use_jwt: + creds = service_account.Credentials(None, None, None) + transport = transport_class(credentials=creds, always_use_jwt_access=False) + use_jwt.assert_not_called() + + +@pytest.mark.parametrize( + "client_class", [ConversationModelsClient, ConversationModelsAsyncClient,] +) +def test_conversation_models_client_from_service_account_file(client_class): + creds = ga_credentials.AnonymousCredentials() + with mock.patch.object( + service_account.Credentials, "from_service_account_file" + ) as factory: + factory.return_value = creds + client = client_class.from_service_account_file("dummy/file/path.json") + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + client = client_class.from_service_account_json("dummy/file/path.json") + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + assert client.transport._host == "dialogflow.googleapis.com:443" + + +def test_conversation_models_client_get_transport_class(): + transport = ConversationModelsClient.get_transport_class() + available_transports = [ + transports.ConversationModelsGrpcTransport, + ] + assert transport in available_transports + + transport = ConversationModelsClient.get_transport_class("grpc") + assert transport == transports.ConversationModelsGrpcTransport + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name", + [ + (ConversationModelsClient, transports.ConversationModelsGrpcTransport, "grpc"), + ( + ConversationModelsAsyncClient, + transports.ConversationModelsGrpcAsyncIOTransport, + "grpc_asyncio", + ), + ], +) +@mock.patch.object( + ConversationModelsClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(ConversationModelsClient), +) +@mock.patch.object( + ConversationModelsAsyncClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(ConversationModelsAsyncClient), +) +def test_conversation_models_client_client_options( + client_class, transport_class, transport_name +): + # Check that if channel is provided we won't create a new one. + with mock.patch.object(ConversationModelsClient, "get_transport_class") as gtc: + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) + client = client_class(transport=transport) + gtc.assert_not_called() + + # Check that if channel is provided via str we will create a new one. + with mock.patch.object(ConversationModelsClient, "get_transport_class") as gtc: + client = client_class(transport=transport_name) + gtc.assert_called() + + # Check the case api_endpoint is provided. + options = client_options.ClientOptions(api_endpoint="squid.clam.whelk") + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name, client_options=options) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host="squid.clam.whelk", + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is + # "never". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT is + # "always". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_MTLS_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # Check the case api_endpoint is not provided and GOOGLE_API_USE_MTLS_ENDPOINT has + # unsupported value. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): + with pytest.raises(MutualTLSChannelError): + client = client_class(transport=transport_name) + + # Check the case GOOGLE_API_USE_CLIENT_CERTIFICATE has unsupported value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} + ): + with pytest.raises(ValueError): + client = client_class(transport=transport_name) + + # Check the case quota_project_id is provided + options = client_options.ClientOptions(quota_project_id="octopus") + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id="octopus", + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,use_client_cert_env", + [ + ( + ConversationModelsClient, + transports.ConversationModelsGrpcTransport, + "grpc", + "true", + ), + ( + ConversationModelsAsyncClient, + transports.ConversationModelsGrpcAsyncIOTransport, + "grpc_asyncio", + "true", + ), + ( + ConversationModelsClient, + transports.ConversationModelsGrpcTransport, + "grpc", + "false", + ), + ( + ConversationModelsAsyncClient, + transports.ConversationModelsGrpcAsyncIOTransport, + "grpc_asyncio", + "false", + ), + ], +) +@mock.patch.object( + ConversationModelsClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(ConversationModelsClient), +) +@mock.patch.object( + ConversationModelsAsyncClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(ConversationModelsAsyncClient), +) +@mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}) +def test_conversation_models_client_mtls_env_auto( + client_class, transport_class, transport_name, use_client_cert_env +): + # This tests the endpoint autoswitch behavior. Endpoint is autoswitched to the default + # mtls endpoint, if GOOGLE_API_USE_CLIENT_CERTIFICATE is "true" and client cert exists. + + # Check the case client_cert_source is provided. Whether client cert is used depends on + # GOOGLE_API_USE_CLIENT_CERTIFICATE value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + options = client_options.ClientOptions( + client_cert_source=client_cert_source_callback + ) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + + if use_client_cert_env == "false": + expected_client_cert_source = None + expected_host = client.DEFAULT_ENDPOINT + else: + expected_client_cert_source = client_cert_source_callback + expected_host = client.DEFAULT_MTLS_ENDPOINT + + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=expected_host, + scopes=None, + client_cert_source_for_mtls=expected_client_cert_source, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # Check the case ADC client cert is provided. Whether client cert is used depends on + # GOOGLE_API_USE_CLIENT_CERTIFICATE value. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + with mock.patch.object(transport_class, "__init__") as patched: + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=True, + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=client_cert_source_callback, + ): + if use_client_cert_env == "false": + expected_host = client.DEFAULT_ENDPOINT + expected_client_cert_source = None + else: + expected_host = client.DEFAULT_MTLS_ENDPOINT + expected_client_cert_source = client_cert_source_callback + + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=expected_host, + scopes=None, + client_cert_source_for_mtls=expected_client_cert_source, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # Check the case client_cert_source and ADC client cert are not provided. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + with mock.patch.object(transport_class, "__init__") as patched: + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=False, + ): + patched.return_value = None + client = client_class(transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + +@pytest.mark.parametrize( + "client_class", [ConversationModelsClient, ConversationModelsAsyncClient] +) +@mock.patch.object( + ConversationModelsClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(ConversationModelsClient), +) +@mock.patch.object( + ConversationModelsAsyncClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(ConversationModelsAsyncClient), +) +def test_conversation_models_client_get_mtls_endpoint_and_cert_source(client_class): + mock_client_cert_source = mock.Mock() + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "true". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source == mock_client_cert_source + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "false". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): + mock_client_cert_source = mock.Mock() + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "never". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "always". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert doesn't exist. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=False, + ): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert exists. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=True, + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=mock_client_cert_source, + ): + ( + api_endpoint, + cert_source, + ) = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source == mock_client_cert_source + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name", + [ + (ConversationModelsClient, transports.ConversationModelsGrpcTransport, "grpc"), + ( + ConversationModelsAsyncClient, + transports.ConversationModelsGrpcAsyncIOTransport, + "grpc_asyncio", + ), + ], +) +def test_conversation_models_client_client_options_scopes( + client_class, transport_class, transport_name +): + # Check the case scopes are provided. + options = client_options.ClientOptions(scopes=["1", "2"],) + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=["1", "2"], + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + ConversationModelsClient, + transports.ConversationModelsGrpcTransport, + "grpc", + grpc_helpers, + ), + ( + ConversationModelsAsyncClient, + transports.ConversationModelsGrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_conversation_models_client_client_options_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + +def test_conversation_models_client_client_options_from_dict(): + with mock.patch( + "google.cloud.dialogflow_v2.services.conversation_models.transports.ConversationModelsGrpcTransport.__init__" + ) as grpc_transport: + grpc_transport.return_value = None + client = ConversationModelsClient( + client_options={"api_endpoint": "squid.clam.whelk"} + ) + grpc_transport.assert_called_once_with( + credentials=None, + credentials_file=None, + host="squid.clam.whelk", + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + ConversationModelsClient, + transports.ConversationModelsGrpcTransport, + "grpc", + grpc_helpers, + ), + ( + ConversationModelsAsyncClient, + transports.ConversationModelsGrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_conversation_models_client_create_channel_credentials_file( + client_class, transport_class, transport_name, grpc_helpers +): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # test that the credentials from file are saved and used as the credentials. + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel" + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() + load_creds.return_value = (file_creds, None) + adc.return_value = (creds, None) + client = client_class(client_options=options, transport=transport_name) + create_channel.assert_called_with( + "dialogflow.googleapis.com:443", + credentials=file_creds, + credentials_file=None, + quota_project_id=None, + default_scopes=( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow", + ), + scopes=None, + default_host="dialogflow.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + +@pytest.mark.parametrize( + "request_type", [gcd_conversation_model.CreateConversationModelRequest, dict,] +) +def test_create_conversation_model(request_type, transport: str = "grpc"): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_model), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.create_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == gcd_conversation_model.CreateConversationModelRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_create_conversation_model_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_model), "__call__" + ) as call: + client.create_conversation_model() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == gcd_conversation_model.CreateConversationModelRequest() + + +@pytest.mark.asyncio +async def test_create_conversation_model_async( + transport: str = "grpc_asyncio", + request_type=gcd_conversation_model.CreateConversationModelRequest, +): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_model), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.create_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == gcd_conversation_model.CreateConversationModelRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_create_conversation_model_async_from_dict(): + await test_create_conversation_model_async(request_type=dict) + + +def test_create_conversation_model_field_headers(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = gcd_conversation_model.CreateConversationModelRequest() + + request.parent = "parent/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_model), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.create_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_create_conversation_model_field_headers_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = gcd_conversation_model.CreateConversationModelRequest() + + request.parent = "parent/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_model), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.create_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + + +def test_create_conversation_model_flattened(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_model), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.create_conversation_model( + parent="parent_value", + conversation_model=gcd_conversation_model.ConversationModel( + name="name_value" + ), + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].conversation_model + mock_val = gcd_conversation_model.ConversationModel(name="name_value") + assert arg == mock_val + + +def test_create_conversation_model_flattened_error(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.create_conversation_model( + gcd_conversation_model.CreateConversationModelRequest(), + parent="parent_value", + conversation_model=gcd_conversation_model.ConversationModel( + name="name_value" + ), + ) + + +@pytest.mark.asyncio +async def test_create_conversation_model_flattened_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_model), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.create_conversation_model( + parent="parent_value", + conversation_model=gcd_conversation_model.ConversationModel( + name="name_value" + ), + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].conversation_model + mock_val = gcd_conversation_model.ConversationModel(name="name_value") + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_create_conversation_model_flattened_error_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.create_conversation_model( + gcd_conversation_model.CreateConversationModelRequest(), + parent="parent_value", + conversation_model=gcd_conversation_model.ConversationModel( + name="name_value" + ), + ) + + +@pytest.mark.parametrize( + "request_type", [conversation_model.GetConversationModelRequest, dict,] +) +def test_get_conversation_model(request_type, transport: str = "grpc"): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_model), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = conversation_model.ConversationModel( + name="name_value", + display_name="display_name_value", + state=conversation_model.ConversationModel.State.CREATING, + language_code="language_code_value", + article_suggestion_model_metadata=conversation_model.ArticleSuggestionModelMetadata( + training_model_type=conversation_model.ConversationModel.ModelType.SMART_REPLY_DUAL_ENCODER_MODEL + ), + ) + response = client.get_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.GetConversationModelRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, conversation_model.ConversationModel) + assert response.name == "name_value" + assert response.display_name == "display_name_value" + assert response.state == conversation_model.ConversationModel.State.CREATING + assert response.language_code == "language_code_value" + + +def test_get_conversation_model_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_model), "__call__" + ) as call: + client.get_conversation_model() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.GetConversationModelRequest() + + +@pytest.mark.asyncio +async def test_get_conversation_model_async( + transport: str = "grpc_asyncio", + request_type=conversation_model.GetConversationModelRequest, +): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_model), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_model.ConversationModel( + name="name_value", + display_name="display_name_value", + state=conversation_model.ConversationModel.State.CREATING, + language_code="language_code_value", + ) + ) + response = await client.get_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.GetConversationModelRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, conversation_model.ConversationModel) + assert response.name == "name_value" + assert response.display_name == "display_name_value" + assert response.state == conversation_model.ConversationModel.State.CREATING + assert response.language_code == "language_code_value" + + +@pytest.mark.asyncio +async def test_get_conversation_model_async_from_dict(): + await test_get_conversation_model_async(request_type=dict) + + +def test_get_conversation_model_field_headers(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_model.GetConversationModelRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_model), "__call__" + ) as call: + call.return_value = conversation_model.ConversationModel() + client.get_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_get_conversation_model_field_headers_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_model.GetConversationModelRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_model), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_model.ConversationModel() + ) + await client.get_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +def test_get_conversation_model_flattened(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_model), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = conversation_model.ConversationModel() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.get_conversation_model(name="name_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +def test_get_conversation_model_flattened_error(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get_conversation_model( + conversation_model.GetConversationModelRequest(), name="name_value", + ) + + +@pytest.mark.asyncio +async def test_get_conversation_model_flattened_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_model), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = conversation_model.ConversationModel() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_model.ConversationModel() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.get_conversation_model(name="name_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_get_conversation_model_flattened_error_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.get_conversation_model( + conversation_model.GetConversationModelRequest(), name="name_value", + ) + + +@pytest.mark.parametrize( + "request_type", [conversation_model.ListConversationModelsRequest, dict,] +) +def test_list_conversation_models(request_type, transport: str = "grpc"): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_models), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = conversation_model.ListConversationModelsResponse( + next_page_token="next_page_token_value", + ) + response = client.list_conversation_models(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.ListConversationModelsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListConversationModelsPager) + assert response.next_page_token == "next_page_token_value" + + +def test_list_conversation_models_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_models), "__call__" + ) as call: + client.list_conversation_models() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.ListConversationModelsRequest() + + +@pytest.mark.asyncio +async def test_list_conversation_models_async( + transport: str = "grpc_asyncio", + request_type=conversation_model.ListConversationModelsRequest, +): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_models), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_model.ListConversationModelsResponse( + next_page_token="next_page_token_value", + ) + ) + response = await client.list_conversation_models(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.ListConversationModelsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListConversationModelsAsyncPager) + assert response.next_page_token == "next_page_token_value" + + +@pytest.mark.asyncio +async def test_list_conversation_models_async_from_dict(): + await test_list_conversation_models_async(request_type=dict) + + +def test_list_conversation_models_field_headers(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_model.ListConversationModelsRequest() + + request.parent = "parent/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_models), "__call__" + ) as call: + call.return_value = conversation_model.ListConversationModelsResponse() + client.list_conversation_models(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_list_conversation_models_field_headers_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_model.ListConversationModelsRequest() + + request.parent = "parent/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_models), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_model.ListConversationModelsResponse() + ) + await client.list_conversation_models(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + + +def test_list_conversation_models_flattened(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_models), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = conversation_model.ListConversationModelsResponse() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.list_conversation_models(parent="parent_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + + +def test_list_conversation_models_flattened_error(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.list_conversation_models( + conversation_model.ListConversationModelsRequest(), parent="parent_value", + ) + + +@pytest.mark.asyncio +async def test_list_conversation_models_flattened_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_models), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = conversation_model.ListConversationModelsResponse() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_model.ListConversationModelsResponse() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.list_conversation_models(parent="parent_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_list_conversation_models_flattened_error_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.list_conversation_models( + conversation_model.ListConversationModelsRequest(), parent="parent_value", + ) + + +def test_list_conversation_models_pager(transport_name: str = "grpc"): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_models), "__call__" + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + conversation_model.ListConversationModelsResponse( + conversation_models=[ + conversation_model.ConversationModel(), + conversation_model.ConversationModel(), + conversation_model.ConversationModel(), + ], + next_page_token="abc", + ), + conversation_model.ListConversationModelsResponse( + conversation_models=[], next_page_token="def", + ), + conversation_model.ListConversationModelsResponse( + conversation_models=[conversation_model.ConversationModel(),], + next_page_token="ghi", + ), + conversation_model.ListConversationModelsResponse( + conversation_models=[ + conversation_model.ConversationModel(), + conversation_model.ConversationModel(), + ], + ), + RuntimeError, + ) + + metadata = () + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", ""),)), + ) + pager = client.list_conversation_models(request={}) + + assert pager._metadata == metadata + + results = [i for i in pager] + assert len(results) == 6 + assert all(isinstance(i, conversation_model.ConversationModel) for i in results) + + +def test_list_conversation_models_pages(transport_name: str = "grpc"): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_models), "__call__" + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + conversation_model.ListConversationModelsResponse( + conversation_models=[ + conversation_model.ConversationModel(), + conversation_model.ConversationModel(), + conversation_model.ConversationModel(), + ], + next_page_token="abc", + ), + conversation_model.ListConversationModelsResponse( + conversation_models=[], next_page_token="def", + ), + conversation_model.ListConversationModelsResponse( + conversation_models=[conversation_model.ConversationModel(),], + next_page_token="ghi", + ), + conversation_model.ListConversationModelsResponse( + conversation_models=[ + conversation_model.ConversationModel(), + conversation_model.ConversationModel(), + ], + ), + RuntimeError, + ) + pages = list(client.list_conversation_models(request={}).pages) + for page_, token in zip(pages, ["abc", "def", "ghi", ""]): + assert page_.raw_page.next_page_token == token + + +@pytest.mark.asyncio +async def test_list_conversation_models_async_pager(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_models), + "__call__", + new_callable=mock.AsyncMock, + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + conversation_model.ListConversationModelsResponse( + conversation_models=[ + conversation_model.ConversationModel(), + conversation_model.ConversationModel(), + conversation_model.ConversationModel(), + ], + next_page_token="abc", + ), + conversation_model.ListConversationModelsResponse( + conversation_models=[], next_page_token="def", + ), + conversation_model.ListConversationModelsResponse( + conversation_models=[conversation_model.ConversationModel(),], + next_page_token="ghi", + ), + conversation_model.ListConversationModelsResponse( + conversation_models=[ + conversation_model.ConversationModel(), + conversation_model.ConversationModel(), + ], + ), + RuntimeError, + ) + async_pager = await client.list_conversation_models(request={},) + assert async_pager.next_page_token == "abc" + responses = [] + async for response in async_pager: + responses.append(response) + + assert len(responses) == 6 + assert all( + isinstance(i, conversation_model.ConversationModel) for i in responses + ) + + +@pytest.mark.asyncio +async def test_list_conversation_models_async_pages(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_models), + "__call__", + new_callable=mock.AsyncMock, + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + conversation_model.ListConversationModelsResponse( + conversation_models=[ + conversation_model.ConversationModel(), + conversation_model.ConversationModel(), + conversation_model.ConversationModel(), + ], + next_page_token="abc", + ), + conversation_model.ListConversationModelsResponse( + conversation_models=[], next_page_token="def", + ), + conversation_model.ListConversationModelsResponse( + conversation_models=[conversation_model.ConversationModel(),], + next_page_token="ghi", + ), + conversation_model.ListConversationModelsResponse( + conversation_models=[ + conversation_model.ConversationModel(), + conversation_model.ConversationModel(), + ], + ), + RuntimeError, + ) + pages = [] + async for page_ in (await client.list_conversation_models(request={})).pages: + pages.append(page_) + for page_, token in zip(pages, ["abc", "def", "ghi", ""]): + assert page_.raw_page.next_page_token == token + + +@pytest.mark.parametrize( + "request_type", [conversation_model.DeleteConversationModelRequest, dict,] +) +def test_delete_conversation_model(request_type, transport: str = "grpc"): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_conversation_model), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.delete_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.DeleteConversationModelRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_delete_conversation_model_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_conversation_model), "__call__" + ) as call: + client.delete_conversation_model() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.DeleteConversationModelRequest() + + +@pytest.mark.asyncio +async def test_delete_conversation_model_async( + transport: str = "grpc_asyncio", + request_type=conversation_model.DeleteConversationModelRequest, +): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_conversation_model), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.delete_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.DeleteConversationModelRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_delete_conversation_model_async_from_dict(): + await test_delete_conversation_model_async(request_type=dict) + + +def test_delete_conversation_model_field_headers(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_model.DeleteConversationModelRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_conversation_model), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.delete_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_delete_conversation_model_field_headers_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_model.DeleteConversationModelRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_conversation_model), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.delete_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +def test_delete_conversation_model_flattened(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_conversation_model), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.delete_conversation_model(name="name_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +def test_delete_conversation_model_flattened_error(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.delete_conversation_model( + conversation_model.DeleteConversationModelRequest(), name="name_value", + ) + + +@pytest.mark.asyncio +async def test_delete_conversation_model_flattened_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.delete_conversation_model), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.delete_conversation_model(name="name_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_delete_conversation_model_flattened_error_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.delete_conversation_model( + conversation_model.DeleteConversationModelRequest(), name="name_value", + ) + + +@pytest.mark.parametrize( + "request_type", [conversation_model.DeployConversationModelRequest, dict,] +) +def test_deploy_conversation_model(request_type, transport: str = "grpc"): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.deploy_conversation_model), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.deploy_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.DeployConversationModelRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_deploy_conversation_model_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.deploy_conversation_model), "__call__" + ) as call: + client.deploy_conversation_model() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.DeployConversationModelRequest() + + +@pytest.mark.asyncio +async def test_deploy_conversation_model_async( + transport: str = "grpc_asyncio", + request_type=conversation_model.DeployConversationModelRequest, +): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.deploy_conversation_model), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.deploy_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.DeployConversationModelRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_deploy_conversation_model_async_from_dict(): + await test_deploy_conversation_model_async(request_type=dict) + + +def test_deploy_conversation_model_field_headers(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_model.DeployConversationModelRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.deploy_conversation_model), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.deploy_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_deploy_conversation_model_field_headers_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_model.DeployConversationModelRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.deploy_conversation_model), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.deploy_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +@pytest.mark.parametrize( + "request_type", [conversation_model.UndeployConversationModelRequest, dict,] +) +def test_undeploy_conversation_model(request_type, transport: str = "grpc"): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.undeploy_conversation_model), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.undeploy_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.UndeployConversationModelRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_undeploy_conversation_model_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.undeploy_conversation_model), "__call__" + ) as call: + client.undeploy_conversation_model() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.UndeployConversationModelRequest() + + +@pytest.mark.asyncio +async def test_undeploy_conversation_model_async( + transport: str = "grpc_asyncio", + request_type=conversation_model.UndeployConversationModelRequest, +): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.undeploy_conversation_model), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.undeploy_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.UndeployConversationModelRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_undeploy_conversation_model_async_from_dict(): + await test_undeploy_conversation_model_async(request_type=dict) + + +def test_undeploy_conversation_model_field_headers(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_model.UndeployConversationModelRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.undeploy_conversation_model), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.undeploy_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_undeploy_conversation_model_field_headers_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_model.UndeployConversationModelRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.undeploy_conversation_model), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.undeploy_conversation_model(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +@pytest.mark.parametrize( + "request_type", [conversation_model.GetConversationModelEvaluationRequest, dict,] +) +def test_get_conversation_model_evaluation(request_type, transport: str = "grpc"): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_model_evaluation), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = conversation_model.ConversationModelEvaluation( + name="name_value", + display_name="display_name_value", + smart_reply_metrics=conversation_model.SmartReplyMetrics( + allowlist_coverage=0.19260000000000002 + ), + ) + response = client.get_conversation_model_evaluation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.GetConversationModelEvaluationRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, conversation_model.ConversationModelEvaluation) + assert response.name == "name_value" + assert response.display_name == "display_name_value" + + +def test_get_conversation_model_evaluation_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_model_evaluation), "__call__" + ) as call: + client.get_conversation_model_evaluation() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.GetConversationModelEvaluationRequest() + + +@pytest.mark.asyncio +async def test_get_conversation_model_evaluation_async( + transport: str = "grpc_asyncio", + request_type=conversation_model.GetConversationModelEvaluationRequest, +): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_model_evaluation), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_model.ConversationModelEvaluation( + name="name_value", display_name="display_name_value", + ) + ) + response = await client.get_conversation_model_evaluation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.GetConversationModelEvaluationRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, conversation_model.ConversationModelEvaluation) + assert response.name == "name_value" + assert response.display_name == "display_name_value" + + +@pytest.mark.asyncio +async def test_get_conversation_model_evaluation_async_from_dict(): + await test_get_conversation_model_evaluation_async(request_type=dict) + + +def test_get_conversation_model_evaluation_field_headers(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_model.GetConversationModelEvaluationRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_model_evaluation), "__call__" + ) as call: + call.return_value = conversation_model.ConversationModelEvaluation() + client.get_conversation_model_evaluation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_get_conversation_model_evaluation_field_headers_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_model.GetConversationModelEvaluationRequest() + + request.name = "name/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_model_evaluation), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_model.ConversationModelEvaluation() + ) + await client.get_conversation_model_evaluation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + + +def test_get_conversation_model_evaluation_flattened(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_model_evaluation), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = conversation_model.ConversationModelEvaluation() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.get_conversation_model_evaluation(name="name_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +def test_get_conversation_model_evaluation_flattened_error(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get_conversation_model_evaluation( + conversation_model.GetConversationModelEvaluationRequest(), + name="name_value", + ) + + +@pytest.mark.asyncio +async def test_get_conversation_model_evaluation_flattened_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_conversation_model_evaluation), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = conversation_model.ConversationModelEvaluation() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_model.ConversationModelEvaluation() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.get_conversation_model_evaluation(name="name_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_get_conversation_model_evaluation_flattened_error_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.get_conversation_model_evaluation( + conversation_model.GetConversationModelEvaluationRequest(), + name="name_value", + ) + + +@pytest.mark.parametrize( + "request_type", [conversation_model.ListConversationModelEvaluationsRequest, dict,] +) +def test_list_conversation_model_evaluations(request_type, transport: str = "grpc"): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_model_evaluations), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = conversation_model.ListConversationModelEvaluationsResponse( + next_page_token="next_page_token_value", + ) + response = client.list_conversation_model_evaluations(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.ListConversationModelEvaluationsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListConversationModelEvaluationsPager) + assert response.next_page_token == "next_page_token_value" + + +def test_list_conversation_model_evaluations_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_model_evaluations), "__call__" + ) as call: + client.list_conversation_model_evaluations() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.ListConversationModelEvaluationsRequest() + + +@pytest.mark.asyncio +async def test_list_conversation_model_evaluations_async( + transport: str = "grpc_asyncio", + request_type=conversation_model.ListConversationModelEvaluationsRequest, +): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_model_evaluations), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_model.ListConversationModelEvaluationsResponse( + next_page_token="next_page_token_value", + ) + ) + response = await client.list_conversation_model_evaluations(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.ListConversationModelEvaluationsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, pagers.ListConversationModelEvaluationsAsyncPager) + assert response.next_page_token == "next_page_token_value" + + +@pytest.mark.asyncio +async def test_list_conversation_model_evaluations_async_from_dict(): + await test_list_conversation_model_evaluations_async(request_type=dict) + + +def test_list_conversation_model_evaluations_field_headers(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_model.ListConversationModelEvaluationsRequest() + + request.parent = "parent/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_model_evaluations), "__call__" + ) as call: + call.return_value = ( + conversation_model.ListConversationModelEvaluationsResponse() + ) + client.list_conversation_model_evaluations(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_list_conversation_model_evaluations_field_headers_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_model.ListConversationModelEvaluationsRequest() + + request.parent = "parent/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_model_evaluations), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_model.ListConversationModelEvaluationsResponse() + ) + await client.list_conversation_model_evaluations(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + + +def test_list_conversation_model_evaluations_flattened(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_model_evaluations), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = ( + conversation_model.ListConversationModelEvaluationsResponse() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.list_conversation_model_evaluations(parent="parent_value",) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + + +def test_list_conversation_model_evaluations_flattened_error(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.list_conversation_model_evaluations( + conversation_model.ListConversationModelEvaluationsRequest(), + parent="parent_value", + ) + + +@pytest.mark.asyncio +async def test_list_conversation_model_evaluations_flattened_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_model_evaluations), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = ( + conversation_model.ListConversationModelEvaluationsResponse() + ) + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + conversation_model.ListConversationModelEvaluationsResponse() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.list_conversation_model_evaluations( + parent="parent_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_list_conversation_model_evaluations_flattened_error_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.list_conversation_model_evaluations( + conversation_model.ListConversationModelEvaluationsRequest(), + parent="parent_value", + ) + + +def test_list_conversation_model_evaluations_pager(transport_name: str = "grpc"): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_model_evaluations), "__call__" + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + conversation_model.ListConversationModelEvaluationsResponse( + conversation_model_evaluations=[ + conversation_model.ConversationModelEvaluation(), + conversation_model.ConversationModelEvaluation(), + conversation_model.ConversationModelEvaluation(), + ], + next_page_token="abc", + ), + conversation_model.ListConversationModelEvaluationsResponse( + conversation_model_evaluations=[], next_page_token="def", + ), + conversation_model.ListConversationModelEvaluationsResponse( + conversation_model_evaluations=[ + conversation_model.ConversationModelEvaluation(), + ], + next_page_token="ghi", + ), + conversation_model.ListConversationModelEvaluationsResponse( + conversation_model_evaluations=[ + conversation_model.ConversationModelEvaluation(), + conversation_model.ConversationModelEvaluation(), + ], + ), + RuntimeError, + ) + + metadata = () + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("parent", ""),)), + ) + pager = client.list_conversation_model_evaluations(request={}) + + assert pager._metadata == metadata + + results = [i for i in pager] + assert len(results) == 6 + assert all( + isinstance(i, conversation_model.ConversationModelEvaluation) + for i in results + ) + + +def test_list_conversation_model_evaluations_pages(transport_name: str = "grpc"): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_model_evaluations), "__call__" + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + conversation_model.ListConversationModelEvaluationsResponse( + conversation_model_evaluations=[ + conversation_model.ConversationModelEvaluation(), + conversation_model.ConversationModelEvaluation(), + conversation_model.ConversationModelEvaluation(), + ], + next_page_token="abc", + ), + conversation_model.ListConversationModelEvaluationsResponse( + conversation_model_evaluations=[], next_page_token="def", + ), + conversation_model.ListConversationModelEvaluationsResponse( + conversation_model_evaluations=[ + conversation_model.ConversationModelEvaluation(), + ], + next_page_token="ghi", + ), + conversation_model.ListConversationModelEvaluationsResponse( + conversation_model_evaluations=[ + conversation_model.ConversationModelEvaluation(), + conversation_model.ConversationModelEvaluation(), + ], + ), + RuntimeError, + ) + pages = list(client.list_conversation_model_evaluations(request={}).pages) + for page_, token in zip(pages, ["abc", "def", "ghi", ""]): + assert page_.raw_page.next_page_token == token + + +@pytest.mark.asyncio +async def test_list_conversation_model_evaluations_async_pager(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_model_evaluations), + "__call__", + new_callable=mock.AsyncMock, + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + conversation_model.ListConversationModelEvaluationsResponse( + conversation_model_evaluations=[ + conversation_model.ConversationModelEvaluation(), + conversation_model.ConversationModelEvaluation(), + conversation_model.ConversationModelEvaluation(), + ], + next_page_token="abc", + ), + conversation_model.ListConversationModelEvaluationsResponse( + conversation_model_evaluations=[], next_page_token="def", + ), + conversation_model.ListConversationModelEvaluationsResponse( + conversation_model_evaluations=[ + conversation_model.ConversationModelEvaluation(), + ], + next_page_token="ghi", + ), + conversation_model.ListConversationModelEvaluationsResponse( + conversation_model_evaluations=[ + conversation_model.ConversationModelEvaluation(), + conversation_model.ConversationModelEvaluation(), + ], + ), + RuntimeError, + ) + async_pager = await client.list_conversation_model_evaluations(request={},) + assert async_pager.next_page_token == "abc" + responses = [] + async for response in async_pager: + responses.append(response) + + assert len(responses) == 6 + assert all( + isinstance(i, conversation_model.ConversationModelEvaluation) + for i in responses + ) + + +@pytest.mark.asyncio +async def test_list_conversation_model_evaluations_async_pages(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_conversation_model_evaluations), + "__call__", + new_callable=mock.AsyncMock, + ) as call: + # Set the response to a series of pages. + call.side_effect = ( + conversation_model.ListConversationModelEvaluationsResponse( + conversation_model_evaluations=[ + conversation_model.ConversationModelEvaluation(), + conversation_model.ConversationModelEvaluation(), + conversation_model.ConversationModelEvaluation(), + ], + next_page_token="abc", + ), + conversation_model.ListConversationModelEvaluationsResponse( + conversation_model_evaluations=[], next_page_token="def", + ), + conversation_model.ListConversationModelEvaluationsResponse( + conversation_model_evaluations=[ + conversation_model.ConversationModelEvaluation(), + ], + next_page_token="ghi", + ), + conversation_model.ListConversationModelEvaluationsResponse( + conversation_model_evaluations=[ + conversation_model.ConversationModelEvaluation(), + conversation_model.ConversationModelEvaluation(), + ], + ), + RuntimeError, + ) + pages = [] + async for page_ in ( + await client.list_conversation_model_evaluations(request={}) + ).pages: + pages.append(page_) + for page_, token in zip(pages, ["abc", "def", "ghi", ""]): + assert page_.raw_page.next_page_token == token + + +@pytest.mark.parametrize( + "request_type", [conversation_model.CreateConversationModelEvaluationRequest, dict,] +) +def test_create_conversation_model_evaluation(request_type, transport: str = "grpc"): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_model_evaluation), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.create_conversation_model_evaluation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.CreateConversationModelEvaluationRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_create_conversation_model_evaluation_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_model_evaluation), "__call__" + ) as call: + client.create_conversation_model_evaluation() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.CreateConversationModelEvaluationRequest() + + +@pytest.mark.asyncio +async def test_create_conversation_model_evaluation_async( + transport: str = "grpc_asyncio", + request_type=conversation_model.CreateConversationModelEvaluationRequest, +): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_model_evaluation), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.create_conversation_model_evaluation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == conversation_model.CreateConversationModelEvaluationRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_create_conversation_model_evaluation_async_from_dict(): + await test_create_conversation_model_evaluation_async(request_type=dict) + + +def test_create_conversation_model_evaluation_field_headers(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_model.CreateConversationModelEvaluationRequest() + + request.parent = "parent/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_model_evaluation), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.create_conversation_model_evaluation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_create_conversation_model_evaluation_field_headers_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = conversation_model.CreateConversationModelEvaluationRequest() + + request.parent = "parent/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_model_evaluation), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.create_conversation_model_evaluation(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + + +def test_create_conversation_model_evaluation_flattened(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_model_evaluation), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.create_conversation_model_evaluation( + parent="parent_value", + conversation_model_evaluation=conversation_model.ConversationModelEvaluation( + name="name_value" + ), + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].conversation_model_evaluation + mock_val = conversation_model.ConversationModelEvaluation(name="name_value") + assert arg == mock_val + + +def test_create_conversation_model_evaluation_flattened_error(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.create_conversation_model_evaluation( + conversation_model.CreateConversationModelEvaluationRequest(), + parent="parent_value", + conversation_model_evaluation=conversation_model.ConversationModelEvaluation( + name="name_value" + ), + ) + + +@pytest.mark.asyncio +async def test_create_conversation_model_evaluation_flattened_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.create_conversation_model_evaluation), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.create_conversation_model_evaluation( + parent="parent_value", + conversation_model_evaluation=conversation_model.ConversationModelEvaluation( + name="name_value" + ), + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].parent + mock_val = "parent_value" + assert arg == mock_val + arg = args[0].conversation_model_evaluation + mock_val = conversation_model.ConversationModelEvaluation(name="name_value") + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_create_conversation_model_evaluation_flattened_error_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.create_conversation_model_evaluation( + conversation_model.CreateConversationModelEvaluationRequest(), + parent="parent_value", + conversation_model_evaluation=conversation_model.ConversationModelEvaluation( + name="name_value" + ), + ) + + +def test_credentials_transport_error(): + # It is an error to provide credentials and a transport instance. + transport = transports.ConversationModelsGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # It is an error to provide a credentials file and a transport instance. + transport = transports.ConversationModelsGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = ConversationModelsClient( + client_options={"credentials_file": "credentials.json"}, + transport=transport, + ) + + # It is an error to provide an api_key and a transport instance. + transport = transports.ConversationModelsGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = ConversationModelsClient(client_options=options, transport=transport,) + + # It is an error to provide an api_key and a credential. + options = mock.Mock() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = ConversationModelsClient( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + + # It is an error to provide scopes and a transport instance. + transport = transports.ConversationModelsGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + with pytest.raises(ValueError): + client = ConversationModelsClient( + client_options={"scopes": ["1", "2"]}, transport=transport, + ) + + +def test_transport_instance(): + # A client may be instantiated with a custom transport instance. + transport = transports.ConversationModelsGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + client = ConversationModelsClient(transport=transport) + assert client.transport is transport + + +def test_transport_get_channel(): + # A client may be instantiated with a custom transport instance. + transport = transports.ConversationModelsGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + channel = transport.grpc_channel + assert channel + + transport = transports.ConversationModelsGrpcAsyncIOTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + channel = transport.grpc_channel + assert channel + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.ConversationModelsGrpcTransport, + transports.ConversationModelsGrpcAsyncIOTransport, + ], +) +def test_transport_adc(transport_class): + # Test default credentials are used if not provided. + with mock.patch.object(google.auth, "default") as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport_class() + adc.assert_called_once() + + +def test_transport_grpc_default(): + # A client should use the gRPC transport by default. + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance(client.transport, transports.ConversationModelsGrpcTransport,) + + +def test_conversation_models_base_transport_error(): + # Passing both a credentials object and credentials_file should raise an error + with pytest.raises(core_exceptions.DuplicateCredentialArgs): + transport = transports.ConversationModelsTransport( + credentials=ga_credentials.AnonymousCredentials(), + credentials_file="credentials.json", + ) + + +def test_conversation_models_base_transport(): + # Instantiate the base transport. + with mock.patch( + "google.cloud.dialogflow_v2.services.conversation_models.transports.ConversationModelsTransport.__init__" + ) as Transport: + Transport.return_value = None + transport = transports.ConversationModelsTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Every method on the transport should just blindly + # raise NotImplementedError. + methods = ( + "create_conversation_model", + "get_conversation_model", + "list_conversation_models", + "delete_conversation_model", + "deploy_conversation_model", + "undeploy_conversation_model", + "get_conversation_model_evaluation", + "list_conversation_model_evaluations", + "create_conversation_model_evaluation", + ) + for method in methods: + with pytest.raises(NotImplementedError): + getattr(transport, method)(request=object()) + + with pytest.raises(NotImplementedError): + transport.close() + + # Additionally, the LRO client (a property) should + # also raise NotImplementedError + with pytest.raises(NotImplementedError): + transport.operations_client + + +def test_conversation_models_base_transport_with_credentials_file(): + # Instantiate the base transport with a credentials file + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch( + "google.cloud.dialogflow_v2.services.conversation_models.transports.ConversationModelsTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.ConversationModelsTransport( + credentials_file="credentials.json", quota_project_id="octopus", + ) + load_creds.assert_called_once_with( + "credentials.json", + scopes=None, + default_scopes=( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow", + ), + quota_project_id="octopus", + ) + + +def test_conversation_models_base_transport_with_adc(): + # Test the default credentials are used if credentials and credentials_file are None. + with mock.patch.object(google.auth, "default", autospec=True) as adc, mock.patch( + "google.cloud.dialogflow_v2.services.conversation_models.transports.ConversationModelsTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.ConversationModelsTransport() + adc.assert_called_once() + + +def test_conversation_models_auth_adc(): + # If no credentials are provided, we should use ADC credentials. + with mock.patch.object(google.auth, "default", autospec=True) as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + ConversationModelsClient() + adc.assert_called_once_with( + scopes=None, + default_scopes=( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow", + ), + quota_project_id=None, + ) + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.ConversationModelsGrpcTransport, + transports.ConversationModelsGrpcAsyncIOTransport, + ], +) +def test_conversation_models_transport_auth_adc(transport_class): + # If credentials and host are not provided, the transport class should use + # ADC credentials. + with mock.patch.object(google.auth, "default", autospec=True) as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport_class(quota_project_id="octopus", scopes=["1", "2"]) + adc.assert_called_once_with( + scopes=["1", "2"], + default_scopes=( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow", + ), + quota_project_id="octopus", + ) + + +@pytest.mark.parametrize( + "transport_class,grpc_helpers", + [ + (transports.ConversationModelsGrpcTransport, grpc_helpers), + (transports.ConversationModelsGrpcAsyncIOTransport, grpc_helpers_async), + ], +) +def test_conversation_models_transport_create_channel(transport_class, grpc_helpers): + # If credentials and host are not provided, the transport class should use + # ADC credentials. + with mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel", autospec=True + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + adc.return_value = (creds, None) + transport_class(quota_project_id="octopus", scopes=["1", "2"]) + + create_channel.assert_called_with( + "dialogflow.googleapis.com:443", + credentials=creds, + credentials_file=None, + quota_project_id="octopus", + default_scopes=( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/dialogflow", + ), + scopes=["1", "2"], + default_host="dialogflow.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.ConversationModelsGrpcTransport, + transports.ConversationModelsGrpcAsyncIOTransport, + ], +) +def test_conversation_models_grpc_transport_client_cert_source_for_mtls( + transport_class, +): + cred = ga_credentials.AnonymousCredentials() + + # Check ssl_channel_credentials is used if provided. + with mock.patch.object(transport_class, "create_channel") as mock_create_channel: + mock_ssl_channel_creds = mock.Mock() + transport_class( + host="squid.clam.whelk", + credentials=cred, + ssl_channel_credentials=mock_ssl_channel_creds, + ) + mock_create_channel.assert_called_once_with( + "squid.clam.whelk:443", + credentials=cred, + credentials_file=None, + scopes=None, + ssl_credentials=mock_ssl_channel_creds, + quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + # Check if ssl_channel_credentials is not provided, then client_cert_source_for_mtls + # is used. + with mock.patch.object(transport_class, "create_channel", return_value=mock.Mock()): + with mock.patch("grpc.ssl_channel_credentials") as mock_ssl_cred: + transport_class( + credentials=cred, + client_cert_source_for_mtls=client_cert_source_callback, + ) + expected_cert, expected_key = client_cert_source_callback() + mock_ssl_cred.assert_called_once_with( + certificate_chain=expected_cert, private_key=expected_key + ) + + +def test_conversation_models_host_no_port(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + client_options=client_options.ClientOptions( + api_endpoint="dialogflow.googleapis.com" + ), + ) + assert client.transport._host == "dialogflow.googleapis.com:443" + + +def test_conversation_models_host_with_port(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), + client_options=client_options.ClientOptions( + api_endpoint="dialogflow.googleapis.com:8000" + ), + ) + assert client.transport._host == "dialogflow.googleapis.com:8000" + + +def test_conversation_models_grpc_transport_channel(): + channel = grpc.secure_channel("http://localhost/", grpc.local_channel_credentials()) + + # Check that channel is used if provided. + transport = transports.ConversationModelsGrpcTransport( + host="squid.clam.whelk", channel=channel, + ) + assert transport.grpc_channel == channel + assert transport._host == "squid.clam.whelk:443" + assert transport._ssl_channel_credentials == None + + +def test_conversation_models_grpc_asyncio_transport_channel(): + channel = aio.secure_channel("http://localhost/", grpc.local_channel_credentials()) + + # Check that channel is used if provided. + transport = transports.ConversationModelsGrpcAsyncIOTransport( + host="squid.clam.whelk", channel=channel, + ) + assert transport.grpc_channel == channel + assert transport._host == "squid.clam.whelk:443" + assert transport._ssl_channel_credentials == None + + +# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are +# removed from grpc/grpc_asyncio transport constructor. +@pytest.mark.parametrize( + "transport_class", + [ + transports.ConversationModelsGrpcTransport, + transports.ConversationModelsGrpcAsyncIOTransport, + ], +) +def test_conversation_models_transport_channel_mtls_with_client_cert_source( + transport_class, +): + with mock.patch( + "grpc.ssl_channel_credentials", autospec=True + ) as grpc_ssl_channel_cred: + with mock.patch.object( + transport_class, "create_channel" + ) as grpc_create_channel: + mock_ssl_cred = mock.Mock() + grpc_ssl_channel_cred.return_value = mock_ssl_cred + + mock_grpc_channel = mock.Mock() + grpc_create_channel.return_value = mock_grpc_channel + + cred = ga_credentials.AnonymousCredentials() + with pytest.warns(DeprecationWarning): + with mock.patch.object(google.auth, "default") as adc: + adc.return_value = (cred, None) + transport = transport_class( + host="squid.clam.whelk", + api_mtls_endpoint="mtls.squid.clam.whelk", + client_cert_source=client_cert_source_callback, + ) + adc.assert_called_once() + + grpc_ssl_channel_cred.assert_called_once_with( + certificate_chain=b"cert bytes", private_key=b"key bytes" + ) + grpc_create_channel.assert_called_once_with( + "mtls.squid.clam.whelk:443", + credentials=cred, + credentials_file=None, + scopes=None, + ssl_credentials=mock_ssl_cred, + quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + assert transport.grpc_channel == mock_grpc_channel + assert transport._ssl_channel_credentials == mock_ssl_cred + + +# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are +# removed from grpc/grpc_asyncio transport constructor. +@pytest.mark.parametrize( + "transport_class", + [ + transports.ConversationModelsGrpcTransport, + transports.ConversationModelsGrpcAsyncIOTransport, + ], +) +def test_conversation_models_transport_channel_mtls_with_adc(transport_class): + mock_ssl_cred = mock.Mock() + with mock.patch.multiple( + "google.auth.transport.grpc.SslCredentials", + __init__=mock.Mock(return_value=None), + ssl_credentials=mock.PropertyMock(return_value=mock_ssl_cred), + ): + with mock.patch.object( + transport_class, "create_channel" + ) as grpc_create_channel: + mock_grpc_channel = mock.Mock() + grpc_create_channel.return_value = mock_grpc_channel + mock_cred = mock.Mock() + + with pytest.warns(DeprecationWarning): + transport = transport_class( + host="squid.clam.whelk", + credentials=mock_cred, + api_mtls_endpoint="mtls.squid.clam.whelk", + client_cert_source=None, + ) + + grpc_create_channel.assert_called_once_with( + "mtls.squid.clam.whelk:443", + credentials=mock_cred, + credentials_file=None, + scopes=None, + ssl_credentials=mock_ssl_cred, + quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + assert transport.grpc_channel == mock_grpc_channel + + +def test_conversation_models_grpc_lro_client(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + transport = client.transport + + # Ensure that we have a api-core operations client. + assert isinstance(transport.operations_client, operations_v1.OperationsClient,) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + +def test_conversation_models_grpc_lro_async_client(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + ) + transport = client.transport + + # Ensure that we have a api-core operations client. + assert isinstance(transport.operations_client, operations_v1.OperationsAsyncClient,) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + +def test_conversation_dataset_path(): + project = "squid" + location = "clam" + conversation_dataset = "whelk" + expected = "projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}".format( + project=project, location=location, conversation_dataset=conversation_dataset, + ) + actual = ConversationModelsClient.conversation_dataset_path( + project, location, conversation_dataset + ) + assert expected == actual + + +def test_parse_conversation_dataset_path(): + expected = { + "project": "octopus", + "location": "oyster", + "conversation_dataset": "nudibranch", + } + path = ConversationModelsClient.conversation_dataset_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationModelsClient.parse_conversation_dataset_path(path) + assert expected == actual + + +def test_conversation_model_path(): + project = "cuttlefish" + location = "mussel" + conversation_model = "winkle" + expected = "projects/{project}/locations/{location}/conversationModels/{conversation_model}".format( + project=project, location=location, conversation_model=conversation_model, + ) + actual = ConversationModelsClient.conversation_model_path( + project, location, conversation_model + ) + assert expected == actual + + +def test_parse_conversation_model_path(): + expected = { + "project": "nautilus", + "location": "scallop", + "conversation_model": "abalone", + } + path = ConversationModelsClient.conversation_model_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationModelsClient.parse_conversation_model_path(path) + assert expected == actual + + +def test_conversation_model_evaluation_path(): + project = "squid" + conversation_model = "clam" + expected = "projects/{project}/conversationModels/{conversation_model}/evaluations/evaluation".format( + project=project, conversation_model=conversation_model, + ) + actual = ConversationModelsClient.conversation_model_evaluation_path( + project, conversation_model + ) + assert expected == actual + + +def test_parse_conversation_model_evaluation_path(): + expected = { + "project": "whelk", + "conversation_model": "octopus", + } + path = ConversationModelsClient.conversation_model_evaluation_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationModelsClient.parse_conversation_model_evaluation_path(path) + assert expected == actual + + +def test_document_path(): + project = "oyster" + knowledge_base = "nudibranch" + document = "cuttlefish" + expected = "projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}".format( + project=project, knowledge_base=knowledge_base, document=document, + ) + actual = ConversationModelsClient.document_path(project, knowledge_base, document) + assert expected == actual + + +def test_parse_document_path(): + expected = { + "project": "mussel", + "knowledge_base": "winkle", + "document": "nautilus", + } + path = ConversationModelsClient.document_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationModelsClient.parse_document_path(path) + assert expected == actual + + +def test_common_billing_account_path(): + billing_account = "scallop" + expected = "billingAccounts/{billing_account}".format( + billing_account=billing_account, + ) + actual = ConversationModelsClient.common_billing_account_path(billing_account) + assert expected == actual + + +def test_parse_common_billing_account_path(): + expected = { + "billing_account": "abalone", + } + path = ConversationModelsClient.common_billing_account_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationModelsClient.parse_common_billing_account_path(path) + assert expected == actual + + +def test_common_folder_path(): + folder = "squid" + expected = "folders/{folder}".format(folder=folder,) + actual = ConversationModelsClient.common_folder_path(folder) + assert expected == actual + + +def test_parse_common_folder_path(): + expected = { + "folder": "clam", + } + path = ConversationModelsClient.common_folder_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationModelsClient.parse_common_folder_path(path) + assert expected == actual + + +def test_common_organization_path(): + organization = "whelk" + expected = "organizations/{organization}".format(organization=organization,) + actual = ConversationModelsClient.common_organization_path(organization) + assert expected == actual + + +def test_parse_common_organization_path(): + expected = { + "organization": "octopus", + } + path = ConversationModelsClient.common_organization_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationModelsClient.parse_common_organization_path(path) + assert expected == actual + + +def test_common_project_path(): + project = "oyster" + expected = "projects/{project}".format(project=project,) + actual = ConversationModelsClient.common_project_path(project) + assert expected == actual + + +def test_parse_common_project_path(): + expected = { + "project": "nudibranch", + } + path = ConversationModelsClient.common_project_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationModelsClient.parse_common_project_path(path) + assert expected == actual + + +def test_common_location_path(): + project = "cuttlefish" + location = "mussel" + expected = "projects/{project}/locations/{location}".format( + project=project, location=location, + ) + actual = ConversationModelsClient.common_location_path(project, location) + assert expected == actual + + +def test_parse_common_location_path(): + expected = { + "project": "winkle", + "location": "nautilus", + } + path = ConversationModelsClient.common_location_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationModelsClient.parse_common_location_path(path) + assert expected == actual + + +def test_client_with_default_client_info(): + client_info = gapic_v1.client_info.ClientInfo() + + with mock.patch.object( + transports.ConversationModelsTransport, "_prep_wrapped_messages" + ) as prep: + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + ) + prep.assert_called_once_with(client_info) + + with mock.patch.object( + transports.ConversationModelsTransport, "_prep_wrapped_messages" + ) as prep: + transport_class = ConversationModelsClient.get_transport_class() + transport = transport_class( + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + ) + prep.assert_called_once_with(client_info) + + +@pytest.mark.asyncio +async def test_transport_close_async(): + client = ConversationModelsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + ) + with mock.patch.object( + type(getattr(client.transport, "grpc_channel")), "close" + ) as close: + async with client: + close.assert_not_called() + close.assert_called_once() + + +def test_transport_close(): + transports = { + "grpc": "_grpc_channel", + } + + for transport, close_name in transports.items(): + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport + ) + with mock.patch.object( + type(getattr(client.transport, close_name)), "close" + ) as close: + with client: + close.assert_not_called() + close.assert_called_once() + + +def test_client_ctx(): + transports = [ + "grpc", + ] + for transport in transports: + client = ConversationModelsClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport + ) + # Test client calls underlying transport. + with mock.patch.object(type(client.transport), "close") as close: + close.assert_not_called() + with client: + pass + close.assert_called() + + +@pytest.mark.parametrize( + "client_class,transport_class", + [ + (ConversationModelsClient, transports.ConversationModelsGrpcTransport), + ( + ConversationModelsAsyncClient, + transports.ConversationModelsGrpcAsyncIOTransport, + ), + ], +) +def test_api_key_credentials(client_class, transport_class): + with mock.patch.object( + google.auth._default, "get_api_key_credentials", create=True + ) as get_api_key_credentials: + mock_cred = mock.Mock() + get_api_key_credentials.return_value = mock_cred + options = client_options.ClientOptions() + options.api_key = "api_key" + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options) + patched.assert_called_once_with( + credentials=mock_cred, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversation_profiles.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversation_profiles.py index f1e93c4ca688..5cba54e6b4d9 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversation_profiles.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversation_profiles.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,9 +25,13 @@ from google.api_core import client_options from google.api_core import exceptions as core_exceptions +from google.api_core import future from google.api_core import gapic_v1 from google.api_core import grpc_helpers from google.api_core import grpc_helpers_async +from google.api_core import operation +from google.api_core import operation_async # type: ignore +from google.api_core import operations_v1 from google.api_core import path_template from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError @@ -44,6 +48,8 @@ from google.cloud.dialogflow_v2.types import ( conversation_profile as gcd_conversation_profile, ) +from google.cloud.dialogflow_v2.types import participant +from google.longrunning import operations_pb2 from google.oauth2 import service_account from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -2077,6 +2083,475 @@ async def test_delete_conversation_profile_flattened_error_async(): ) +@pytest.mark.parametrize( + "request_type", [gcd_conversation_profile.SetSuggestionFeatureConfigRequest, dict,] +) +def test_set_suggestion_feature_config(request_type, transport: str = "grpc"): + client = ConversationProfilesClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_suggestion_feature_config), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.set_suggestion_feature_config(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == gcd_conversation_profile.SetSuggestionFeatureConfigRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_set_suggestion_feature_config_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ConversationProfilesClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_suggestion_feature_config), "__call__" + ) as call: + client.set_suggestion_feature_config() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == gcd_conversation_profile.SetSuggestionFeatureConfigRequest() + + +@pytest.mark.asyncio +async def test_set_suggestion_feature_config_async( + transport: str = "grpc_asyncio", + request_type=gcd_conversation_profile.SetSuggestionFeatureConfigRequest, +): + client = ConversationProfilesAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_suggestion_feature_config), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.set_suggestion_feature_config(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == gcd_conversation_profile.SetSuggestionFeatureConfigRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_set_suggestion_feature_config_async_from_dict(): + await test_set_suggestion_feature_config_async(request_type=dict) + + +def test_set_suggestion_feature_config_field_headers(): + client = ConversationProfilesClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = gcd_conversation_profile.SetSuggestionFeatureConfigRequest() + + request.conversation_profile = "conversation_profile/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_suggestion_feature_config), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.set_suggestion_feature_config(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "conversation_profile=conversation_profile/value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_set_suggestion_feature_config_field_headers_async(): + client = ConversationProfilesAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = gcd_conversation_profile.SetSuggestionFeatureConfigRequest() + + request.conversation_profile = "conversation_profile/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_suggestion_feature_config), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.set_suggestion_feature_config(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "conversation_profile=conversation_profile/value", + ) in kw["metadata"] + + +def test_set_suggestion_feature_config_flattened(): + client = ConversationProfilesClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_suggestion_feature_config), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.set_suggestion_feature_config( + conversation_profile="conversation_profile_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].conversation_profile + mock_val = "conversation_profile_value" + assert arg == mock_val + + +def test_set_suggestion_feature_config_flattened_error(): + client = ConversationProfilesClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.set_suggestion_feature_config( + gcd_conversation_profile.SetSuggestionFeatureConfigRequest(), + conversation_profile="conversation_profile_value", + ) + + +@pytest.mark.asyncio +async def test_set_suggestion_feature_config_flattened_async(): + client = ConversationProfilesAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_suggestion_feature_config), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.set_suggestion_feature_config( + conversation_profile="conversation_profile_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].conversation_profile + mock_val = "conversation_profile_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_set_suggestion_feature_config_flattened_error_async(): + client = ConversationProfilesAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.set_suggestion_feature_config( + gcd_conversation_profile.SetSuggestionFeatureConfigRequest(), + conversation_profile="conversation_profile_value", + ) + + +@pytest.mark.parametrize( + "request_type", + [gcd_conversation_profile.ClearSuggestionFeatureConfigRequest, dict,], +) +def test_clear_suggestion_feature_config(request_type, transport: str = "grpc"): + client = ConversationProfilesClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.clear_suggestion_feature_config), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/spam") + response = client.clear_suggestion_feature_config(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == gcd_conversation_profile.ClearSuggestionFeatureConfigRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +def test_clear_suggestion_feature_config_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ConversationProfilesClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.clear_suggestion_feature_config), "__call__" + ) as call: + client.clear_suggestion_feature_config() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == gcd_conversation_profile.ClearSuggestionFeatureConfigRequest() + + +@pytest.mark.asyncio +async def test_clear_suggestion_feature_config_async( + transport: str = "grpc_asyncio", + request_type=gcd_conversation_profile.ClearSuggestionFeatureConfigRequest, +): + client = ConversationProfilesAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.clear_suggestion_feature_config), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + response = await client.clear_suggestion_feature_config(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == gcd_conversation_profile.ClearSuggestionFeatureConfigRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, future.Future) + + +@pytest.mark.asyncio +async def test_clear_suggestion_feature_config_async_from_dict(): + await test_clear_suggestion_feature_config_async(request_type=dict) + + +def test_clear_suggestion_feature_config_field_headers(): + client = ConversationProfilesClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = gcd_conversation_profile.ClearSuggestionFeatureConfigRequest() + + request.conversation_profile = "conversation_profile/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.clear_suggestion_feature_config), "__call__" + ) as call: + call.return_value = operations_pb2.Operation(name="operations/op") + client.clear_suggestion_feature_config(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "conversation_profile=conversation_profile/value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_clear_suggestion_feature_config_field_headers_async(): + client = ConversationProfilesAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = gcd_conversation_profile.ClearSuggestionFeatureConfigRequest() + + request.conversation_profile = "conversation_profile/value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.clear_suggestion_feature_config), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/op") + ) + await client.clear_suggestion_feature_config(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "conversation_profile=conversation_profile/value", + ) in kw["metadata"] + + +def test_clear_suggestion_feature_config_flattened(): + client = ConversationProfilesClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.clear_suggestion_feature_config), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.clear_suggestion_feature_config( + conversation_profile="conversation_profile_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].conversation_profile + mock_val = "conversation_profile_value" + assert arg == mock_val + + +def test_clear_suggestion_feature_config_flattened_error(): + client = ConversationProfilesClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.clear_suggestion_feature_config( + gcd_conversation_profile.ClearSuggestionFeatureConfigRequest(), + conversation_profile="conversation_profile_value", + ) + + +@pytest.mark.asyncio +async def test_clear_suggestion_feature_config_flattened_async(): + client = ConversationProfilesAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.clear_suggestion_feature_config), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = operations_pb2.Operation(name="operations/op") + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + operations_pb2.Operation(name="operations/spam") + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.clear_suggestion_feature_config( + conversation_profile="conversation_profile_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].conversation_profile + mock_val = "conversation_profile_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_clear_suggestion_feature_config_flattened_error_async(): + client = ConversationProfilesAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.clear_suggestion_feature_config( + gcd_conversation_profile.ClearSuggestionFeatureConfigRequest(), + conversation_profile="conversation_profile_value", + ) + + def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.ConversationProfilesGrpcTransport( @@ -2200,6 +2675,8 @@ def test_conversation_profiles_base_transport(): "create_conversation_profile", "update_conversation_profile", "delete_conversation_profile", + "set_suggestion_feature_config", + "clear_suggestion_feature_config", ) for method in methods: with pytest.raises(NotImplementedError): @@ -2208,6 +2685,11 @@ def test_conversation_profiles_base_transport(): with pytest.raises(NotImplementedError): transport.close() + # Additionally, the LRO client (a property) should + # also raise NotImplementedError + with pytest.raises(NotImplementedError): + transport.operations_client + def test_conversation_profiles_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -2510,6 +2992,32 @@ def test_conversation_profiles_transport_channel_mtls_with_adc(transport_class): assert transport.grpc_channel == mock_grpc_channel +def test_conversation_profiles_grpc_lro_client(): + client = ConversationProfilesClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + ) + transport = client.transport + + # Ensure that we have a api-core operations client. + assert isinstance(transport.operations_client, operations_v1.OperationsClient,) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + +def test_conversation_profiles_grpc_lro_async_client(): + client = ConversationProfilesAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + ) + transport = client.transport + + # Ensure that we have a api-core operations client. + assert isinstance(transport.operations_client, operations_v1.OperationsAsyncClient,) + + # Ensure that subsequent calls to the property send the exact same object. + assert transport.operations_client is transport.operations_client + + def test_agent_path(): project = "squid" expected = "projects/{project}/agent".format(project=project,) diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversations.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversations.py index bbdfd3584f0d..621fedbe470e 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversations.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversations.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_documents.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_documents.py index 0c077435e741..130f329c4531 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_documents.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_documents.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -972,6 +972,7 @@ def test_get_document(request_type, transport: str = "grpc"): mime_type="mime_type_value", knowledge_types=[document.Document.KnowledgeType.FAQ], enable_auto_reload=True, + state=document.Document.State.CREATING, content_uri="content_uri_value", ) response = client.get_document(request) @@ -988,6 +989,7 @@ def test_get_document(request_type, transport: str = "grpc"): assert response.mime_type == "mime_type_value" assert response.knowledge_types == [document.Document.KnowledgeType.FAQ] assert response.enable_auto_reload is True + assert response.state == document.Document.State.CREATING def test_get_document_empty_call(): @@ -1027,6 +1029,7 @@ async def test_get_document_async( mime_type="mime_type_value", knowledge_types=[document.Document.KnowledgeType.FAQ], enable_auto_reload=True, + state=document.Document.State.CREATING, ) ) response = await client.get_document(request) @@ -1043,6 +1046,7 @@ async def test_get_document_async( assert response.mime_type == "mime_type_value" assert response.knowledge_types == [document.Document.KnowledgeType.FAQ] assert response.enable_auto_reload is True + assert response.state == document.Document.State.CREATING @pytest.mark.asyncio diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_entity_types.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_entity_types.py index f4de60d57a5d..a28c6730bdb6 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_entity_types.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_entity_types.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_environments.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_environments.py index f1d90c24cde5..8e030750ab3b 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_environments.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_environments.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_fulfillments.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_fulfillments.py index e3d5849b325c..b8363464adfd 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_fulfillments.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_fulfillments.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_intents.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_intents.py index 9091677d0322..02351dc140a3 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_intents.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_intents.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_knowledge_bases.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_knowledge_bases.py index 63404d1637a0..733e42aa4e8c 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_knowledge_bases.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_knowledge_bases.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_participants.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_participants.py index bc0e2e86891b..3633d154eab2 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_participants.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_participants.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_session_entity_types.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_session_entity_types.py index bcd25296e55c..0c0cee480f52 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_session_entity_types.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_session_entity_types.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_sessions.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_sessions.py index 33915ea906a7..dc0777cd88e2 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_sessions.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_sessions.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_versions.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_versions.py index 1a3cc890bf7e..2d13678e09b2 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_versions.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_versions.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/__init__.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/__init__.py index 4de65971c238..e8e1c3845db5 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/__init__.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_agents.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_agents.py index 8c8c88186ed9..e966245cd6d7 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_agents.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_agents.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_answer_records.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_answer_records.py index e1f103a98490..08ddaf79fa6c 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_answer_records.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_answer_records.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_contexts.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_contexts.py index 5c5b03c90028..6ef215e50436 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_contexts.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_contexts.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_conversation_profiles.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_conversation_profiles.py index b10548f06097..fa8b39183cd4 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_conversation_profiles.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_conversation_profiles.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_conversations.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_conversations.py index 8d411494a147..7dbecb3e87f9 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_conversations.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_conversations.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_documents.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_documents.py index 44106179a303..a2e011b032ab 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_documents.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_documents.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_entity_types.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_entity_types.py index 3e387087c92f..5493ded96a33 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_entity_types.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_entity_types.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_environments.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_environments.py index f687a4bc286b..fd07d058d2aa 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_environments.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_environments.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_fulfillments.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_fulfillments.py index ac840ee780e7..0392f22c39fb 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_fulfillments.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_fulfillments.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_intents.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_intents.py index fd6c26656ec3..72b25f47765d 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_intents.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_intents.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_knowledge_bases.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_knowledge_bases.py index cdb83b9f2925..1aece444a975 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_knowledge_bases.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_knowledge_bases.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_participants.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_participants.py index fe215eaf1a49..14599305259a 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_participants.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_participants.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_session_entity_types.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_session_entity_types.py index 46c4a45bf8e3..c18b784a42c5 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_session_entity_types.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_session_entity_types.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_sessions.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_sessions.py index 3e7e1201406f..e98e2afe2b27 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_sessions.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_sessions.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_versions.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_versions.py index 2cf8fa801640..a8ada3ac56cc 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_versions.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_versions.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.