diff --git a/packages/google-cloud-dialogflow/linkinator.config.json b/packages/google-cloud-dialogflow/linkinator.config.json index 29a223b6db6..0121dfa684f 100644 --- a/packages/google-cloud-dialogflow/linkinator.config.json +++ b/packages/google-cloud-dialogflow/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/agents.delete_agent.js b/packages/google-cloud-dialogflow/samples/generated/v2/agents.delete_agent.js index eba49c9cccb..55d1dddf2e9 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/agents.delete_agent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/agents.delete_agent.js @@ -31,7 +31,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function deleteAgent() { + async function callDeleteAgent() { // Construct request const request = { parent, @@ -42,7 +42,7 @@ function main(parent) { console.log(response); } - deleteAgent(); + callDeleteAgent(); // [END dialogflow_v2_generated_Agents_DeleteAgent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/agents.export_agent.js b/packages/google-cloud-dialogflow/samples/generated/v2/agents.export_agent.js index b3daf997e0b..36a6227ddb7 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/agents.export_agent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/agents.export_agent.js @@ -25,7 +25,7 @@ function main(parent, agentUri) { */ // const parent = 'abc123' /** - * Required. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) + * Required. The Google Cloud Storage (https://cloud.google.com/storage/docs/) * URI to export the agent to. * The format of this URI must be `gs:///`. * If left unspecified, the serialized agent is returned inline. @@ -38,7 +38,7 @@ function main(parent, agentUri) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function exportAgent() { + async function callExportAgent() { // Construct request const request = { parent, @@ -51,7 +51,7 @@ function main(parent, agentUri) { console.log(response); } - exportAgent(); + callExportAgent(); // [END dialogflow_v2_generated_Agents_ExportAgent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/agents.get_agent.js b/packages/google-cloud-dialogflow/samples/generated/v2/agents.get_agent.js index 07fceb7e298..aca7916657a 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/agents.get_agent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/agents.get_agent.js @@ -31,7 +31,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function getAgent() { + async function callGetAgent() { // Construct request const request = { parent, @@ -42,7 +42,7 @@ function main(parent) { console.log(response); } - getAgent(); + callGetAgent(); // [END dialogflow_v2_generated_Agents_GetAgent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/agents.get_validation_result.js b/packages/google-cloud-dialogflow/samples/generated/v2/agents.get_validation_result.js index 60c0b7ffaf2..a62d1d60ede 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/agents.get_validation_result.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/agents.get_validation_result.js @@ -26,8 +26,8 @@ function main(parent) { // const parent = 'abc123' /** * Optional. The language for which you want a validation result. If not - * specified, the agent's default language is used. [Many - * languages](https://cloud.google.com/dialogflow/docs/reference/language) + * specified, the agent's default language is used. Many + * languages (https://cloud.google.com/dialogflow/docs/reference/language) * are supported. Note: languages must be enabled in the agent before they can * be used. */ @@ -39,7 +39,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function getValidationResult() { + async function callGetValidationResult() { // Construct request const request = { parent, @@ -50,7 +50,7 @@ function main(parent) { console.log(response); } - getValidationResult(); + callGetValidationResult(); // [END dialogflow_v2_generated_Agents_GetValidationResult_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/agents.import_agent.js b/packages/google-cloud-dialogflow/samples/generated/v2/agents.import_agent.js index fd6b44d947b..304cd31de62 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/agents.import_agent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/agents.import_agent.js @@ -40,7 +40,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function importAgent() { + async function callImportAgent() { // Construct request const request = { parent, @@ -52,7 +52,7 @@ function main(parent) { console.log(response); } - importAgent(); + callImportAgent(); // [END dialogflow_v2_generated_Agents_ImportAgent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/agents.restore_agent.js b/packages/google-cloud-dialogflow/samples/generated/v2/agents.restore_agent.js index 62d6f5c1f2b..6ffb4f88499 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/agents.restore_agent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/agents.restore_agent.js @@ -40,7 +40,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function restoreAgent() { + async function callRestoreAgent() { // Construct request const request = { parent, @@ -52,7 +52,7 @@ function main(parent) { console.log(response); } - restoreAgent(); + callRestoreAgent(); // [END dialogflow_v2_generated_Agents_RestoreAgent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/agents.search_agents.js b/packages/google-cloud-dialogflow/samples/generated/v2/agents.search_agents.js index cc35d530fe3..67698d11409 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/agents.search_agents.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/agents.search_agents.js @@ -40,7 +40,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function searchAgents() { + async function callSearchAgents() { // Construct request const request = { parent, @@ -53,7 +53,7 @@ function main(parent) { } } - searchAgents(); + callSearchAgents(); // [END dialogflow_v2_generated_Agents_SearchAgents_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/agents.set_agent.js b/packages/google-cloud-dialogflow/samples/generated/v2/agents.set_agent.js index 1b868989019..71ab250d1d2 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/agents.set_agent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/agents.set_agent.js @@ -22,11 +22,11 @@ function main(agent) { /** * Required. The agent to update. */ - // const agent = '' + // const agent = {} /** * Optional. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {AgentsClient} = require('@google-cloud/dialogflow').v2; @@ -34,7 +34,7 @@ function main(agent) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function setAgent() { + async function callSetAgent() { // Construct request const request = { agent, @@ -45,7 +45,7 @@ function main(agent) { console.log(response); } - setAgent(); + callSetAgent(); // [END dialogflow_v2_generated_Agents_SetAgent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/agents.train_agent.js b/packages/google-cloud-dialogflow/samples/generated/v2/agents.train_agent.js index 633ce3aca6c..320d8b08cae 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/agents.train_agent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/agents.train_agent.js @@ -31,7 +31,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function trainAgent() { + async function callTrainAgent() { // Construct request const request = { parent, @@ -43,7 +43,7 @@ function main(parent) { console.log(response); } - trainAgent(); + callTrainAgent(); // [END dialogflow_v2_generated_Agents_TrainAgent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/answer_records.list_answer_records.js b/packages/google-cloud-dialogflow/samples/generated/v2/answer_records.list_answer_records.js index 1bb997b293f..25ce565d711 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/answer_records.list_answer_records.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/answer_records.list_answer_records.js @@ -30,7 +30,7 @@ function main(parent, filter) { * Filter on answer record type. Currently predicates on `type` is supported, * valid values are `ARTICLE_ANSWER`, `FAQ_ANSWER`. * For more information about filtering, see - * [API Filtering](https://aip.dev/160). + * API Filtering (https://aip.dev/160). */ // const filter = 'abc123' /** @@ -41,7 +41,7 @@ function main(parent, filter) { // const pageSize = 1234 /** * Optional. The - * [ListAnswerRecordsResponse.next_page_token][google.cloud.dialogflow.v2.ListAnswerRecordsResponse.next_page_token] + * ListAnswerRecordsResponse.next_page_token google.cloud.dialogflow.v2.ListAnswerRecordsResponse.next_page_token * value returned from a previous list request used to continue listing on * the next page. */ @@ -53,7 +53,7 @@ function main(parent, filter) { // Instantiates a client const dialogflowClient = new AnswerRecordsClient(); - async function listAnswerRecords() { + async function callListAnswerRecords() { // Construct request const request = { parent, @@ -67,7 +67,7 @@ function main(parent, filter) { } } - listAnswerRecords(); + callListAnswerRecords(); // [END dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/answer_records.update_answer_record.js b/packages/google-cloud-dialogflow/samples/generated/v2/answer_records.update_answer_record.js index 74ce76e00ce..a9500622693 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/answer_records.update_answer_record.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/answer_records.update_answer_record.js @@ -22,11 +22,11 @@ function main(answerRecord, updateMask) { /** * Required. Answer record to update. */ - // const answerRecord = '' + // const answerRecord = {} /** * Required. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {AnswerRecordsClient} = require('@google-cloud/dialogflow').v2; @@ -34,7 +34,7 @@ function main(answerRecord, updateMask) { // Instantiates a client const dialogflowClient = new AnswerRecordsClient(); - async function updateAnswerRecord() { + async function callUpdateAnswerRecord() { // Construct request const request = { answerRecord, @@ -46,7 +46,7 @@ function main(answerRecord, updateMask) { console.log(response); } - updateAnswerRecord(); + callUpdateAnswerRecord(); // [END dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/contexts.create_context.js b/packages/google-cloud-dialogflow/samples/generated/v2/contexts.create_context.js index 1d0563ef20e..290d28ca11d 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/contexts.create_context.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/contexts.create_context.js @@ -31,7 +31,7 @@ function main(parent, context) { /** * Required. The context to create. */ - // const context = '' + // const context = {} // Imports the Dialogflow library const {ContextsClient} = require('@google-cloud/dialogflow').v2; @@ -39,7 +39,7 @@ function main(parent, context) { // Instantiates a client const dialogflowClient = new ContextsClient(); - async function createContext() { + async function callCreateContext() { // Construct request const request = { parent, @@ -51,7 +51,7 @@ function main(parent, context) { console.log(response); } - createContext(); + callCreateContext(); // [END dialogflow_v2_generated_Contexts_CreateContext_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/contexts.delete_all_contexts.js b/packages/google-cloud-dialogflow/samples/generated/v2/contexts.delete_all_contexts.js index aeb652023cf..d6fedf751e5 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/contexts.delete_all_contexts.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/contexts.delete_all_contexts.js @@ -35,7 +35,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new ContextsClient(); - async function deleteAllContexts() { + async function callDeleteAllContexts() { // Construct request const request = { parent, @@ -46,7 +46,7 @@ function main(parent) { console.log(response); } - deleteAllContexts(); + callDeleteAllContexts(); // [END dialogflow_v2_generated_Contexts_DeleteAllContexts_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/contexts.delete_context.js b/packages/google-cloud-dialogflow/samples/generated/v2/contexts.delete_context.js index 97befd50a11..a8f57d6e8b2 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/contexts.delete_context.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/contexts.delete_context.js @@ -35,7 +35,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new ContextsClient(); - async function deleteContext() { + async function callDeleteContext() { // Construct request const request = { name, @@ -46,7 +46,7 @@ function main(name) { console.log(response); } - deleteContext(); + callDeleteContext(); // [END dialogflow_v2_generated_Contexts_DeleteContext_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/contexts.get_context.js b/packages/google-cloud-dialogflow/samples/generated/v2/contexts.get_context.js index 62f9e8f015b..12316dc3259 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/contexts.get_context.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/contexts.get_context.js @@ -35,7 +35,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new ContextsClient(); - async function getContext() { + async function callGetContext() { // Construct request const request = { name, @@ -46,7 +46,7 @@ function main(name) { console.log(response); } - getContext(); + callGetContext(); // [END dialogflow_v2_generated_Contexts_GetContext_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/contexts.list_contexts.js b/packages/google-cloud-dialogflow/samples/generated/v2/contexts.list_contexts.js index 85eb7123c53..3f41abee442 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/contexts.list_contexts.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/contexts.list_contexts.js @@ -44,7 +44,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new ContextsClient(); - async function listContexts() { + async function callListContexts() { // Construct request const request = { parent, @@ -57,7 +57,7 @@ function main(parent) { } } - listContexts(); + callListContexts(); // [END dialogflow_v2_generated_Contexts_ListContexts_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/contexts.update_context.js b/packages/google-cloud-dialogflow/samples/generated/v2/contexts.update_context.js index d52c2f8bbd7..64372bd0e61 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/contexts.update_context.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/contexts.update_context.js @@ -22,11 +22,11 @@ function main(context) { /** * Required. The context to update. */ - // const context = '' + // const context = {} /** * Optional. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {ContextsClient} = require('@google-cloud/dialogflow').v2; @@ -34,7 +34,7 @@ function main(context) { // Instantiates a client const dialogflowClient = new ContextsClient(); - async function updateContext() { + async function callUpdateContext() { // Construct request const request = { context, @@ -45,7 +45,7 @@ function main(context) { console.log(response); } - updateContext(); + callUpdateContext(); // [END dialogflow_v2_generated_Contexts_UpdateContext_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.create_conversation_profile.js b/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.create_conversation_profile.js index f97b1708c78..8fb7fff477a 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.create_conversation_profile.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.create_conversation_profile.js @@ -27,7 +27,7 @@ function main(parent, conversationProfile) { /** * Required. The conversation profile to create. */ - // const conversationProfile = '' + // const conversationProfile = {} // Imports the Dialogflow library const {ConversationProfilesClient} = require('@google-cloud/dialogflow').v2; @@ -35,7 +35,7 @@ function main(parent, conversationProfile) { // Instantiates a client const dialogflowClient = new ConversationProfilesClient(); - async function createConversationProfile() { + async function callCreateConversationProfile() { // Construct request const request = { parent, @@ -47,7 +47,7 @@ function main(parent, conversationProfile) { console.log(response); } - createConversationProfile(); + callCreateConversationProfile(); // [END dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.delete_conversation_profile.js b/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.delete_conversation_profile.js index 65db7c8f8bb..799539bfac7 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.delete_conversation_profile.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.delete_conversation_profile.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new ConversationProfilesClient(); - async function deleteConversationProfile() { + async function callDeleteConversationProfile() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - deleteConversationProfile(); + callDeleteConversationProfile(); // [END dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.get_conversation_profile.js b/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.get_conversation_profile.js index e112e35e1a8..49e0f4ac905 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.get_conversation_profile.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.get_conversation_profile.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new ConversationProfilesClient(); - async function getConversationProfile() { + async function callGetConversationProfile() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getConversationProfile(); + callGetConversationProfile(); // [END dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.list_conversation_profiles.js b/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.list_conversation_profiles.js index 8ad5b4249a9..4800a1b563a 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.list_conversation_profiles.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.list_conversation_profiles.js @@ -40,7 +40,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new ConversationProfilesClient(); - async function listConversationProfiles() { + async function callListConversationProfiles() { // Construct request const request = { parent, @@ -55,7 +55,7 @@ function main(parent) { } } - listConversationProfiles(); + callListConversationProfiles(); // [END dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.update_conversation_profile.js b/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.update_conversation_profile.js index 85bce09fd8f..13d5a7bb193 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.update_conversation_profile.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/conversation_profiles.update_conversation_profile.js @@ -22,11 +22,11 @@ function main(conversationProfile, updateMask) { /** * Required. The conversation profile to update. */ - // const conversationProfile = '' + // const conversationProfile = {} /** * Required. The mask to control which fields to update. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {ConversationProfilesClient} = require('@google-cloud/dialogflow').v2; @@ -34,7 +34,7 @@ function main(conversationProfile, updateMask) { // Instantiates a client const dialogflowClient = new ConversationProfilesClient(); - async function updateConversationProfile() { + async function callUpdateConversationProfile() { // Construct request const request = { conversationProfile, @@ -46,7 +46,7 @@ function main(conversationProfile, updateMask) { console.log(response); } - updateConversationProfile(); + callUpdateConversationProfile(); // [END dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/conversations.complete_conversation.js b/packages/google-cloud-dialogflow/samples/generated/v2/conversations.complete_conversation.js index f84f76412bb..4d213af251e 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/conversations.complete_conversation.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/conversations.complete_conversation.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new ConversationsClient(); - async function completeConversation() { + async function callCompleteConversation() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - completeConversation(); + callCompleteConversation(); // [END dialogflow_v2_generated_Conversations_CompleteConversation_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/conversations.create_conversation.js b/packages/google-cloud-dialogflow/samples/generated/v2/conversations.create_conversation.js index 0e0ee8c8a85..62d670d9f32 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/conversations.create_conversation.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/conversations.create_conversation.js @@ -27,13 +27,13 @@ function main(parent, conversation) { /** * Required. The conversation to create. */ - // const conversation = '' + // const conversation = {} /** * Optional. Identifier of the conversation. Generally it's auto generated by Google. * Only set it if you cannot wait for the response to return a * auto-generated one to you. * The conversation ID must be compliant with the regression fomula - * "[a-zA-Z][a-zA-Z0-9_-]*" with the characters length in range of [3,64]. + * "a-zA-Z a-zA-Z0-9_-*" with the characters length in range of 3,64. * If the field is provided, the caller is resposible for * 1. the uniqueness of the ID, otherwise the request will be rejected. * 2. the consistency for whether to use custom ID or not under a project to @@ -47,7 +47,7 @@ function main(parent, conversation) { // Instantiates a client const dialogflowClient = new ConversationsClient(); - async function createConversation() { + async function callCreateConversation() { // Construct request const request = { parent, @@ -59,7 +59,7 @@ function main(parent, conversation) { console.log(response); } - createConversation(); + callCreateConversation(); // [END dialogflow_v2_generated_Conversations_CreateConversation_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/conversations.get_conversation.js b/packages/google-cloud-dialogflow/samples/generated/v2/conversations.get_conversation.js index 3c1075007e4..d4336c89c5a 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/conversations.get_conversation.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/conversations.get_conversation.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new ConversationsClient(); - async function getConversation() { + async function callGetConversation() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getConversation(); + callGetConversation(); // [END dialogflow_v2_generated_Conversations_GetConversation_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/conversations.list_conversations.js b/packages/google-cloud-dialogflow/samples/generated/v2/conversations.list_conversations.js index ca3c05e7f6e..cf6676c453c 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/conversations.list_conversations.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/conversations.list_conversations.js @@ -48,7 +48,7 @@ function main(parent) { * the following expression only returns `COMPLETED` conversations: * `lifecycle_state = "COMPLETED"` * For more information about filtering, see - * [API Filtering](https://aip.dev/160). + * API Filtering (https://aip.dev/160). */ // const filter = 'abc123' @@ -58,7 +58,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new ConversationsClient(); - async function listConversations() { + async function callListConversations() { // Construct request const request = { parent, @@ -71,7 +71,7 @@ function main(parent) { } } - listConversations(); + callListConversations(); // [END dialogflow_v2_generated_Conversations_ListConversations_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/conversations.list_messages.js b/packages/google-cloud-dialogflow/samples/generated/v2/conversations.list_messages.js index 42e73e8a99f..3aaf0c027ac 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/conversations.list_messages.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/conversations.list_messages.js @@ -32,7 +32,7 @@ function main(parent) { * `create_time_epoch_microseconds > 1551790877964485` or * `create_time > 2017-01-15T01:30:15.01Z`. * For more information about filtering, see - * [API Filtering](https://aip.dev/160). + * API Filtering (https://aip.dev/160). */ // const filter = 'abc123' /** @@ -51,7 +51,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new ConversationsClient(); - async function listMessages() { + async function callListMessages() { // Construct request const request = { parent, @@ -64,7 +64,7 @@ function main(parent) { } } - listMessages(); + callListMessages(); // [END dialogflow_v2_generated_Conversations_ListMessages_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/documents.create_document.js b/packages/google-cloud-dialogflow/samples/generated/v2/documents.create_document.js index 299c1267d65..315b9fd4981 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/documents.create_document.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/documents.create_document.js @@ -28,7 +28,7 @@ function main(parent, document) { /** * Required. The document to create. */ - // const document = '' + // const document = {} // Imports the Dialogflow library const {DocumentsClient} = require('@google-cloud/dialogflow').v2; @@ -36,7 +36,7 @@ function main(parent, document) { // Instantiates a client const dialogflowClient = new DocumentsClient(); - async function createDocument() { + async function callCreateDocument() { // Construct request const request = { parent, @@ -49,7 +49,7 @@ function main(parent, document) { console.log(response); } - createDocument(); + callCreateDocument(); // [END dialogflow_v2_generated_Documents_CreateDocument_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/documents.delete_document.js b/packages/google-cloud-dialogflow/samples/generated/v2/documents.delete_document.js index 251cc2c9b72..706f4a33747 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/documents.delete_document.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/documents.delete_document.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new DocumentsClient(); - async function deleteDocument() { + async function callDeleteDocument() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - deleteDocument(); + callDeleteDocument(); // [END dialogflow_v2_generated_Documents_DeleteDocument_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/documents.get_document.js b/packages/google-cloud-dialogflow/samples/generated/v2/documents.get_document.js index 8e616221985..e287b51f02c 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/documents.get_document.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/documents.get_document.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new DocumentsClient(); - async function getDocument() { + async function callGetDocument() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getDocument(); + callGetDocument(); // [END dialogflow_v2_generated_Documents_GetDocument_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/documents.list_documents.js b/packages/google-cloud-dialogflow/samples/generated/v2/documents.list_documents.js index c67a9ad8aec..1a9415f87ba 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/documents.list_documents.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/documents.list_documents.js @@ -41,7 +41,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new DocumentsClient(); - async function listDocuments() { + async function callListDocuments() { // Construct request const request = { parent, @@ -54,7 +54,7 @@ function main(parent) { } } - listDocuments(); + callListDocuments(); // [END dialogflow_v2_generated_Documents_ListDocuments_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/documents.reload_document.js b/packages/google-cloud-dialogflow/samples/generated/v2/documents.reload_document.js index 07dcaab6381..33711f9f8ad 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/documents.reload_document.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/documents.reload_document.js @@ -39,7 +39,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new DocumentsClient(); - async function reloadDocument() { + async function callReloadDocument() { // Construct request const request = { name, @@ -51,7 +51,7 @@ function main(name) { console.log(response); } - reloadDocument(); + callReloadDocument(); // [END dialogflow_v2_generated_Documents_ReloadDocument_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/documents.update_document.js b/packages/google-cloud-dialogflow/samples/generated/v2/documents.update_document.js index c7cf16cb2a8..619e5665bf9 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/documents.update_document.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/documents.update_document.js @@ -22,13 +22,13 @@ function main(document) { /** * Required. The document to update. */ - // const document = '' + // const document = {} /** * Optional. Not specified means `update all`. * Currently, only `display_name` can be updated, an InvalidArgument will be * returned for attempting to update other fields. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {DocumentsClient} = require('@google-cloud/dialogflow').v2; @@ -36,7 +36,7 @@ function main(document) { // Instantiates a client const dialogflowClient = new DocumentsClient(); - async function updateDocument() { + async function callUpdateDocument() { // Construct request const request = { document, @@ -48,7 +48,7 @@ function main(document) { console.log(response); } - updateDocument(); + callUpdateDocument(); // [END dialogflow_v2_generated_Documents_UpdateDocument_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_create_entities.js b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_create_entities.js index 764aa4fdf99..233fd7d1d71 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_create_entities.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_create_entities.js @@ -32,8 +32,8 @@ function main(parent, entities) { * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' @@ -43,7 +43,7 @@ function main(parent, entities) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function batchCreateEntities() { + async function callBatchCreateEntities() { // Construct request const request = { parent, @@ -56,7 +56,7 @@ function main(parent, entities) { console.log(response); } - batchCreateEntities(); + callBatchCreateEntities(); // [END dialogflow_v2_generated_EntityTypes_BatchCreateEntities_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_delete_entities.js b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_delete_entities.js index 67f65fe1a7a..14606347a73 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_delete_entities.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_delete_entities.js @@ -34,8 +34,8 @@ function main(parent, entityValues) { * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' @@ -45,7 +45,7 @@ function main(parent, entityValues) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function batchDeleteEntities() { + async function callBatchDeleteEntities() { // Construct request const request = { parent, @@ -58,7 +58,7 @@ function main(parent, entityValues) { console.log(response); } - batchDeleteEntities(); + callBatchDeleteEntities(); // [END dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_delete_entity_types.js b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_delete_entity_types.js index 6bd8fedddfd..3c5c1be9249 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_delete_entity_types.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_delete_entity_types.js @@ -36,7 +36,7 @@ function main(parent, entityTypeNames) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function batchDeleteEntityTypes() { + async function callBatchDeleteEntityTypes() { // Construct request const request = { parent, @@ -49,7 +49,7 @@ function main(parent, entityTypeNames) { console.log(response); } - batchDeleteEntityTypes(); + callBatchDeleteEntityTypes(); // [END dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_update_entities.js b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_update_entities.js index e9cadb2a1fb..09adaa244c9 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_update_entities.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_update_entities.js @@ -32,14 +32,14 @@ function main(parent, entities) { * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** * Optional. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {EntityTypesClient} = require('@google-cloud/dialogflow').v2; @@ -47,7 +47,7 @@ function main(parent, entities) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function batchUpdateEntities() { + async function callBatchUpdateEntities() { // Construct request const request = { parent, @@ -60,7 +60,7 @@ function main(parent, entities) { console.log(response); } - batchUpdateEntities(); + callBatchUpdateEntities(); // [END dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_update_entity_types.js b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_update_entity_types.js index b6433d71a1a..5a71bf5e242 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_update_entity_types.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.batch_update_entity_types.js @@ -34,19 +34,19 @@ function main(parent) { /** * The collection of entity types to update or create. */ - // const entityTypeBatchInline = '' + // const entityTypeBatchInline = {} /** * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** * Optional. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {EntityTypesClient} = require('@google-cloud/dialogflow').v2; @@ -54,7 +54,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function batchUpdateEntityTypes() { + async function callBatchUpdateEntityTypes() { // Construct request const request = { parent, @@ -66,7 +66,7 @@ function main(parent) { console.log(response); } - batchUpdateEntityTypes(); + callBatchUpdateEntityTypes(); // [END dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.create_entity_type.js b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.create_entity_type.js index ace0b0cbe18..3a7cb1c51a2 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.create_entity_type.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.create_entity_type.js @@ -27,13 +27,13 @@ function main(parent, entityType) { /** * Required. The entity type to create. */ - // const entityType = '' + // const entityType = {} /** * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' @@ -43,7 +43,7 @@ function main(parent, entityType) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function createEntityType() { + async function callCreateEntityType() { // Construct request const request = { parent, @@ -55,7 +55,7 @@ function main(parent, entityType) { console.log(response); } - createEntityType(); + callCreateEntityType(); // [END dialogflow_v2_generated_EntityTypes_CreateEntityType_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.delete_entity_type.js b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.delete_entity_type.js index 9916c069c17..bad8a9cf1ad 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.delete_entity_type.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.delete_entity_type.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function deleteEntityType() { + async function callDeleteEntityType() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - deleteEntityType(); + callDeleteEntityType(); // [END dialogflow_v2_generated_EntityTypes_DeleteEntityType_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.get_entity_type.js b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.get_entity_type.js index 00aa5d6f3b1..15830f98ff4 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.get_entity_type.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.get_entity_type.js @@ -28,8 +28,8 @@ function main(name) { * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' @@ -39,7 +39,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function getEntityType() { + async function callGetEntityType() { // Construct request const request = { name, @@ -50,7 +50,7 @@ function main(name) { console.log(response); } - getEntityType(); + callGetEntityType(); // [END dialogflow_v2_generated_EntityTypes_GetEntityType_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.list_entity_types.js b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.list_entity_types.js index 5643c5f3276..0def1062e69 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.list_entity_types.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.list_entity_types.js @@ -28,8 +28,8 @@ function main(parent) { * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** @@ -48,7 +48,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function listEntityTypes() { + async function callListEntityTypes() { // Construct request const request = { parent, @@ -61,7 +61,7 @@ function main(parent) { } } - listEntityTypes(); + callListEntityTypes(); // [END dialogflow_v2_generated_EntityTypes_ListEntityTypes_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.update_entity_type.js b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.update_entity_type.js index 728e35bd726..76a60bad856 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.update_entity_type.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/entity_types.update_entity_type.js @@ -22,19 +22,19 @@ function main(entityType) { /** * Required. The entity type to update. */ - // const entityType = '' + // const entityType = {} /** * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** * Optional. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {EntityTypesClient} = require('@google-cloud/dialogflow').v2; @@ -42,7 +42,7 @@ function main(entityType) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function updateEntityType() { + async function callUpdateEntityType() { // Construct request const request = { entityType, @@ -53,7 +53,7 @@ function main(entityType) { console.log(response); } - updateEntityType(); + callUpdateEntityType(); // [END dialogflow_v2_generated_EntityTypes_UpdateEntityType_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/environments.create_environment.js b/packages/google-cloud-dialogflow/samples/generated/v2/environments.create_environment.js index e72bc7823bd..43b9d7075d5 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/environments.create_environment.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/environments.create_environment.js @@ -29,7 +29,7 @@ function main(parent, environment, environmentId) { /** * Required. The environment to create. */ - // const environment = '' + // const environment = {} /** * Required. The unique id of the new environment. */ @@ -41,7 +41,7 @@ function main(parent, environment, environmentId) { // Instantiates a client const dialogflowClient = new EnvironmentsClient(); - async function createEnvironment() { + async function callCreateEnvironment() { // Construct request const request = { parent, @@ -54,7 +54,7 @@ function main(parent, environment, environmentId) { console.log(response); } - createEnvironment(); + callCreateEnvironment(); // [END dialogflow_v2_generated_Environments_CreateEnvironment_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/environments.delete_environment.js b/packages/google-cloud-dialogflow/samples/generated/v2/environments.delete_environment.js index d641c537115..57b0b6fac83 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/environments.delete_environment.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/environments.delete_environment.js @@ -35,7 +35,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new EnvironmentsClient(); - async function deleteEnvironment() { + async function callDeleteEnvironment() { // Construct request const request = { name, @@ -46,7 +46,7 @@ function main(name) { console.log(response); } - deleteEnvironment(); + callDeleteEnvironment(); // [END dialogflow_v2_generated_Environments_DeleteEnvironment_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/environments.get_environment.js b/packages/google-cloud-dialogflow/samples/generated/v2/environments.get_environment.js index d7574bb14b0..a3666fd87b9 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/environments.get_environment.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/environments.get_environment.js @@ -35,7 +35,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new EnvironmentsClient(); - async function getEnvironment() { + async function callGetEnvironment() { // Construct request const request = { name, @@ -46,7 +46,7 @@ function main(name) { console.log(response); } - getEnvironment(); + callGetEnvironment(); // [END dialogflow_v2_generated_Environments_GetEnvironment_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/environments.get_environment_history.js b/packages/google-cloud-dialogflow/samples/generated/v2/environments.get_environment_history.js index c1d5dcd1d9a..a12bed7d4f0 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/environments.get_environment_history.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/environments.get_environment_history.js @@ -44,7 +44,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new EnvironmentsClient(); - async function getEnvironmentHistory() { + async function callGetEnvironmentHistory() { // Construct request const request = { parent, @@ -57,7 +57,7 @@ function main(parent) { } } - getEnvironmentHistory(); + callGetEnvironmentHistory(); // [END dialogflow_v2_generated_Environments_GetEnvironmentHistory_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/environments.list_environments.js b/packages/google-cloud-dialogflow/samples/generated/v2/environments.list_environments.js index 4993af6c4d8..3555206ac6e 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/environments.list_environments.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/environments.list_environments.js @@ -42,7 +42,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new EnvironmentsClient(); - async function listEnvironments() { + async function callListEnvironments() { // Construct request const request = { parent, @@ -55,7 +55,7 @@ function main(parent) { } } - listEnvironments(); + callListEnvironments(); // [END dialogflow_v2_generated_Environments_ListEnvironments_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/environments.update_environment.js b/packages/google-cloud-dialogflow/samples/generated/v2/environments.update_environment.js index ee20103dd85..1f1f74ec1e5 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/environments.update_environment.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/environments.update_environment.js @@ -22,11 +22,11 @@ function main(environment, updateMask) { /** * Required. The environment to update. */ - // const environment = '' + // const environment = {} /** * Required. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} /** * Optional. This field is used to prevent accidental overwrite of the default * environment, which is an operation that cannot be undone. To confirm that @@ -41,7 +41,7 @@ function main(environment, updateMask) { // Instantiates a client const dialogflowClient = new EnvironmentsClient(); - async function updateEnvironment() { + async function callUpdateEnvironment() { // Construct request const request = { environment, @@ -53,7 +53,7 @@ function main(environment, updateMask) { console.log(response); } - updateEnvironment(); + callUpdateEnvironment(); // [END dialogflow_v2_generated_Environments_UpdateEnvironment_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/fulfillments.get_fulfillment.js b/packages/google-cloud-dialogflow/samples/generated/v2/fulfillments.get_fulfillment.js index ce7e9fb339d..a4964e957f7 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/fulfillments.get_fulfillment.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/fulfillments.get_fulfillment.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new FulfillmentsClient(); - async function getFulfillment() { + async function callGetFulfillment() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - getFulfillment(); + callGetFulfillment(); // [END dialogflow_v2_generated_Fulfillments_GetFulfillment_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/fulfillments.update_fulfillment.js b/packages/google-cloud-dialogflow/samples/generated/v2/fulfillments.update_fulfillment.js index 3ac1213a036..b82cbae8302 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/fulfillments.update_fulfillment.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/fulfillments.update_fulfillment.js @@ -22,12 +22,12 @@ function main(fulfillment, updateMask) { /** * Required. The fulfillment to update. */ - // const fulfillment = '' + // const fulfillment = {} /** * Required. The mask to control which fields get updated. If the mask is not * present, all fields will be updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {FulfillmentsClient} = require('@google-cloud/dialogflow').v2; @@ -35,7 +35,7 @@ function main(fulfillment, updateMask) { // Instantiates a client const dialogflowClient = new FulfillmentsClient(); - async function updateFulfillment() { + async function callUpdateFulfillment() { // Construct request const request = { fulfillment, @@ -47,7 +47,7 @@ function main(fulfillment, updateMask) { console.log(response); } - updateFulfillment(); + callUpdateFulfillment(); // [END dialogflow_v2_generated_Fulfillments_UpdateFulfillment_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/intents.batch_delete_intents.js b/packages/google-cloud-dialogflow/samples/generated/v2/intents.batch_delete_intents.js index 8188369216c..b4d9a9708bc 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/intents.batch_delete_intents.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/intents.batch_delete_intents.js @@ -36,7 +36,7 @@ function main(parent, intents) { // Instantiates a client const dialogflowClient = new IntentsClient(); - async function batchDeleteIntents() { + async function callBatchDeleteIntents() { // Construct request const request = { parent, @@ -49,7 +49,7 @@ function main(parent, intents) { console.log(response); } - batchDeleteIntents(); + callBatchDeleteIntents(); // [END dialogflow_v2_generated_Intents_BatchDeleteIntents_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/intents.batch_update_intents.js b/packages/google-cloud-dialogflow/samples/generated/v2/intents.batch_update_intents.js index 53b5ed5d2ff..6bcf128b768 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/intents.batch_update_intents.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/intents.batch_update_intents.js @@ -33,23 +33,23 @@ function main(parent) { /** * The collection of intents to update or create. */ - // const intentBatchInline = '' + // const intentBatchInline = {} /** * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** * Optional. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} /** * Optional. The resource view to apply to the returned intent. */ - // const intentView = '' + // const intentView = {} // Imports the Dialogflow library const {IntentsClient} = require('@google-cloud/dialogflow').v2; @@ -57,7 +57,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new IntentsClient(); - async function batchUpdateIntents() { + async function callBatchUpdateIntents() { // Construct request const request = { parent, @@ -69,7 +69,7 @@ function main(parent) { console.log(response); } - batchUpdateIntents(); + callBatchUpdateIntents(); // [END dialogflow_v2_generated_Intents_BatchUpdateIntents_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/intents.create_intent.js b/packages/google-cloud-dialogflow/samples/generated/v2/intents.create_intent.js index 17cfc2ccb72..c47372294d3 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/intents.create_intent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/intents.create_intent.js @@ -27,19 +27,19 @@ function main(parent, intent) { /** * Required. The intent to create. */ - // const intent = '' + // const intent = {} /** * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** * Optional. The resource view to apply to the returned intent. */ - // const intentView = '' + // const intentView = {} // Imports the Dialogflow library const {IntentsClient} = require('@google-cloud/dialogflow').v2; @@ -47,7 +47,7 @@ function main(parent, intent) { // Instantiates a client const dialogflowClient = new IntentsClient(); - async function createIntent() { + async function callCreateIntent() { // Construct request const request = { parent, @@ -59,7 +59,7 @@ function main(parent, intent) { console.log(response); } - createIntent(); + callCreateIntent(); // [END dialogflow_v2_generated_Intents_CreateIntent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/intents.delete_intent.js b/packages/google-cloud-dialogflow/samples/generated/v2/intents.delete_intent.js index dcbc428732a..5c00916866a 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/intents.delete_intent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/intents.delete_intent.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new IntentsClient(); - async function deleteIntent() { + async function callDeleteIntent() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - deleteIntent(); + callDeleteIntent(); // [END dialogflow_v2_generated_Intents_DeleteIntent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/intents.get_intent.js b/packages/google-cloud-dialogflow/samples/generated/v2/intents.get_intent.js index cf3a45c43a7..92dab8aa367 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/intents.get_intent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/intents.get_intent.js @@ -28,14 +28,14 @@ function main(name) { * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** * Optional. The resource view to apply to the returned intent. */ - // const intentView = '' + // const intentView = {} // Imports the Dialogflow library const {IntentsClient} = require('@google-cloud/dialogflow').v2; @@ -43,7 +43,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new IntentsClient(); - async function getIntent() { + async function callGetIntent() { // Construct request const request = { name, @@ -54,7 +54,7 @@ function main(name) { console.log(response); } - getIntent(); + callGetIntent(); // [END dialogflow_v2_generated_Intents_GetIntent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/intents.list_intents.js b/packages/google-cloud-dialogflow/samples/generated/v2/intents.list_intents.js index 9de1ab9f828..10b521d9e57 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/intents.list_intents.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/intents.list_intents.js @@ -35,14 +35,14 @@ function main(parent) { * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** * Optional. The resource view to apply to the returned intent. */ - // const intentView = '' + // const intentView = {} /** * Optional. The maximum number of items to return in a single page. By * default 100 and at most 1000. @@ -59,7 +59,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new IntentsClient(); - async function listIntents() { + async function callListIntents() { // Construct request const request = { parent, @@ -72,7 +72,7 @@ function main(parent) { } } - listIntents(); + callListIntents(); // [END dialogflow_v2_generated_Intents_ListIntents_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/intents.update_intent.js b/packages/google-cloud-dialogflow/samples/generated/v2/intents.update_intent.js index 6ffaae383ea..47d085b0f47 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/intents.update_intent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/intents.update_intent.js @@ -22,23 +22,23 @@ function main(intent) { /** * Required. The intent to update. */ - // const intent = '' + // const intent = {} /** * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** * Optional. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} /** * Optional. The resource view to apply to the returned intent. */ - // const intentView = '' + // const intentView = {} // Imports the Dialogflow library const {IntentsClient} = require('@google-cloud/dialogflow').v2; @@ -46,7 +46,7 @@ function main(intent) { // Instantiates a client const dialogflowClient = new IntentsClient(); - async function updateIntent() { + async function callUpdateIntent() { // Construct request const request = { intent, @@ -57,7 +57,7 @@ function main(intent) { console.log(response); } - updateIntent(); + callUpdateIntent(); // [END dialogflow_v2_generated_Intents_UpdateIntent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.create_knowledge_base.js b/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.create_knowledge_base.js index 008cc3d364e..a6d5e82f0f7 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.create_knowledge_base.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.create_knowledge_base.js @@ -27,7 +27,7 @@ function main(parent, knowledgeBase) { /** * Required. The knowledge base to create. */ - // const knowledgeBase = '' + // const knowledgeBase = {} // Imports the Dialogflow library const {KnowledgeBasesClient} = require('@google-cloud/dialogflow').v2; @@ -35,7 +35,7 @@ function main(parent, knowledgeBase) { // Instantiates a client const dialogflowClient = new KnowledgeBasesClient(); - async function createKnowledgeBase() { + async function callCreateKnowledgeBase() { // Construct request const request = { parent, @@ -47,7 +47,7 @@ function main(parent, knowledgeBase) { console.log(response); } - createKnowledgeBase(); + callCreateKnowledgeBase(); // [END dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.delete_knowledge_base.js b/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.delete_knowledge_base.js index 0cc40c59c8e..1a1f60ac8ef 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.delete_knowledge_base.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.delete_knowledge_base.js @@ -37,7 +37,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new KnowledgeBasesClient(); - async function deleteKnowledgeBase() { + async function callDeleteKnowledgeBase() { // Construct request const request = { name, @@ -48,7 +48,7 @@ function main(name) { console.log(response); } - deleteKnowledgeBase(); + callDeleteKnowledgeBase(); // [END dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.get_knowledge_base.js b/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.get_knowledge_base.js index e3fafe26139..6e940e75e99 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.get_knowledge_base.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.get_knowledge_base.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new KnowledgeBasesClient(); - async function getKnowledgeBase() { + async function callGetKnowledgeBase() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getKnowledgeBase(); + callGetKnowledgeBase(); // [END dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.list_knowledge_bases.js b/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.list_knowledge_bases.js index f6bbbb5bc62..0e238398355 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.list_knowledge_bases.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.list_knowledge_bases.js @@ -40,7 +40,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new KnowledgeBasesClient(); - async function listKnowledgeBases() { + async function callListKnowledgeBases() { // Construct request const request = { parent, @@ -53,7 +53,7 @@ function main(parent) { } } - listKnowledgeBases(); + callListKnowledgeBases(); // [END dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.update_knowledge_base.js b/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.update_knowledge_base.js index 5929ab08cf6..57aa2bf4091 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.update_knowledge_base.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/knowledge_bases.update_knowledge_base.js @@ -22,13 +22,13 @@ function main(knowledgeBase) { /** * Required. The knowledge base to update. */ - // const knowledgeBase = '' + // const knowledgeBase = {} /** * Optional. Not specified means `update all`. * Currently, only `display_name` can be updated, an InvalidArgument will be * returned for attempting to update other fields. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {KnowledgeBasesClient} = require('@google-cloud/dialogflow').v2; @@ -36,7 +36,7 @@ function main(knowledgeBase) { // Instantiates a client const dialogflowClient = new KnowledgeBasesClient(); - async function updateKnowledgeBase() { + async function callUpdateKnowledgeBase() { // Construct request const request = { knowledgeBase, @@ -47,7 +47,7 @@ function main(knowledgeBase) { console.log(response); } - updateKnowledgeBase(); + callUpdateKnowledgeBase(); // [END dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/participants.analyze_content.js b/packages/google-cloud-dialogflow/samples/generated/v2/participants.analyze_content.js index d94b4ea199e..fd76de76023 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/participants.analyze_content.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/participants.analyze_content.js @@ -28,11 +28,11 @@ function main(participant) { /** * The natural language text to be processed. */ - // const textInput = '' + // const textInput = {} /** * An input event to send to Dialogflow. */ - // const eventInput = '' + // const eventInput = {} /** * Speech synthesis configuration. * The speech synthesis settings for a virtual agent that may be configured @@ -40,11 +40,11 @@ function main(participant) { * AnalyzeContent. If this configuration is not supplied, speech synthesis * is disabled. */ - // const replyAudioConfig = '' + // const replyAudioConfig = {} /** * Parameters for a Dialogflow virtual-agent query. */ - // const queryParams = '' + // const queryParams = {} /** * A unique identifier for this request. Restricted to 36 ASCII characters. * A random UUID is recommended. @@ -58,7 +58,7 @@ function main(participant) { // Instantiates a client const dialogflowClient = new ParticipantsClient(); - async function analyzeContent() { + async function callAnalyzeContent() { // Construct request const request = { participant, @@ -69,7 +69,7 @@ function main(participant) { console.log(response); } - analyzeContent(); + callAnalyzeContent(); // [END dialogflow_v2_generated_Participants_AnalyzeContent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/participants.create_participant.js b/packages/google-cloud-dialogflow/samples/generated/v2/participants.create_participant.js index 46d152a9cec..5b1cd5033b2 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/participants.create_participant.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/participants.create_participant.js @@ -28,7 +28,7 @@ function main(parent, participant) { /** * Required. The participant to create. */ - // const participant = '' + // const participant = {} // Imports the Dialogflow library const {ParticipantsClient} = require('@google-cloud/dialogflow').v2; @@ -36,7 +36,7 @@ function main(parent, participant) { // Instantiates a client const dialogflowClient = new ParticipantsClient(); - async function createParticipant() { + async function callCreateParticipant() { // Construct request const request = { parent, @@ -48,7 +48,7 @@ function main(parent, participant) { console.log(response); } - createParticipant(); + callCreateParticipant(); // [END dialogflow_v2_generated_Participants_CreateParticipant_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/participants.get_participant.js b/packages/google-cloud-dialogflow/samples/generated/v2/participants.get_participant.js index 9a868a188f5..f5b8e5620bc 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/participants.get_participant.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/participants.get_participant.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new ParticipantsClient(); - async function getParticipant() { + async function callGetParticipant() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getParticipant(); + callGetParticipant(); // [END dialogflow_v2_generated_Participants_GetParticipant_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/participants.list_participants.js b/packages/google-cloud-dialogflow/samples/generated/v2/participants.list_participants.js index 9763ed22084..73396c16c45 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/participants.list_participants.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/participants.list_participants.js @@ -41,7 +41,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new ParticipantsClient(); - async function listParticipants() { + async function callListParticipants() { // Construct request const request = { parent, @@ -54,7 +54,7 @@ function main(parent) { } } - listParticipants(); + callListParticipants(); // [END dialogflow_v2_generated_Participants_ListParticipants_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/participants.suggest_articles.js b/packages/google-cloud-dialogflow/samples/generated/v2/participants.suggest_articles.js index ce418812155..c1edb421bae 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/participants.suggest_articles.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/participants.suggest_articles.js @@ -34,7 +34,7 @@ function main(parent) { // const latestMessage = 'abc123' /** * Max number of messages prior to and including - * [latest_message][google.cloud.dialogflow.v2.SuggestArticlesRequest.latest_message] to use as context + * latest_message google.cloud.dialogflow.v2.SuggestArticlesRequest.latest_message to use as context * when compiling the suggestion. By default 20 and at most 50. */ // const contextSize = 1234 @@ -45,7 +45,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new ParticipantsClient(); - async function suggestArticles() { + async function callSuggestArticles() { // Construct request const request = { parent, @@ -56,7 +56,7 @@ function main(parent) { console.log(response); } - suggestArticles(); + callSuggestArticles(); // [END dialogflow_v2_generated_Participants_SuggestArticles_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/participants.suggest_faq_answers.js b/packages/google-cloud-dialogflow/samples/generated/v2/participants.suggest_faq_answers.js index 4620edf33c3..3f76b91d86b 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/participants.suggest_faq_answers.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/participants.suggest_faq_answers.js @@ -34,7 +34,7 @@ function main(parent) { // const latestMessage = 'abc123' /** * Max number of messages prior to and including - * [latest_message] to use as context when compiling the + * latest_message to use as context when compiling the * suggestion. By default 20 and at most 50. */ // const contextSize = 1234 @@ -45,7 +45,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new ParticipantsClient(); - async function suggestFaqAnswers() { + async function callSuggestFaqAnswers() { // Construct request const request = { parent, @@ -56,7 +56,7 @@ function main(parent) { console.log(response); } - suggestFaqAnswers(); + callSuggestFaqAnswers(); // [END dialogflow_v2_generated_Participants_SuggestFaqAnswers_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/participants.update_participant.js b/packages/google-cloud-dialogflow/samples/generated/v2/participants.update_participant.js index 4a356e691af..f588dc380d2 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/participants.update_participant.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/participants.update_participant.js @@ -22,11 +22,11 @@ function main(participant, updateMask) { /** * Required. The participant to update. */ - // const participant = '' + // const participant = {} /** * Required. The mask to specify which fields to update. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {ParticipantsClient} = require('@google-cloud/dialogflow').v2; @@ -34,7 +34,7 @@ function main(participant, updateMask) { // Instantiates a client const dialogflowClient = new ParticipantsClient(); - async function updateParticipant() { + async function callUpdateParticipant() { // Construct request const request = { participant, @@ -46,7 +46,7 @@ function main(participant, updateMask) { console.log(response); } - updateParticipant(); + callUpdateParticipant(); // [END dialogflow_v2_generated_Participants_UpdateParticipant_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.create_session_entity_type.js b/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.create_session_entity_type.js index 075c79407be..d68283bef75 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.create_session_entity_type.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.create_session_entity_type.js @@ -31,7 +31,7 @@ function main(parent, sessionEntityType) { /** * Required. The session entity type to create. */ - // const sessionEntityType = '' + // const sessionEntityType = {} // Imports the Dialogflow library const {SessionEntityTypesClient} = require('@google-cloud/dialogflow').v2; @@ -39,7 +39,7 @@ function main(parent, sessionEntityType) { // Instantiates a client const dialogflowClient = new SessionEntityTypesClient(); - async function createSessionEntityType() { + async function callCreateSessionEntityType() { // Construct request const request = { parent, @@ -51,7 +51,7 @@ function main(parent, sessionEntityType) { console.log(response); } - createSessionEntityType(); + callCreateSessionEntityType(); // [END dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.delete_session_entity_type.js b/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.delete_session_entity_type.js index 8a8c5821e14..5d6da599cf9 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.delete_session_entity_type.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.delete_session_entity_type.js @@ -36,7 +36,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new SessionEntityTypesClient(); - async function deleteSessionEntityType() { + async function callDeleteSessionEntityType() { // Construct request const request = { name, @@ -47,7 +47,7 @@ function main(name) { console.log(response); } - deleteSessionEntityType(); + callDeleteSessionEntityType(); // [END dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.get_session_entity_type.js b/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.get_session_entity_type.js index 5d97d84533d..438c090eb47 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.get_session_entity_type.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.get_session_entity_type.js @@ -36,7 +36,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new SessionEntityTypesClient(); - async function getSessionEntityType() { + async function callGetSessionEntityType() { // Construct request const request = { name, @@ -47,7 +47,7 @@ function main(name) { console.log(response); } - getSessionEntityType(); + callGetSessionEntityType(); // [END dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.list_session_entity_types.js b/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.list_session_entity_types.js index d84930ae2c7..9cd4b18a07b 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.list_session_entity_types.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.list_session_entity_types.js @@ -44,7 +44,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new SessionEntityTypesClient(); - async function listSessionEntityTypes() { + async function callListSessionEntityTypes() { // Construct request const request = { parent, @@ -59,7 +59,7 @@ function main(parent) { } } - listSessionEntityTypes(); + callListSessionEntityTypes(); // [END dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.update_session_entity_type.js b/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.update_session_entity_type.js index 9b116d4c838..5164b4b4e6b 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.update_session_entity_type.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/session_entity_types.update_session_entity_type.js @@ -22,11 +22,11 @@ function main(sessionEntityType) { /** * Required. The session entity type to update. */ - // const sessionEntityType = '' + // const sessionEntityType = {} /** * Optional. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {SessionEntityTypesClient} = require('@google-cloud/dialogflow').v2; @@ -34,7 +34,7 @@ function main(sessionEntityType) { // Instantiates a client const dialogflowClient = new SessionEntityTypesClient(); - async function updateSessionEntityType() { + async function callUpdateSessionEntityType() { // Construct request const request = { sessionEntityType, @@ -45,7 +45,7 @@ function main(sessionEntityType) { console.log(response); } - updateSessionEntityType(); + callUpdateSessionEntityType(); // [END dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/sessions.detect_intent.js b/packages/google-cloud-dialogflow/samples/generated/v2/sessions.detect_intent.js index a22ccae83b7..aad680eb739 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/sessions.detect_intent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/sessions.detect_intent.js @@ -30,17 +30,17 @@ function main(session, queryInput) { * and `User Id`. They can be a random number or some type of user and session * identifiers (preferably hashed). The length of the `Session ID` and * `User ID` must not exceed 36 characters. - * For more information, see the [API interactions - * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * For more information, see the API interactions + * guide (https://cloud.google.com/dialogflow/docs/api-overview). * Note: Always use agent versions for production traffic. - * See [Versions and - * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * See Versions and + * environments (https://cloud.google.com/dialogflow/es/docs/agents-versions). */ // const session = 'abc123' /** * The parameters of this query. */ - // const queryParams = '' + // const queryParams = {} /** * Required. The input specification. It can be set to: * 1. an audio config @@ -48,21 +48,21 @@ function main(session, queryInput) { * 2. a conversational query in the form of text, or * 3. an event that specifies which intent to trigger. */ - // const queryInput = '' + // const queryInput = {} /** * Instructs the speech synthesizer how to generate the output * audio. If this field is not set and agent-level speech synthesizer is not * configured, no output audio is generated. */ - // const outputAudioConfig = '' + // const outputAudioConfig = {} /** - * Mask for [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] indicating which settings in this + * Mask for output_audio_config google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config indicating which settings in this * request-level config should override speech synthesizer settings defined at * agent-level. - * If unspecified or empty, [output_audio_config][google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config] replaces the agent-level + * If unspecified or empty, output_audio_config google.cloud.dialogflow.v2.DetectIntentRequest.output_audio_config replaces the agent-level * config in its entirety. */ - // const outputAudioConfigMask = '' + // const outputAudioConfigMask = {} /** * The natural language speech audio to be processed. This field * should be populated iff `query_input` is set to an input audio config. @@ -76,7 +76,7 @@ function main(session, queryInput) { // Instantiates a client const dialogflowClient = new SessionsClient(); - async function detectIntent() { + async function callDetectIntent() { // Construct request const request = { session, @@ -88,7 +88,7 @@ function main(session, queryInput) { console.log(response); } - detectIntent(); + callDetectIntent(); // [END dialogflow_v2_generated_Sessions_DetectIntent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/sessions.streaming_detect_intent.js b/packages/google-cloud-dialogflow/samples/generated/v2/sessions.streaming_detect_intent.js index 8933abec7fd..81d02e2b9c9 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/sessions.streaming_detect_intent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/sessions.streaming_detect_intent.js @@ -30,17 +30,17 @@ function main(session, queryInput) { * `User Id`. They can be a random number or some type of user and session * identifiers (preferably hashed). The length of the `Session ID` and * `User ID` must not exceed 36 characters. - * For more information, see the [API interactions - * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * For more information, see the API interactions + * guide (https://cloud.google.com/dialogflow/docs/api-overview). * Note: Always use agent versions for production traffic. - * See [Versions and - * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * See Versions and + * environments (https://cloud.google.com/dialogflow/es/docs/agents-versions). */ // const session = 'abc123' /** * The parameters of this query. */ - // const queryParams = '' + // const queryParams = {} /** * Required. The input specification. It can be set to: * 1. an audio config which instructs the speech recognizer how to process @@ -48,9 +48,9 @@ function main(session, queryInput) { * 2. a conversational query in the form of text, or * 3. an event that specifies which intent to trigger. */ - // const queryInput = '' + // const queryInput = {} /** - * Please use [InputAudioConfig.single_utterance][google.cloud.dialogflow.v2.InputAudioConfig.single_utterance] instead. + * Please use InputAudioConfig.single_utterance google.cloud.dialogflow.v2.InputAudioConfig.single_utterance instead. * If `false` (default), recognition does not cease until * the client closes the stream. If `true`, the recognizer will detect a * single spoken utterance in input audio. Recognition ceases when it detects @@ -65,15 +65,15 @@ function main(session, queryInput) { * audio. If this field is not set and agent-level speech synthesizer is not * configured, no output audio is generated. */ - // const outputAudioConfig = '' + // const outputAudioConfig = {} /** - * Mask for [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] indicating which settings in this + * Mask for output_audio_config google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config indicating which settings in this * request-level config should override speech synthesizer settings defined at * agent-level. - * If unspecified or empty, [output_audio_config][google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config] replaces the agent-level + * If unspecified or empty, output_audio_config google.cloud.dialogflow.v2.StreamingDetectIntentRequest.output_audio_config replaces the agent-level * config in its entirety. */ - // const outputAudioConfigMask = '' + // const outputAudioConfigMask = {} /** * The input audio content to be recognized. Must be sent if * `query_input` was set to a streaming input audio config. The complete audio @@ -87,7 +87,7 @@ function main(session, queryInput) { // Instantiates a client const dialogflowClient = new SessionsClient(); - async function streamingDetectIntent() { + async function callStreamingDetectIntent() { // Construct request const request = { session, @@ -109,7 +109,7 @@ function main(session, queryInput) { stream.end(); } - streamingDetectIntent(); + callStreamingDetectIntent(); // [END dialogflow_v2_generated_Sessions_StreamingDetectIntent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/versions.create_version.js b/packages/google-cloud-dialogflow/samples/generated/v2/versions.create_version.js index be92d55aa4c..431dc512479 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/versions.create_version.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/versions.create_version.js @@ -29,7 +29,7 @@ function main(parent, version) { /** * Required. The version to create. */ - // const version = '' + // const version = {} // Imports the Dialogflow library const {VersionsClient} = require('@google-cloud/dialogflow').v2; @@ -37,7 +37,7 @@ function main(parent, version) { // Instantiates a client const dialogflowClient = new VersionsClient(); - async function createVersion() { + async function callCreateVersion() { // Construct request const request = { parent, @@ -49,7 +49,7 @@ function main(parent, version) { console.log(response); } - createVersion(); + callCreateVersion(); // [END dialogflow_v2_generated_Versions_CreateVersion_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/versions.delete_version.js b/packages/google-cloud-dialogflow/samples/generated/v2/versions.delete_version.js index 1d6f0c6a080..c50eba6d840 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/versions.delete_version.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/versions.delete_version.js @@ -34,7 +34,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new VersionsClient(); - async function deleteVersion() { + async function callDeleteVersion() { // Construct request const request = { name, @@ -45,7 +45,7 @@ function main(name) { console.log(response); } - deleteVersion(); + callDeleteVersion(); // [END dialogflow_v2_generated_Versions_DeleteVersion_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/versions.get_version.js b/packages/google-cloud-dialogflow/samples/generated/v2/versions.get_version.js index fb294cd6f67..2e2abef66cb 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/versions.get_version.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/versions.get_version.js @@ -34,7 +34,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new VersionsClient(); - async function getVersion() { + async function callGetVersion() { // Construct request const request = { name, @@ -45,7 +45,7 @@ function main(name) { console.log(response); } - getVersion(); + callGetVersion(); // [END dialogflow_v2_generated_Versions_GetVersion_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/versions.list_versions.js b/packages/google-cloud-dialogflow/samples/generated/v2/versions.list_versions.js index f459917dda9..a4d30d94d69 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/versions.list_versions.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/versions.list_versions.js @@ -42,7 +42,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new VersionsClient(); - async function listVersions() { + async function callListVersions() { // Construct request const request = { parent, @@ -55,7 +55,7 @@ function main(parent) { } } - listVersions(); + callListVersions(); // [END dialogflow_v2_generated_Versions_ListVersions_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2/versions.update_version.js b/packages/google-cloud-dialogflow/samples/generated/v2/versions.update_version.js index 18d11ac89e1..be19687da8e 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2/versions.update_version.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2/versions.update_version.js @@ -26,11 +26,11 @@ function main(version, updateMask) { * - `projects//locations//agent/versions/` */ - // const version = '' + // const version = {} /** * Required. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {VersionsClient} = require('@google-cloud/dialogflow').v2; @@ -38,7 +38,7 @@ function main(version, updateMask) { // Instantiates a client const dialogflowClient = new VersionsClient(); - async function updateVersion() { + async function callUpdateVersion() { // Construct request const request = { version, @@ -50,7 +50,7 @@ function main(version, updateMask) { console.log(response); } - updateVersion(); + callUpdateVersion(); // [END dialogflow_v2_generated_Versions_UpdateVersion_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.delete_agent.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.delete_agent.js index 99bf4a318fe..ec55a01922c 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.delete_agent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.delete_agent.js @@ -32,7 +32,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function deleteAgent() { + async function callDeleteAgent() { // Construct request const request = { parent, @@ -43,7 +43,7 @@ function main(parent) { console.log(response); } - deleteAgent(); + callDeleteAgent(); // [END dialogflow_v2beta1_generated_Agents_DeleteAgent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.export_agent.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.export_agent.js index a8d65906353..50a2b3318ef 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.export_agent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.export_agent.js @@ -27,7 +27,7 @@ function main(parent) { // const parent = 'abc123' /** * Optional. The - * [Google Cloud Storage](https://cloud.google.com/storage/docs/) + * Google Cloud Storage (https://cloud.google.com/storage/docs/) * URI to export the agent to. * The format of this URI must be `gs:///`. * If left unspecified, the serialized agent is returned inline. @@ -40,7 +40,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function exportAgent() { + async function callExportAgent() { // Construct request const request = { parent, @@ -52,7 +52,7 @@ function main(parent) { console.log(response); } - exportAgent(); + callExportAgent(); // [END dialogflow_v2beta1_generated_Agents_ExportAgent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.get_agent.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.get_agent.js index 5b9d737bbdd..f1df4b9d9d4 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.get_agent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.get_agent.js @@ -32,7 +32,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function getAgent() { + async function callGetAgent() { // Construct request const request = { parent, @@ -43,7 +43,7 @@ function main(parent) { console.log(response); } - getAgent(); + callGetAgent(); // [END dialogflow_v2beta1_generated_Agents_GetAgent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.get_validation_result.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.get_validation_result.js index d63e308d9d6..a0c75ce06eb 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.get_validation_result.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.get_validation_result.js @@ -27,8 +27,8 @@ function main(parent) { // const parent = 'abc123' /** * Optional. The language for which you want a validation result. If not - * specified, the agent's default language is used. [Many - * languages](https://cloud.google.com/dialogflow/docs/reference/language) + * specified, the agent's default language is used. Many + * languages (https://cloud.google.com/dialogflow/docs/reference/language) * are supported. Note: languages must be enabled in the agent before they can * be used. */ @@ -40,7 +40,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function getValidationResult() { + async function callGetValidationResult() { // Construct request const request = { parent, @@ -51,7 +51,7 @@ function main(parent) { console.log(response); } - getValidationResult(); + callGetValidationResult(); // [END dialogflow_v2beta1_generated_Agents_GetValidationResult_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.import_agent.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.import_agent.js index e103013e97b..f1645093471 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.import_agent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.import_agent.js @@ -41,7 +41,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function importAgent() { + async function callImportAgent() { // Construct request const request = { parent, @@ -53,7 +53,7 @@ function main(parent) { console.log(response); } - importAgent(); + callImportAgent(); // [END dialogflow_v2beta1_generated_Agents_ImportAgent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.restore_agent.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.restore_agent.js index 2aece129733..48cfcf99bc1 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.restore_agent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.restore_agent.js @@ -41,7 +41,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function restoreAgent() { + async function callRestoreAgent() { // Construct request const request = { parent, @@ -53,7 +53,7 @@ function main(parent) { console.log(response); } - restoreAgent(); + callRestoreAgent(); // [END dialogflow_v2beta1_generated_Agents_RestoreAgent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.search_agents.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.search_agents.js index 2aaa602a96c..afbcf10c924 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.search_agents.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.search_agents.js @@ -41,7 +41,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function searchAgents() { + async function callSearchAgents() { // Construct request const request = { parent, @@ -54,7 +54,7 @@ function main(parent) { } } - searchAgents(); + callSearchAgents(); // [END dialogflow_v2beta1_generated_Agents_SearchAgents_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.set_agent.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.set_agent.js index 0d652315e52..a0e19d34798 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.set_agent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.set_agent.js @@ -22,11 +22,11 @@ function main(agent) { /** * Required. The agent to update. */ - // const agent = '' + // const agent = {} /** * Optional. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {AgentsClient} = require('@google-cloud/dialogflow').v2beta1; @@ -34,7 +34,7 @@ function main(agent) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function setAgent() { + async function callSetAgent() { // Construct request const request = { agent, @@ -45,7 +45,7 @@ function main(agent) { console.log(response); } - setAgent(); + callSetAgent(); // [END dialogflow_v2beta1_generated_Agents_SetAgent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.train_agent.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.train_agent.js index cb3cbb7d054..45b2026716d 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.train_agent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/agents.train_agent.js @@ -32,7 +32,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new AgentsClient(); - async function trainAgent() { + async function callTrainAgent() { // Construct request const request = { parent, @@ -44,7 +44,7 @@ function main(parent) { console.log(response); } - trainAgent(); + callTrainAgent(); // [END dialogflow_v2beta1_generated_Agents_TrainAgent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/answer_records.get_answer_record.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/answer_records.get_answer_record.js index bf4f628a8bc..4f33de4b16e 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/answer_records.get_answer_record.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/answer_records.get_answer_record.js @@ -32,7 +32,7 @@ function main() { // Instantiates a client const dialogflowClient = new AnswerRecordsClient(); - async function getAnswerRecord() { + async function callGetAnswerRecord() { // Construct request const request = {}; @@ -41,7 +41,7 @@ function main() { console.log(response); } - getAnswerRecord(); + callGetAnswerRecord(); // [END dialogflow_v2beta1_generated_AnswerRecords_GetAnswerRecord_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/answer_records.list_answer_records.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/answer_records.list_answer_records.js index 1e23d6feb90..626c1ca4676 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/answer_records.list_answer_records.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/answer_records.list_answer_records.js @@ -33,7 +33,7 @@ function main() { // const pageSize = 1234 /** * Optional. The - * [ListAnswerRecordsResponse.next_page_token][google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse.next_page_token] + * ListAnswerRecordsResponse.next_page_token google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse.next_page_token * value returned from a previous list request used to continue listing on * the next page. */ @@ -45,7 +45,7 @@ function main() { // Instantiates a client const dialogflowClient = new AnswerRecordsClient(); - async function listAnswerRecords() { + async function callListAnswerRecords() { // Construct request const request = {}; @@ -56,7 +56,7 @@ function main() { } } - listAnswerRecords(); + callListAnswerRecords(); // [END dialogflow_v2beta1_generated_AnswerRecords_ListAnswerRecords_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/answer_records.update_answer_record.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/answer_records.update_answer_record.js index 1bc87c0fe2f..914a599ad3e 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/answer_records.update_answer_record.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/answer_records.update_answer_record.js @@ -22,11 +22,11 @@ function main(answerRecord) { /** * Required. Answer record to update. */ - // const answerRecord = '' + // const answerRecord = {} /** * Required. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {AnswerRecordsClient} = require('@google-cloud/dialogflow').v2beta1; @@ -34,7 +34,7 @@ function main(answerRecord) { // Instantiates a client const dialogflowClient = new AnswerRecordsClient(); - async function updateAnswerRecord() { + async function callUpdateAnswerRecord() { // Construct request const request = { answerRecord, @@ -45,7 +45,7 @@ function main(answerRecord) { console.log(response); } - updateAnswerRecord(); + callUpdateAnswerRecord(); // [END dialogflow_v2beta1_generated_AnswerRecords_UpdateAnswerRecord_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.create_context.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.create_context.js index ba295b92351..042977db8b6 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.create_context.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.create_context.js @@ -37,7 +37,7 @@ function main(parent, context) { /** * Required. The context to create. */ - // const context = '' + // const context = {} // Imports the Dialogflow library const {ContextsClient} = require('@google-cloud/dialogflow').v2beta1; @@ -45,7 +45,7 @@ function main(parent, context) { // Instantiates a client const dialogflowClient = new ContextsClient(); - async function createContext() { + async function callCreateContext() { // Construct request const request = { parent, @@ -57,7 +57,7 @@ function main(parent, context) { console.log(response); } - createContext(); + callCreateContext(); // [END dialogflow_v2beta1_generated_Contexts_CreateContext_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.delete_all_contexts.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.delete_all_contexts.js index 4101c1daddf..18916f3b095 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.delete_all_contexts.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.delete_all_contexts.js @@ -41,7 +41,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new ContextsClient(); - async function deleteAllContexts() { + async function callDeleteAllContexts() { // Construct request const request = { parent, @@ -52,7 +52,7 @@ function main(parent) { console.log(response); } - deleteAllContexts(); + callDeleteAllContexts(); // [END dialogflow_v2beta1_generated_Contexts_DeleteAllContexts_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.delete_context.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.delete_context.js index 064baa0a7c7..eb72b3129ff 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.delete_context.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.delete_context.js @@ -42,7 +42,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new ContextsClient(); - async function deleteContext() { + async function callDeleteContext() { // Construct request const request = { name, @@ -53,7 +53,7 @@ function main(name) { console.log(response); } - deleteContext(); + callDeleteContext(); // [END dialogflow_v2beta1_generated_Contexts_DeleteContext_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.get_context.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.get_context.js index 8a9f74655ce..5d47cec4a3b 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.get_context.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.get_context.js @@ -42,7 +42,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new ContextsClient(); - async function getContext() { + async function callGetContext() { // Construct request const request = { name, @@ -53,7 +53,7 @@ function main(name) { console.log(response); } - getContext(); + callGetContext(); // [END dialogflow_v2beta1_generated_Contexts_GetContext_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.list_contexts.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.list_contexts.js index f81fc04504b..ad1472ae891 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.list_contexts.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.list_contexts.js @@ -50,7 +50,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new ContextsClient(); - async function listContexts() { + async function callListContexts() { // Construct request const request = { parent, @@ -63,7 +63,7 @@ function main(parent) { } } - listContexts(); + callListContexts(); // [END dialogflow_v2beta1_generated_Contexts_ListContexts_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.update_context.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.update_context.js index ab272d0c397..627099f1d7d 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.update_context.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/contexts.update_context.js @@ -22,11 +22,11 @@ function main(context) { /** * Required. The context to update. */ - // const context = '' + // const context = {} /** * Optional. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {ContextsClient} = require('@google-cloud/dialogflow').v2beta1; @@ -34,7 +34,7 @@ function main(context) { // Instantiates a client const dialogflowClient = new ContextsClient(); - async function updateContext() { + async function callUpdateContext() { // Construct request const request = { context, @@ -45,7 +45,7 @@ function main(context) { console.log(response); } - updateContext(); + callUpdateContext(); // [END dialogflow_v2beta1_generated_Contexts_UpdateContext_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.create_conversation_profile.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.create_conversation_profile.js index 3fba222bfc1..79a4cca07ac 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.create_conversation_profile.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.create_conversation_profile.js @@ -27,7 +27,7 @@ function main(parent, conversationProfile) { /** * Required. The conversation profile to create. */ - // const conversationProfile = '' + // const conversationProfile = {} // Imports the Dialogflow library const {ConversationProfilesClient} = @@ -36,7 +36,7 @@ function main(parent, conversationProfile) { // Instantiates a client const dialogflowClient = new ConversationProfilesClient(); - async function createConversationProfile() { + async function callCreateConversationProfile() { // Construct request const request = { parent, @@ -48,7 +48,7 @@ function main(parent, conversationProfile) { console.log(response); } - createConversationProfile(); + callCreateConversationProfile(); // [END dialogflow_v2beta1_generated_ConversationProfiles_CreateConversationProfile_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.delete_conversation_profile.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.delete_conversation_profile.js index bead81700b6..43b6079ce83 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.delete_conversation_profile.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.delete_conversation_profile.js @@ -33,7 +33,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new ConversationProfilesClient(); - async function deleteConversationProfile() { + async function callDeleteConversationProfile() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - deleteConversationProfile(); + callDeleteConversationProfile(); // [END dialogflow_v2beta1_generated_ConversationProfiles_DeleteConversationProfile_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.get_conversation_profile.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.get_conversation_profile.js index 50ba5ecdec6..efb5e4303ec 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.get_conversation_profile.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.get_conversation_profile.js @@ -33,7 +33,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new ConversationProfilesClient(); - async function getConversationProfile() { + async function callGetConversationProfile() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - getConversationProfile(); + callGetConversationProfile(); // [END dialogflow_v2beta1_generated_ConversationProfiles_GetConversationProfile_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.list_conversation_profiles.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.list_conversation_profiles.js index 5cf26e1ee9d..fe8830a8a4d 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.list_conversation_profiles.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.list_conversation_profiles.js @@ -41,7 +41,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new ConversationProfilesClient(); - async function listConversationProfiles() { + async function callListConversationProfiles() { // Construct request const request = { parent, @@ -56,7 +56,7 @@ function main(parent) { } } - listConversationProfiles(); + callListConversationProfiles(); // [END dialogflow_v2beta1_generated_ConversationProfiles_ListConversationProfiles_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.update_conversation_profile.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.update_conversation_profile.js index 00de3dc5223..f826203d07d 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.update_conversation_profile.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversation_profiles.update_conversation_profile.js @@ -22,11 +22,11 @@ function main(conversationProfile, updateMask) { /** * Required. The conversation profile to update. */ - // const conversationProfile = '' + // const conversationProfile = {} /** * Required. The mask to control which fields to update. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {ConversationProfilesClient} = @@ -35,7 +35,7 @@ function main(conversationProfile, updateMask) { // Instantiates a client const dialogflowClient = new ConversationProfilesClient(); - async function updateConversationProfile() { + async function callUpdateConversationProfile() { // Construct request const request = { conversationProfile, @@ -47,7 +47,7 @@ function main(conversationProfile, updateMask) { console.log(response); } - updateConversationProfile(); + callUpdateConversationProfile(); // [END dialogflow_v2beta1_generated_ConversationProfiles_UpdateConversationProfile_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.batch_create_messages.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.batch_create_messages.js index a70bb19b0e7..9d15aba9036 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.batch_create_messages.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.batch_create_messages.js @@ -27,8 +27,8 @@ function main(parent, requests) { // const parent = 'abc123' /** * Required. A maximum of 1000 Messages can be created in a batch. - * [CreateMessageRequest.message.send_time][] is required. All created - * messages will have identical [Message.create_time][google.cloud.dialogflow.v2beta1.Message.create_time]. + * CreateMessageRequest.message.send_time is required. All created + * messages will have identical Message.create_time google.cloud.dialogflow.v2beta1.Message.create_time. */ // const requests = 1234 @@ -38,7 +38,7 @@ function main(parent, requests) { // Instantiates a client const dialogflowClient = new ConversationsClient(); - async function batchCreateMessages() { + async function callBatchCreateMessages() { // Construct request const request = { parent, @@ -50,7 +50,7 @@ function main(parent, requests) { console.log(response); } - batchCreateMessages(); + callBatchCreateMessages(); // [END dialogflow_v2beta1_generated_Conversations_BatchCreateMessages_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.complete_conversation.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.complete_conversation.js index ae04e94d30c..45b088da41f 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.complete_conversation.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.complete_conversation.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new ConversationsClient(); - async function completeConversation() { + async function callCompleteConversation() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - completeConversation(); + callCompleteConversation(); // [END dialogflow_v2beta1_generated_Conversations_CompleteConversation_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.create_conversation.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.create_conversation.js index 9c8a81b74f3..e78dbb31db4 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.create_conversation.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.create_conversation.js @@ -27,13 +27,13 @@ function main(parent, conversation) { /** * Required. The conversation to create. */ - // const conversation = '' + // const conversation = {} /** * Optional. Identifier of the conversation. Generally it's auto generated by Google. * Only set it if you cannot wait for the response to return a * auto-generated one to you. * The conversation ID must be compliant with the regression fomula - * "[a-zA-Z][a-zA-Z0-9_-]*" with the characters length in range of [3,64]. + * "a-zA-Z a-zA-Z0-9_-*" with the characters length in range of 3,64. * If the field is provided, the caller is resposible for * 1. the uniqueness of the ID, otherwise the request will be rejected. * 2. the consistency for whether to use custom ID or not under a project to @@ -47,7 +47,7 @@ function main(parent, conversation) { // Instantiates a client const dialogflowClient = new ConversationsClient(); - async function createConversation() { + async function callCreateConversation() { // Construct request const request = { parent, @@ -59,7 +59,7 @@ function main(parent, conversation) { console.log(response); } - createConversation(); + callCreateConversation(); // [END dialogflow_v2beta1_generated_Conversations_CreateConversation_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.get_conversation.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.get_conversation.js index 27e47679e42..8dc25279829 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.get_conversation.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.get_conversation.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new ConversationsClient(); - async function getConversation() { + async function callGetConversation() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getConversation(); + callGetConversation(); // [END dialogflow_v2beta1_generated_Conversations_GetConversation_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.list_conversations.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.list_conversations.js index 0aac35e13b8..9a2d463cca4 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.list_conversations.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.list_conversations.js @@ -48,7 +48,7 @@ function main(parent) { * the following expression only returns `COMPLETED` conversations: * `lifecycle_state = "COMPLETED"` * For more information about filtering, see - * [API Filtering](https://aip.dev/160). + * API Filtering (https://aip.dev/160). */ // const filter = 'abc123' @@ -58,7 +58,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new ConversationsClient(); - async function listConversations() { + async function callListConversations() { // Construct request const request = { parent, @@ -71,7 +71,7 @@ function main(parent) { } } - listConversations(); + callListConversations(); // [END dialogflow_v2beta1_generated_Conversations_ListConversations_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.list_messages.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.list_messages.js index 707ca4666e4..ce2a4ff9ea4 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.list_messages.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/conversations.list_messages.js @@ -32,7 +32,7 @@ function main(parent) { * `create_time_epoch_microseconds > 1551790877964485` or * `create_time > "2017-01-15T01:30:15.01Z"`. * For more information about filtering, see - * [API Filtering](https://aip.dev/160). + * API Filtering (https://aip.dev/160). */ // const filter = 'abc123' /** @@ -51,7 +51,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new ConversationsClient(); - async function listMessages() { + async function callListMessages() { // Construct request const request = { parent, @@ -64,7 +64,7 @@ function main(parent) { } } - listMessages(); + callListMessages(); // [END dialogflow_v2beta1_generated_Conversations_ListMessages_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.create_document.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.create_document.js index 8b50192c9ce..1b2e93eae60 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.create_document.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.create_document.js @@ -28,7 +28,7 @@ function main(parent, document) { /** * Required. The document to create. */ - // const document = '' + // const document = {} /** * Whether to import custom metadata from Google Cloud Storage. * Only valid when the document source is Google Cloud Storage URI. @@ -41,7 +41,7 @@ function main(parent, document) { // Instantiates a client const dialogflowClient = new DocumentsClient(); - async function createDocument() { + async function callCreateDocument() { // Construct request const request = { parent, @@ -54,7 +54,7 @@ function main(parent, document) { console.log(response); } - createDocument(); + callCreateDocument(); // [END dialogflow_v2beta1_generated_Documents_CreateDocument_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.delete_document.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.delete_document.js index 64abf22f899..37ec181cd70 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.delete_document.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.delete_document.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new DocumentsClient(); - async function deleteDocument() { + async function callDeleteDocument() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - deleteDocument(); + callDeleteDocument(); // [END dialogflow_v2beta1_generated_Documents_DeleteDocument_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.get_document.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.get_document.js index 9fe147690d1..345f742862c 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.get_document.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.get_document.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new DocumentsClient(); - async function getDocument() { + async function callGetDocument() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getDocument(); + callGetDocument(); // [END dialogflow_v2beta1_generated_Documents_GetDocument_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.import_documents.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.import_documents.js index f344e3c4dbc..32bef82a73f 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.import_documents.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.import_documents.js @@ -32,11 +32,11 @@ function main(parent, documentTemplate) { * `gs:///`. * `gs:////*.`. */ - // const gcsSource = '' + // const gcsSource = {} /** * Required. Document template used for importing all the documents. */ - // const documentTemplate = '' + // const documentTemplate = {} /** * Whether to import custom metadata from Google Cloud Storage. * Only valid when the document source is Google Cloud Storage URI. @@ -49,7 +49,7 @@ function main(parent, documentTemplate) { // Instantiates a client const dialogflowClient = new DocumentsClient(); - async function importDocuments() { + async function callImportDocuments() { // Construct request const request = { parent, @@ -62,7 +62,7 @@ function main(parent, documentTemplate) { console.log(response); } - importDocuments(); + callImportDocuments(); // [END dialogflow_v2beta1_generated_Documents_ImportDocuments_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.list_documents.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.list_documents.js index 805d44e2821..38a70a1c34c 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.list_documents.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.list_documents.js @@ -37,7 +37,7 @@ function main(parent) { /** * The filter expression used to filter documents returned by the list method. * The expression has the following syntax: - * [AND ] ... + * AND ... * The following fields and operators are supported: * * knowledge_types with has(:) operator * * display_name with has(:) operator @@ -49,7 +49,7 @@ function main(parent) { * * "state=ACTIVE" matches documents with ACTIVE state. * * "knowledge_types:FAQ AND state=ACTIVE" matches all active FAQ documents. * For more information about filtering, see - * [API Filtering](https://aip.dev/160). + * API Filtering (https://aip.dev/160). */ // const filter = 'abc123' @@ -59,7 +59,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new DocumentsClient(); - async function listDocuments() { + async function callListDocuments() { // Construct request const request = { parent, @@ -72,7 +72,7 @@ function main(parent) { } } - listDocuments(); + callListDocuments(); // [END dialogflow_v2beta1_generated_Documents_ListDocuments_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.reload_document.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.reload_document.js index 0b58bf4e7de..9f3c0d1d842 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.reload_document.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.reload_document.js @@ -29,7 +29,7 @@ function main(name) { * The path for a Cloud Storage source file for reloading document content. * If not provided, the Document's existing source will be reloaded. */ - // const gcsSource = '' + // const gcsSource = {} /** * Whether to import custom metadata from Google Cloud Storage. * Only valid when the document source is Google Cloud Storage URI. @@ -42,7 +42,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new DocumentsClient(); - async function reloadDocument() { + async function callReloadDocument() { // Construct request const request = { name, @@ -54,7 +54,7 @@ function main(name) { console.log(response); } - reloadDocument(); + callReloadDocument(); // [END dialogflow_v2beta1_generated_Documents_ReloadDocument_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.update_document.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.update_document.js index fc5aec6e841..de674226ad3 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.update_document.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/documents.update_document.js @@ -22,13 +22,13 @@ function main(document) { /** * Required. The document to update. */ - // const document = '' + // const document = {} /** * Optional. Not specified means `update all`. * Currently, only `display_name` can be updated, an InvalidArgument will be * returned for attempting to update other fields. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {DocumentsClient} = require('@google-cloud/dialogflow').v2beta1; @@ -36,7 +36,7 @@ function main(document) { // Instantiates a client const dialogflowClient = new DocumentsClient(); - async function updateDocument() { + async function callUpdateDocument() { // Construct request const request = { document, @@ -48,7 +48,7 @@ function main(document) { console.log(response); } - updateDocument(); + callUpdateDocument(); // [END dialogflow_v2beta1_generated_Documents_UpdateDocument_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_create_entities.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_create_entities.js index 6f421960be8..0a9f120dfcd 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_create_entities.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_create_entities.js @@ -35,8 +35,8 @@ function main(parent, entities) { * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' @@ -46,7 +46,7 @@ function main(parent, entities) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function batchCreateEntities() { + async function callBatchCreateEntities() { // Construct request const request = { parent, @@ -59,7 +59,7 @@ function main(parent, entities) { console.log(response); } - batchCreateEntities(); + callBatchCreateEntities(); // [END dialogflow_v2beta1_generated_EntityTypes_BatchCreateEntities_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_delete_entities.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_delete_entities.js index b9152b672e2..ed029de26a9 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_delete_entities.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_delete_entities.js @@ -37,8 +37,8 @@ function main(parent, entityValues) { * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' @@ -48,7 +48,7 @@ function main(parent, entityValues) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function batchDeleteEntities() { + async function callBatchDeleteEntities() { // Construct request const request = { parent, @@ -61,7 +61,7 @@ function main(parent, entityValues) { console.log(response); } - batchDeleteEntities(); + callBatchDeleteEntities(); // [END dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntities_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_delete_entity_types.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_delete_entity_types.js index 6d7c721be1d..b49200a4fc9 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_delete_entity_types.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_delete_entity_types.js @@ -38,7 +38,7 @@ function main(parent, entityTypeNames) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function batchDeleteEntityTypes() { + async function callBatchDeleteEntityTypes() { // Construct request const request = { parent, @@ -51,7 +51,7 @@ function main(parent, entityTypeNames) { console.log(response); } - batchDeleteEntityTypes(); + callBatchDeleteEntityTypes(); // [END dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntityTypes_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_update_entities.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_update_entities.js index 7c98966e496..f3e208ced1e 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_update_entities.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_update_entities.js @@ -35,14 +35,14 @@ function main(parent, entities) { * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** * Optional. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {EntityTypesClient} = require('@google-cloud/dialogflow').v2beta1; @@ -50,7 +50,7 @@ function main(parent, entities) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function batchUpdateEntities() { + async function callBatchUpdateEntities() { // Construct request const request = { parent, @@ -63,7 +63,7 @@ function main(parent, entities) { console.log(response); } - batchUpdateEntities(); + callBatchUpdateEntities(); // [END dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntities_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_update_entity_types.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_update_entity_types.js index b053bf0324c..dd0116622e2 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_update_entity_types.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.batch_update_entity_types.js @@ -36,19 +36,19 @@ function main(parent) { /** * The collection of entity types to update or create. */ - // const entityTypeBatchInline = '' + // const entityTypeBatchInline = {} /** * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** * Optional. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {EntityTypesClient} = require('@google-cloud/dialogflow').v2beta1; @@ -56,7 +56,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function batchUpdateEntityTypes() { + async function callBatchUpdateEntityTypes() { // Construct request const request = { parent, @@ -68,7 +68,7 @@ function main(parent) { console.log(response); } - batchUpdateEntityTypes(); + callBatchUpdateEntityTypes(); // [END dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntityTypes_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.create_entity_type.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.create_entity_type.js index c1de9ddc995..80e33c1555d 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.create_entity_type.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.create_entity_type.js @@ -29,13 +29,13 @@ function main(parent, entityType) { /** * Required. The entity type to create. */ - // const entityType = '' + // const entityType = {} /** * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' @@ -45,7 +45,7 @@ function main(parent, entityType) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function createEntityType() { + async function callCreateEntityType() { // Construct request const request = { parent, @@ -57,7 +57,7 @@ function main(parent, entityType) { console.log(response); } - createEntityType(); + callCreateEntityType(); // [END dialogflow_v2beta1_generated_EntityTypes_CreateEntityType_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.delete_entity_type.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.delete_entity_type.js index 4f93afdfbe3..28b5e389c0d 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.delete_entity_type.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.delete_entity_type.js @@ -34,7 +34,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function deleteEntityType() { + async function callDeleteEntityType() { // Construct request const request = { name, @@ -45,7 +45,7 @@ function main(name) { console.log(response); } - deleteEntityType(); + callDeleteEntityType(); // [END dialogflow_v2beta1_generated_EntityTypes_DeleteEntityType_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.get_entity_type.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.get_entity_type.js index 37a910908c3..d32c2567ba4 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.get_entity_type.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.get_entity_type.js @@ -31,8 +31,8 @@ function main(name) { * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' @@ -42,7 +42,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function getEntityType() { + async function callGetEntityType() { // Construct request const request = { name, @@ -53,7 +53,7 @@ function main(name) { console.log(response); } - getEntityType(); + callGetEntityType(); // [END dialogflow_v2beta1_generated_EntityTypes_GetEntityType_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.list_entity_types.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.list_entity_types.js index b0bc1cfca5c..64fa4f50256 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.list_entity_types.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.list_entity_types.js @@ -30,8 +30,8 @@ function main(parent) { * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** @@ -50,7 +50,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function listEntityTypes() { + async function callListEntityTypes() { // Construct request const request = { parent, @@ -63,7 +63,7 @@ function main(parent) { } } - listEntityTypes(); + callListEntityTypes(); // [END dialogflow_v2beta1_generated_EntityTypes_ListEntityTypes_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.update_entity_type.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.update_entity_type.js index df8e735e082..dfe66ec97bc 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.update_entity_type.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/entity_types.update_entity_type.js @@ -22,19 +22,19 @@ function main(entityType) { /** * Required. The entity type to update. */ - // const entityType = '' + // const entityType = {} /** * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** * Optional. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {EntityTypesClient} = require('@google-cloud/dialogflow').v2beta1; @@ -42,7 +42,7 @@ function main(entityType) { // Instantiates a client const dialogflowClient = new EntityTypesClient(); - async function updateEntityType() { + async function callUpdateEntityType() { // Construct request const request = { entityType, @@ -53,7 +53,7 @@ function main(entityType) { console.log(response); } - updateEntityType(); + callUpdateEntityType(); // [END dialogflow_v2beta1_generated_EntityTypes_UpdateEntityType_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.create_environment.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.create_environment.js index ba49f0b2e7d..4db9c08a5d9 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.create_environment.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.create_environment.js @@ -29,7 +29,7 @@ function main(parent, environment, environmentId) { /** * Required. The environment to create. */ - // const environment = '' + // const environment = {} /** * Required. The unique id of the new environment. */ @@ -41,7 +41,7 @@ function main(parent, environment, environmentId) { // Instantiates a client const dialogflowClient = new EnvironmentsClient(); - async function createEnvironment() { + async function callCreateEnvironment() { // Construct request const request = { parent, @@ -54,7 +54,7 @@ function main(parent, environment, environmentId) { console.log(response); } - createEnvironment(); + callCreateEnvironment(); // [END dialogflow_v2beta1_generated_Environments_CreateEnvironment_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.delete_environment.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.delete_environment.js index 72e91733e86..6c16cedf626 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.delete_environment.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.delete_environment.js @@ -34,7 +34,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new EnvironmentsClient(); - async function deleteEnvironment() { + async function callDeleteEnvironment() { // Construct request const request = { name, @@ -45,7 +45,7 @@ function main(name) { console.log(response); } - deleteEnvironment(); + callDeleteEnvironment(); // [END dialogflow_v2beta1_generated_Environments_DeleteEnvironment_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.get_environment.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.get_environment.js index 70ab6b2eddb..ce28c8707c0 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.get_environment.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.get_environment.js @@ -34,7 +34,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new EnvironmentsClient(); - async function getEnvironment() { + async function callGetEnvironment() { // Construct request const request = { name, @@ -45,7 +45,7 @@ function main(name) { console.log(response); } - getEnvironment(); + callGetEnvironment(); // [END dialogflow_v2beta1_generated_Environments_GetEnvironment_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.get_environment_history.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.get_environment_history.js index 16a1061c74e..291c8a03bb0 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.get_environment_history.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.get_environment_history.js @@ -43,7 +43,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new EnvironmentsClient(); - async function getEnvironmentHistory() { + async function callGetEnvironmentHistory() { // Construct request const request = { parent, @@ -56,7 +56,7 @@ function main(parent) { } } - getEnvironmentHistory(); + callGetEnvironmentHistory(); // [END dialogflow_v2beta1_generated_Environments_GetEnvironmentHistory_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.list_environments.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.list_environments.js index 6c0af68dafe..6bbee880287 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.list_environments.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.list_environments.js @@ -42,7 +42,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new EnvironmentsClient(); - async function listEnvironments() { + async function callListEnvironments() { // Construct request const request = { parent, @@ -55,7 +55,7 @@ function main(parent) { } } - listEnvironments(); + callListEnvironments(); // [END dialogflow_v2beta1_generated_Environments_ListEnvironments_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.update_environment.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.update_environment.js index b1e5e4585f5..77e0d94731f 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.update_environment.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/environments.update_environment.js @@ -22,11 +22,11 @@ function main(environment, updateMask) { /** * Required. The environment to update. */ - // const environment = '' + // const environment = {} /** * Required. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} /** * Optional. This field is used to prevent accidental overwrite of the draft * environment, which is an operation that cannot be undone. To confirm that @@ -41,7 +41,7 @@ function main(environment, updateMask) { // Instantiates a client const dialogflowClient = new EnvironmentsClient(); - async function updateEnvironment() { + async function callUpdateEnvironment() { // Construct request const request = { environment, @@ -53,7 +53,7 @@ function main(environment, updateMask) { console.log(response); } - updateEnvironment(); + callUpdateEnvironment(); // [END dialogflow_v2beta1_generated_Environments_UpdateEnvironment_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/fulfillments.get_fulfillment.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/fulfillments.get_fulfillment.js index 0e9f5783d4a..fc44c0c800a 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/fulfillments.get_fulfillment.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/fulfillments.get_fulfillment.js @@ -33,7 +33,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new FulfillmentsClient(); - async function getFulfillment() { + async function callGetFulfillment() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - getFulfillment(); + callGetFulfillment(); // [END dialogflow_v2beta1_generated_Fulfillments_GetFulfillment_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/fulfillments.update_fulfillment.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/fulfillments.update_fulfillment.js index 4d9394194eb..951ce822edc 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/fulfillments.update_fulfillment.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/fulfillments.update_fulfillment.js @@ -22,12 +22,12 @@ function main(fulfillment, updateMask) { /** * Required. The fulfillment to update. */ - // const fulfillment = '' + // const fulfillment = {} /** * Required. The mask to control which fields get updated. If the mask is not * present, all fields will be updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {FulfillmentsClient} = require('@google-cloud/dialogflow').v2beta1; @@ -35,7 +35,7 @@ function main(fulfillment, updateMask) { // Instantiates a client const dialogflowClient = new FulfillmentsClient(); - async function updateFulfillment() { + async function callUpdateFulfillment() { // Construct request const request = { fulfillment, @@ -47,7 +47,7 @@ function main(fulfillment, updateMask) { console.log(response); } - updateFulfillment(); + callUpdateFulfillment(); // [END dialogflow_v2beta1_generated_Fulfillments_UpdateFulfillment_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.batch_delete_intents.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.batch_delete_intents.js index f421cd7a8f4..78bc7f381ab 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.batch_delete_intents.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.batch_delete_intents.js @@ -38,7 +38,7 @@ function main(parent, intents) { // Instantiates a client const dialogflowClient = new IntentsClient(); - async function batchDeleteIntents() { + async function callBatchDeleteIntents() { // Construct request const request = { parent, @@ -51,7 +51,7 @@ function main(parent, intents) { console.log(response); } - batchDeleteIntents(); + callBatchDeleteIntents(); // [END dialogflow_v2beta1_generated_Intents_BatchDeleteIntents_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.batch_update_intents.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.batch_update_intents.js index 954f927a4f0..4b60e136b6a 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.batch_update_intents.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.batch_update_intents.js @@ -35,23 +35,23 @@ function main(parent) { /** * The collection of intents to update or create. */ - // const intentBatchInline = '' + // const intentBatchInline = {} /** * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** * Optional. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} /** * Optional. The resource view to apply to the returned intent. */ - // const intentView = '' + // const intentView = {} // Imports the Dialogflow library const {IntentsClient} = require('@google-cloud/dialogflow').v2beta1; @@ -59,7 +59,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new IntentsClient(); - async function batchUpdateIntents() { + async function callBatchUpdateIntents() { // Construct request const request = { parent, @@ -71,7 +71,7 @@ function main(parent) { console.log(response); } - batchUpdateIntents(); + callBatchUpdateIntents(); // [END dialogflow_v2beta1_generated_Intents_BatchUpdateIntents_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.create_intent.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.create_intent.js index 4c685df32d9..5871020e55e 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.create_intent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.create_intent.js @@ -29,19 +29,19 @@ function main(parent, intent) { /** * Required. The intent to create. */ - // const intent = '' + // const intent = {} /** * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** * Optional. The resource view to apply to the returned intent. */ - // const intentView = '' + // const intentView = {} // Imports the Dialogflow library const {IntentsClient} = require('@google-cloud/dialogflow').v2beta1; @@ -49,7 +49,7 @@ function main(parent, intent) { // Instantiates a client const dialogflowClient = new IntentsClient(); - async function createIntent() { + async function callCreateIntent() { // Construct request const request = { parent, @@ -61,7 +61,7 @@ function main(parent, intent) { console.log(response); } - createIntent(); + callCreateIntent(); // [END dialogflow_v2beta1_generated_Intents_CreateIntent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.delete_intent.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.delete_intent.js index 8c13437d783..65936120ad9 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.delete_intent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.delete_intent.js @@ -34,7 +34,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new IntentsClient(); - async function deleteIntent() { + async function callDeleteIntent() { // Construct request const request = { name, @@ -45,7 +45,7 @@ function main(name) { console.log(response); } - deleteIntent(); + callDeleteIntent(); // [END dialogflow_v2beta1_generated_Intents_DeleteIntent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.get_intent.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.get_intent.js index de18d612635..424dc56aa85 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.get_intent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.get_intent.js @@ -30,14 +30,14 @@ function main(name) { * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** * Optional. The resource view to apply to the returned intent. */ - // const intentView = '' + // const intentView = {} // Imports the Dialogflow library const {IntentsClient} = require('@google-cloud/dialogflow').v2beta1; @@ -45,7 +45,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new IntentsClient(); - async function getIntent() { + async function callGetIntent() { // Construct request const request = { name, @@ -56,7 +56,7 @@ function main(name) { console.log(response); } - getIntent(); + callGetIntent(); // [END dialogflow_v2beta1_generated_Intents_GetIntent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.list_intents.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.list_intents.js index 623c395a488..80d7238c213 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.list_intents.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.list_intents.js @@ -35,14 +35,14 @@ function main(parent) { * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** * Optional. The resource view to apply to the returned intent. */ - // const intentView = '' + // const intentView = {} /** * Optional. The maximum number of items to return in a single page. By * default 100 and at most 1000. @@ -59,7 +59,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new IntentsClient(); - async function listIntents() { + async function callListIntents() { // Construct request const request = { parent, @@ -72,7 +72,7 @@ function main(parent) { } } - listIntents(); + callListIntents(); // [END dialogflow_v2beta1_generated_Intents_ListIntents_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.update_intent.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.update_intent.js index 989524e851f..92481ef3544 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.update_intent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/intents.update_intent.js @@ -22,23 +22,23 @@ function main(intent) { /** * Required. The intent to update. */ - // const intent = '' + // const intent = {} /** * Optional. The language used to access language-specific data. * If not specified, the agent's default language is used. * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * Multilingual intent and entity + * data (https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). */ // const languageCode = 'abc123' /** * Optional. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} /** * Optional. The resource view to apply to the returned intent. */ - // const intentView = '' + // const intentView = {} // Imports the Dialogflow library const {IntentsClient} = require('@google-cloud/dialogflow').v2beta1; @@ -46,7 +46,7 @@ function main(intent) { // Instantiates a client const dialogflowClient = new IntentsClient(); - async function updateIntent() { + async function callUpdateIntent() { // Construct request const request = { intent, @@ -57,7 +57,7 @@ function main(intent) { console.log(response); } - updateIntent(); + callUpdateIntent(); // [END dialogflow_v2beta1_generated_Intents_UpdateIntent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.create_knowledge_base.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.create_knowledge_base.js index 4a3a79cab4b..4e3a170d3e5 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.create_knowledge_base.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.create_knowledge_base.js @@ -27,7 +27,7 @@ function main(parent, knowledgeBase) { /** * Required. The knowledge base to create. */ - // const knowledgeBase = '' + // const knowledgeBase = {} // Imports the Dialogflow library const {KnowledgeBasesClient} = require('@google-cloud/dialogflow').v2beta1; @@ -35,7 +35,7 @@ function main(parent, knowledgeBase) { // Instantiates a client const dialogflowClient = new KnowledgeBasesClient(); - async function createKnowledgeBase() { + async function callCreateKnowledgeBase() { // Construct request const request = { parent, @@ -47,7 +47,7 @@ function main(parent, knowledgeBase) { console.log(response); } - createKnowledgeBase(); + callCreateKnowledgeBase(); // [END dialogflow_v2beta1_generated_KnowledgeBases_CreateKnowledgeBase_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.delete_knowledge_base.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.delete_knowledge_base.js index 3bd604aed87..59541a1dda6 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.delete_knowledge_base.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.delete_knowledge_base.js @@ -37,7 +37,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new KnowledgeBasesClient(); - async function deleteKnowledgeBase() { + async function callDeleteKnowledgeBase() { // Construct request const request = { name, @@ -48,7 +48,7 @@ function main(name) { console.log(response); } - deleteKnowledgeBase(); + callDeleteKnowledgeBase(); // [END dialogflow_v2beta1_generated_KnowledgeBases_DeleteKnowledgeBase_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.get_knowledge_base.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.get_knowledge_base.js index de08c5d36f1..8bb6c80c670 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.get_knowledge_base.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.get_knowledge_base.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new KnowledgeBasesClient(); - async function getKnowledgeBase() { + async function callGetKnowledgeBase() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getKnowledgeBase(); + callGetKnowledgeBase(); // [END dialogflow_v2beta1_generated_KnowledgeBases_GetKnowledgeBase_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.list_knowledge_bases.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.list_knowledge_bases.js index 1d250f303a3..fcbcfded9e5 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.list_knowledge_bases.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.list_knowledge_bases.js @@ -36,7 +36,7 @@ function main(parent) { /** * The filter expression used to filter knowledge bases returned by the list * method. The expression has the following syntax: - * [AND ] ... + * AND ... * The following fields and operators are supported: * * display_name with has(:) operator * * language_code with equals(=) operator @@ -52,7 +52,7 @@ function main(parent) { * Note: An empty filter string (i.e. "") is a no-op and will result in no * filtering. * For more information about filtering, see - * [API Filtering](https://aip.dev/160). + * API Filtering (https://aip.dev/160). */ // const filter = 'abc123' @@ -62,7 +62,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new KnowledgeBasesClient(); - async function listKnowledgeBases() { + async function callListKnowledgeBases() { // Construct request const request = { parent, @@ -75,7 +75,7 @@ function main(parent) { } } - listKnowledgeBases(); + callListKnowledgeBases(); // [END dialogflow_v2beta1_generated_KnowledgeBases_ListKnowledgeBases_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.update_knowledge_base.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.update_knowledge_base.js index 612286eb264..14b8f00fffa 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.update_knowledge_base.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/knowledge_bases.update_knowledge_base.js @@ -22,13 +22,13 @@ function main(knowledgeBase) { /** * Required. The knowledge base to update. */ - // const knowledgeBase = '' + // const knowledgeBase = {} /** * Optional. Not specified means `update all`. * Currently, only `display_name` can be updated, an InvalidArgument will be * returned for attempting to update other fields. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {KnowledgeBasesClient} = require('@google-cloud/dialogflow').v2beta1; @@ -36,7 +36,7 @@ function main(knowledgeBase) { // Instantiates a client const dialogflowClient = new KnowledgeBasesClient(); - async function updateKnowledgeBase() { + async function callUpdateKnowledgeBase() { // Construct request const request = { knowledgeBase, @@ -47,7 +47,7 @@ function main(knowledgeBase) { console.log(response); } - updateKnowledgeBase(); + callUpdateKnowledgeBase(); // [END dialogflow_v2beta1_generated_KnowledgeBases_UpdateKnowledgeBase_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.analyze_content.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.analyze_content.js index 230e78835c1..5b7343df13c 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.analyze_content.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.analyze_content.js @@ -28,11 +28,11 @@ function main(participant) { /** * The natural language text to be processed. */ - // const textInput = '' + // const textInput = {} /** * An input event to send to Dialogflow. */ - // const eventInput = '' + // const eventInput = {} /** * Speech synthesis configuration. * The speech synthesis settings for a virtual agent that may be configured @@ -40,11 +40,11 @@ function main(participant) { * AnalyzeContent. If this configuration is not supplied, speech synthesis * is disabled. */ - // const replyAudioConfig = '' + // const replyAudioConfig = {} /** * Parameters for a Dialogflow virtual-agent query. */ - // const queryParams = '' + // const queryParams = {} /** * Optional. The send time of the message from end user or human agent's * perspective. It is used for identifying the same message under one @@ -59,7 +59,7 @@ function main(participant) { * If the value is not provided, a new request will always be regarded as a * new message without any de-duplication. */ - // const messageSendTime = '' + // const messageSendTime = {} /** * A unique identifier for this request. Restricted to 36 ASCII characters. * A random UUID is recommended. @@ -73,7 +73,7 @@ function main(participant) { // Instantiates a client const dialogflowClient = new ParticipantsClient(); - async function analyzeContent() { + async function callAnalyzeContent() { // Construct request const request = { participant, @@ -84,7 +84,7 @@ function main(participant) { console.log(response); } - analyzeContent(); + callAnalyzeContent(); // [END dialogflow_v2beta1_generated_Participants_AnalyzeContent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.compile_suggestion.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.compile_suggestion.js index fa3f0df95d2..342475f8e91 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.compile_suggestion.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.compile_suggestion.js @@ -34,7 +34,7 @@ function main() { // const latestMessage = 'abc123' /** * Optional. Max number of messages prior to and including - * [latest_message] to use as context when compiling the + * latest_message to use as context when compiling the * suggestion. If zero or less than zero, 20 is used. */ // const contextSize = 1234 @@ -45,7 +45,7 @@ function main() { // Instantiates a client const dialogflowClient = new ParticipantsClient(); - async function compileSuggestion() { + async function callCompileSuggestion() { // Construct request const request = {}; @@ -54,7 +54,7 @@ function main() { console.log(response); } - compileSuggestion(); + callCompileSuggestion(); // [END dialogflow_v2beta1_generated_Participants_CompileSuggestion_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.create_participant.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.create_participant.js index 1e0dafd5fc2..e4e68205ebc 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.create_participant.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.create_participant.js @@ -28,7 +28,7 @@ function main(parent, participant) { /** * Required. The participant to create. */ - // const participant = '' + // const participant = {} // Imports the Dialogflow library const {ParticipantsClient} = require('@google-cloud/dialogflow').v2beta1; @@ -36,7 +36,7 @@ function main(parent, participant) { // Instantiates a client const dialogflowClient = new ParticipantsClient(); - async function createParticipant() { + async function callCreateParticipant() { // Construct request const request = { parent, @@ -48,7 +48,7 @@ function main(parent, participant) { console.log(response); } - createParticipant(); + callCreateParticipant(); // [END dialogflow_v2beta1_generated_Participants_CreateParticipant_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.get_participant.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.get_participant.js index 98163612354..de8ad47233a 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.get_participant.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.get_participant.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new ParticipantsClient(); - async function getParticipant() { + async function callGetParticipant() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getParticipant(); + callGetParticipant(); // [END dialogflow_v2beta1_generated_Participants_GetParticipant_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.list_participants.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.list_participants.js index a350dacafd6..2632913f290 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.list_participants.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.list_participants.js @@ -41,7 +41,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new ParticipantsClient(); - async function listParticipants() { + async function callListParticipants() { // Construct request const request = { parent, @@ -54,7 +54,7 @@ function main(parent) { } } - listParticipants(); + callListParticipants(); // [END dialogflow_v2beta1_generated_Participants_ListParticipants_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.list_suggestions.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.list_suggestions.js index 22129daf5a7..a2a896054dc 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.list_suggestions.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.list_suggestions.js @@ -41,7 +41,7 @@ function main() { * `create_time_epoch_microseconds > 1551790877964485` or * `create_time > "2017-01-15T01:30:15.01Z"` * For more information about filtering, see - * [API Filtering](https://aip.dev/160). + * API Filtering (https://aip.dev/160). */ // const filter = 'abc123' @@ -51,7 +51,7 @@ function main() { // Instantiates a client const dialogflowClient = new ParticipantsClient(); - async function listSuggestions() { + async function callListSuggestions() { // Construct request const request = {}; @@ -62,7 +62,7 @@ function main() { } } - listSuggestions(); + callListSuggestions(); // [END dialogflow_v2beta1_generated_Participants_ListSuggestions_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.suggest_articles.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.suggest_articles.js index e3f3e96e32d..5f37c18c4d5 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.suggest_articles.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.suggest_articles.js @@ -34,7 +34,7 @@ function main(parent) { // const latestMessage = 'abc123' /** * Optional. Max number of messages prior to and including - * [latest_message][google.cloud.dialogflow.v2beta1.SuggestArticlesRequest.latest_message] to use as context + * latest_message google.cloud.dialogflow.v2beta1.SuggestArticlesRequest.latest_message to use as context * when compiling the suggestion. By default 20 and at most 50. */ // const contextSize = 1234 @@ -45,7 +45,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new ParticipantsClient(); - async function suggestArticles() { + async function callSuggestArticles() { // Construct request const request = { parent, @@ -56,7 +56,7 @@ function main(parent) { console.log(response); } - suggestArticles(); + callSuggestArticles(); // [END dialogflow_v2beta1_generated_Participants_SuggestArticles_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.suggest_faq_answers.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.suggest_faq_answers.js index ff7419af66c..f6732ce3597 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.suggest_faq_answers.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.suggest_faq_answers.js @@ -34,7 +34,7 @@ function main(parent) { // const latestMessage = 'abc123' /** * Optional. Max number of messages prior to and including - * [latest_message] to use as context when compiling the + * latest_message to use as context when compiling the * suggestion. By default 20 and at most 50. */ // const contextSize = 1234 @@ -45,7 +45,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new ParticipantsClient(); - async function suggestFaqAnswers() { + async function callSuggestFaqAnswers() { // Construct request const request = { parent, @@ -56,7 +56,7 @@ function main(parent) { console.log(response); } - suggestFaqAnswers(); + callSuggestFaqAnswers(); // [END dialogflow_v2beta1_generated_Participants_SuggestFaqAnswers_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.suggest_smart_replies.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.suggest_smart_replies.js index 259ca77ddd1..11b45a09ff3 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.suggest_smart_replies.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.suggest_smart_replies.js @@ -30,7 +30,7 @@ function main(parent) { * for. This provides a way for user to get follow up smart reply suggestion * after a smart reply selection, without sending a text message. */ - // const currentTextInput = '' + // const currentTextInput = {} /** * The name of the latest conversation message to compile suggestion * for. If empty, it will be the latest message of the conversation. @@ -40,7 +40,7 @@ function main(parent) { // const latestMessage = 'abc123' /** * Optional. Max number of messages prior to and including - * [latest_message] to use as context when compiling the + * latest_message to use as context when compiling the * suggestion. By default 20 and at most 50. */ // const contextSize = 1234 @@ -51,7 +51,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new ParticipantsClient(); - async function suggestSmartReplies() { + async function callSuggestSmartReplies() { // Construct request const request = { parent, @@ -62,7 +62,7 @@ function main(parent) { console.log(response); } - suggestSmartReplies(); + callSuggestSmartReplies(); // [END dialogflow_v2beta1_generated_Participants_SuggestSmartReplies_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.update_participant.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.update_participant.js index 0ef6f16f1c2..4422d4ea6dd 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.update_participant.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/participants.update_participant.js @@ -22,11 +22,11 @@ function main(participant, updateMask) { /** * Required. The participant to update. */ - // const participant = '' + // const participant = {} /** * Required. The mask to specify which fields to update. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {ParticipantsClient} = require('@google-cloud/dialogflow').v2beta1; @@ -34,7 +34,7 @@ function main(participant, updateMask) { // Instantiates a client const dialogflowClient = new ParticipantsClient(); - async function updateParticipant() { + async function callUpdateParticipant() { // Construct request const request = { participant, @@ -46,7 +46,7 @@ function main(participant, updateMask) { console.log(response); } - updateParticipant(); + callUpdateParticipant(); // [END dialogflow_v2beta1_generated_Participants_UpdateParticipant_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.create_session_entity_type.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.create_session_entity_type.js index 56f85597e72..7d691ff0819 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.create_session_entity_type.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.create_session_entity_type.js @@ -38,7 +38,7 @@ function main(parent, sessionEntityType) { /** * Required. The session entity type to create. */ - // const sessionEntityType = '' + // const sessionEntityType = {} // Imports the Dialogflow library const {SessionEntityTypesClient} = @@ -47,7 +47,7 @@ function main(parent, sessionEntityType) { // Instantiates a client const dialogflowClient = new SessionEntityTypesClient(); - async function createSessionEntityType() { + async function callCreateSessionEntityType() { // Construct request const request = { parent, @@ -59,7 +59,7 @@ function main(parent, sessionEntityType) { console.log(response); } - createSessionEntityType(); + callCreateSessionEntityType(); // [END dialogflow_v2beta1_generated_SessionEntityTypes_CreateSessionEntityType_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.delete_session_entity_type.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.delete_session_entity_type.js index 0907aae9a10..10c3b907f16 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.delete_session_entity_type.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.delete_session_entity_type.js @@ -44,7 +44,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new SessionEntityTypesClient(); - async function deleteSessionEntityType() { + async function callDeleteSessionEntityType() { // Construct request const request = { name, @@ -55,7 +55,7 @@ function main(name) { console.log(response); } - deleteSessionEntityType(); + callDeleteSessionEntityType(); // [END dialogflow_v2beta1_generated_SessionEntityTypes_DeleteSessionEntityType_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.get_session_entity_type.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.get_session_entity_type.js index 4e3ee7d2ab2..71b4131da2d 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.get_session_entity_type.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.get_session_entity_type.js @@ -43,7 +43,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new SessionEntityTypesClient(); - async function getSessionEntityType() { + async function callGetSessionEntityType() { // Construct request const request = { name, @@ -54,7 +54,7 @@ function main(name) { console.log(response); } - getSessionEntityType(); + callGetSessionEntityType(); // [END dialogflow_v2beta1_generated_SessionEntityTypes_GetSessionEntityType_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.list_session_entity_types.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.list_session_entity_types.js index 0bfe7136867..ce2dd656995 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.list_session_entity_types.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.list_session_entity_types.js @@ -52,7 +52,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new SessionEntityTypesClient(); - async function listSessionEntityTypes() { + async function callListSessionEntityTypes() { // Construct request const request = { parent, @@ -67,7 +67,7 @@ function main(parent) { } } - listSessionEntityTypes(); + callListSessionEntityTypes(); // [END dialogflow_v2beta1_generated_SessionEntityTypes_ListSessionEntityTypes_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.update_session_entity_type.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.update_session_entity_type.js index d4b0f42ac68..535f5e45c00 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.update_session_entity_type.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/session_entity_types.update_session_entity_type.js @@ -22,11 +22,11 @@ function main(sessionEntityType) { /** * Required. The session entity type to update. */ - // const sessionEntityType = '' + // const sessionEntityType = {} /** * Optional. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {SessionEntityTypesClient} = @@ -35,7 +35,7 @@ function main(sessionEntityType) { // Instantiates a client const dialogflowClient = new SessionEntityTypesClient(); - async function updateSessionEntityType() { + async function callUpdateSessionEntityType() { // Construct request const request = { sessionEntityType, @@ -46,7 +46,7 @@ function main(sessionEntityType) { console.log(response); } - updateSessionEntityType(); + callUpdateSessionEntityType(); // [END dialogflow_v2beta1_generated_SessionEntityTypes_UpdateSessionEntityType_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/sessions.detect_intent.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/sessions.detect_intent.js index e6356276c16..286b4aecc72 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/sessions.detect_intent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/sessions.detect_intent.js @@ -36,17 +36,17 @@ function main(session, queryInput) { * to choose an appropriate `Session ID` and `User Id`. They can be a random * number or some type of user and session identifiers (preferably hashed). * The length of the `Session ID` and `User ID` must not exceed 36 characters. - * For more information, see the [API interactions - * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * For more information, see the API interactions + * guide (https://cloud.google.com/dialogflow/docs/api-overview). * Note: Always use agent versions for production traffic. - * See [Versions and - * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * See Versions and + * environments (https://cloud.google.com/dialogflow/es/docs/agents-versions). */ // const session = 'abc123' /** * The parameters of this query. */ - // const queryParams = '' + // const queryParams = {} /** * Required. The input specification. It can be set to: * 1. an audio config @@ -54,21 +54,21 @@ function main(session, queryInput) { * 2. a conversational query in the form of text, or * 3. an event that specifies which intent to trigger. */ - // const queryInput = '' + // const queryInput = {} /** * Instructs the speech synthesizer how to generate the output * audio. If this field is not set and agent-level speech synthesizer is not * configured, no output audio is generated. */ - // const outputAudioConfig = '' + // const outputAudioConfig = {} /** - * Mask for [output_audio_config][google.cloud.dialogflow.v2beta1.DetectIntentRequest.output_audio_config] indicating which settings in this + * Mask for output_audio_config google.cloud.dialogflow.v2beta1.DetectIntentRequest.output_audio_config indicating which settings in this * request-level config should override speech synthesizer settings defined at * agent-level. - * If unspecified or empty, [output_audio_config][google.cloud.dialogflow.v2beta1.DetectIntentRequest.output_audio_config] replaces the agent-level + * If unspecified or empty, output_audio_config google.cloud.dialogflow.v2beta1.DetectIntentRequest.output_audio_config replaces the agent-level * config in its entirety. */ - // const outputAudioConfigMask = '' + // const outputAudioConfigMask = {} /** * The natural language speech audio to be processed. This field * should be populated iff `query_input` is set to an input audio config. @@ -82,7 +82,7 @@ function main(session, queryInput) { // Instantiates a client const dialogflowClient = new SessionsClient(); - async function detectIntent() { + async function callDetectIntent() { // Construct request const request = { session, @@ -94,7 +94,7 @@ function main(session, queryInput) { console.log(response); } - detectIntent(); + callDetectIntent(); // [END dialogflow_v2beta1_generated_Sessions_DetectIntent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/sessions.streaming_detect_intent.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/sessions.streaming_detect_intent.js index b7e6bc05cab..7fb3009cd9a 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/sessions.streaming_detect_intent.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/sessions.streaming_detect_intent.js @@ -36,17 +36,17 @@ function main(session, queryInput) { * to choose an appropriate `Session ID` and `User Id`. They can be a random * number or some type of user and session identifiers (preferably hashed). * The length of the `Session ID` and `User ID` must not exceed 36 characters. - * For more information, see the [API interactions - * guide](https://cloud.google.com/dialogflow/docs/api-overview). + * For more information, see the API interactions + * guide (https://cloud.google.com/dialogflow/docs/api-overview). * Note: Always use agent versions for production traffic. - * See [Versions and - * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * See Versions and + * environments (https://cloud.google.com/dialogflow/es/docs/agents-versions). */ // const session = 'abc123' /** * The parameters of this query. */ - // const queryParams = '' + // const queryParams = {} /** * Required. The input specification. It can be set to: * 1. an audio config which instructs the speech recognizer how to process @@ -54,9 +54,9 @@ function main(session, queryInput) { * 2. a conversational query in the form of text, or * 3. an event that specifies which intent to trigger. */ - // const queryInput = '' + // const queryInput = {} /** - * DEPRECATED. Please use [InputAudioConfig.single_utterance][google.cloud.dialogflow.v2beta1.InputAudioConfig.single_utterance] instead. + * DEPRECATED. Please use InputAudioConfig.single_utterance google.cloud.dialogflow.v2beta1.InputAudioConfig.single_utterance instead. * If `false` (default), recognition does not cease until the * client closes the stream. * If `true`, the recognizer will detect a single spoken utterance in input @@ -72,15 +72,15 @@ function main(session, queryInput) { * audio. If this field is not set and agent-level speech synthesizer is not * configured, no output audio is generated. */ - // const outputAudioConfig = '' + // const outputAudioConfig = {} /** - * Mask for [output_audio_config][google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.output_audio_config] indicating which settings in this + * Mask for output_audio_config google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.output_audio_config indicating which settings in this * request-level config should override speech synthesizer settings defined at * agent-level. - * If unspecified or empty, [output_audio_config][google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.output_audio_config] replaces the agent-level + * If unspecified or empty, output_audio_config google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.output_audio_config replaces the agent-level * config in its entirety. */ - // const outputAudioConfigMask = '' + // const outputAudioConfigMask = {} /** * The input audio content to be recognized. Must be sent if * `query_input` was set to a streaming input audio config. The complete audio @@ -94,7 +94,7 @@ function main(session, queryInput) { // Instantiates a client const dialogflowClient = new SessionsClient(); - async function streamingDetectIntent() { + async function callStreamingDetectIntent() { // Construct request const request = { session, @@ -116,7 +116,7 @@ function main(session, queryInput) { stream.end(); } - streamingDetectIntent(); + callStreamingDetectIntent(); // [END dialogflow_v2beta1_generated_Sessions_StreamingDetectIntent_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.create_version.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.create_version.js index f7dca439df6..b70d02bf146 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.create_version.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.create_version.js @@ -29,7 +29,7 @@ function main(parent, version) { /** * Required. The version to create. */ - // const version = '' + // const version = {} // Imports the Dialogflow library const {VersionsClient} = require('@google-cloud/dialogflow').v2beta1; @@ -37,7 +37,7 @@ function main(parent, version) { // Instantiates a client const dialogflowClient = new VersionsClient(); - async function createVersion() { + async function callCreateVersion() { // Construct request const request = { parent, @@ -49,7 +49,7 @@ function main(parent, version) { console.log(response); } - createVersion(); + callCreateVersion(); // [END dialogflow_v2beta1_generated_Versions_CreateVersion_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.delete_version.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.delete_version.js index 7476b5a4953..a29cade5375 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.delete_version.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.delete_version.js @@ -34,7 +34,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new VersionsClient(); - async function deleteVersion() { + async function callDeleteVersion() { // Construct request const request = { name, @@ -45,7 +45,7 @@ function main(name) { console.log(response); } - deleteVersion(); + callDeleteVersion(); // [END dialogflow_v2beta1_generated_Versions_DeleteVersion_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.get_version.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.get_version.js index b3237c0db91..87060fe11d0 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.get_version.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.get_version.js @@ -34,7 +34,7 @@ function main(name) { // Instantiates a client const dialogflowClient = new VersionsClient(); - async function getVersion() { + async function callGetVersion() { // Construct request const request = { name, @@ -45,7 +45,7 @@ function main(name) { console.log(response); } - getVersion(); + callGetVersion(); // [END dialogflow_v2beta1_generated_Versions_GetVersion_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.list_versions.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.list_versions.js index 4d8673cd84f..61014bb7304 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.list_versions.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.list_versions.js @@ -42,7 +42,7 @@ function main(parent) { // Instantiates a client const dialogflowClient = new VersionsClient(); - async function listVersions() { + async function callListVersions() { // Construct request const request = { parent, @@ -55,7 +55,7 @@ function main(parent) { } } - listVersions(); + callListVersions(); // [END dialogflow_v2beta1_generated_Versions_ListVersions_async] } diff --git a/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.update_version.js b/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.update_version.js index 17c200d0282..90cac68a72b 100644 --- a/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.update_version.js +++ b/packages/google-cloud-dialogflow/samples/generated/v2beta1/versions.update_version.js @@ -26,11 +26,11 @@ function main(version, updateMask) { * - `projects//locations//agent/versions/` */ - // const version = '' + // const version = {} /** * Required. The mask to control which fields get updated. */ - // const updateMask = '' + // const updateMask = {} // Imports the Dialogflow library const {VersionsClient} = require('@google-cloud/dialogflow').v2beta1; @@ -38,7 +38,7 @@ function main(version, updateMask) { // Instantiates a client const dialogflowClient = new VersionsClient(); - async function updateVersion() { + async function callUpdateVersion() { // Construct request const request = { version, @@ -50,7 +50,7 @@ function main(version, updateMask) { console.log(response); } - updateVersion(); + callUpdateVersion(); // [END dialogflow_v2beta1_generated_Versions_UpdateVersion_async] } diff --git a/packages/google-cloud-dialogflow/src/v2/agents_client.ts b/packages/google-cloud-dialogflow/src/v2/agents_client.ts index dbfdd13a9cc..970c414dc03 100644 --- a/packages/google-cloud-dialogflow/src/v2/agents_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/agents_client.ts @@ -508,6 +508,24 @@ export class AgentsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project that the agent to fetch is associated with. + * Format: `projects/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Agent]{@link google.cloud.dialogflow.v2.Agent}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/agents.get_agent.js + * region_tag:dialogflow_v2_generated_Agents_GetAgent_async + */ getAgent( request?: protos.google.cloud.dialogflow.v2.IGetAgentRequest, options?: CallOptions @@ -535,24 +553,6 @@ export class AgentsClient { {} | null | undefined > ): void; - /** - * Retrieves the specified agent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project that the agent to fetch is associated with. - * Format: `projects/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Agent]{@link google.cloud.dialogflow.v2.Agent}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getAgent(request); - */ getAgent( request?: protos.google.cloud.dialogflow.v2.IGetAgentRequest, optionsOrCallback?: @@ -592,6 +592,29 @@ export class AgentsClient { this.initialize(); return this.innerApiCalls.getAgent(request, options, callback); } + /** + * Creates/updates the specified agent. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2.Agent} request.agent + * Required. The agent to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Agent]{@link google.cloud.dialogflow.v2.Agent}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/agents.set_agent.js + * region_tag:dialogflow_v2_generated_Agents_SetAgent_async + */ setAgent( request?: protos.google.cloud.dialogflow.v2.ISetAgentRequest, options?: CallOptions @@ -619,29 +642,6 @@ export class AgentsClient { {} | null | undefined > ): void; - /** - * Creates/updates the specified agent. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2.Agent} request.agent - * Required. The agent to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The mask to control which fields get updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Agent]{@link google.cloud.dialogflow.v2.Agent}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.setAgent(request); - */ setAgent( request?: protos.google.cloud.dialogflow.v2.ISetAgentRequest, optionsOrCallback?: @@ -681,6 +681,24 @@ export class AgentsClient { this.initialize(); return this.innerApiCalls.setAgent(request, options, callback); } + /** + * Deletes the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project that the agent to delete is associated with. + * Format: `projects/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/agents.delete_agent.js + * region_tag:dialogflow_v2_generated_Agents_DeleteAgent_async + */ deleteAgent( request?: protos.google.cloud.dialogflow.v2.IDeleteAgentRequest, options?: CallOptions @@ -708,24 +726,6 @@ export class AgentsClient { {} | null | undefined > ): void; - /** - * Deletes the specified agent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project that the agent to delete is associated with. - * Format: `projects/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteAgent(request); - */ deleteAgent( request?: protos.google.cloud.dialogflow.v2.IDeleteAgentRequest, optionsOrCallback?: @@ -767,6 +767,31 @@ export class AgentsClient { this.initialize(); return this.innerApiCalls.deleteAgent(request, options, callback); } + /** + * Gets agent validation result. Agent validation is performed during + * training time and is updated automatically when training is completed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project that the agent is associated with. + * Format: `projects/`. + * @param {string} [request.languageCode] + * Optional. The language for which you want a validation result. If not + * specified, the agent's default language is used. [Many + * languages](https://cloud.google.com/dialogflow/docs/reference/language) + * are supported. Note: languages must be enabled in the agent before they can + * be used. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ValidationResult]{@link google.cloud.dialogflow.v2.ValidationResult}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/agents.get_validation_result.js + * region_tag:dialogflow_v2_generated_Agents_GetValidationResult_async + */ getValidationResult( request?: protos.google.cloud.dialogflow.v2.IGetValidationResultRequest, options?: CallOptions @@ -798,31 +823,6 @@ export class AgentsClient { {} | null | undefined > ): void; - /** - * Gets agent validation result. Agent validation is performed during - * training time and is updated automatically when training is completed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project that the agent is associated with. - * Format: `projects/`. - * @param {string} [request.languageCode] - * Optional. The language for which you want a validation result. If not - * specified, the agent's default language is used. [Many - * languages](https://cloud.google.com/dialogflow/docs/reference/language) - * are supported. Note: languages must be enabled in the agent before they can - * be used. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ValidationResult]{@link google.cloud.dialogflow.v2.ValidationResult}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getValidationResult(request); - */ getValidationResult( request?: protos.google.cloud.dialogflow.v2.IGetValidationResultRequest, optionsOrCallback?: @@ -867,6 +867,39 @@ export class AgentsClient { return this.innerApiCalls.getValidationResult(request, options, callback); } + /** + * Trains the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project that the agent to train is associated with. + * Format: `projects/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2/agents.train_agent.js + * region_tag:dialogflow_v2_generated_Agents_TrainAgent_async + */ trainAgent( request?: protos.google.cloud.dialogflow.v2.ITrainAgentRequest, options?: CallOptions @@ -903,40 +936,6 @@ export class AgentsClient { {} | null | undefined > ): void; - /** - * Trains the specified agent. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: An empty [Struct - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - * - `response`: An [Empty - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project that the agent to train is associated with. - * Format: `projects/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.trainAgent(request); - * const [response] = await operation.promise(); - */ trainAgent( request?: protos.google.cloud.dialogflow.v2.ITrainAgentRequest, optionsOrCallback?: @@ -994,11 +993,8 @@ export class AgentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkTrainAgentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2/agents.train_agent.js + * region_tag:dialogflow_v2_generated_Agents_TrainAgent_async */ async checkTrainAgentProgress( name: string @@ -1019,6 +1015,39 @@ export class AgentsClient { protos.google.protobuf.Struct >; } + /** + * Exports the specified agent to a ZIP file. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: {@link google.cloud.dialogflow.v2.ExportAgentResponse|ExportAgentResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project that the agent to export is associated with. + * Format: `projects/`. + * @param {string} request.agentUri + * Required. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) + * URI to export the agent to. + * The format of this URI must be `gs:///`. + * If left unspecified, the serialized agent is returned inline. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2/agents.export_agent.js + * region_tag:dialogflow_v2_generated_Agents_ExportAgent_async + */ exportAgent( request?: protos.google.cloud.dialogflow.v2.IExportAgentRequest, options?: CallOptions @@ -1055,40 +1084,6 @@ export class AgentsClient { {} | null | undefined > ): void; - /** - * Exports the specified agent to a ZIP file. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: An empty [Struct - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - * - `response`: {@link google.cloud.dialogflow.v2.ExportAgentResponse|ExportAgentResponse} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project that the agent to export is associated with. - * Format: `projects/`. - * @param {string} request.agentUri - * Required. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) - * URI to export the agent to. - * The format of this URI must be `gs:///`. - * If left unspecified, the serialized agent is returned inline. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.exportAgent(request); - * const [response] = await operation.promise(); - */ exportAgent( request?: protos.google.cloud.dialogflow.v2.IExportAgentRequest, optionsOrCallback?: @@ -1146,11 +1141,8 @@ export class AgentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkExportAgentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2/agents.export_agent.js + * region_tag:dialogflow_v2_generated_Agents_ExportAgent_async */ async checkExportAgentProgress( name: string @@ -1174,42 +1166,6 @@ export class AgentsClient { protos.google.protobuf.Struct >; } - importAgent( - request?: protos.google.cloud.dialogflow.v2.IImportAgentRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - importAgent( - request: protos.google.cloud.dialogflow.v2.IImportAgentRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - importAgent( - request: protos.google.cloud.dialogflow.v2.IImportAgentRequest, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Imports the specified agent from a ZIP file. * @@ -1256,10 +1212,45 @@ export class AgentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.importAgent(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2/agents.import_agent.js + * region_tag:dialogflow_v2_generated_Agents_ImportAgent_async */ + importAgent( + request?: protos.google.cloud.dialogflow.v2.IImportAgentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + importAgent( + request: protos.google.cloud.dialogflow.v2.IImportAgentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importAgent( + request: protos.google.cloud.dialogflow.v2.IImportAgentRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; importAgent( request?: protos.google.cloud.dialogflow.v2.IImportAgentRequest, optionsOrCallback?: @@ -1317,11 +1308,8 @@ export class AgentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkImportAgentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2/agents.import_agent.js + * region_tag:dialogflow_v2_generated_Agents_ImportAgent_async */ async checkImportAgentProgress( name: string @@ -1342,42 +1330,6 @@ export class AgentsClient { protos.google.protobuf.Struct >; } - restoreAgent( - request?: protos.google.cloud.dialogflow.v2.IRestoreAgentRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - restoreAgent( - request: protos.google.cloud.dialogflow.v2.IRestoreAgentRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - restoreAgent( - request: protos.google.cloud.dialogflow.v2.IRestoreAgentRequest, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Restores the specified agent from a ZIP file. * @@ -1423,10 +1375,45 @@ export class AgentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.restoreAgent(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2/agents.restore_agent.js + * region_tag:dialogflow_v2_generated_Agents_RestoreAgent_async */ + restoreAgent( + request?: protos.google.cloud.dialogflow.v2.IRestoreAgentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + restoreAgent( + request: protos.google.cloud.dialogflow.v2.IRestoreAgentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + restoreAgent( + request: protos.google.cloud.dialogflow.v2.IRestoreAgentRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; restoreAgent( request?: protos.google.cloud.dialogflow.v2.IRestoreAgentRequest, optionsOrCallback?: @@ -1484,11 +1471,8 @@ export class AgentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkRestoreAgentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2/agents.restore_agent.js + * region_tag:dialogflow_v2_generated_Agents_RestoreAgent_async */ async checkRestoreAgentProgress( name: string @@ -1509,37 +1493,6 @@ export class AgentsClient { protos.google.protobuf.Struct >; } - searchAgents( - request?: protos.google.cloud.dialogflow.v2.ISearchAgentsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2.IAgent[], - protos.google.cloud.dialogflow.v2.ISearchAgentsRequest | null, - protos.google.cloud.dialogflow.v2.ISearchAgentsResponse - ] - >; - searchAgents( - request: protos.google.cloud.dialogflow.v2.ISearchAgentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2.ISearchAgentsRequest, - | protos.google.cloud.dialogflow.v2.ISearchAgentsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2.IAgent - > - ): void; - searchAgents( - request: protos.google.cloud.dialogflow.v2.ISearchAgentsRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2.ISearchAgentsRequest, - | protos.google.cloud.dialogflow.v2.ISearchAgentsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2.IAgent - > - ): void; /** * Returns the list of agents. * @@ -1572,6 +1525,37 @@ export class AgentsClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + searchAgents( + request?: protos.google.cloud.dialogflow.v2.ISearchAgentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IAgent[], + protos.google.cloud.dialogflow.v2.ISearchAgentsRequest | null, + protos.google.cloud.dialogflow.v2.ISearchAgentsResponse + ] + >; + searchAgents( + request: protos.google.cloud.dialogflow.v2.ISearchAgentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.ISearchAgentsRequest, + | protos.google.cloud.dialogflow.v2.ISearchAgentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IAgent + > + ): void; + searchAgents( + request: protos.google.cloud.dialogflow.v2.ISearchAgentsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.ISearchAgentsRequest, + | protos.google.cloud.dialogflow.v2.ISearchAgentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IAgent + > + ): void; searchAgents( request?: protos.google.cloud.dialogflow.v2.ISearchAgentsRequest, optionsOrCallback?: @@ -1686,11 +1670,8 @@ export class AgentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.searchAgentsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2/agents.search_agents.js + * region_tag:dialogflow_v2_generated_Agents_SearchAgents_async */ searchAgentsAsync( request?: protos.google.cloud.dialogflow.v2.ISearchAgentsRequest, @@ -1704,7 +1685,6 @@ export class AgentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['searchAgents']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2/answer_records_client.ts b/packages/google-cloud-dialogflow/src/v2/answer_records_client.ts index b276d23850b..38376de1360 100644 --- a/packages/google-cloud-dialogflow/src/v2/answer_records_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/answer_records_client.ts @@ -436,6 +436,25 @@ export class AnswerRecordsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Updates the specified answer record. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2.AnswerRecord} request.answerRecord + * Required. Answer record to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnswerRecord]{@link google.cloud.dialogflow.v2.AnswerRecord}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/answer_records.update_answer_record.js + * region_tag:dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_async + */ updateAnswerRecord( request?: protos.google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest, options?: CallOptions @@ -467,25 +486,6 @@ export class AnswerRecordsClient { {} | null | undefined > ): void; - /** - * Updates the specified answer record. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2.AnswerRecord} request.answerRecord - * Required. Answer record to update. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The mask to control which fields get updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AnswerRecord]{@link google.cloud.dialogflow.v2.AnswerRecord}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateAnswerRecord(request); - */ updateAnswerRecord( request?: protos.google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest, optionsOrCallback?: @@ -530,37 +530,6 @@ export class AnswerRecordsClient { return this.innerApiCalls.updateAnswerRecord(request, options, callback); } - listAnswerRecords( - request?: protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2.IAnswerRecord[], - protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest | null, - protos.google.cloud.dialogflow.v2.IListAnswerRecordsResponse - ] - >; - listAnswerRecords( - request: protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, - | protos.google.cloud.dialogflow.v2.IListAnswerRecordsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2.IAnswerRecord - > - ): void; - listAnswerRecords( - request: protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, - | protos.google.cloud.dialogflow.v2.IListAnswerRecordsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2.IAnswerRecord - > - ): void; /** * Returns the list of all answer records in the specified project in reverse * chronological order. @@ -600,6 +569,37 @@ export class AnswerRecordsClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listAnswerRecords( + request?: protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IAnswerRecord[], + protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest | null, + protos.google.cloud.dialogflow.v2.IListAnswerRecordsResponse + ] + >; + listAnswerRecords( + request: protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, + | protos.google.cloud.dialogflow.v2.IListAnswerRecordsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IAnswerRecord + > + ): void; + listAnswerRecords( + request: protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, + | protos.google.cloud.dialogflow.v2.IListAnswerRecordsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IAnswerRecord + > + ): void; listAnswerRecords( request?: protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, optionsOrCallback?: @@ -738,11 +738,8 @@ export class AnswerRecordsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listAnswerRecordsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2/answer_records.list_answer_records.js + * region_tag:dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_async */ listAnswerRecordsAsync( request?: protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, @@ -756,7 +753,6 @@ export class AnswerRecordsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listAnswerRecords']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2/contexts_client.ts b/packages/google-cloud-dialogflow/src/v2/contexts_client.ts index 9380b8b5d61..f6852be51df 100644 --- a/packages/google-cloud-dialogflow/src/v2/contexts_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/contexts_client.ts @@ -443,6 +443,28 @@ export class ContextsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified context. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the context. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Context]{@link google.cloud.dialogflow.v2.Context}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/contexts.get_context.js + * region_tag:dialogflow_v2_generated_Contexts_GetContext_async + */ getContext( request?: protos.google.cloud.dialogflow.v2.IGetContextRequest, options?: CallOptions @@ -470,28 +492,6 @@ export class ContextsClient { {} | null | undefined > ): void; - /** - * Retrieves the specified context. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the context. Format: - * `projects//agent/sessions//contexts/` - * or `projects//agent/environments//users//sessions//contexts/`. - * If `Environment ID` is not specified, we assume default 'draft' - * environment. If `User ID` is not specified, we assume default '-' user. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Context]{@link google.cloud.dialogflow.v2.Context}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getContext(request); - */ getContext( request?: protos.google.cloud.dialogflow.v2.IGetContextRequest, optionsOrCallback?: @@ -533,6 +533,32 @@ export class ContextsClient { this.initialize(); return this.innerApiCalls.getContext(request, options, callback); } + /** + * Creates a context. + * + * If the specified context already exists, overrides the context. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The session to create a context for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * @param {google.cloud.dialogflow.v2.Context} request.context + * Required. The context to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Context]{@link google.cloud.dialogflow.v2.Context}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/contexts.create_context.js + * region_tag:dialogflow_v2_generated_Contexts_CreateContext_async + */ createContext( request?: protos.google.cloud.dialogflow.v2.ICreateContextRequest, options?: CallOptions @@ -564,32 +590,6 @@ export class ContextsClient { {} | null | undefined > ): void; - /** - * Creates a context. - * - * If the specified context already exists, overrides the context. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The session to create a context for. - * Format: `projects//agent/sessions/` or - * `projects//agent/environments//users//sessions/`. - * If `Environment ID` is not specified, we assume default 'draft' - * environment. If `User ID` is not specified, we assume default '-' user. - * @param {google.cloud.dialogflow.v2.Context} request.context - * Required. The context to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Context]{@link google.cloud.dialogflow.v2.Context}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createContext(request); - */ createContext( request?: protos.google.cloud.dialogflow.v2.ICreateContextRequest, optionsOrCallback?: @@ -633,6 +633,25 @@ export class ContextsClient { this.initialize(); return this.innerApiCalls.createContext(request, options, callback); } + /** + * Updates the specified context. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2.Context} request.context + * Required. The context to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Context]{@link google.cloud.dialogflow.v2.Context}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/contexts.update_context.js + * region_tag:dialogflow_v2_generated_Contexts_UpdateContext_async + */ updateContext( request?: protos.google.cloud.dialogflow.v2.IUpdateContextRequest, options?: CallOptions @@ -664,25 +683,6 @@ export class ContextsClient { {} | null | undefined > ): void; - /** - * Updates the specified context. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2.Context} request.context - * Required. The context to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The mask to control which fields get updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Context]{@link google.cloud.dialogflow.v2.Context}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateContext(request); - */ updateContext( request?: protos.google.cloud.dialogflow.v2.IUpdateContextRequest, optionsOrCallback?: @@ -726,6 +726,28 @@ export class ContextsClient { this.initialize(); return this.innerApiCalls.updateContext(request, options, callback); } + /** + * Deletes the specified context. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the context to delete. Format: + * `projects//agent/sessions//contexts/` + * or `projects//agent/environments//users//sessions//contexts/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/contexts.delete_context.js + * region_tag:dialogflow_v2_generated_Contexts_DeleteContext_async + */ deleteContext( request?: protos.google.cloud.dialogflow.v2.IDeleteContextRequest, options?: CallOptions @@ -757,28 +779,6 @@ export class ContextsClient { {} | null | undefined > ): void; - /** - * Deletes the specified context. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the context to delete. Format: - * `projects//agent/sessions//contexts/` - * or `projects//agent/environments//users//sessions//contexts/`. - * If `Environment ID` is not specified, we assume default 'draft' - * environment. If `User ID` is not specified, we assume default '-' user. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteContext(request); - */ deleteContext( request?: protos.google.cloud.dialogflow.v2.IDeleteContextRequest, optionsOrCallback?: @@ -822,6 +822,28 @@ export class ContextsClient { this.initialize(); return this.innerApiCalls.deleteContext(request, options, callback); } + /** + * Deletes all active contexts in the specified session. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the session to delete all contexts from. Format: + * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified we assume default 'draft' environment. + * If `User ID` is not specified, we assume default '-' user. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/contexts.delete_all_contexts.js + * region_tag:dialogflow_v2_generated_Contexts_DeleteAllContexts_async + */ deleteAllContexts( request?: protos.google.cloud.dialogflow.v2.IDeleteAllContextsRequest, options?: CallOptions @@ -853,28 +875,6 @@ export class ContextsClient { {} | null | undefined > ): void; - /** - * Deletes all active contexts in the specified session. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the session to delete all contexts from. Format: - * `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. - * If `Environment ID` is not specified we assume default 'draft' environment. - * If `User ID` is not specified, we assume default '-' user. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteAllContexts(request); - */ deleteAllContexts( request?: protos.google.cloud.dialogflow.v2.IDeleteAllContextsRequest, optionsOrCallback?: @@ -919,6 +919,36 @@ export class ContextsClient { return this.innerApiCalls.deleteAllContexts(request, options, callback); } + /** + * Returns the list of all contexts in the specified session. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The session to list all contexts from. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users//sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Context]{@link google.cloud.dialogflow.v2.Context}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listContextsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listContexts( request?: protos.google.cloud.dialogflow.v2.IListContextsRequest, options?: CallOptions @@ -950,36 +980,6 @@ export class ContextsClient { protos.google.cloud.dialogflow.v2.IContext > ): void; - /** - * Returns the list of all contexts in the specified session. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The session to list all contexts from. - * Format: `projects//agent/sessions/` or - * `projects//agent/environments//users//sessions/`. - * If `Environment ID` is not specified, we assume default 'draft' - * environment. If `User ID` is not specified, we assume default '-' user. - * @param {number} [request.pageSize] - * Optional. The maximum number of items to return in a single page. By - * default 100 and at most 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous list request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Context]{@link google.cloud.dialogflow.v2.Context}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listContextsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listContexts( request?: protos.google.cloud.dialogflow.v2.IListContextsRequest, optionsOrCallback?: @@ -1102,11 +1102,8 @@ export class ContextsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listContextsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2/contexts.list_contexts.js + * region_tag:dialogflow_v2_generated_Contexts_ListContexts_async */ listContextsAsync( request?: protos.google.cloud.dialogflow.v2.IListContextsRequest, @@ -1120,7 +1117,6 @@ export class ContextsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listContexts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2/conversation_profiles_client.ts b/packages/google-cloud-dialogflow/src/v2/conversation_profiles_client.ts index 9d609cbe042..326613b80ef 100644 --- a/packages/google-cloud-dialogflow/src/v2/conversation_profiles_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/conversation_profiles_client.ts @@ -442,6 +442,25 @@ export class ConversationProfilesClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified conversation profile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2.ConversationProfile}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/conversation_profiles.get_conversation_profile.js + * region_tag:dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_async + */ getConversationProfile( request?: protos.google.cloud.dialogflow.v2.IGetConversationProfileRequest, options?: CallOptions @@ -476,25 +495,6 @@ export class ConversationProfilesClient { {} | null | undefined > ): void; - /** - * Retrieves the specified conversation profile. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the conversation profile. - * Format: `projects//locations//conversationProfiles/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2.ConversationProfile}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getConversationProfile(request); - */ getConversationProfile( request?: protos.google.cloud.dialogflow.v2.IGetConversationProfileRequest, optionsOrCallback?: @@ -545,6 +545,30 @@ export class ConversationProfilesClient { callback ); } + /** + * Creates a conversation profile in the specified project. + * + * {@link |ConversationProfile.CreateTime} and {@link |ConversationProfile.UpdateTime} + * aren't populated in the response. You can retrieve them via + * {@link google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile|GetConversationProfile} API. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to create a conversation profile for. + * Format: `projects//locations/`. + * @param {google.cloud.dialogflow.v2.ConversationProfile} request.conversationProfile + * Required. The conversation profile to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2.ConversationProfile}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/conversation_profiles.create_conversation_profile.js + * region_tag:dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_async + */ createConversationProfile( request?: protos.google.cloud.dialogflow.v2.ICreateConversationProfileRequest, options?: CallOptions @@ -579,30 +603,6 @@ export class ConversationProfilesClient { {} | null | undefined > ): void; - /** - * Creates a conversation profile in the specified project. - * - * {@link |ConversationProfile.CreateTime} and {@link |ConversationProfile.UpdateTime} - * aren't populated in the response. You can retrieve them via - * {@link google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile|GetConversationProfile} API. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project to create a conversation profile for. - * Format: `projects//locations/`. - * @param {google.cloud.dialogflow.v2.ConversationProfile} request.conversationProfile - * Required. The conversation profile to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2.ConversationProfile}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createConversationProfile(request); - */ createConversationProfile( request?: protos.google.cloud.dialogflow.v2.ICreateConversationProfileRequest, optionsOrCallback?: @@ -653,6 +653,29 @@ export class ConversationProfilesClient { callback ); } + /** + * Updates the specified conversation profile. + * + * {@link |ConversationProfile.CreateTime} and {@link |ConversationProfile.UpdateTime} + * aren't populated in the response. You can retrieve them via + * {@link google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile|GetConversationProfile} API. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2.ConversationProfile} request.conversationProfile + * Required. The conversation profile to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2.ConversationProfile}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/conversation_profiles.update_conversation_profile.js + * region_tag:dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_async + */ updateConversationProfile( request?: protos.google.cloud.dialogflow.v2.IUpdateConversationProfileRequest, options?: CallOptions @@ -687,29 +710,6 @@ export class ConversationProfilesClient { {} | null | undefined > ): void; - /** - * Updates the specified conversation profile. - * - * {@link |ConversationProfile.CreateTime} and {@link |ConversationProfile.UpdateTime} - * aren't populated in the response. You can retrieve them via - * {@link google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile|GetConversationProfile} API. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2.ConversationProfile} request.conversationProfile - * Required. The conversation profile to update. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The mask to control which fields to update. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2.ConversationProfile}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateConversationProfile(request); - */ updateConversationProfile( request?: protos.google.cloud.dialogflow.v2.IUpdateConversationProfileRequest, optionsOrCallback?: @@ -760,6 +760,25 @@ export class ConversationProfilesClient { callback ); } + /** + * Deletes the specified conversation profile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the conversation profile to delete. + * Format: `projects//locations//conversationProfiles/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/conversation_profiles.delete_conversation_profile.js + * region_tag:dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_async + */ deleteConversationProfile( request?: protos.google.cloud.dialogflow.v2.IDeleteConversationProfileRequest, options?: CallOptions @@ -794,25 +813,6 @@ export class ConversationProfilesClient { {} | null | undefined > ): void; - /** - * Deletes the specified conversation profile. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the conversation profile to delete. - * Format: `projects//locations//conversationProfiles/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteConversationProfile(request); - */ deleteConversationProfile( request?: protos.google.cloud.dialogflow.v2.IDeleteConversationProfileRequest, optionsOrCallback?: @@ -864,6 +864,32 @@ export class ConversationProfilesClient { ); } + /** + * Returns the list of all conversation profiles in the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ConversationProfile]{@link google.cloud.dialogflow.v2.ConversationProfile}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listConversationProfilesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listConversationProfiles( request?: protos.google.cloud.dialogflow.v2.IListConversationProfilesRequest, options?: CallOptions @@ -895,32 +921,6 @@ export class ConversationProfilesClient { protos.google.cloud.dialogflow.v2.IConversationProfile > ): void; - /** - * Returns the list of all conversation profiles in the specified project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project to list all conversation profiles from. - * Format: `projects//locations/`. - * @param {number} request.pageSize - * The maximum number of items to return in a single page. By - * default 100 and at most 1000. - * @param {string} request.pageToken - * The next_page_token value returned from a previous list request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [ConversationProfile]{@link google.cloud.dialogflow.v2.ConversationProfile}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listConversationProfilesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listConversationProfiles( request?: protos.google.cloud.dialogflow.v2.IListConversationProfilesRequest, optionsOrCallback?: @@ -1039,11 +1039,8 @@ export class ConversationProfilesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listConversationProfilesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2/conversation_profiles.list_conversation_profiles.js + * region_tag:dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_async */ listConversationProfilesAsync( request?: protos.google.cloud.dialogflow.v2.IListConversationProfilesRequest, @@ -1057,7 +1054,6 @@ export class ConversationProfilesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listConversationProfiles']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2/conversations_client.ts b/packages/google-cloud-dialogflow/src/v2/conversations_client.ts index 5b42c52c409..dc68f4e6f0d 100644 --- a/packages/google-cloud-dialogflow/src/v2/conversations_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/conversations_client.ts @@ -444,37 +444,6 @@ export class ConversationsClient { // ------------------- // -- Service calls -- // ------------------- - createConversation( - request?: protos.google.cloud.dialogflow.v2.ICreateConversationRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2.IConversation, - protos.google.cloud.dialogflow.v2.ICreateConversationRequest | undefined, - {} | undefined - ] - >; - createConversation( - request: protos.google.cloud.dialogflow.v2.ICreateConversationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dialogflow.v2.IConversation, - | protos.google.cloud.dialogflow.v2.ICreateConversationRequest - | null - | undefined, - {} | null | undefined - > - ): void; - createConversation( - request: protos.google.cloud.dialogflow.v2.ICreateConversationRequest, - callback: Callback< - protos.google.cloud.dialogflow.v2.IConversation, - | protos.google.cloud.dialogflow.v2.ICreateConversationRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Creates a new conversation. Conversations are auto-completed after 24 * hours. @@ -520,9 +489,40 @@ export class ConversationsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.createConversation(request); + * @example include:samples/generated/v2/conversations.create_conversation.js + * region_tag:dialogflow_v2_generated_Conversations_CreateConversation_async */ + createConversation( + request?: protos.google.cloud.dialogflow.v2.ICreateConversationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversation, + protos.google.cloud.dialogflow.v2.ICreateConversationRequest | undefined, + {} | undefined + ] + >; + createConversation( + request: protos.google.cloud.dialogflow.v2.ICreateConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IConversation, + | protos.google.cloud.dialogflow.v2.ICreateConversationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createConversation( + request: protos.google.cloud.dialogflow.v2.ICreateConversationRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IConversation, + | protos.google.cloud.dialogflow.v2.ICreateConversationRequest + | null + | undefined, + {} | null | undefined + > + ): void; createConversation( request?: protos.google.cloud.dialogflow.v2.ICreateConversationRequest, optionsOrCallback?: @@ -566,6 +566,25 @@ export class ConversationsClient { this.initialize(); return this.innerApiCalls.createConversation(request, options, callback); } + /** + * Retrieves the specific conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the conversation. Format: + * `projects//locations//conversations/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Conversation]{@link google.cloud.dialogflow.v2.Conversation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/conversations.get_conversation.js + * region_tag:dialogflow_v2_generated_Conversations_GetConversation_async + */ getConversation( request?: protos.google.cloud.dialogflow.v2.IGetConversationRequest, options?: CallOptions @@ -597,25 +616,6 @@ export class ConversationsClient { {} | null | undefined > ): void; - /** - * Retrieves the specific conversation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the conversation. Format: - * `projects//locations//conversations/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Conversation]{@link google.cloud.dialogflow.v2.Conversation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getConversation(request); - */ getConversation( request?: protos.google.cloud.dialogflow.v2.IGetConversationRequest, optionsOrCallback?: @@ -659,6 +659,26 @@ export class ConversationsClient { this.initialize(); return this.innerApiCalls.getConversation(request, options, callback); } + /** + * Completes the specified conversation. Finished conversations are purged + * from the database after 30 days. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource identifier of the conversation to close. + * Format: `projects//locations//conversations/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Conversation]{@link google.cloud.dialogflow.v2.Conversation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/conversations.complete_conversation.js + * region_tag:dialogflow_v2_generated_Conversations_CompleteConversation_async + */ completeConversation( request?: protos.google.cloud.dialogflow.v2.ICompleteConversationRequest, options?: CallOptions @@ -693,26 +713,6 @@ export class ConversationsClient { {} | null | undefined > ): void; - /** - * Completes the specified conversation. Finished conversations are purged - * from the database after 30 days. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource identifier of the conversation to close. - * Format: `projects//locations//conversations/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Conversation]{@link google.cloud.dialogflow.v2.Conversation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.completeConversation(request); - */ completeConversation( request?: protos.google.cloud.dialogflow.v2.ICompleteConversationRequest, optionsOrCallback?: @@ -760,37 +760,6 @@ export class ConversationsClient { return this.innerApiCalls.completeConversation(request, options, callback); } - listConversations( - request?: protos.google.cloud.dialogflow.v2.IListConversationsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2.IConversation[], - protos.google.cloud.dialogflow.v2.IListConversationsRequest | null, - protos.google.cloud.dialogflow.v2.IListConversationsResponse - ] - >; - listConversations( - request: protos.google.cloud.dialogflow.v2.IListConversationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2.IListConversationsRequest, - | protos.google.cloud.dialogflow.v2.IListConversationsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2.IConversation - > - ): void; - listConversations( - request: protos.google.cloud.dialogflow.v2.IListConversationsRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2.IListConversationsRequest, - | protos.google.cloud.dialogflow.v2.IListConversationsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2.IConversation - > - ): void; /** * Returns the list of all conversations in the specified project. * @@ -835,6 +804,37 @@ export class ConversationsClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listConversations( + request?: protos.google.cloud.dialogflow.v2.IListConversationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversation[], + protos.google.cloud.dialogflow.v2.IListConversationsRequest | null, + protos.google.cloud.dialogflow.v2.IListConversationsResponse + ] + >; + listConversations( + request: protos.google.cloud.dialogflow.v2.IListConversationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListConversationsRequest, + | protos.google.cloud.dialogflow.v2.IListConversationsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IConversation + > + ): void; + listConversations( + request: protos.google.cloud.dialogflow.v2.IListConversationsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListConversationsRequest, + | protos.google.cloud.dialogflow.v2.IListConversationsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IConversation + > + ): void; listConversations( request?: protos.google.cloud.dialogflow.v2.IListConversationsRequest, optionsOrCallback?: @@ -985,11 +985,8 @@ export class ConversationsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listConversationsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2/conversations.list_conversations.js + * region_tag:dialogflow_v2_generated_Conversations_ListConversations_async */ listConversationsAsync( request?: protos.google.cloud.dialogflow.v2.IListConversationsRequest, @@ -1003,7 +1000,6 @@ export class ConversationsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listConversations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1013,37 +1009,6 @@ export class ConversationsClient { callSettings ) as AsyncIterable; } - listMessages( - request?: protos.google.cloud.dialogflow.v2.IListMessagesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2.IMessage[], - protos.google.cloud.dialogflow.v2.IListMessagesRequest | null, - protos.google.cloud.dialogflow.v2.IListMessagesResponse - ] - >; - listMessages( - request: protos.google.cloud.dialogflow.v2.IListMessagesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2.IListMessagesRequest, - | protos.google.cloud.dialogflow.v2.IListMessagesResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2.IMessage - > - ): void; - listMessages( - request: protos.google.cloud.dialogflow.v2.IListMessagesRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2.IListMessagesRequest, - | protos.google.cloud.dialogflow.v2.IListMessagesResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2.IMessage - > - ): void; /** * Lists messages that belong to a given conversation. * `messages` are ordered by `create_time` in descending order. To fetch @@ -1084,6 +1049,37 @@ export class ConversationsClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listMessages( + request?: protos.google.cloud.dialogflow.v2.IListMessagesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IMessage[], + protos.google.cloud.dialogflow.v2.IListMessagesRequest | null, + protos.google.cloud.dialogflow.v2.IListMessagesResponse + ] + >; + listMessages( + request: protos.google.cloud.dialogflow.v2.IListMessagesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListMessagesRequest, + | protos.google.cloud.dialogflow.v2.IListMessagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IMessage + > + ): void; + listMessages( + request: protos.google.cloud.dialogflow.v2.IListMessagesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListMessagesRequest, + | protos.google.cloud.dialogflow.v2.IListMessagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IMessage + > + ): void; listMessages( request?: protos.google.cloud.dialogflow.v2.IListMessagesRequest, optionsOrCallback?: @@ -1218,11 +1214,8 @@ export class ConversationsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listMessagesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2/conversations.list_messages.js + * region_tag:dialogflow_v2_generated_Conversations_ListMessages_async */ listMessagesAsync( request?: protos.google.cloud.dialogflow.v2.IListMessagesRequest, @@ -1236,7 +1229,6 @@ export class ConversationsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listMessages']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2/documents_client.ts b/packages/google-cloud-dialogflow/src/v2/documents_client.ts index 8f7b6b83f62..5a3787d9467 100644 --- a/packages/google-cloud-dialogflow/src/v2/documents_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/documents_client.ts @@ -505,6 +505,25 @@ export class DocumentsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified document. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the document to retrieve. + * Format `projects//locations//knowledgeBases//documents/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Document]{@link google.cloud.dialogflow.v2.Document}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/documents.get_document.js + * region_tag:dialogflow_v2_generated_Documents_GetDocument_async + */ getDocument( request?: protos.google.cloud.dialogflow.v2.IGetDocumentRequest, options?: CallOptions @@ -532,25 +551,6 @@ export class DocumentsClient { {} | null | undefined > ): void; - /** - * Retrieves the specified document. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the document to retrieve. - * Format `projects//locations//knowledgeBases//documents/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Document]{@link google.cloud.dialogflow.v2.Document}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getDocument(request); - */ getDocument( request?: protos.google.cloud.dialogflow.v2.IGetDocumentRequest, optionsOrCallback?: @@ -593,6 +593,36 @@ export class DocumentsClient { return this.innerApiCalls.getDocument(request, options, callback); } + /** + * Creates a new document. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: {@link google.cloud.dialogflow.v2.KnowledgeOperationMetadata|KnowledgeOperationMetadata} + * - `response`: {@link google.cloud.dialogflow.v2.Document|Document} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The knowledge base to create a document for. + * Format: `projects//locations//knowledgeBases/`. + * @param {google.cloud.dialogflow.v2.Document} request.document + * Required. The document to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2/documents.create_document.js + * region_tag:dialogflow_v2_generated_Documents_CreateDocument_async + */ createDocument( request?: protos.google.cloud.dialogflow.v2.ICreateDocumentRequest, options?: CallOptions @@ -629,37 +659,6 @@ export class DocumentsClient { {} | null | undefined > ): void; - /** - * Creates a new document. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: {@link google.cloud.dialogflow.v2.KnowledgeOperationMetadata|KnowledgeOperationMetadata} - * - `response`: {@link google.cloud.dialogflow.v2.Document|Document} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The knowledge base to create a document for. - * Format: `projects//locations//knowledgeBases/`. - * @param {google.cloud.dialogflow.v2.Document} request.document - * Required. The document to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.createDocument(request); - * const [response] = await operation.promise(); - */ createDocument( request?: protos.google.cloud.dialogflow.v2.ICreateDocumentRequest, optionsOrCallback?: @@ -717,11 +716,8 @@ export class DocumentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkCreateDocumentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2/documents.create_document.js + * region_tag:dialogflow_v2_generated_Documents_CreateDocument_async */ async checkCreateDocumentProgress( name: string @@ -745,6 +741,35 @@ export class DocumentsClient { protos.google.cloud.dialogflow.v2.KnowledgeOperationMetadata >; } + /** + * Deletes the specified document. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: {@link google.cloud.dialogflow.v2.KnowledgeOperationMetadata|KnowledgeOperationMetadata} + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the document to delete. + * Format: `projects//locations//knowledgeBases//documents/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2/documents.delete_document.js + * region_tag:dialogflow_v2_generated_Documents_DeleteDocument_async + */ deleteDocument( request?: protos.google.cloud.dialogflow.v2.IDeleteDocumentRequest, options?: CallOptions @@ -781,36 +806,6 @@ export class DocumentsClient { {} | null | undefined > ): void; - /** - * Deletes the specified document. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: {@link google.cloud.dialogflow.v2.KnowledgeOperationMetadata|KnowledgeOperationMetadata} - * - `response`: An [Empty - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the document to delete. - * Format: `projects//locations//knowledgeBases//documents/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.deleteDocument(request); - * const [response] = await operation.promise(); - */ deleteDocument( request?: protos.google.cloud.dialogflow.v2.IDeleteDocumentRequest, optionsOrCallback?: @@ -868,11 +863,8 @@ export class DocumentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeleteDocumentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2/documents.delete_document.js + * region_tag:dialogflow_v2_generated_Documents_DeleteDocument_async */ async checkDeleteDocumentProgress( name: string @@ -896,6 +888,36 @@ export class DocumentsClient { protos.google.cloud.dialogflow.v2.KnowledgeOperationMetadata >; } + /** + * Updates the specified document. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: {@link google.cloud.dialogflow.v2.KnowledgeOperationMetadata|KnowledgeOperationMetadata} + * - `response`: {@link google.cloud.dialogflow.v2.Document|Document} + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2.Document} request.document + * Required. The document to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2/documents.update_document.js + * region_tag:dialogflow_v2_generated_Documents_UpdateDocument_async + */ updateDocument( request?: protos.google.cloud.dialogflow.v2.IUpdateDocumentRequest, options?: CallOptions @@ -932,37 +954,6 @@ export class DocumentsClient { {} | null | undefined > ): void; - /** - * Updates the specified document. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: {@link google.cloud.dialogflow.v2.KnowledgeOperationMetadata|KnowledgeOperationMetadata} - * - `response`: {@link google.cloud.dialogflow.v2.Document|Document} - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2.Document} request.document - * Required. The document to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. Not specified means `update all`. - * Currently, only `display_name` can be updated, an InvalidArgument will be - * returned for attempting to update other fields. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.updateDocument(request); - * const [response] = await operation.promise(); - */ updateDocument( request?: protos.google.cloud.dialogflow.v2.IUpdateDocumentRequest, optionsOrCallback?: @@ -1020,11 +1011,8 @@ export class DocumentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkUpdateDocumentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2/documents.update_document.js + * region_tag:dialogflow_v2_generated_Documents_UpdateDocument_async */ async checkUpdateDocumentProgress( name: string @@ -1048,42 +1036,6 @@ export class DocumentsClient { protos.google.cloud.dialogflow.v2.KnowledgeOperationMetadata >; } - reloadDocument( - request?: protos.google.cloud.dialogflow.v2.IReloadDocumentRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.dialogflow.v2.IDocument, - protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - reloadDocument( - request: protos.google.cloud.dialogflow.v2.IReloadDocumentRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.dialogflow.v2.IDocument, - protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - reloadDocument( - request: protos.google.cloud.dialogflow.v2.IReloadDocumentRequest, - callback: Callback< - LROperation< - protos.google.cloud.dialogflow.v2.IDocument, - protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Reloads the specified document from its specified source, content_uri or * content. The previously loaded content of the document will be deleted. @@ -1121,10 +1073,45 @@ export class DocumentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.reloadDocument(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2/documents.reload_document.js + * region_tag:dialogflow_v2_generated_Documents_ReloadDocument_async */ + reloadDocument( + request?: protos.google.cloud.dialogflow.v2.IReloadDocumentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + reloadDocument( + request: protos.google.cloud.dialogflow.v2.IReloadDocumentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + reloadDocument( + request: protos.google.cloud.dialogflow.v2.IReloadDocumentRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; reloadDocument( request?: protos.google.cloud.dialogflow.v2.IReloadDocumentRequest, optionsOrCallback?: @@ -1182,11 +1169,8 @@ export class DocumentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkReloadDocumentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2/documents.reload_document.js + * region_tag:dialogflow_v2_generated_Documents_ReloadDocument_async */ async checkReloadDocumentProgress( name: string @@ -1210,6 +1194,33 @@ export class DocumentsClient { protos.google.cloud.dialogflow.v2.KnowledgeOperationMetadata >; } + /** + * Returns the list of all documents of the knowledge base. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The knowledge base to list all documents for. + * Format: `projects//locations//knowledgeBases/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Document]{@link google.cloud.dialogflow.v2.Document}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDocumentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listDocuments( request?: protos.google.cloud.dialogflow.v2.IListDocumentsRequest, options?: CallOptions @@ -1241,33 +1252,6 @@ export class DocumentsClient { protos.google.cloud.dialogflow.v2.IDocument > ): void; - /** - * Returns the list of all documents of the knowledge base. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The knowledge base to list all documents for. - * Format: `projects//locations//knowledgeBases/`. - * @param {number} request.pageSize - * The maximum number of items to return in a single page. By - * default 10 and at most 100. - * @param {string} request.pageToken - * The next_page_token value returned from a previous list request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Document]{@link google.cloud.dialogflow.v2.Document}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listDocumentsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listDocuments( request?: protos.google.cloud.dialogflow.v2.IListDocumentsRequest, optionsOrCallback?: @@ -1384,11 +1368,8 @@ export class DocumentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listDocumentsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2/documents.list_documents.js + * region_tag:dialogflow_v2_generated_Documents_ListDocuments_async */ listDocumentsAsync( request?: protos.google.cloud.dialogflow.v2.IListDocumentsRequest, @@ -1402,7 +1383,6 @@ export class DocumentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listDocuments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2/entity_types_client.ts b/packages/google-cloud-dialogflow/src/v2/entity_types_client.ts index 6446d5b6124..d33dc7e42a3 100644 --- a/packages/google-cloud-dialogflow/src/v2/entity_types_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/entity_types_client.ts @@ -528,6 +528,30 @@ export class EntityTypesClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified entity type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the entity type. + * Format: `projects//agent/entityTypes/`. + * @param {string} [request.languageCode] + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [EntityType]{@link google.cloud.dialogflow.v2.EntityType}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/entity_types.get_entity_type.js + * region_tag:dialogflow_v2_generated_EntityTypes_GetEntityType_async + */ getEntityType( request?: protos.google.cloud.dialogflow.v2.IGetEntityTypeRequest, options?: CallOptions @@ -559,30 +583,6 @@ export class EntityTypesClient { {} | null | undefined > ): void; - /** - * Retrieves the specified entity type. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the entity type. - * Format: `projects//agent/entityTypes/`. - * @param {string} [request.languageCode] - * Optional. The language used to access language-specific data. - * If not specified, the agent's default language is used. - * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [EntityType]{@link google.cloud.dialogflow.v2.EntityType}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getEntityType(request); - */ getEntityType( request?: protos.google.cloud.dialogflow.v2.IGetEntityTypeRequest, optionsOrCallback?: @@ -626,6 +626,36 @@ export class EntityTypesClient { this.initialize(); return this.innerApiCalls.getEntityType(request, options, callback); } + /** + * Creates an entity type in the specified agent. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create a entity type for. + * Format: `projects//agent`. + * @param {google.cloud.dialogflow.v2.EntityType} request.entityType + * Required. The entity type to create. + * @param {string} [request.languageCode] + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [EntityType]{@link google.cloud.dialogflow.v2.EntityType}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/entity_types.create_entity_type.js + * region_tag:dialogflow_v2_generated_EntityTypes_CreateEntityType_async + */ createEntityType( request?: protos.google.cloud.dialogflow.v2.ICreateEntityTypeRequest, options?: CallOptions @@ -657,36 +687,6 @@ export class EntityTypesClient { {} | null | undefined > ): void; - /** - * Creates an entity type in the specified agent. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The agent to create a entity type for. - * Format: `projects//agent`. - * @param {google.cloud.dialogflow.v2.EntityType} request.entityType - * Required. The entity type to create. - * @param {string} [request.languageCode] - * Optional. The language used to access language-specific data. - * If not specified, the agent's default language is used. - * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [EntityType]{@link google.cloud.dialogflow.v2.EntityType}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createEntityType(request); - */ createEntityType( request?: protos.google.cloud.dialogflow.v2.ICreateEntityTypeRequest, optionsOrCallback?: @@ -730,6 +730,35 @@ export class EntityTypesClient { this.initialize(); return this.innerApiCalls.createEntityType(request, options, callback); } + /** + * Updates the specified entity type. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2.EntityType} request.entityType + * Required. The entity type to update. + * @param {string} [request.languageCode] + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [EntityType]{@link google.cloud.dialogflow.v2.EntityType}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/entity_types.update_entity_type.js + * region_tag:dialogflow_v2_generated_EntityTypes_UpdateEntityType_async + */ updateEntityType( request?: protos.google.cloud.dialogflow.v2.IUpdateEntityTypeRequest, options?: CallOptions @@ -761,35 +790,6 @@ export class EntityTypesClient { {} | null | undefined > ): void; - /** - * Updates the specified entity type. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2.EntityType} request.entityType - * Required. The entity type to update. - * @param {string} [request.languageCode] - * Optional. The language used to access language-specific data. - * If not specified, the agent's default language is used. - * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The mask to control which fields get updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [EntityType]{@link google.cloud.dialogflow.v2.EntityType}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateEntityType(request); - */ updateEntityType( request?: protos.google.cloud.dialogflow.v2.IUpdateEntityTypeRequest, optionsOrCallback?: @@ -833,6 +833,28 @@ export class EntityTypesClient { this.initialize(); return this.innerApiCalls.updateEntityType(request, options, callback); } + /** + * Deletes the specified entity type. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the entity type to delete. + * Format: `projects//agent/entityTypes/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/entity_types.delete_entity_type.js + * region_tag:dialogflow_v2_generated_EntityTypes_DeleteEntityType_async + */ deleteEntityType( request?: protos.google.cloud.dialogflow.v2.IDeleteEntityTypeRequest, options?: CallOptions @@ -864,28 +886,6 @@ export class EntityTypesClient { {} | null | undefined > ): void; - /** - * Deletes the specified entity type. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the entity type to delete. - * Format: `projects//agent/entityTypes/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteEntityType(request); - */ deleteEntityType( request?: protos.google.cloud.dialogflow.v2.IDeleteEntityTypeRequest, optionsOrCallback?: @@ -930,42 +930,6 @@ export class EntityTypesClient { return this.innerApiCalls.deleteEntityType(request, options, callback); } - batchUpdateEntityTypes( - request?: protos.google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchUpdateEntityTypes( - request: protos.google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchUpdateEntityTypes( - request: protos.google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest, - callback: Callback< - LROperation< - protos.google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Updates/Creates multiple entity types in the specified agent. * @@ -1010,10 +974,45 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.batchUpdateEntityTypes(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2/entity_types.batch_update_entity_types.js + * region_tag:dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_async */ + batchUpdateEntityTypes( + request?: protos.google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchUpdateEntityTypes( + request: protos.google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchUpdateEntityTypes( + request: protos.google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchUpdateEntityTypes( request?: protos.google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest, optionsOrCallback?: @@ -1075,11 +1074,8 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkBatchUpdateEntityTypesProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2/entity_types.batch_update_entity_types.js + * region_tag:dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_async */ async checkBatchUpdateEntityTypesProgress( name: string @@ -1103,6 +1099,42 @@ export class EntityTypesClient { protos.google.protobuf.Struct >; } + /** + * Deletes entity types in the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * @param {string[]} request.entityTypeNames + * Required. The names entity types to delete. All names must point to the + * same agent as `parent`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2/entity_types.batch_delete_entity_types.js + * region_tag:dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_async + */ batchDeleteEntityTypes( request?: protos.google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest, options?: CallOptions @@ -1139,43 +1171,6 @@ export class EntityTypesClient { {} | null | undefined > ): void; - /** - * Deletes entity types in the specified agent. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: An empty [Struct - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - * - `response`: An [Empty - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the agent to delete all entities types for. Format: - * `projects//agent`. - * @param {string[]} request.entityTypeNames - * Required. The names entity types to delete. All names must point to the - * same agent as `parent`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.batchDeleteEntityTypes(request); - * const [response] = await operation.promise(); - */ batchDeleteEntityTypes( request?: protos.google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest, optionsOrCallback?: @@ -1237,11 +1232,8 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkBatchDeleteEntityTypesProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2/entity_types.batch_delete_entity_types.js + * region_tag:dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_async */ async checkBatchDeleteEntityTypesProgress( name: string @@ -1249,55 +1241,19 @@ export class EntityTypesClient { LROperation > { const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( - operation, - this.descriptors.longrunning.batchDeleteEntityTypes, - gax.createDefaultBackoffSettings() - ); - return decodeOperation as LROperation< - protos.google.protobuf.Empty, - protos.google.protobuf.Struct - >; - } - batchCreateEntities( - request?: protos.google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchCreateEntities( - request: protos.google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchCreateEntities( - request: protos.google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.batchDeleteEntityTypes, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.protobuf.Struct + >; + } /** * Creates multiple new entities in the specified entity type. * @@ -1336,10 +1292,45 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.batchCreateEntities(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2/entity_types.batch_create_entities.js + * region_tag:dialogflow_v2_generated_EntityTypes_BatchCreateEntities_async */ + batchCreateEntities( + request?: protos.google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchCreateEntities( + request: protos.google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchCreateEntities( + request: protos.google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchCreateEntities( request?: protos.google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest, optionsOrCallback?: @@ -1397,11 +1388,8 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkBatchCreateEntitiesProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2/entity_types.batch_create_entities.js + * region_tag:dialogflow_v2_generated_EntityTypes_BatchCreateEntities_async */ async checkBatchCreateEntitiesProgress( name: string @@ -1422,42 +1410,6 @@ export class EntityTypesClient { protos.google.protobuf.Struct >; } - batchUpdateEntities( - request?: protos.google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchUpdateEntities( - request: protos.google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchUpdateEntities( - request: protos.google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Updates or creates multiple entities in the specified entity type. This * method does not affect entities in the entity type that aren't explicitly @@ -1501,10 +1453,45 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.batchUpdateEntities(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2/entity_types.batch_update_entities.js + * region_tag:dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_async */ + batchUpdateEntities( + request?: protos.google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchUpdateEntities( + request: protos.google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchUpdateEntities( + request: protos.google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchUpdateEntities( request?: protos.google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest, optionsOrCallback?: @@ -1562,11 +1549,8 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkBatchUpdateEntitiesProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2/entity_types.batch_update_entities.js + * region_tag:dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_async */ async checkBatchUpdateEntitiesProgress( name: string @@ -1587,42 +1571,6 @@ export class EntityTypesClient { protos.google.protobuf.Struct >; } - batchDeleteEntities( - request?: protos.google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchDeleteEntities( - request: protos.google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchDeleteEntities( - request: protos.google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Deletes entities in the specified entity type. * @@ -1663,10 +1611,45 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.batchDeleteEntities(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2/entity_types.batch_delete_entities.js + * region_tag:dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_async */ + batchDeleteEntities( + request?: protos.google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchDeleteEntities( + request: protos.google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchDeleteEntities( + request: protos.google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchDeleteEntities( request?: protos.google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest, optionsOrCallback?: @@ -1724,11 +1707,8 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkBatchDeleteEntitiesProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2/entity_types.batch_delete_entities.js + * region_tag:dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_async */ async checkBatchDeleteEntitiesProgress( name: string @@ -1749,37 +1729,6 @@ export class EntityTypesClient { protos.google.protobuf.Struct >; } - listEntityTypes( - request?: protos.google.cloud.dialogflow.v2.IListEntityTypesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2.IEntityType[], - protos.google.cloud.dialogflow.v2.IListEntityTypesRequest | null, - protos.google.cloud.dialogflow.v2.IListEntityTypesResponse - ] - >; - listEntityTypes( - request: protos.google.cloud.dialogflow.v2.IListEntityTypesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2.IListEntityTypesRequest, - | protos.google.cloud.dialogflow.v2.IListEntityTypesResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2.IEntityType - > - ): void; - listEntityTypes( - request: protos.google.cloud.dialogflow.v2.IListEntityTypesRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2.IListEntityTypesRequest, - | protos.google.cloud.dialogflow.v2.IListEntityTypesResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2.IEntityType - > - ): void; /** * Returns the list of all entity types in the specified agent. * @@ -1812,6 +1761,37 @@ export class EntityTypesClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listEntityTypes( + request?: protos.google.cloud.dialogflow.v2.IListEntityTypesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IEntityType[], + protos.google.cloud.dialogflow.v2.IListEntityTypesRequest | null, + protos.google.cloud.dialogflow.v2.IListEntityTypesResponse + ] + >; + listEntityTypes( + request: protos.google.cloud.dialogflow.v2.IListEntityTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListEntityTypesRequest, + | protos.google.cloud.dialogflow.v2.IListEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IEntityType + > + ): void; + listEntityTypes( + request: protos.google.cloud.dialogflow.v2.IListEntityTypesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListEntityTypesRequest, + | protos.google.cloud.dialogflow.v2.IListEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IEntityType + > + ): void; listEntityTypes( request?: protos.google.cloud.dialogflow.v2.IListEntityTypesRequest, optionsOrCallback?: @@ -1938,11 +1918,8 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listEntityTypesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2/entity_types.list_entity_types.js + * region_tag:dialogflow_v2_generated_EntityTypes_ListEntityTypes_async */ listEntityTypesAsync( request?: protos.google.cloud.dialogflow.v2.IListEntityTypesRequest, @@ -1956,7 +1933,6 @@ export class EntityTypesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listEntityTypes']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2/environments_client.ts b/packages/google-cloud-dialogflow/src/v2/environments_client.ts index 5e6352972e7..d3677da3432 100644 --- a/packages/google-cloud-dialogflow/src/v2/environments_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/environments_client.ts @@ -445,6 +445,30 @@ export class EnvironmentsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified agent environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the environment. + * Supported formats: + * + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * + * The environment ID for the default environment is `-`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Environment]{@link google.cloud.dialogflow.v2.Environment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/environments.get_environment.js + * region_tag:dialogflow_v2_generated_Environments_GetEnvironment_async + */ getEnvironment( request?: protos.google.cloud.dialogflow.v2.IGetEnvironmentRequest, options?: CallOptions @@ -476,30 +500,6 @@ export class EnvironmentsClient { {} | null | undefined > ): void; - /** - * Retrieves the specified agent environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the environment. - * Supported formats: - * - * - `projects//agent/environments/` - * - `projects//locations//agent/environments/` - * - * The environment ID for the default environment is `-`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Environment]{@link google.cloud.dialogflow.v2.Environment}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getEnvironment(request); - */ getEnvironment( request?: protos.google.cloud.dialogflow.v2.IGetEnvironmentRequest, optionsOrCallback?: @@ -543,6 +543,31 @@ export class EnvironmentsClient { this.initialize(); return this.innerApiCalls.getEnvironment(request, options, callback); } + /** + * Creates an agent environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create an environment for. + * Supported formats: + * + * - `projects//agent` + * - `projects//locations//agent` + * @param {google.cloud.dialogflow.v2.Environment} request.environment + * Required. The environment to create. + * @param {string} request.environmentId + * Required. The unique id of the new environment. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Environment]{@link google.cloud.dialogflow.v2.Environment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/environments.create_environment.js + * region_tag:dialogflow_v2_generated_Environments_CreateEnvironment_async + */ createEnvironment( request?: protos.google.cloud.dialogflow.v2.ICreateEnvironmentRequest, options?: CallOptions @@ -574,31 +599,6 @@ export class EnvironmentsClient { {} | null | undefined > ): void; - /** - * Creates an agent environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The agent to create an environment for. - * Supported formats: - * - * - `projects//agent` - * - `projects//locations//agent` - * @param {google.cloud.dialogflow.v2.Environment} request.environment - * Required. The environment to create. - * @param {string} request.environmentId - * Required. The unique id of the new environment. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Environment]{@link google.cloud.dialogflow.v2.Environment}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createEnvironment(request); - */ createEnvironment( request?: protos.google.cloud.dialogflow.v2.ICreateEnvironmentRequest, optionsOrCallback?: @@ -642,37 +642,6 @@ export class EnvironmentsClient { this.initialize(); return this.innerApiCalls.createEnvironment(request, options, callback); } - updateEnvironment( - request?: protos.google.cloud.dialogflow.v2.IUpdateEnvironmentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2.IEnvironment, - protos.google.cloud.dialogflow.v2.IUpdateEnvironmentRequest | undefined, - {} | undefined - ] - >; - updateEnvironment( - request: protos.google.cloud.dialogflow.v2.IUpdateEnvironmentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dialogflow.v2.IEnvironment, - | protos.google.cloud.dialogflow.v2.IUpdateEnvironmentRequest - | null - | undefined, - {} | null | undefined - > - ): void; - updateEnvironment( - request: protos.google.cloud.dialogflow.v2.IUpdateEnvironmentRequest, - callback: Callback< - protos.google.cloud.dialogflow.v2.IEnvironment, - | protos.google.cloud.dialogflow.v2.IUpdateEnvironmentRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Updates the specified agent environment. * @@ -705,9 +674,40 @@ export class EnvironmentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.updateEnvironment(request); + * @example include:samples/generated/v2/environments.update_environment.js + * region_tag:dialogflow_v2_generated_Environments_UpdateEnvironment_async */ + updateEnvironment( + request?: protos.google.cloud.dialogflow.v2.IUpdateEnvironmentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IEnvironment, + protos.google.cloud.dialogflow.v2.IUpdateEnvironmentRequest | undefined, + {} | undefined + ] + >; + updateEnvironment( + request: protos.google.cloud.dialogflow.v2.IUpdateEnvironmentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IEnvironment, + | protos.google.cloud.dialogflow.v2.IUpdateEnvironmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateEnvironment( + request: protos.google.cloud.dialogflow.v2.IUpdateEnvironmentRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IEnvironment, + | protos.google.cloud.dialogflow.v2.IUpdateEnvironmentRequest + | null + | undefined, + {} | null | undefined + > + ): void; updateEnvironment( request?: protos.google.cloud.dialogflow.v2.IUpdateEnvironmentRequest, optionsOrCallback?: @@ -751,6 +751,30 @@ export class EnvironmentsClient { this.initialize(); return this.innerApiCalls.updateEnvironment(request, options, callback); } + /** + * Deletes the specified agent environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the environment to delete. + * / Format: + * + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * + * The environment ID for the default environment is `-`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/environments.delete_environment.js + * region_tag:dialogflow_v2_generated_Environments_DeleteEnvironment_async + */ deleteEnvironment( request?: protos.google.cloud.dialogflow.v2.IDeleteEnvironmentRequest, options?: CallOptions @@ -782,30 +806,6 @@ export class EnvironmentsClient { {} | null | undefined > ): void; - /** - * Deletes the specified agent environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the environment to delete. - * / Format: - * - * - `projects//agent/environments/` - * - `projects//locations//agent/environments/` - * - * The environment ID for the default environment is `-`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteEnvironment(request); - */ deleteEnvironment( request?: protos.google.cloud.dialogflow.v2.IDeleteEnvironmentRequest, optionsOrCallback?: @@ -850,6 +850,35 @@ export class EnvironmentsClient { return this.innerApiCalls.deleteEnvironment(request, options, callback); } + /** + * Returns the list of all non-default environments of the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all environments from. + * Format: + * + * - `projects//agent` + * - `projects//locations//agent` + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Environment]{@link google.cloud.dialogflow.v2.Environment}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listEnvironmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listEnvironments( request?: protos.google.cloud.dialogflow.v2.IListEnvironmentsRequest, options?: CallOptions @@ -881,35 +910,6 @@ export class EnvironmentsClient { protos.google.cloud.dialogflow.v2.IEnvironment > ): void; - /** - * Returns the list of all non-default environments of the specified agent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The agent to list all environments from. - * Format: - * - * - `projects//agent` - * - `projects//locations//agent` - * @param {number} [request.pageSize] - * Optional. The maximum number of items to return in a single page. By default 100 and - * at most 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous list request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Environment]{@link google.cloud.dialogflow.v2.Environment}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listEnvironmentsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listEnvironments( request?: protos.google.cloud.dialogflow.v2.IListEnvironmentsRequest, optionsOrCallback?: @@ -1030,11 +1030,8 @@ export class EnvironmentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listEnvironmentsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2/environments.list_environments.js + * region_tag:dialogflow_v2_generated_Environments_ListEnvironments_async */ listEnvironmentsAsync( request?: protos.google.cloud.dialogflow.v2.IListEnvironmentsRequest, @@ -1048,7 +1045,6 @@ export class EnvironmentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listEnvironments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1058,33 +1054,6 @@ export class EnvironmentsClient { callSettings ) as AsyncIterable; } - getEnvironmentHistory( - request?: protos.google.cloud.dialogflow.v2.IGetEnvironmentHistoryRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2.EnvironmentHistory.IEntry[], - protos.google.cloud.dialogflow.v2.IGetEnvironmentHistoryRequest | null, - protos.google.cloud.dialogflow.v2.IEnvironmentHistory - ] - >; - getEnvironmentHistory( - request: protos.google.cloud.dialogflow.v2.IGetEnvironmentHistoryRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2.IGetEnvironmentHistoryRequest, - protos.google.cloud.dialogflow.v2.IEnvironmentHistory | null | undefined, - protos.google.cloud.dialogflow.v2.EnvironmentHistory.IEntry - > - ): void; - getEnvironmentHistory( - request: protos.google.cloud.dialogflow.v2.IGetEnvironmentHistoryRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2.IGetEnvironmentHistoryRequest, - protos.google.cloud.dialogflow.v2.IEnvironmentHistory | null | undefined, - protos.google.cloud.dialogflow.v2.EnvironmentHistory.IEntry - > - ): void; /** * Gets the history of the specified environment. * @@ -1117,6 +1086,33 @@ export class EnvironmentsClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + getEnvironmentHistory( + request?: protos.google.cloud.dialogflow.v2.IGetEnvironmentHistoryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.EnvironmentHistory.IEntry[], + protos.google.cloud.dialogflow.v2.IGetEnvironmentHistoryRequest | null, + protos.google.cloud.dialogflow.v2.IEnvironmentHistory + ] + >; + getEnvironmentHistory( + request: protos.google.cloud.dialogflow.v2.IGetEnvironmentHistoryRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IGetEnvironmentHistoryRequest, + protos.google.cloud.dialogflow.v2.IEnvironmentHistory | null | undefined, + protos.google.cloud.dialogflow.v2.EnvironmentHistory.IEntry + > + ): void; + getEnvironmentHistory( + request: protos.google.cloud.dialogflow.v2.IGetEnvironmentHistoryRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IGetEnvironmentHistoryRequest, + protos.google.cloud.dialogflow.v2.IEnvironmentHistory | null | undefined, + protos.google.cloud.dialogflow.v2.EnvironmentHistory.IEntry + > + ): void; getEnvironmentHistory( request?: protos.google.cloud.dialogflow.v2.IGetEnvironmentHistoryRequest, optionsOrCallback?: @@ -1241,11 +1237,8 @@ export class EnvironmentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.getEnvironmentHistoryAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2/environments.get_environment_history.js + * region_tag:dialogflow_v2_generated_Environments_GetEnvironmentHistory_async */ getEnvironmentHistoryAsync( request?: protos.google.cloud.dialogflow.v2.IGetEnvironmentHistoryRequest, @@ -1259,7 +1252,6 @@ export class EnvironmentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['getEnvironmentHistory']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2/fulfillments_client.ts b/packages/google-cloud-dialogflow/src/v2/fulfillments_client.ts index 3f9cbf5b749..96806b62676 100644 --- a/packages/google-cloud-dialogflow/src/v2/fulfillments_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/fulfillments_client.ts @@ -410,6 +410,24 @@ export class FulfillmentsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the fulfillment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the fulfillment. + * Format: `projects//agent/fulfillment`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Fulfillment]{@link google.cloud.dialogflow.v2.Fulfillment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/fulfillments.get_fulfillment.js + * region_tag:dialogflow_v2_generated_Fulfillments_GetFulfillment_async + */ getFulfillment( request?: protos.google.cloud.dialogflow.v2.IGetFulfillmentRequest, options?: CallOptions @@ -441,24 +459,6 @@ export class FulfillmentsClient { {} | null | undefined > ): void; - /** - * Retrieves the fulfillment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the fulfillment. - * Format: `projects//agent/fulfillment`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Fulfillment]{@link google.cloud.dialogflow.v2.Fulfillment}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getFulfillment(request); - */ getFulfillment( request?: protos.google.cloud.dialogflow.v2.IGetFulfillmentRequest, optionsOrCallback?: @@ -502,6 +502,26 @@ export class FulfillmentsClient { this.initialize(); return this.innerApiCalls.getFulfillment(request, options, callback); } + /** + * Updates the fulfillment. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2.Fulfillment} request.fulfillment + * Required. The fulfillment to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Fulfillment]{@link google.cloud.dialogflow.v2.Fulfillment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/fulfillments.update_fulfillment.js + * region_tag:dialogflow_v2_generated_Fulfillments_UpdateFulfillment_async + */ updateFulfillment( request?: protos.google.cloud.dialogflow.v2.IUpdateFulfillmentRequest, options?: CallOptions @@ -533,26 +553,6 @@ export class FulfillmentsClient { {} | null | undefined > ): void; - /** - * Updates the fulfillment. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2.Fulfillment} request.fulfillment - * Required. The fulfillment to update. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The mask to control which fields get updated. If the mask is not - * present, all fields will be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Fulfillment]{@link google.cloud.dialogflow.v2.Fulfillment}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateFulfillment(request); - */ updateFulfillment( request?: protos.google.cloud.dialogflow.v2.IUpdateFulfillmentRequest, optionsOrCallback?: diff --git a/packages/google-cloud-dialogflow/src/v2/intents_client.ts b/packages/google-cloud-dialogflow/src/v2/intents_client.ts index 475d20fc869..6c8da94cd46 100644 --- a/packages/google-cloud-dialogflow/src/v2/intents_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/intents_client.ts @@ -484,6 +484,32 @@ export class IntentsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified intent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the intent. + * Format: `projects//agent/intents/`. + * @param {string} [request.languageCode] + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @param {google.cloud.dialogflow.v2.IntentView} [request.intentView] + * Optional. The resource view to apply to the returned intent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Intent]{@link google.cloud.dialogflow.v2.Intent}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/intents.get_intent.js + * region_tag:dialogflow_v2_generated_Intents_GetIntent_async + */ getIntent( request?: protos.google.cloud.dialogflow.v2.IGetIntentRequest, options?: CallOptions @@ -511,32 +537,6 @@ export class IntentsClient { {} | null | undefined > ): void; - /** - * Retrieves the specified intent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the intent. - * Format: `projects//agent/intents/`. - * @param {string} [request.languageCode] - * Optional. The language used to access language-specific data. - * If not specified, the agent's default language is used. - * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - * @param {google.cloud.dialogflow.v2.IntentView} [request.intentView] - * Optional. The resource view to apply to the returned intent. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Intent]{@link google.cloud.dialogflow.v2.Intent}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getIntent(request); - */ getIntent( request?: protos.google.cloud.dialogflow.v2.IGetIntentRequest, optionsOrCallback?: @@ -578,33 +578,6 @@ export class IntentsClient { this.initialize(); return this.innerApiCalls.getIntent(request, options, callback); } - createIntent( - request?: protos.google.cloud.dialogflow.v2.ICreateIntentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2.IIntent, - protos.google.cloud.dialogflow.v2.ICreateIntentRequest | undefined, - {} | undefined - ] - >; - createIntent( - request: protos.google.cloud.dialogflow.v2.ICreateIntentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dialogflow.v2.IIntent, - protos.google.cloud.dialogflow.v2.ICreateIntentRequest | null | undefined, - {} | null | undefined - > - ): void; - createIntent( - request: protos.google.cloud.dialogflow.v2.ICreateIntentRequest, - callback: Callback< - protos.google.cloud.dialogflow.v2.IIntent, - protos.google.cloud.dialogflow.v2.ICreateIntentRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Creates an intent in the specified agent. * @@ -634,9 +607,36 @@ export class IntentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.createIntent(request); + * @example include:samples/generated/v2/intents.create_intent.js + * region_tag:dialogflow_v2_generated_Intents_CreateIntent_async */ + createIntent( + request?: protos.google.cloud.dialogflow.v2.ICreateIntentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IIntent, + protos.google.cloud.dialogflow.v2.ICreateIntentRequest | undefined, + {} | undefined + ] + >; + createIntent( + request: protos.google.cloud.dialogflow.v2.ICreateIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IIntent, + protos.google.cloud.dialogflow.v2.ICreateIntentRequest | null | undefined, + {} | null | undefined + > + ): void; + createIntent( + request: protos.google.cloud.dialogflow.v2.ICreateIntentRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IIntent, + protos.google.cloud.dialogflow.v2.ICreateIntentRequest | null | undefined, + {} | null | undefined + > + ): void; createIntent( request?: protos.google.cloud.dialogflow.v2.ICreateIntentRequest, optionsOrCallback?: @@ -678,33 +678,6 @@ export class IntentsClient { this.initialize(); return this.innerApiCalls.createIntent(request, options, callback); } - updateIntent( - request?: protos.google.cloud.dialogflow.v2.IUpdateIntentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2.IIntent, - protos.google.cloud.dialogflow.v2.IUpdateIntentRequest | undefined, - {} | undefined - ] - >; - updateIntent( - request: protos.google.cloud.dialogflow.v2.IUpdateIntentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dialogflow.v2.IIntent, - protos.google.cloud.dialogflow.v2.IUpdateIntentRequest | null | undefined, - {} | null | undefined - > - ): void; - updateIntent( - request: protos.google.cloud.dialogflow.v2.IUpdateIntentRequest, - callback: Callback< - protos.google.cloud.dialogflow.v2.IIntent, - protos.google.cloud.dialogflow.v2.IUpdateIntentRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Updates the specified intent. * @@ -733,9 +706,36 @@ export class IntentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.updateIntent(request); + * @example include:samples/generated/v2/intents.update_intent.js + * region_tag:dialogflow_v2_generated_Intents_UpdateIntent_async */ + updateIntent( + request?: protos.google.cloud.dialogflow.v2.IUpdateIntentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IIntent, + protos.google.cloud.dialogflow.v2.IUpdateIntentRequest | undefined, + {} | undefined + ] + >; + updateIntent( + request: protos.google.cloud.dialogflow.v2.IUpdateIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IIntent, + protos.google.cloud.dialogflow.v2.IUpdateIntentRequest | null | undefined, + {} | null | undefined + > + ): void; + updateIntent( + request: protos.google.cloud.dialogflow.v2.IUpdateIntentRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IIntent, + protos.google.cloud.dialogflow.v2.IUpdateIntentRequest | null | undefined, + {} | null | undefined + > + ): void; updateIntent( request?: protos.google.cloud.dialogflow.v2.IUpdateIntentRequest, optionsOrCallback?: @@ -777,6 +777,29 @@ export class IntentsClient { this.initialize(); return this.innerApiCalls.updateIntent(request, options, callback); } + /** + * Deletes the specified intent and its direct or indirect followup intents. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the intent to delete. If this intent has direct or + * indirect followup intents, we also delete them. + * Format: `projects//agent/intents/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/intents.delete_intent.js + * region_tag:dialogflow_v2_generated_Intents_DeleteIntent_async + */ deleteIntent( request?: protos.google.cloud.dialogflow.v2.IDeleteIntentRequest, options?: CallOptions @@ -804,29 +827,6 @@ export class IntentsClient { {} | null | undefined > ): void; - /** - * Deletes the specified intent and its direct or indirect followup intents. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the intent to delete. If this intent has direct or - * indirect followup intents, we also delete them. - * Format: `projects//agent/intents/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteIntent(request); - */ deleteIntent( request?: protos.google.cloud.dialogflow.v2.IDeleteIntentRequest, optionsOrCallback?: @@ -869,42 +869,6 @@ export class IntentsClient { return this.innerApiCalls.deleteIntent(request, options, callback); } - batchUpdateIntents( - request?: protos.google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchUpdateIntents( - request: protos.google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchUpdateIntents( - request: protos.google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest, - callback: Callback< - LROperation< - protos.google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Updates/Creates multiple intents in the specified agent. * @@ -950,10 +914,45 @@ export class IntentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.batchUpdateIntents(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2/intents.batch_update_intents.js + * region_tag:dialogflow_v2_generated_Intents_BatchUpdateIntents_async */ + batchUpdateIntents( + request?: protos.google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchUpdateIntents( + request: protos.google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchUpdateIntents( + request: protos.google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchUpdateIntents( request?: protos.google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest, optionsOrCallback?: @@ -1011,11 +1010,8 @@ export class IntentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkBatchUpdateIntentsProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2/intents.batch_update_intents.js + * region_tag:dialogflow_v2_generated_Intents_BatchUpdateIntents_async */ async checkBatchUpdateIntentsProgress( name: string @@ -1039,6 +1035,42 @@ export class IntentsClient { protos.google.protobuf.Struct >; } + /** + * Deletes intents in the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the agent to delete all entities types for. Format: + * `projects//agent`. + * @param {number[]} request.intents + * Required. The collection of intents to delete. Only intent `name` must be + * filled in. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2/intents.batch_delete_intents.js + * region_tag:dialogflow_v2_generated_Intents_BatchDeleteIntents_async + */ batchDeleteIntents( request?: protos.google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest, options?: CallOptions @@ -1075,43 +1107,6 @@ export class IntentsClient { {} | null | undefined > ): void; - /** - * Deletes intents in the specified agent. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: An empty [Struct - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - * - `response`: An [Empty - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the agent to delete all entities types for. Format: - * `projects//agent`. - * @param {number[]} request.intents - * Required. The collection of intents to delete. Only intent `name` must be - * filled in. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.batchDeleteIntents(request); - * const [response] = await operation.promise(); - */ batchDeleteIntents( request?: protos.google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest, optionsOrCallback?: @@ -1169,11 +1164,8 @@ export class IntentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkBatchDeleteIntentsProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2/intents.batch_delete_intents.js + * region_tag:dialogflow_v2_generated_Intents_BatchDeleteIntents_async */ async checkBatchDeleteIntentsProgress( name: string @@ -1194,33 +1186,6 @@ export class IntentsClient { protos.google.protobuf.Struct >; } - listIntents( - request?: protos.google.cloud.dialogflow.v2.IListIntentsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2.IIntent[], - protos.google.cloud.dialogflow.v2.IListIntentsRequest | null, - protos.google.cloud.dialogflow.v2.IListIntentsResponse - ] - >; - listIntents( - request: protos.google.cloud.dialogflow.v2.IListIntentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2.IListIntentsRequest, - protos.google.cloud.dialogflow.v2.IListIntentsResponse | null | undefined, - protos.google.cloud.dialogflow.v2.IIntent - > - ): void; - listIntents( - request: protos.google.cloud.dialogflow.v2.IListIntentsRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2.IListIntentsRequest, - protos.google.cloud.dialogflow.v2.IListIntentsResponse | null | undefined, - protos.google.cloud.dialogflow.v2.IIntent - > - ): void; /** * Returns the list of all intents in the specified agent. * @@ -1263,6 +1228,33 @@ export class IntentsClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listIntents( + request?: protos.google.cloud.dialogflow.v2.IListIntentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IIntent[], + protos.google.cloud.dialogflow.v2.IListIntentsRequest | null, + protos.google.cloud.dialogflow.v2.IListIntentsResponse + ] + >; + listIntents( + request: protos.google.cloud.dialogflow.v2.IListIntentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListIntentsRequest, + protos.google.cloud.dialogflow.v2.IListIntentsResponse | null | undefined, + protos.google.cloud.dialogflow.v2.IIntent + > + ): void; + listIntents( + request: protos.google.cloud.dialogflow.v2.IListIntentsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListIntentsRequest, + protos.google.cloud.dialogflow.v2.IListIntentsResponse | null | undefined, + protos.google.cloud.dialogflow.v2.IIntent + > + ): void; listIntents( request?: protos.google.cloud.dialogflow.v2.IListIntentsRequest, optionsOrCallback?: @@ -1407,11 +1399,8 @@ export class IntentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listIntentsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2/intents.list_intents.js + * region_tag:dialogflow_v2_generated_Intents_ListIntents_async */ listIntentsAsync( request?: protos.google.cloud.dialogflow.v2.IListIntentsRequest, @@ -1425,7 +1414,6 @@ export class IntentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listIntents']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2/knowledge_bases_client.ts b/packages/google-cloud-dialogflow/src/v2/knowledge_bases_client.ts index cc1afec5a75..f1a2e290dc3 100644 --- a/packages/google-cloud-dialogflow/src/v2/knowledge_bases_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/knowledge_bases_client.ts @@ -439,6 +439,25 @@ export class KnowledgeBasesClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified knowledge base. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the knowledge base to retrieve. + * Format `projects//locations//knowledgeBases/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [KnowledgeBase]{@link google.cloud.dialogflow.v2.KnowledgeBase}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/knowledge_bases.get_knowledge_base.js + * region_tag:dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_async + */ getKnowledgeBase( request?: protos.google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest, options?: CallOptions @@ -470,25 +489,6 @@ export class KnowledgeBasesClient { {} | null | undefined > ): void; - /** - * Retrieves the specified knowledge base. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the knowledge base to retrieve. - * Format `projects//locations//knowledgeBases/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [KnowledgeBase]{@link google.cloud.dialogflow.v2.KnowledgeBase}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getKnowledgeBase(request); - */ getKnowledgeBase( request?: protos.google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest, optionsOrCallback?: @@ -532,6 +532,26 @@ export class KnowledgeBasesClient { this.initialize(); return this.innerApiCalls.getKnowledgeBase(request, options, callback); } + /** + * Creates a knowledge base. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to create a knowledge base for. + * Format: `projects//locations/`. + * @param {google.cloud.dialogflow.v2.KnowledgeBase} request.knowledgeBase + * Required. The knowledge base to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [KnowledgeBase]{@link google.cloud.dialogflow.v2.KnowledgeBase}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/knowledge_bases.create_knowledge_base.js + * region_tag:dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_async + */ createKnowledgeBase( request?: protos.google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest, options?: CallOptions @@ -563,26 +583,6 @@ export class KnowledgeBasesClient { {} | null | undefined > ): void; - /** - * Creates a knowledge base. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project to create a knowledge base for. - * Format: `projects//locations/`. - * @param {google.cloud.dialogflow.v2.KnowledgeBase} request.knowledgeBase - * Required. The knowledge base to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [KnowledgeBase]{@link google.cloud.dialogflow.v2.KnowledgeBase}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createKnowledgeBase(request); - */ createKnowledgeBase( request?: protos.google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest, optionsOrCallback?: @@ -626,6 +626,28 @@ export class KnowledgeBasesClient { this.initialize(); return this.innerApiCalls.createKnowledgeBase(request, options, callback); } + /** + * Deletes the specified knowledge base. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the knowledge base to delete. + * Format: `projects//locations//knowledgeBases/`. + * @param {boolean} [request.force] + * Optional. Force deletes the knowledge base. When set to true, any documents + * in the knowledge base are also deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/knowledge_bases.delete_knowledge_base.js + * region_tag:dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_async + */ deleteKnowledgeBase( request?: protos.google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest, options?: CallOptions @@ -657,28 +679,6 @@ export class KnowledgeBasesClient { {} | null | undefined > ): void; - /** - * Deletes the specified knowledge base. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the knowledge base to delete. - * Format: `projects//locations//knowledgeBases/`. - * @param {boolean} [request.force] - * Optional. Force deletes the knowledge base. When set to true, any documents - * in the knowledge base are also deleted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteKnowledgeBase(request); - */ deleteKnowledgeBase( request?: protos.google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest, optionsOrCallback?: @@ -722,6 +722,27 @@ export class KnowledgeBasesClient { this.initialize(); return this.innerApiCalls.deleteKnowledgeBase(request, options, callback); } + /** + * Updates the specified knowledge base. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2.KnowledgeBase} request.knowledgeBase + * Required. The knowledge base to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [KnowledgeBase]{@link google.cloud.dialogflow.v2.KnowledgeBase}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/knowledge_bases.update_knowledge_base.js + * region_tag:dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_async + */ updateKnowledgeBase( request?: protos.google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest, options?: CallOptions @@ -753,27 +774,6 @@ export class KnowledgeBasesClient { {} | null | undefined > ): void; - /** - * Updates the specified knowledge base. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2.KnowledgeBase} request.knowledgeBase - * Required. The knowledge base to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. Not specified means `update all`. - * Currently, only `display_name` can be updated, an InvalidArgument will be - * returned for attempting to update other fields. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [KnowledgeBase]{@link google.cloud.dialogflow.v2.KnowledgeBase}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateKnowledgeBase(request); - */ updateKnowledgeBase( request?: protos.google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest, optionsOrCallback?: @@ -818,6 +818,32 @@ export class KnowledgeBasesClient { return this.innerApiCalls.updateKnowledgeBase(request, options, callback); } + /** + * Returns the list of all knowledge bases of the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list of knowledge bases for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [KnowledgeBase]{@link google.cloud.dialogflow.v2.KnowledgeBase}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listKnowledgeBasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listKnowledgeBases( request?: protos.google.cloud.dialogflow.v2.IListKnowledgeBasesRequest, options?: CallOptions @@ -849,32 +875,6 @@ export class KnowledgeBasesClient { protos.google.cloud.dialogflow.v2.IKnowledgeBase > ): void; - /** - * Returns the list of all knowledge bases of the specified agent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project to list of knowledge bases for. - * Format: `projects//locations/`. - * @param {number} request.pageSize - * The maximum number of items to return in a single page. By - * default 10 and at most 100. - * @param {string} request.pageToken - * The next_page_token value returned from a previous list request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [KnowledgeBase]{@link google.cloud.dialogflow.v2.KnowledgeBase}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listKnowledgeBasesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listKnowledgeBases( request?: protos.google.cloud.dialogflow.v2.IListKnowledgeBasesRequest, optionsOrCallback?: @@ -989,11 +989,8 @@ export class KnowledgeBasesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listKnowledgeBasesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2/knowledge_bases.list_knowledge_bases.js + * region_tag:dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_async */ listKnowledgeBasesAsync( request?: protos.google.cloud.dialogflow.v2.IListKnowledgeBasesRequest, @@ -1007,7 +1004,6 @@ export class KnowledgeBasesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listKnowledgeBases']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2/participants_client.ts b/packages/google-cloud-dialogflow/src/v2/participants_client.ts index 5880a798ba0..551e5aac8ad 100644 --- a/packages/google-cloud-dialogflow/src/v2/participants_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/participants_client.ts @@ -441,6 +441,27 @@ export class ParticipantsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Creates a new participant in a conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource identifier of the conversation adding the participant. + * Format: `projects//locations//conversations/`. + * @param {google.cloud.dialogflow.v2.Participant} request.participant + * Required. The participant to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2.Participant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/participants.create_participant.js + * region_tag:dialogflow_v2_generated_Participants_CreateParticipant_async + */ createParticipant( request?: protos.google.cloud.dialogflow.v2.ICreateParticipantRequest, options?: CallOptions @@ -472,27 +493,6 @@ export class ParticipantsClient { {} | null | undefined > ): void; - /** - * Creates a new participant in a conversation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource identifier of the conversation adding the participant. - * Format: `projects//locations//conversations/`. - * @param {google.cloud.dialogflow.v2.Participant} request.participant - * Required. The participant to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2.Participant}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createParticipant(request); - */ createParticipant( request?: protos.google.cloud.dialogflow.v2.ICreateParticipantRequest, optionsOrCallback?: @@ -536,6 +536,25 @@ export class ParticipantsClient { this.initialize(); return this.innerApiCalls.createParticipant(request, options, callback); } + /** + * Retrieves a conversation participant. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the participant. Format: + * `projects//locations//conversations//participants/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2.Participant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/participants.get_participant.js + * region_tag:dialogflow_v2_generated_Participants_GetParticipant_async + */ getParticipant( request?: protos.google.cloud.dialogflow.v2.IGetParticipantRequest, options?: CallOptions @@ -567,25 +586,6 @@ export class ParticipantsClient { {} | null | undefined > ): void; - /** - * Retrieves a conversation participant. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the participant. Format: - * `projects//locations//conversations//participants/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2.Participant}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getParticipant(request); - */ getParticipant( request?: protos.google.cloud.dialogflow.v2.IGetParticipantRequest, optionsOrCallback?: @@ -629,6 +629,25 @@ export class ParticipantsClient { this.initialize(); return this.innerApiCalls.getParticipant(request, options, callback); } + /** + * Updates the specified participant. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2.Participant} request.participant + * Required. The participant to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to specify which fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2.Participant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/participants.update_participant.js + * region_tag:dialogflow_v2_generated_Participants_UpdateParticipant_async + */ updateParticipant( request?: protos.google.cloud.dialogflow.v2.IUpdateParticipantRequest, options?: CallOptions @@ -660,25 +679,6 @@ export class ParticipantsClient { {} | null | undefined > ): void; - /** - * Updates the specified participant. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2.Participant} request.participant - * Required. The participant to update. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The mask to specify which fields to update. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2.Participant}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateParticipant(request); - */ updateParticipant( request?: protos.google.cloud.dialogflow.v2.IUpdateParticipantRequest, optionsOrCallback?: @@ -722,37 +722,6 @@ export class ParticipantsClient { this.initialize(); return this.innerApiCalls.updateParticipant(request, options, callback); } - analyzeContent( - request?: protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2.IAnalyzeContentResponse, - protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest | undefined, - {} | undefined - ] - >; - analyzeContent( - request: protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dialogflow.v2.IAnalyzeContentResponse, - | protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest - | null - | undefined, - {} | null | undefined - > - ): void; - analyzeContent( - request: protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest, - callback: Callback< - protos.google.cloud.dialogflow.v2.IAnalyzeContentResponse, - | protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Adds a text (chat, for example), or audio (phone recording, for example) * message from a participant into the conversation. @@ -790,9 +759,40 @@ export class ParticipantsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.analyzeContent(request); + * @example include:samples/generated/v2/participants.analyze_content.js + * region_tag:dialogflow_v2_generated_Participants_AnalyzeContent_async */ + analyzeContent( + request?: protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IAnalyzeContentResponse, + protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest | undefined, + {} | undefined + ] + >; + analyzeContent( + request: protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IAnalyzeContentResponse, + | protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeContent( + request: protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IAnalyzeContentResponse, + | protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; analyzeContent( request?: protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest, optionsOrCallback?: @@ -836,6 +836,36 @@ export class ParticipantsClient { this.initialize(); return this.innerApiCalls.analyzeContent(request, options, callback); } + /** + * Gets suggested articles for a participant based on specific historical + * messages. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @param {string} request.latestMessage + * The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * + * Format: `projects//locations//conversations//messages/`. + * @param {number} request.contextSize + * Max number of messages prior to and including + * {@link google.cloud.dialogflow.v2.SuggestArticlesRequest.latest_message|latest_message} to use as context + * when compiling the suggestion. By default 20 and at most 50. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SuggestArticlesResponse]{@link google.cloud.dialogflow.v2.SuggestArticlesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/participants.suggest_articles.js + * region_tag:dialogflow_v2_generated_Participants_SuggestArticles_async + */ suggestArticles( request?: protos.google.cloud.dialogflow.v2.ISuggestArticlesRequest, options?: CallOptions @@ -867,36 +897,6 @@ export class ParticipantsClient { {} | null | undefined > ): void; - /** - * Gets suggested articles for a participant based on specific historical - * messages. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the participant to fetch suggestion for. - * Format: `projects//locations//conversations//participants/`. - * @param {string} request.latestMessage - * The name of the latest conversation message to compile suggestion - * for. If empty, it will be the latest message of the conversation. - * - * Format: `projects//locations//conversations//messages/`. - * @param {number} request.contextSize - * Max number of messages prior to and including - * {@link google.cloud.dialogflow.v2.SuggestArticlesRequest.latest_message|latest_message} to use as context - * when compiling the suggestion. By default 20 and at most 50. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SuggestArticlesResponse]{@link google.cloud.dialogflow.v2.SuggestArticlesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.suggestArticles(request); - */ suggestArticles( request?: protos.google.cloud.dialogflow.v2.ISuggestArticlesRequest, optionsOrCallback?: @@ -940,6 +940,36 @@ export class ParticipantsClient { this.initialize(); return this.innerApiCalls.suggestArticles(request, options, callback); } + /** + * Gets suggested faq answers for a participant based on specific historical + * messages. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @param {string} request.latestMessage + * The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * + * Format: `projects//locations//conversations//messages/`. + * @param {number} request.contextSize + * Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SuggestFaqAnswersResponse]{@link google.cloud.dialogflow.v2.SuggestFaqAnswersResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/participants.suggest_faq_answers.js + * region_tag:dialogflow_v2_generated_Participants_SuggestFaqAnswers_async + */ suggestFaqAnswers( request?: protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest, options?: CallOptions @@ -971,36 +1001,6 @@ export class ParticipantsClient { {} | null | undefined > ): void; - /** - * Gets suggested faq answers for a participant based on specific historical - * messages. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the participant to fetch suggestion for. - * Format: `projects//locations//conversations//participants/`. - * @param {string} request.latestMessage - * The name of the latest conversation message to compile suggestion - * for. If empty, it will be the latest message of the conversation. - * - * Format: `projects//locations//conversations//messages/`. - * @param {number} request.contextSize - * Max number of messages prior to and including - * [latest_message] to use as context when compiling the - * suggestion. By default 20 and at most 50. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SuggestFaqAnswersResponse]{@link google.cloud.dialogflow.v2.SuggestFaqAnswersResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.suggestFaqAnswers(request); - */ suggestFaqAnswers( request?: protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest, optionsOrCallback?: @@ -1045,6 +1045,33 @@ export class ParticipantsClient { return this.innerApiCalls.suggestFaqAnswers(request, options, callback); } + /** + * Returns the list of all participants in the specified conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Participant]{@link google.cloud.dialogflow.v2.Participant}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listParticipantsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listParticipants( request?: protos.google.cloud.dialogflow.v2.IListParticipantsRequest, options?: CallOptions @@ -1076,33 +1103,6 @@ export class ParticipantsClient { protos.google.cloud.dialogflow.v2.IParticipant > ): void; - /** - * Returns the list of all participants in the specified conversation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The conversation to list all participants from. - * Format: `projects//locations//conversations/`. - * @param {number} [request.pageSize] - * Optional. The maximum number of items to return in a single page. By - * default 100 and at most 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous list request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Participant]{@link google.cloud.dialogflow.v2.Participant}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listParticipantsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listParticipants( request?: protos.google.cloud.dialogflow.v2.IListParticipantsRequest, optionsOrCallback?: @@ -1219,11 +1219,8 @@ export class ParticipantsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listParticipantsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2/participants.list_participants.js + * region_tag:dialogflow_v2_generated_Participants_ListParticipants_async */ listParticipantsAsync( request?: protos.google.cloud.dialogflow.v2.IListParticipantsRequest, @@ -1237,7 +1234,6 @@ export class ParticipantsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listParticipants']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2/session_entity_types_client.ts b/packages/google-cloud-dialogflow/src/v2/session_entity_types_client.ts index 9d4726f54d3..9abcee99f8b 100644 --- a/packages/google-cloud-dialogflow/src/v2/session_entity_types_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/session_entity_types_client.ts @@ -442,6 +442,33 @@ export class SessionEntityTypesClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified session entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the session entity type. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SessionEntityType]{@link google.cloud.dialogflow.v2.SessionEntityType}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/session_entity_types.get_session_entity_type.js + * region_tag:dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_async + */ getSessionEntityType( request?: protos.google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest, options?: CallOptions @@ -476,33 +503,6 @@ export class SessionEntityTypesClient { {} | null | undefined > ): void; - /** - * Retrieves the specified session entity type. - * - * This method doesn't work with Google Assistant integration. - * Contact Dialogflow support if you need to use session entities - * with Google Assistant integration. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the session entity type. Format: - * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. - * If `Environment ID` is not specified, we assume default 'draft' - * environment. If `User ID` is not specified, we assume default '-' user. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SessionEntityType]{@link google.cloud.dialogflow.v2.SessionEntityType}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getSessionEntityType(request); - */ getSessionEntityType( request?: protos.google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest, optionsOrCallback?: @@ -549,6 +549,37 @@ export class SessionEntityTypesClient { this.initialize(); return this.innerApiCalls.getSessionEntityType(request, options, callback); } + /** + * Creates a session entity type. + * + * If the specified session entity type already exists, overrides the session + * entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The session to create a session entity type for. + * Format: `projects//agent/sessions/` or + * `projects//agent/environments//users// + * sessions/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * @param {google.cloud.dialogflow.v2.SessionEntityType} request.sessionEntityType + * Required. The session entity type to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SessionEntityType]{@link google.cloud.dialogflow.v2.SessionEntityType}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/session_entity_types.create_session_entity_type.js + * region_tag:dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_async + */ createSessionEntityType( request?: protos.google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest, options?: CallOptions @@ -583,37 +614,6 @@ export class SessionEntityTypesClient { {} | null | undefined > ): void; - /** - * Creates a session entity type. - * - * If the specified session entity type already exists, overrides the session - * entity type. - * - * This method doesn't work with Google Assistant integration. - * Contact Dialogflow support if you need to use session entities - * with Google Assistant integration. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The session to create a session entity type for. - * Format: `projects//agent/sessions/` or - * `projects//agent/environments//users// - * sessions/`. - * If `Environment ID` is not specified, we assume default 'draft' - * environment. If `User ID` is not specified, we assume default '-' user. - * @param {google.cloud.dialogflow.v2.SessionEntityType} request.sessionEntityType - * Required. The session entity type to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SessionEntityType]{@link google.cloud.dialogflow.v2.SessionEntityType}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createSessionEntityType(request); - */ createSessionEntityType( request?: protos.google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest, optionsOrCallback?: @@ -664,6 +664,29 @@ export class SessionEntityTypesClient { callback ); } + /** + * Updates the specified session entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2.SessionEntityType} request.sessionEntityType + * Required. The session entity type to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SessionEntityType]{@link google.cloud.dialogflow.v2.SessionEntityType}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/session_entity_types.update_session_entity_type.js + * region_tag:dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_async + */ updateSessionEntityType( request?: protos.google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest, options?: CallOptions @@ -698,29 +721,6 @@ export class SessionEntityTypesClient { {} | null | undefined > ): void; - /** - * Updates the specified session entity type. - * - * This method doesn't work with Google Assistant integration. - * Contact Dialogflow support if you need to use session entities - * with Google Assistant integration. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2.SessionEntityType} request.sessionEntityType - * Required. The session entity type to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The mask to control which fields get updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SessionEntityType]{@link google.cloud.dialogflow.v2.SessionEntityType}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateSessionEntityType(request); - */ updateSessionEntityType( request?: protos.google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest, optionsOrCallback?: @@ -771,6 +771,33 @@ export class SessionEntityTypesClient { callback ); } + /** + * Deletes the specified session entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the entity type to delete. Format: + * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. + * If `Environment ID` is not specified, we assume default 'draft' + * environment. If `User ID` is not specified, we assume default '-' user. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/session_entity_types.delete_session_entity_type.js + * region_tag:dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_async + */ deleteSessionEntityType( request?: protos.google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest, options?: CallOptions @@ -805,33 +832,6 @@ export class SessionEntityTypesClient { {} | null | undefined > ): void; - /** - * Deletes the specified session entity type. - * - * This method doesn't work with Google Assistant integration. - * Contact Dialogflow support if you need to use session entities - * with Google Assistant integration. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the entity type to delete. Format: - * `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. - * If `Environment ID` is not specified, we assume default 'draft' - * environment. If `User ID` is not specified, we assume default '-' user. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteSessionEntityType(request); - */ deleteSessionEntityType( request?: protos.google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest, optionsOrCallback?: @@ -883,37 +883,6 @@ export class SessionEntityTypesClient { ); } - listSessionEntityTypes( - request?: protos.google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2.ISessionEntityType[], - protos.google.cloud.dialogflow.v2.IListSessionEntityTypesRequest | null, - protos.google.cloud.dialogflow.v2.IListSessionEntityTypesResponse - ] - >; - listSessionEntityTypes( - request: protos.google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, - | protos.google.cloud.dialogflow.v2.IListSessionEntityTypesResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2.ISessionEntityType - > - ): void; - listSessionEntityTypes( - request: protos.google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, - | protos.google.cloud.dialogflow.v2.IListSessionEntityTypesResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2.ISessionEntityType - > - ): void; /** * Returns the list of all session entity types in the specified session. * @@ -948,6 +917,37 @@ export class SessionEntityTypesClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listSessionEntityTypes( + request?: protos.google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.ISessionEntityType[], + protos.google.cloud.dialogflow.v2.IListSessionEntityTypesRequest | null, + protos.google.cloud.dialogflow.v2.IListSessionEntityTypesResponse + ] + >; + listSessionEntityTypes( + request: protos.google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, + | protos.google.cloud.dialogflow.v2.IListSessionEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.ISessionEntityType + > + ): void; + listSessionEntityTypes( + request: protos.google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, + | protos.google.cloud.dialogflow.v2.IListSessionEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.ISessionEntityType + > + ): void; listSessionEntityTypes( request?: protos.google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, optionsOrCallback?: @@ -1074,11 +1074,8 @@ export class SessionEntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listSessionEntityTypesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2/session_entity_types.list_session_entity_types.js + * region_tag:dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_async */ listSessionEntityTypesAsync( request?: protos.google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, @@ -1092,7 +1089,6 @@ export class SessionEntityTypesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listSessionEntityTypes']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2/sessions_client.ts b/packages/google-cloud-dialogflow/src/v2/sessions_client.ts index a5fb03cda56..f0c43f1fa6c 100644 --- a/packages/google-cloud-dialogflow/src/v2/sessions_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/sessions_client.ts @@ -435,33 +435,6 @@ export class SessionsClient { // ------------------- // -- Service calls -- // ------------------- - detectIntent( - request?: protos.google.cloud.dialogflow.v2.IDetectIntentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2.IDetectIntentResponse, - protos.google.cloud.dialogflow.v2.IDetectIntentRequest | undefined, - {} | undefined - ] - >; - detectIntent( - request: protos.google.cloud.dialogflow.v2.IDetectIntentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dialogflow.v2.IDetectIntentResponse, - protos.google.cloud.dialogflow.v2.IDetectIntentRequest | null | undefined, - {} | null | undefined - > - ): void; - detectIntent( - request: protos.google.cloud.dialogflow.v2.IDetectIntentRequest, - callback: Callback< - protos.google.cloud.dialogflow.v2.IDetectIntentResponse, - protos.google.cloud.dialogflow.v2.IDetectIntentRequest | null | undefined, - {} | null | undefined - > - ): void; /** * Processes a natural language query and returns structured, actionable data * as a result. This method is not idempotent, because it may cause contexts @@ -532,9 +505,36 @@ export class SessionsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.detectIntent(request); + * @example include:samples/generated/v2/sessions.detect_intent.js + * region_tag:dialogflow_v2_generated_Sessions_DetectIntent_async */ + detectIntent( + request?: protos.google.cloud.dialogflow.v2.IDetectIntentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IDetectIntentResponse, + protos.google.cloud.dialogflow.v2.IDetectIntentRequest | undefined, + {} | undefined + ] + >; + detectIntent( + request: protos.google.cloud.dialogflow.v2.IDetectIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IDetectIntentResponse, + protos.google.cloud.dialogflow.v2.IDetectIntentRequest | null | undefined, + {} | null | undefined + > + ): void; + detectIntent( + request: protos.google.cloud.dialogflow.v2.IDetectIntentRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IDetectIntentResponse, + protos.google.cloud.dialogflow.v2.IDetectIntentRequest | null | undefined, + {} | null | undefined + > + ): void; detectIntent( request?: protos.google.cloud.dialogflow.v2.IDetectIntentRequest, optionsOrCallback?: @@ -602,12 +602,8 @@ export class SessionsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming) * for more details and examples. - * @example - * const stream = client.streamingDetectIntent(); - * stream.on('data', (response) => { ... }); - * stream.on('end', () => { ... }); - * stream.write(request); - * stream.end(); + * @example include:samples/generated/v2/sessions.streaming_detect_intent.js + * region_tag:dialogflow_v2_generated_Sessions_StreamingDetectIntent_async */ streamingDetectIntent(options?: CallOptions): gax.CancellableStream { this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2/versions_client.ts b/packages/google-cloud-dialogflow/src/v2/versions_client.ts index 893a0858650..81c69de854c 100644 --- a/packages/google-cloud-dialogflow/src/v2/versions_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/versions_client.ts @@ -439,6 +439,28 @@ export class VersionsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified agent version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the version. + * Supported formats: + * + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Version]{@link google.cloud.dialogflow.v2.Version}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/versions.get_version.js + * region_tag:dialogflow_v2_generated_Versions_GetVersion_async + */ getVersion( request?: protos.google.cloud.dialogflow.v2.IGetVersionRequest, options?: CallOptions @@ -466,28 +488,6 @@ export class VersionsClient { {} | null | undefined > ): void; - /** - * Retrieves the specified agent version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the version. - * Supported formats: - * - * - `projects//agent/versions/` - * - `projects//locations//agent/versions/` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Version]{@link google.cloud.dialogflow.v2.Version}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getVersion(request); - */ getVersion( request?: protos.google.cloud.dialogflow.v2.IGetVersionRequest, optionsOrCallback?: @@ -529,6 +529,31 @@ export class VersionsClient { this.initialize(); return this.innerApiCalls.getVersion(request, options, callback); } + /** + * Creates an agent version. + * + * The new version points to the agent instance in the "default" environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create a version for. + * Supported formats: + * + * - `projects//agent` + * - `projects//locations//agent` + * @param {google.cloud.dialogflow.v2.Version} request.version + * Required. The version to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Version]{@link google.cloud.dialogflow.v2.Version}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/versions.create_version.js + * region_tag:dialogflow_v2_generated_Versions_CreateVersion_async + */ createVersion( request?: protos.google.cloud.dialogflow.v2.ICreateVersionRequest, options?: CallOptions @@ -560,31 +585,6 @@ export class VersionsClient { {} | null | undefined > ): void; - /** - * Creates an agent version. - * - * The new version points to the agent instance in the "default" environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The agent to create a version for. - * Supported formats: - * - * - `projects//agent` - * - `projects//locations//agent` - * @param {google.cloud.dialogflow.v2.Version} request.version - * Required. The version to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Version]{@link google.cloud.dialogflow.v2.Version}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createVersion(request); - */ createVersion( request?: protos.google.cloud.dialogflow.v2.ICreateVersionRequest, optionsOrCallback?: @@ -628,6 +628,34 @@ export class VersionsClient { this.initialize(); return this.innerApiCalls.createVersion(request, options, callback); } + /** + * Updates the specified agent version. + * + * Note that this method does not allow you to update the state of the agent + * the given version points to. It allows you to update only mutable + * properties of the version resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2.Version} request.version + * Required. The version to update. + * Supported formats: + * + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Version]{@link google.cloud.dialogflow.v2.Version}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/versions.update_version.js + * region_tag:dialogflow_v2_generated_Versions_UpdateVersion_async + */ updateVersion( request?: protos.google.cloud.dialogflow.v2.IUpdateVersionRequest, options?: CallOptions @@ -659,34 +687,6 @@ export class VersionsClient { {} | null | undefined > ): void; - /** - * Updates the specified agent version. - * - * Note that this method does not allow you to update the state of the agent - * the given version points to. It allows you to update only mutable - * properties of the version resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2.Version} request.version - * Required. The version to update. - * Supported formats: - * - * - `projects//agent/versions/` - * - `projects//locations//agent/versions/` - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The mask to control which fields get updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Version]{@link google.cloud.dialogflow.v2.Version}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateVersion(request); - */ updateVersion( request?: protos.google.cloud.dialogflow.v2.IUpdateVersionRequest, optionsOrCallback?: @@ -730,6 +730,28 @@ export class VersionsClient { this.initialize(); return this.innerApiCalls.updateVersion(request, options, callback); } + /** + * Delete the specified agent version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the version to delete. + * Supported formats: + * + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2/versions.delete_version.js + * region_tag:dialogflow_v2_generated_Versions_DeleteVersion_async + */ deleteVersion( request?: protos.google.cloud.dialogflow.v2.IDeleteVersionRequest, options?: CallOptions @@ -761,28 +783,6 @@ export class VersionsClient { {} | null | undefined > ): void; - /** - * Delete the specified agent version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the version to delete. - * Supported formats: - * - * - `projects//agent/versions/` - * - `projects//locations//agent/versions/` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteVersion(request); - */ deleteVersion( request?: protos.google.cloud.dialogflow.v2.IDeleteVersionRequest, optionsOrCallback?: @@ -827,6 +827,35 @@ export class VersionsClient { return this.innerApiCalls.deleteVersion(request, options, callback); } + /** + * Returns the list of all versions of the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all versions from. + * Supported formats: + * + * - `projects//agent` + * - `projects//locations//agent` + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Version]{@link google.cloud.dialogflow.v2.Version}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listVersions( request?: protos.google.cloud.dialogflow.v2.IListVersionsRequest, options?: CallOptions @@ -858,35 +887,6 @@ export class VersionsClient { protos.google.cloud.dialogflow.v2.IVersion > ): void; - /** - * Returns the list of all versions of the specified agent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The agent to list all versions from. - * Supported formats: - * - * - `projects//agent` - * - `projects//locations//agent` - * @param {number} [request.pageSize] - * Optional. The maximum number of items to return in a single page. By default 100 and - * at most 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous list request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Version]{@link google.cloud.dialogflow.v2.Version}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listVersionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listVersions( request?: protos.google.cloud.dialogflow.v2.IListVersionsRequest, optionsOrCallback?: @@ -1007,11 +1007,8 @@ export class VersionsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listVersionsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2/versions.list_versions.js + * region_tag:dialogflow_v2_generated_Versions_ListVersions_async */ listVersionsAsync( request?: protos.google.cloud.dialogflow.v2.IListVersionsRequest, @@ -1025,7 +1022,6 @@ export class VersionsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listVersions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2beta1/agents_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/agents_client.ts index 9a450166778..025363ef272 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/agents_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/agents_client.ts @@ -508,6 +508,25 @@ export class AgentsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project that the agent to fetch is associated with. + * Format: `projects/` or + * `projects//locations/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Agent]{@link google.cloud.dialogflow.v2beta1.Agent}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/agents.get_agent.js + * region_tag:dialogflow_v2beta1_generated_Agents_GetAgent_async + */ getAgent( request?: protos.google.cloud.dialogflow.v2beta1.IGetAgentRequest, options?: CallOptions @@ -539,25 +558,6 @@ export class AgentsClient { {} | null | undefined > ): void; - /** - * Retrieves the specified agent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project that the agent to fetch is associated with. - * Format: `projects/` or - * `projects//locations/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Agent]{@link google.cloud.dialogflow.v2beta1.Agent}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getAgent(request); - */ getAgent( request?: protos.google.cloud.dialogflow.v2beta1.IGetAgentRequest, optionsOrCallback?: @@ -601,6 +601,29 @@ export class AgentsClient { this.initialize(); return this.innerApiCalls.getAgent(request, options, callback); } + /** + * Creates/updates the specified agent. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2beta1.Agent} request.agent + * Required. The agent to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Optional. The mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Agent]{@link google.cloud.dialogflow.v2beta1.Agent}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/agents.set_agent.js + * region_tag:dialogflow_v2beta1_generated_Agents_SetAgent_async + */ setAgent( request?: protos.google.cloud.dialogflow.v2beta1.ISetAgentRequest, options?: CallOptions @@ -632,29 +655,6 @@ export class AgentsClient { {} | null | undefined > ): void; - /** - * Creates/updates the specified agent. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2beta1.Agent} request.agent - * Required. The agent to update. - * @param {google.protobuf.FieldMask} request.updateMask - * Optional. The mask to control which fields get updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Agent]{@link google.cloud.dialogflow.v2beta1.Agent}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.setAgent(request); - */ setAgent( request?: protos.google.cloud.dialogflow.v2beta1.ISetAgentRequest, optionsOrCallback?: @@ -698,6 +698,25 @@ export class AgentsClient { this.initialize(); return this.innerApiCalls.setAgent(request, options, callback); } + /** + * Deletes the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project that the agent to delete is associated with. + * Format: `projects/` or + * `projects//locations/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/agents.delete_agent.js + * region_tag:dialogflow_v2beta1_generated_Agents_DeleteAgent_async + */ deleteAgent( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteAgentRequest, options?: CallOptions @@ -729,25 +748,6 @@ export class AgentsClient { {} | null | undefined > ): void; - /** - * Deletes the specified agent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project that the agent to delete is associated with. - * Format: `projects/` or - * `projects//locations/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteAgent(request); - */ deleteAgent( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteAgentRequest, optionsOrCallback?: @@ -791,6 +791,32 @@ export class AgentsClient { this.initialize(); return this.innerApiCalls.deleteAgent(request, options, callback); } + /** + * Gets agent validation result. Agent validation is performed during + * training time and is updated automatically when training is completed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project that the agent is associated with. + * Format: `projects/` or + * `projects//locations/`. + * @param {string} [request.languageCode] + * Optional. The language for which you want a validation result. If not + * specified, the agent's default language is used. [Many + * languages](https://cloud.google.com/dialogflow/docs/reference/language) + * are supported. Note: languages must be enabled in the agent before they can + * be used. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ValidationResult]{@link google.cloud.dialogflow.v2beta1.ValidationResult}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/agents.get_validation_result.js + * region_tag:dialogflow_v2beta1_generated_Agents_GetValidationResult_async + */ getValidationResult( request?: protos.google.cloud.dialogflow.v2beta1.IGetValidationResultRequest, options?: CallOptions @@ -825,32 +851,6 @@ export class AgentsClient { {} | null | undefined > ): void; - /** - * Gets agent validation result. Agent validation is performed during - * training time and is updated automatically when training is completed. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project that the agent is associated with. - * Format: `projects/` or - * `projects//locations/`. - * @param {string} [request.languageCode] - * Optional. The language for which you want a validation result. If not - * specified, the agent's default language is used. [Many - * languages](https://cloud.google.com/dialogflow/docs/reference/language) - * are supported. Note: languages must be enabled in the agent before they can - * be used. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ValidationResult]{@link google.cloud.dialogflow.v2beta1.ValidationResult}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getValidationResult(request); - */ getValidationResult( request?: protos.google.cloud.dialogflow.v2beta1.IGetValidationResultRequest, optionsOrCallback?: @@ -898,6 +898,40 @@ export class AgentsClient { return this.innerApiCalls.getValidationResult(request, options, callback); } + /** + * Trains the specified agent. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project that the agent to train is associated with. + * Format: `projects/` or + * `projects//locations/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2beta1/agents.train_agent.js + * region_tag:dialogflow_v2beta1_generated_Agents_TrainAgent_async + */ trainAgent( request?: protos.google.cloud.dialogflow.v2beta1.ITrainAgentRequest, options?: CallOptions @@ -934,41 +968,6 @@ export class AgentsClient { {} | null | undefined > ): void; - /** - * Trains the specified agent. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: An empty [Struct - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - * - `response`: An [Empty - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project that the agent to train is associated with. - * Format: `projects/` or - * `projects//locations/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.trainAgent(request); - * const [response] = await operation.promise(); - */ trainAgent( request?: protos.google.cloud.dialogflow.v2beta1.ITrainAgentRequest, optionsOrCallback?: @@ -1026,11 +1025,8 @@ export class AgentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkTrainAgentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2beta1/agents.train_agent.js + * region_tag:dialogflow_v2beta1_generated_Agents_TrainAgent_async */ async checkTrainAgentProgress( name: string @@ -1051,6 +1047,41 @@ export class AgentsClient { protos.google.protobuf.Struct >; } + /** + * Exports the specified agent to a ZIP file. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: An empty [Struct + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) + * - `response`: {@link google.cloud.dialogflow.v2beta1.ExportAgentResponse|ExportAgentResponse} + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project that the agent to export is associated with. + * Format: `projects/` or + * `projects//locations/`. + * @param {string} request.agentUri + * Optional. The + * [Google Cloud Storage](https://cloud.google.com/storage/docs/) + * URI to export the agent to. + * The format of this URI must be `gs:///`. + * If left unspecified, the serialized agent is returned inline. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2beta1/agents.export_agent.js + * region_tag:dialogflow_v2beta1_generated_Agents_ExportAgent_async + */ exportAgent( request?: protos.google.cloud.dialogflow.v2beta1.IExportAgentRequest, options?: CallOptions @@ -1087,42 +1118,6 @@ export class AgentsClient { {} | null | undefined > ): void; - /** - * Exports the specified agent to a ZIP file. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: An empty [Struct - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - * - `response`: {@link google.cloud.dialogflow.v2beta1.ExportAgentResponse|ExportAgentResponse} - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project that the agent to export is associated with. - * Format: `projects/` or - * `projects//locations/`. - * @param {string} request.agentUri - * Optional. The - * [Google Cloud Storage](https://cloud.google.com/storage/docs/) - * URI to export the agent to. - * The format of this URI must be `gs:///`. - * If left unspecified, the serialized agent is returned inline. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.exportAgent(request); - * const [response] = await operation.promise(); - */ exportAgent( request?: protos.google.cloud.dialogflow.v2beta1.IExportAgentRequest, optionsOrCallback?: @@ -1180,11 +1175,8 @@ export class AgentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkExportAgentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2beta1/agents.export_agent.js + * region_tag:dialogflow_v2beta1_generated_Agents_ExportAgent_async */ async checkExportAgentProgress( name: string @@ -1208,42 +1200,6 @@ export class AgentsClient { protos.google.protobuf.Struct >; } - importAgent( - request?: protos.google.cloud.dialogflow.v2beta1.IImportAgentRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - importAgent( - request: protos.google.cloud.dialogflow.v2beta1.IImportAgentRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - importAgent( - request: protos.google.cloud.dialogflow.v2beta1.IImportAgentRequest, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Imports the specified agent from a ZIP file. * @@ -1291,10 +1247,45 @@ export class AgentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.importAgent(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2beta1/agents.import_agent.js + * region_tag:dialogflow_v2beta1_generated_Agents_ImportAgent_async */ + importAgent( + request?: protos.google.cloud.dialogflow.v2beta1.IImportAgentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + importAgent( + request: protos.google.cloud.dialogflow.v2beta1.IImportAgentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importAgent( + request: protos.google.cloud.dialogflow.v2beta1.IImportAgentRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; importAgent( request?: protos.google.cloud.dialogflow.v2beta1.IImportAgentRequest, optionsOrCallback?: @@ -1352,11 +1343,8 @@ export class AgentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkImportAgentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2beta1/agents.import_agent.js + * region_tag:dialogflow_v2beta1_generated_Agents_ImportAgent_async */ async checkImportAgentProgress( name: string @@ -1377,42 +1365,6 @@ export class AgentsClient { protos.google.protobuf.Struct >; } - restoreAgent( - request?: protos.google.cloud.dialogflow.v2beta1.IRestoreAgentRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - restoreAgent( - request: protos.google.cloud.dialogflow.v2beta1.IRestoreAgentRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - restoreAgent( - request: protos.google.cloud.dialogflow.v2beta1.IRestoreAgentRequest, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Restores the specified agent from a ZIP file. * @@ -1459,10 +1411,45 @@ export class AgentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.restoreAgent(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2beta1/agents.restore_agent.js + * region_tag:dialogflow_v2beta1_generated_Agents_RestoreAgent_async */ + restoreAgent( + request?: protos.google.cloud.dialogflow.v2beta1.IRestoreAgentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + restoreAgent( + request: protos.google.cloud.dialogflow.v2beta1.IRestoreAgentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + restoreAgent( + request: protos.google.cloud.dialogflow.v2beta1.IRestoreAgentRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; restoreAgent( request?: protos.google.cloud.dialogflow.v2beta1.IRestoreAgentRequest, optionsOrCallback?: @@ -1520,11 +1507,8 @@ export class AgentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkRestoreAgentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2beta1/agents.restore_agent.js + * region_tag:dialogflow_v2beta1_generated_Agents_RestoreAgent_async */ async checkRestoreAgentProgress( name: string @@ -1545,37 +1529,6 @@ export class AgentsClient { protos.google.protobuf.Struct >; } - searchAgents( - request?: protos.google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.IAgent[], - protos.google.cloud.dialogflow.v2beta1.ISearchAgentsRequest | null, - protos.google.cloud.dialogflow.v2beta1.ISearchAgentsResponse - ] - >; - searchAgents( - request: protos.google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, - | protos.google.cloud.dialogflow.v2beta1.ISearchAgentsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IAgent - > - ): void; - searchAgents( - request: protos.google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, - | protos.google.cloud.dialogflow.v2beta1.ISearchAgentsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IAgent - > - ): void; /** * Returns the list of agents. * Since there is at most one conversational agent per project, this method is @@ -1608,6 +1561,37 @@ export class AgentsClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + searchAgents( + request?: protos.google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IAgent[], + protos.google.cloud.dialogflow.v2beta1.ISearchAgentsRequest | null, + protos.google.cloud.dialogflow.v2beta1.ISearchAgentsResponse + ] + >; + searchAgents( + request: protos.google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, + | protos.google.cloud.dialogflow.v2beta1.ISearchAgentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IAgent + > + ): void; + searchAgents( + request: protos.google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, + | protos.google.cloud.dialogflow.v2beta1.ISearchAgentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IAgent + > + ): void; searchAgents( request?: protos.google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, optionsOrCallback?: @@ -1724,11 +1708,8 @@ export class AgentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.searchAgentsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta1/agents.search_agents.js + * region_tag:dialogflow_v2beta1_generated_Agents_SearchAgents_async */ searchAgentsAsync( request?: protos.google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, @@ -1742,7 +1723,6 @@ export class AgentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['searchAgents']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2beta1/answer_records_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/answer_records_client.ts index afc483abc86..045cbe32cac 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/answer_records_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/answer_records_client.ts @@ -437,6 +437,27 @@ export class AnswerRecordsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Deprecated. + * Retrieves a specific answer record. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the answer record to retrieve. + * Format: `projects//locations//answerRecords/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnswerRecord]{@link google.cloud.dialogflow.v2beta1.AnswerRecord}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/answer_records.get_answer_record.js + * region_tag:dialogflow_v2beta1_generated_AnswerRecords_GetAnswerRecord_async + * @deprecated GetAnswerRecord is deprecated and may be removed in a future version. + */ getAnswerRecord( request?: protos.google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest, options?: CallOptions @@ -471,27 +492,6 @@ export class AnswerRecordsClient { {} | null | undefined > ): void; - /** - * Deprecated. - * Retrieves a specific answer record. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the answer record to retrieve. - * Format: `projects//locations//answerRecords/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AnswerRecord]{@link google.cloud.dialogflow.v2beta1.AnswerRecord}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getAnswerRecord(request); - * @deprecated GetAnswerRecord is deprecated and may be removed in a future version. - */ getAnswerRecord( request?: protos.google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest, optionsOrCallback?: @@ -543,6 +543,25 @@ export class AnswerRecordsClient { ); return this.innerApiCalls.getAnswerRecord(request, options, callback); } + /** + * Updates the specified answer record. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2beta1.AnswerRecord} request.answerRecord + * Required. Answer record to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnswerRecord]{@link google.cloud.dialogflow.v2beta1.AnswerRecord}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/answer_records.update_answer_record.js + * region_tag:dialogflow_v2beta1_generated_AnswerRecords_UpdateAnswerRecord_async + */ updateAnswerRecord( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest, options?: CallOptions @@ -577,25 +596,6 @@ export class AnswerRecordsClient { {} | null | undefined > ): void; - /** - * Updates the specified answer record. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2beta1.AnswerRecord} request.answerRecord - * Required. Answer record to update. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The mask to control which fields get updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AnswerRecord]{@link google.cloud.dialogflow.v2beta1.AnswerRecord}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateAnswerRecord(request); - */ updateAnswerRecord( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest, optionsOrCallback?: @@ -643,37 +643,6 @@ export class AnswerRecordsClient { return this.innerApiCalls.updateAnswerRecord(request, options, callback); } - listAnswerRecords( - request?: protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.IAnswerRecord[], - protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest | null, - protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse - ] - >; - listAnswerRecords( - request: protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, - | protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IAnswerRecord - > - ): void; - listAnswerRecords( - request: protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, - | protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IAnswerRecord - > - ): void; /** * Returns the list of all answer records in the specified project in reverse * chronological order. @@ -706,6 +675,37 @@ export class AnswerRecordsClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listAnswerRecords( + request?: protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord[], + protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse + ] + >; + listAnswerRecords( + request: protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord + > + ): void; + listAnswerRecords( + request: protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord + > + ): void; listAnswerRecords( request?: protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, optionsOrCallback?: @@ -830,11 +830,8 @@ export class AnswerRecordsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listAnswerRecordsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta1/answer_records.list_answer_records.js + * region_tag:dialogflow_v2beta1_generated_AnswerRecords_ListAnswerRecords_async */ listAnswerRecordsAsync( request?: protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, @@ -848,7 +845,6 @@ export class AnswerRecordsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listAnswerRecords']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2beta1/contexts_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/contexts_client.ts index 43917f9b137..48be4e98662 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/contexts_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/contexts_client.ts @@ -443,6 +443,36 @@ export class ContextsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified context. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the context. Supported formats: + * - `projects//agent/sessions//contexts/`, + * - `projects//locations//agent/sessions//contexts/`, + * - `projects//agent/environments//users//sessions//contexts/`, + * - `projects//locations//agent/environments//users//sessions//contexts/`, + * + * If `Location ID` is not specified we assume default 'us' location. If + * `Environment ID` is not specified, we assume default 'draft' environment. + * If `User ID` is not specified, we assume default '-' user. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Context]{@link google.cloud.dialogflow.v2beta1.Context}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/contexts.get_context.js + * region_tag:dialogflow_v2beta1_generated_Contexts_GetContext_async + */ getContext( request?: protos.google.cloud.dialogflow.v2beta1.IGetContextRequest, options?: CallOptions @@ -474,36 +504,6 @@ export class ContextsClient { {} | null | undefined > ): void; - /** - * Retrieves the specified context. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the context. Supported formats: - * - `projects//agent/sessions//contexts/`, - * - `projects//locations//agent/sessions//contexts/`, - * - `projects//agent/environments//users//sessions//contexts/`, - * - `projects//locations//agent/environments//users//sessions//contexts/`, - * - * If `Location ID` is not specified we assume default 'us' location. If - * `Environment ID` is not specified, we assume default 'draft' environment. - * If `User ID` is not specified, we assume default '-' user. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Context]{@link google.cloud.dialogflow.v2beta1.Context}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getContext(request); - */ getContext( request?: protos.google.cloud.dialogflow.v2beta1.IGetContextRequest, optionsOrCallback?: @@ -547,37 +547,6 @@ export class ContextsClient { this.initialize(); return this.innerApiCalls.getContext(request, options, callback); } - createContext( - request?: protos.google.cloud.dialogflow.v2beta1.ICreateContextRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.IContext, - protos.google.cloud.dialogflow.v2beta1.ICreateContextRequest | undefined, - {} | undefined - ] - >; - createContext( - request: protos.google.cloud.dialogflow.v2beta1.ICreateContextRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dialogflow.v2beta1.IContext, - | protos.google.cloud.dialogflow.v2beta1.ICreateContextRequest - | null - | undefined, - {} | null | undefined - > - ): void; - createContext( - request: protos.google.cloud.dialogflow.v2beta1.ICreateContextRequest, - callback: Callback< - protos.google.cloud.dialogflow.v2beta1.IContext, - | protos.google.cloud.dialogflow.v2beta1.ICreateContextRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Creates a context. * @@ -608,9 +577,40 @@ export class ContextsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.createContext(request); + * @example include:samples/generated/v2beta1/contexts.create_context.js + * region_tag:dialogflow_v2beta1_generated_Contexts_CreateContext_async */ + createContext( + request?: protos.google.cloud.dialogflow.v2beta1.ICreateContextRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IContext, + protos.google.cloud.dialogflow.v2beta1.ICreateContextRequest | undefined, + {} | undefined + ] + >; + createContext( + request: protos.google.cloud.dialogflow.v2beta1.ICreateContextRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IContext, + | protos.google.cloud.dialogflow.v2beta1.ICreateContextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createContext( + request: protos.google.cloud.dialogflow.v2beta1.ICreateContextRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IContext, + | protos.google.cloud.dialogflow.v2beta1.ICreateContextRequest + | null + | undefined, + {} | null | undefined + > + ): void; createContext( request?: protos.google.cloud.dialogflow.v2beta1.ICreateContextRequest, optionsOrCallback?: @@ -654,6 +654,25 @@ export class ContextsClient { this.initialize(); return this.innerApiCalls.createContext(request, options, callback); } + /** + * Updates the specified context. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2beta1.Context} request.context + * Required. The context to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Context]{@link google.cloud.dialogflow.v2beta1.Context}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/contexts.update_context.js + * region_tag:dialogflow_v2beta1_generated_Contexts_UpdateContext_async + */ updateContext( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateContextRequest, options?: CallOptions @@ -685,25 +704,6 @@ export class ContextsClient { {} | null | undefined > ): void; - /** - * Updates the specified context. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2beta1.Context} request.context - * Required. The context to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The mask to control which fields get updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Context]{@link google.cloud.dialogflow.v2beta1.Context}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateContext(request); - */ updateContext( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateContextRequest, optionsOrCallback?: @@ -747,6 +747,36 @@ export class ContextsClient { this.initialize(); return this.innerApiCalls.updateContext(request, options, callback); } + /** + * Deletes the specified context. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the context to delete. Supported formats: + * - `projects//agent/sessions//contexts/`, + * - `projects//locations//agent/sessions//contexts/`, + * - `projects//agent/environments//users//sessions//contexts/`, + * - `projects//locations//agent/environments//users//sessions//contexts/`, + * + * If `Location ID` is not specified we assume default 'us' location. If + * `Environment ID` is not specified, we assume default 'draft' environment. + * If `User ID` is not specified, we assume default '-' user. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/contexts.delete_context.js + * region_tag:dialogflow_v2beta1_generated_Contexts_DeleteContext_async + */ deleteContext( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteContextRequest, options?: CallOptions @@ -778,36 +808,6 @@ export class ContextsClient { {} | null | undefined > ): void; - /** - * Deletes the specified context. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the context to delete. Supported formats: - * - `projects//agent/sessions//contexts/`, - * - `projects//locations//agent/sessions//contexts/`, - * - `projects//agent/environments//users//sessions//contexts/`, - * - `projects//locations//agent/environments//users//sessions//contexts/`, - * - * If `Location ID` is not specified we assume default 'us' location. If - * `Environment ID` is not specified, we assume default 'draft' environment. - * If `User ID` is not specified, we assume default '-' user. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteContext(request); - */ deleteContext( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteContextRequest, optionsOrCallback?: @@ -851,6 +851,35 @@ export class ContextsClient { this.initialize(); return this.innerApiCalls.deleteContext(request, options, callback); } + /** + * Deletes all active contexts in the specified session. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the session to delete all contexts from. Supported formats: + * - `projects//agent/sessions/, + * - `projects//locations//agent/sessions/`, + * - `projects//agent/environments//users//sessions/`, + * - `projects//locations//agent/environments//users//sessions/`, + * + * If `Location ID` is not specified we assume default 'us' location. If + * `Environment ID` is not specified we assume default 'draft' environment. If + * `User ID` is not specified, we assume default '-' user. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/contexts.delete_all_contexts.js + * region_tag:dialogflow_v2beta1_generated_Contexts_DeleteAllContexts_async + */ deleteAllContexts( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest, options?: CallOptions @@ -885,35 +914,6 @@ export class ContextsClient { {} | null | undefined > ): void; - /** - * Deletes all active contexts in the specified session. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the session to delete all contexts from. Supported formats: - * - `projects//agent/sessions/, - * - `projects//locations//agent/sessions/`, - * - `projects//agent/environments//users//sessions/`, - * - `projects//locations//agent/environments//users//sessions/`, - * - * If `Location ID` is not specified we assume default 'us' location. If - * `Environment ID` is not specified we assume default 'draft' environment. If - * `User ID` is not specified, we assume default '-' user. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteAllContexts(request); - */ deleteAllContexts( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest, optionsOrCallback?: @@ -961,37 +961,6 @@ export class ContextsClient { return this.innerApiCalls.deleteAllContexts(request, options, callback); } - listContexts( - request?: protos.google.cloud.dialogflow.v2beta1.IListContextsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.IContext[], - protos.google.cloud.dialogflow.v2beta1.IListContextsRequest | null, - protos.google.cloud.dialogflow.v2beta1.IListContextsResponse - ] - >; - listContexts( - request: protos.google.cloud.dialogflow.v2beta1.IListContextsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListContextsRequest, - | protos.google.cloud.dialogflow.v2beta1.IListContextsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IContext - > - ): void; - listContexts( - request: protos.google.cloud.dialogflow.v2beta1.IListContextsRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListContextsRequest, - | protos.google.cloud.dialogflow.v2beta1.IListContextsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IContext - > - ): void; /** * Returns the list of all contexts in the specified session. * @@ -1029,6 +998,37 @@ export class ContextsClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listContexts( + request?: protos.google.cloud.dialogflow.v2beta1.IListContextsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IContext[], + protos.google.cloud.dialogflow.v2beta1.IListContextsRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListContextsResponse + ] + >; + listContexts( + request: protos.google.cloud.dialogflow.v2beta1.IListContextsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListContextsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListContextsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IContext + > + ): void; + listContexts( + request: protos.google.cloud.dialogflow.v2beta1.IListContextsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListContextsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListContextsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IContext + > + ): void; listContexts( request?: protos.google.cloud.dialogflow.v2beta1.IListContextsRequest, optionsOrCallback?: @@ -1165,11 +1165,8 @@ export class ContextsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listContextsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta1/contexts.list_contexts.js + * region_tag:dialogflow_v2beta1_generated_Contexts_ListContexts_async */ listContextsAsync( request?: protos.google.cloud.dialogflow.v2beta1.IListContextsRequest, @@ -1183,7 +1180,6 @@ export class ContextsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listContexts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2beta1/conversation_profiles_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/conversation_profiles_client.ts index c7c0d0e55e6..743d03f29c9 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/conversation_profiles_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/conversation_profiles_client.ts @@ -443,6 +443,25 @@ export class ConversationProfilesClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified conversation profile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2beta1.ConversationProfile}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/conversation_profiles.get_conversation_profile.js + * region_tag:dialogflow_v2beta1_generated_ConversationProfiles_GetConversationProfile_async + */ getConversationProfile( request?: protos.google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest, options?: CallOptions @@ -477,25 +496,6 @@ export class ConversationProfilesClient { {} | null | undefined > ): void; - /** - * Retrieves the specified conversation profile. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the conversation profile. - * Format: `projects//locations//conversationProfiles/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2beta1.ConversationProfile}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getConversationProfile(request); - */ getConversationProfile( request?: protos.google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest, optionsOrCallback?: @@ -546,6 +546,30 @@ export class ConversationProfilesClient { callback ); } + /** + * Creates a conversation profile in the specified project. + * + * {@link |ConversationProfile.CreateTime} and {@link |ConversationProfile.UpdateTime} + * aren't populated in the response. You can retrieve them via + * {@link google.cloud.dialogflow.v2beta1.ConversationProfiles.GetConversationProfile|GetConversationProfile} API. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to create a conversation profile for. + * Format: `projects//locations/`. + * @param {google.cloud.dialogflow.v2beta1.ConversationProfile} request.conversationProfile + * Required. The conversation profile to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2beta1.ConversationProfile}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/conversation_profiles.create_conversation_profile.js + * region_tag:dialogflow_v2beta1_generated_ConversationProfiles_CreateConversationProfile_async + */ createConversationProfile( request?: protos.google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest, options?: CallOptions @@ -580,30 +604,6 @@ export class ConversationProfilesClient { {} | null | undefined > ): void; - /** - * Creates a conversation profile in the specified project. - * - * {@link |ConversationProfile.CreateTime} and {@link |ConversationProfile.UpdateTime} - * aren't populated in the response. You can retrieve them via - * {@link google.cloud.dialogflow.v2beta1.ConversationProfiles.GetConversationProfile|GetConversationProfile} API. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project to create a conversation profile for. - * Format: `projects//locations/`. - * @param {google.cloud.dialogflow.v2beta1.ConversationProfile} request.conversationProfile - * Required. The conversation profile to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2beta1.ConversationProfile}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createConversationProfile(request); - */ createConversationProfile( request?: protos.google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest, optionsOrCallback?: @@ -654,6 +654,29 @@ export class ConversationProfilesClient { callback ); } + /** + * Updates the specified conversation profile. + * + * {@link |ConversationProfile.CreateTime} and {@link |ConversationProfile.UpdateTime} + * aren't populated in the response. You can retrieve them via + * {@link google.cloud.dialogflow.v2beta1.ConversationProfiles.GetConversationProfile|GetConversationProfile} API. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2beta1.ConversationProfile} request.conversationProfile + * Required. The conversation profile to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2beta1.ConversationProfile}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/conversation_profiles.update_conversation_profile.js + * region_tag:dialogflow_v2beta1_generated_ConversationProfiles_UpdateConversationProfile_async + */ updateConversationProfile( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest, options?: CallOptions @@ -688,29 +711,6 @@ export class ConversationProfilesClient { {} | null | undefined > ): void; - /** - * Updates the specified conversation profile. - * - * {@link |ConversationProfile.CreateTime} and {@link |ConversationProfile.UpdateTime} - * aren't populated in the response. You can retrieve them via - * {@link google.cloud.dialogflow.v2beta1.ConversationProfiles.GetConversationProfile|GetConversationProfile} API. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2beta1.ConversationProfile} request.conversationProfile - * Required. The conversation profile to update. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The mask to control which fields to update. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2beta1.ConversationProfile}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateConversationProfile(request); - */ updateConversationProfile( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest, optionsOrCallback?: @@ -761,6 +761,25 @@ export class ConversationProfilesClient { callback ); } + /** + * Deletes the specified conversation profile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the conversation profile to delete. + * Format: `projects//locations//conversationProfiles/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/conversation_profiles.delete_conversation_profile.js + * region_tag:dialogflow_v2beta1_generated_ConversationProfiles_DeleteConversationProfile_async + */ deleteConversationProfile( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest, options?: CallOptions @@ -795,25 +814,6 @@ export class ConversationProfilesClient { {} | null | undefined > ): void; - /** - * Deletes the specified conversation profile. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the conversation profile to delete. - * Format: `projects//locations//conversationProfiles/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteConversationProfile(request); - */ deleteConversationProfile( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest, optionsOrCallback?: @@ -865,6 +865,32 @@ export class ConversationProfilesClient { ); } + /** + * Returns the list of all conversation profiles in the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ConversationProfile]{@link google.cloud.dialogflow.v2beta1.ConversationProfile}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listConversationProfilesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listConversationProfiles( request?: protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest, options?: CallOptions @@ -896,32 +922,6 @@ export class ConversationProfilesClient { protos.google.cloud.dialogflow.v2beta1.IConversationProfile > ): void; - /** - * Returns the list of all conversation profiles in the specified project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project to list all conversation profiles from. - * Format: `projects//locations/`. - * @param {number} request.pageSize - * The maximum number of items to return in a single page. By - * default 100 and at most 1000. - * @param {string} request.pageToken - * The next_page_token value returned from a previous list request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [ConversationProfile]{@link google.cloud.dialogflow.v2beta1.ConversationProfile}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listConversationProfilesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listConversationProfiles( request?: protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest, optionsOrCallback?: @@ -1040,11 +1040,8 @@ export class ConversationProfilesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listConversationProfilesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta1/conversation_profiles.list_conversation_profiles.js + * region_tag:dialogflow_v2beta1_generated_ConversationProfiles_ListConversationProfiles_async */ listConversationProfilesAsync( request?: protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest, @@ -1058,7 +1055,6 @@ export class ConversationProfilesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listConversationProfiles']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2beta1/conversations_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/conversations_client.ts index 847a37c7d37..08c70f2062f 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/conversations_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/conversations_client.ts @@ -445,40 +445,6 @@ export class ConversationsClient { // ------------------- // -- Service calls -- // ------------------- - createConversation( - request?: protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.IConversation, - ( - | protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest - | undefined - ), - {} | undefined - ] - >; - createConversation( - request: protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dialogflow.v2beta1.IConversation, - | protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest - | null - | undefined, - {} | null | undefined - > - ): void; - createConversation( - request: protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest, - callback: Callback< - protos.google.cloud.dialogflow.v2beta1.IConversation, - | protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Creates a new conversation. Conversations are auto-completed after 24 * hours. @@ -524,9 +490,43 @@ export class ConversationsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.createConversation(request); + * @example include:samples/generated/v2beta1/conversations.create_conversation.js + * region_tag:dialogflow_v2beta1_generated_Conversations_CreateConversation_async */ + createConversation( + request?: protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversation, + ( + | protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest + | undefined + ), + {} | undefined + ] + >; + createConversation( + request: protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversation, + | protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createConversation( + request: protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversation, + | protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest + | null + | undefined, + {} | null | undefined + > + ): void; createConversation( request?: protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest, optionsOrCallback?: @@ -573,6 +573,25 @@ export class ConversationsClient { this.initialize(); return this.innerApiCalls.createConversation(request, options, callback); } + /** + * Retrieves the specific conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the conversation. Format: + * `projects//locations//conversations/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Conversation]{@link google.cloud.dialogflow.v2beta1.Conversation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/conversations.get_conversation.js + * region_tag:dialogflow_v2beta1_generated_Conversations_GetConversation_async + */ getConversation( request?: protos.google.cloud.dialogflow.v2beta1.IGetConversationRequest, options?: CallOptions @@ -607,25 +626,6 @@ export class ConversationsClient { {} | null | undefined > ): void; - /** - * Retrieves the specific conversation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the conversation. Format: - * `projects//locations//conversations/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Conversation]{@link google.cloud.dialogflow.v2beta1.Conversation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getConversation(request); - */ getConversation( request?: protos.google.cloud.dialogflow.v2beta1.IGetConversationRequest, optionsOrCallback?: @@ -672,6 +672,26 @@ export class ConversationsClient { this.initialize(); return this.innerApiCalls.getConversation(request, options, callback); } + /** + * Completes the specified conversation. Finished conversations are purged + * from the database after 30 days. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource identifier of the conversation to close. + * Format: `projects//locations//conversations/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Conversation]{@link google.cloud.dialogflow.v2beta1.Conversation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/conversations.complete_conversation.js + * region_tag:dialogflow_v2beta1_generated_Conversations_CompleteConversation_async + */ completeConversation( request?: protos.google.cloud.dialogflow.v2beta1.ICompleteConversationRequest, options?: CallOptions @@ -706,26 +726,6 @@ export class ConversationsClient { {} | null | undefined > ): void; - /** - * Completes the specified conversation. Finished conversations are purged - * from the database after 30 days. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Resource identifier of the conversation to close. - * Format: `projects//locations//conversations/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Conversation]{@link google.cloud.dialogflow.v2beta1.Conversation}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.completeConversation(request); - */ completeConversation( request?: protos.google.cloud.dialogflow.v2beta1.ICompleteConversationRequest, optionsOrCallback?: @@ -772,6 +772,30 @@ export class ConversationsClient { this.initialize(); return this.innerApiCalls.completeConversation(request, options, callback); } + /** + * Batch ingests messages to conversation. Customers can use this RPC to + * ingest historical messages to conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource identifier of the conversation to create message. + * Format: `projects//locations//conversations/`. + * @param {number[]} request.requests + * Required. A maximum of 1000 Messages can be created in a batch. + * {@link |CreateMessageRequest.message.send_time} is required. All created + * messages will have identical {@link google.cloud.dialogflow.v2beta1.Message.create_time|Message.create_time}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchCreateMessagesResponse]{@link google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/conversations.batch_create_messages.js + * region_tag:dialogflow_v2beta1_generated_Conversations_BatchCreateMessages_async + */ batchCreateMessages( request?: protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest, options?: CallOptions @@ -806,30 +830,6 @@ export class ConversationsClient { {} | null | undefined > ): void; - /** - * Batch ingests messages to conversation. Customers can use this RPC to - * ingest historical messages to conversation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource identifier of the conversation to create message. - * Format: `projects//locations//conversations/`. - * @param {number[]} request.requests - * Required. A maximum of 1000 Messages can be created in a batch. - * {@link |CreateMessageRequest.message.send_time} is required. All created - * messages will have identical {@link google.cloud.dialogflow.v2beta1.Message.create_time|Message.create_time}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [BatchCreateMessagesResponse]{@link google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.batchCreateMessages(request); - */ batchCreateMessages( request?: protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest, optionsOrCallback?: @@ -877,37 +877,6 @@ export class ConversationsClient { return this.innerApiCalls.batchCreateMessages(request, options, callback); } - listConversations( - request?: protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.IConversation[], - protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest | null, - protos.google.cloud.dialogflow.v2beta1.IListConversationsResponse - ] - >; - listConversations( - request: protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, - | protos.google.cloud.dialogflow.v2beta1.IListConversationsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IConversation - > - ): void; - listConversations( - request: protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, - | protos.google.cloud.dialogflow.v2beta1.IListConversationsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IConversation - > - ): void; /** * Returns the list of all conversations in the specified project. * @@ -952,6 +921,37 @@ export class ConversationsClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listConversations( + request?: protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversation[], + protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListConversationsResponse + ] + >; + listConversations( + request: protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListConversationsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IConversation + > + ): void; + listConversations( + request: protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListConversationsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IConversation + > + ): void; listConversations( request?: protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, optionsOrCallback?: @@ -1102,11 +1102,8 @@ export class ConversationsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listConversationsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta1/conversations.list_conversations.js + * region_tag:dialogflow_v2beta1_generated_Conversations_ListConversations_async */ listConversationsAsync( request?: protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, @@ -1120,7 +1117,6 @@ export class ConversationsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listConversations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1130,37 +1126,6 @@ export class ConversationsClient { callSettings ) as AsyncIterable; } - listMessages( - request?: protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.IMessage[], - protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest | null, - protos.google.cloud.dialogflow.v2beta1.IListMessagesResponse - ] - >; - listMessages( - request: protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, - | protos.google.cloud.dialogflow.v2beta1.IListMessagesResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IMessage - > - ): void; - listMessages( - request: protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, - | protos.google.cloud.dialogflow.v2beta1.IListMessagesResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IMessage - > - ): void; /** * Lists messages that belong to a given conversation. * `messages` are ordered by `create_time` in descending order. To fetch @@ -1201,6 +1166,37 @@ export class ConversationsClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listMessages( + request?: protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IMessage[], + protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListMessagesResponse + ] + >; + listMessages( + request: protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, + | protos.google.cloud.dialogflow.v2beta1.IListMessagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IMessage + > + ): void; + listMessages( + request: protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, + | protos.google.cloud.dialogflow.v2beta1.IListMessagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IMessage + > + ): void; listMessages( request?: protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, optionsOrCallback?: @@ -1335,11 +1331,8 @@ export class ConversationsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listMessagesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta1/conversations.list_messages.js + * region_tag:dialogflow_v2beta1_generated_Conversations_ListMessages_async */ listMessagesAsync( request?: protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, @@ -1353,7 +1346,6 @@ export class ConversationsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listMessages']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2beta1/documents_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/documents_client.ts index d6cc7a45d53..4937a355f96 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/documents_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/documents_client.ts @@ -517,6 +517,28 @@ export class DocumentsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified document. + * + * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + * only use `projects.knowledgeBases.documents`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the document to retrieve. + * Format `projects//locations//knowledgeBases//documents/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Document]{@link google.cloud.dialogflow.v2beta1.Document}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/documents.get_document.js + * region_tag:dialogflow_v2beta1_generated_Documents_GetDocument_async + */ getDocument( request?: protos.google.cloud.dialogflow.v2beta1.IGetDocumentRequest, options?: CallOptions @@ -548,28 +570,6 @@ export class DocumentsClient { {} | null | undefined > ): void; - /** - * Retrieves the specified document. - * - * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - * only use `projects.knowledgeBases.documents`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the document to retrieve. - * Format `projects//locations//knowledgeBases//documents/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Document]{@link google.cloud.dialogflow.v2beta1.Document}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getDocument(request); - */ getDocument( request?: protos.google.cloud.dialogflow.v2beta1.IGetDocumentRequest, optionsOrCallback?: @@ -614,6 +614,42 @@ export class DocumentsClient { return this.innerApiCalls.getDocument(request, options, callback); } + /** + * Creates a new document. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: {@link google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata|KnowledgeOperationMetadata} + * - `response`: {@link google.cloud.dialogflow.v2beta1.Document|Document} + * + * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + * only use `projects.knowledgeBases.documents`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The knowledge base to create a document for. + * Format: `projects//locations//knowledgeBases/`. + * @param {google.cloud.dialogflow.v2beta1.Document} request.document + * Required. The document to create. + * @param {boolean} request.importGcsCustomMetadata + * Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2beta1/documents.create_document.js + * region_tag:dialogflow_v2beta1_generated_Documents_CreateDocument_async + */ createDocument( request?: protos.google.cloud.dialogflow.v2beta1.ICreateDocumentRequest, options?: CallOptions @@ -650,43 +686,6 @@ export class DocumentsClient { {} | null | undefined > ): void; - /** - * Creates a new document. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: {@link google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata|KnowledgeOperationMetadata} - * - `response`: {@link google.cloud.dialogflow.v2beta1.Document|Document} - * - * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - * only use `projects.knowledgeBases.documents`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The knowledge base to create a document for. - * Format: `projects//locations//knowledgeBases/`. - * @param {google.cloud.dialogflow.v2beta1.Document} request.document - * Required. The document to create. - * @param {boolean} request.importGcsCustomMetadata - * Whether to import custom metadata from Google Cloud Storage. - * Only valid when the document source is Google Cloud Storage URI. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.createDocument(request); - * const [response] = await operation.promise(); - */ createDocument( request?: protos.google.cloud.dialogflow.v2beta1.ICreateDocumentRequest, optionsOrCallback?: @@ -744,11 +743,8 @@ export class DocumentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkCreateDocumentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2beta1/documents.create_document.js + * region_tag:dialogflow_v2beta1_generated_Documents_CreateDocument_async */ async checkCreateDocumentProgress( name: string @@ -772,42 +768,6 @@ export class DocumentsClient { protos.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata >; } - importDocuments( - request?: protos.google.cloud.dialogflow.v2beta1.IImportDocumentsRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.dialogflow.v2beta1.IImportDocumentsResponse, - protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - importDocuments( - request: protos.google.cloud.dialogflow.v2beta1.IImportDocumentsRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.dialogflow.v2beta1.IImportDocumentsResponse, - protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - importDocuments( - request: protos.google.cloud.dialogflow.v2beta1.IImportDocumentsRequest, - callback: Callback< - LROperation< - protos.google.cloud.dialogflow.v2beta1.IImportDocumentsResponse, - protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Create documents by importing data from external sources. * Dialogflow supports up to 350 documents in each request. If you try to @@ -847,10 +807,45 @@ export class DocumentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.importDocuments(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2beta1/documents.import_documents.js + * region_tag:dialogflow_v2beta1_generated_Documents_ImportDocuments_async */ + importDocuments( + request?: protos.google.cloud.dialogflow.v2beta1.IImportDocumentsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.v2beta1.IImportDocumentsResponse, + protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + importDocuments( + request: protos.google.cloud.dialogflow.v2beta1.IImportDocumentsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2beta1.IImportDocumentsResponse, + protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importDocuments( + request: protos.google.cloud.dialogflow.v2beta1.IImportDocumentsRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2beta1.IImportDocumentsResponse, + protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; importDocuments( request?: protos.google.cloud.dialogflow.v2beta1.IImportDocumentsRequest, optionsOrCallback?: @@ -908,11 +903,8 @@ export class DocumentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkImportDocumentsProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2beta1/documents.import_documents.js + * region_tag:dialogflow_v2beta1_generated_Documents_ImportDocuments_async */ async checkImportDocumentsProgress( name: string @@ -936,6 +928,38 @@ export class DocumentsClient { protos.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata >; } + /** + * Deletes the specified document. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: {@link google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata|KnowledgeOperationMetadata} + * - `response`: An [Empty + * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) + * + * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + * only use `projects.knowledgeBases.documents`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the document to delete. + * Format: `projects//locations//knowledgeBases//documents/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2beta1/documents.delete_document.js + * region_tag:dialogflow_v2beta1_generated_Documents_DeleteDocument_async + */ deleteDocument( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest, options?: CallOptions @@ -972,39 +996,6 @@ export class DocumentsClient { {} | null | undefined > ): void; - /** - * Deletes the specified document. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: {@link google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata|KnowledgeOperationMetadata} - * - `response`: An [Empty - * message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty) - * - * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - * only use `projects.knowledgeBases.documents`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the document to delete. - * Format: `projects//locations//knowledgeBases//documents/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.deleteDocument(request); - * const [response] = await operation.promise(); - */ deleteDocument( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest, optionsOrCallback?: @@ -1062,11 +1053,8 @@ export class DocumentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeleteDocumentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2beta1/documents.delete_document.js + * region_tag:dialogflow_v2beta1_generated_Documents_DeleteDocument_async */ async checkDeleteDocumentProgress( name: string @@ -1090,6 +1078,39 @@ export class DocumentsClient { protos.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata >; } + /** + * Updates the specified document. + * + * This method is a [long-running + * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). + * The returned `Operation` type has the following method-specific fields: + * + * - `metadata`: {@link google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata|KnowledgeOperationMetadata} + * - `response`: {@link google.cloud.dialogflow.v2beta1.Document|Document} + * + * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; + * only use `projects.knowledgeBases.documents`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2beta1.Document} request.document + * Required. The document to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v2beta1/documents.update_document.js + * region_tag:dialogflow_v2beta1_generated_Documents_UpdateDocument_async + */ updateDocument( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest, options?: CallOptions @@ -1126,40 +1147,6 @@ export class DocumentsClient { {} | null | undefined > ): void; - /** - * Updates the specified document. - * - * This method is a [long-running - * operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). - * The returned `Operation` type has the following method-specific fields: - * - * - `metadata`: {@link google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata|KnowledgeOperationMetadata} - * - `response`: {@link google.cloud.dialogflow.v2beta1.Document|Document} - * - * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; - * only use `projects.knowledgeBases.documents`. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2beta1.Document} request.document - * Required. The document to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. Not specified means `update all`. - * Currently, only `display_name` can be updated, an InvalidArgument will be - * returned for attempting to update other fields. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.updateDocument(request); - * const [response] = await operation.promise(); - */ updateDocument( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest, optionsOrCallback?: @@ -1217,11 +1204,8 @@ export class DocumentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkUpdateDocumentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2beta1/documents.update_document.js + * region_tag:dialogflow_v2beta1_generated_Documents_UpdateDocument_async */ async checkUpdateDocumentProgress( name: string @@ -1245,42 +1229,6 @@ export class DocumentsClient { protos.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata >; } - reloadDocument( - request?: protos.google.cloud.dialogflow.v2beta1.IReloadDocumentRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.dialogflow.v2beta1.IDocument, - protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - reloadDocument( - request: protos.google.cloud.dialogflow.v2beta1.IReloadDocumentRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.dialogflow.v2beta1.IDocument, - protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - reloadDocument( - request: protos.google.cloud.dialogflow.v2beta1.IReloadDocumentRequest, - callback: Callback< - LROperation< - protos.google.cloud.dialogflow.v2beta1.IDocument, - protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Reloads the specified document from its specified source, content_uri or * content. The previously loaded content of the document will be deleted. @@ -1321,10 +1269,45 @@ export class DocumentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.reloadDocument(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2beta1/documents.reload_document.js + * region_tag:dialogflow_v2beta1_generated_Documents_ReloadDocument_async */ + reloadDocument( + request?: protos.google.cloud.dialogflow.v2beta1.IReloadDocumentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.v2beta1.IDocument, + protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + reloadDocument( + request: protos.google.cloud.dialogflow.v2beta1.IReloadDocumentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2beta1.IDocument, + protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + reloadDocument( + request: protos.google.cloud.dialogflow.v2beta1.IReloadDocumentRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2beta1.IDocument, + protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; reloadDocument( request?: protos.google.cloud.dialogflow.v2beta1.IReloadDocumentRequest, optionsOrCallback?: @@ -1382,11 +1365,8 @@ export class DocumentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkReloadDocumentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2beta1/documents.reload_document.js + * region_tag:dialogflow_v2beta1_generated_Documents_ReloadDocument_async */ async checkReloadDocumentProgress( name: string @@ -1410,37 +1390,6 @@ export class DocumentsClient { protos.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata >; } - listDocuments( - request?: protos.google.cloud.dialogflow.v2beta1.IListDocumentsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.IDocument[], - protos.google.cloud.dialogflow.v2beta1.IListDocumentsRequest | null, - protos.google.cloud.dialogflow.v2beta1.IListDocumentsResponse - ] - >; - listDocuments( - request: protos.google.cloud.dialogflow.v2beta1.IListDocumentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListDocumentsRequest, - | protos.google.cloud.dialogflow.v2beta1.IListDocumentsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IDocument - > - ): void; - listDocuments( - request: protos.google.cloud.dialogflow.v2beta1.IListDocumentsRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListDocumentsRequest, - | protos.google.cloud.dialogflow.v2beta1.IListDocumentsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IDocument - > - ): void; /** * Returns the list of all documents of the knowledge base. * @@ -1493,6 +1442,37 @@ export class DocumentsClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listDocuments( + request?: protos.google.cloud.dialogflow.v2beta1.IListDocumentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IDocument[], + protos.google.cloud.dialogflow.v2beta1.IListDocumentsRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListDocumentsResponse + ] + >; + listDocuments( + request: protos.google.cloud.dialogflow.v2beta1.IListDocumentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListDocumentsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListDocumentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IDocument + > + ): void; + listDocuments( + request: protos.google.cloud.dialogflow.v2beta1.IListDocumentsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListDocumentsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListDocumentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IDocument + > + ): void; listDocuments( request?: protos.google.cloud.dialogflow.v2beta1.IListDocumentsRequest, optionsOrCallback?: @@ -1653,11 +1633,8 @@ export class DocumentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listDocumentsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta1/documents.list_documents.js + * region_tag:dialogflow_v2beta1_generated_Documents_ListDocuments_async */ listDocumentsAsync( request?: protos.google.cloud.dialogflow.v2beta1.IListDocumentsRequest, @@ -1671,7 +1648,6 @@ export class DocumentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listDocuments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2beta1/entity_types_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/entity_types_client.ts index d712d68fc78..fd09e9273e0 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/entity_types_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/entity_types_client.ts @@ -528,6 +528,33 @@ export class EntityTypesClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified entity type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the entity type. + * Supported formats: + * - `projects//agent/entityTypes/` + * - `projects//locations//agent/entityTypes/` + * @param {string} [request.languageCode] + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [EntityType]{@link google.cloud.dialogflow.v2beta1.EntityType}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/entity_types.get_entity_type.js + * region_tag:dialogflow_v2beta1_generated_EntityTypes_GetEntityType_async + */ getEntityType( request?: protos.google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest, options?: CallOptions @@ -559,33 +586,6 @@ export class EntityTypesClient { {} | null | undefined > ): void; - /** - * Retrieves the specified entity type. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the entity type. - * Supported formats: - * - `projects//agent/entityTypes/` - * - `projects//locations//agent/entityTypes/` - * @param {string} [request.languageCode] - * Optional. The language used to access language-specific data. - * If not specified, the agent's default language is used. - * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [EntityType]{@link google.cloud.dialogflow.v2beta1.EntityType}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getEntityType(request); - */ getEntityType( request?: protos.google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest, optionsOrCallback?: @@ -629,6 +629,38 @@ export class EntityTypesClient { this.initialize(); return this.innerApiCalls.getEntityType(request, options, callback); } + /** + * Creates an entity type in the specified agent. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create a entity type for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * @param {google.cloud.dialogflow.v2beta1.EntityType} request.entityType + * Required. The entity type to create. + * @param {string} [request.languageCode] + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [EntityType]{@link google.cloud.dialogflow.v2beta1.EntityType}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/entity_types.create_entity_type.js + * region_tag:dialogflow_v2beta1_generated_EntityTypes_CreateEntityType_async + */ createEntityType( request?: protos.google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest, options?: CallOptions @@ -663,38 +695,6 @@ export class EntityTypesClient { {} | null | undefined > ): void; - /** - * Creates an entity type in the specified agent. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The agent to create a entity type for. - * Supported formats: - * - `projects//agent` - * - `projects//locations//agent` - * @param {google.cloud.dialogflow.v2beta1.EntityType} request.entityType - * Required. The entity type to create. - * @param {string} [request.languageCode] - * Optional. The language used to access language-specific data. - * If not specified, the agent's default language is used. - * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [EntityType]{@link google.cloud.dialogflow.v2beta1.EntityType}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createEntityType(request); - */ createEntityType( request?: protos.google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest, optionsOrCallback?: @@ -741,6 +741,35 @@ export class EntityTypesClient { this.initialize(); return this.innerApiCalls.createEntityType(request, options, callback); } + /** + * Updates the specified entity type. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2beta1.EntityType} request.entityType + * Required. The entity type to update. + * @param {string} [request.languageCode] + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [EntityType]{@link google.cloud.dialogflow.v2beta1.EntityType}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/entity_types.update_entity_type.js + * region_tag:dialogflow_v2beta1_generated_EntityTypes_UpdateEntityType_async + */ updateEntityType( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest, options?: CallOptions @@ -775,35 +804,6 @@ export class EntityTypesClient { {} | null | undefined > ): void; - /** - * Updates the specified entity type. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2beta1.EntityType} request.entityType - * Required. The entity type to update. - * @param {string} [request.languageCode] - * Optional. The language used to access language-specific data. - * If not specified, the agent's default language is used. - * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. The mask to control which fields get updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [EntityType]{@link google.cloud.dialogflow.v2beta1.EntityType}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateEntityType(request); - */ updateEntityType( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest, optionsOrCallback?: @@ -850,6 +850,31 @@ export class EntityTypesClient { this.initialize(); return this.innerApiCalls.updateEntityType(request, options, callback); } + /** + * Deletes the specified entity type. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the entity type to delete. + * Supported formats: + * - `projects//agent/entityTypes/` + * - `projects//locations//agent/entityTypes/` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/entity_types.delete_entity_type.js + * region_tag:dialogflow_v2beta1_generated_EntityTypes_DeleteEntityType_async + */ deleteEntityType( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest, options?: CallOptions @@ -884,31 +909,6 @@ export class EntityTypesClient { {} | null | undefined > ): void; - /** - * Deletes the specified entity type. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the entity type to delete. - * Supported formats: - * - `projects//agent/entityTypes/` - * - `projects//locations//agent/entityTypes/` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteEntityType(request); - */ deleteEntityType( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest, optionsOrCallback?: @@ -956,42 +956,6 @@ export class EntityTypesClient { return this.innerApiCalls.deleteEntityType(request, options, callback); } - batchUpdateEntityTypes( - request?: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchUpdateEntityTypes( - request: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchUpdateEntityTypes( - request: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest, - callback: Callback< - LROperation< - protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Updates/Creates multiple entity types in the specified agent. * @@ -1038,10 +1002,45 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.batchUpdateEntityTypes(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2beta1/entity_types.batch_update_entity_types.js + * region_tag:dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntityTypes_async */ + batchUpdateEntityTypes( + request?: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchUpdateEntityTypes( + request: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchUpdateEntityTypes( + request: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchUpdateEntityTypes( request?: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest, optionsOrCallback?: @@ -1103,11 +1102,8 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkBatchUpdateEntityTypesProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2beta1/entity_types.batch_update_entity_types.js + * region_tag:dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntityTypes_async */ async checkBatchUpdateEntityTypesProgress( name: string @@ -1131,42 +1127,6 @@ export class EntityTypesClient { protos.google.protobuf.Struct >; } - batchDeleteEntityTypes( - request?: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchDeleteEntityTypes( - request: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchDeleteEntityTypes( - request: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Deletes entity types in the specified agent. * @@ -1202,10 +1162,45 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.batchDeleteEntityTypes(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2beta1/entity_types.batch_delete_entity_types.js + * region_tag:dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntityTypes_async */ + batchDeleteEntityTypes( + request?: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchDeleteEntityTypes( + request: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchDeleteEntityTypes( + request: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchDeleteEntityTypes( request?: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest, optionsOrCallback?: @@ -1267,11 +1262,8 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkBatchDeleteEntityTypesProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2beta1/entity_types.batch_delete_entity_types.js + * region_tag:dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntityTypes_async */ async checkBatchDeleteEntityTypesProgress( name: string @@ -1279,55 +1271,19 @@ export class EntityTypesClient { LROperation > { const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( - operation, - this.descriptors.longrunning.batchDeleteEntityTypes, - gax.createDefaultBackoffSettings() - ); - return decodeOperation as LROperation< - protos.google.protobuf.Empty, - protos.google.protobuf.Struct - >; - } - batchCreateEntities( - request?: protos.google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchCreateEntities( - request: protos.google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchCreateEntities( - request: protos.google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.batchDeleteEntityTypes, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.protobuf.Struct + >; + } /** * Creates multiple new entities in the specified entity type. * @@ -1369,10 +1325,45 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.batchCreateEntities(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2beta1/entity_types.batch_create_entities.js + * region_tag:dialogflow_v2beta1_generated_EntityTypes_BatchCreateEntities_async */ + batchCreateEntities( + request?: protos.google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchCreateEntities( + request: protos.google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchCreateEntities( + request: protos.google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchCreateEntities( request?: protos.google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest, optionsOrCallback?: @@ -1430,11 +1421,8 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkBatchCreateEntitiesProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2beta1/entity_types.batch_create_entities.js + * region_tag:dialogflow_v2beta1_generated_EntityTypes_BatchCreateEntities_async */ async checkBatchCreateEntitiesProgress( name: string @@ -1455,42 +1443,6 @@ export class EntityTypesClient { protos.google.protobuf.Struct >; } - batchUpdateEntities( - request?: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchUpdateEntities( - request: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchUpdateEntities( - request: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Updates or creates multiple entities in the specified entity type. This * method does not affect entities in the entity type that aren't explicitly @@ -1536,10 +1488,45 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.batchUpdateEntities(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2beta1/entity_types.batch_update_entities.js + * region_tag:dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntities_async */ + batchUpdateEntities( + request?: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchUpdateEntities( + request: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchUpdateEntities( + request: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchUpdateEntities( request?: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest, optionsOrCallback?: @@ -1597,11 +1584,8 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkBatchUpdateEntitiesProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2beta1/entity_types.batch_update_entities.js + * region_tag:dialogflow_v2beta1_generated_EntityTypes_BatchUpdateEntities_async */ async checkBatchUpdateEntitiesProgress( name: string @@ -1622,42 +1606,6 @@ export class EntityTypesClient { protos.google.protobuf.Struct >; } - batchDeleteEntities( - request?: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchDeleteEntities( - request: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchDeleteEntities( - request: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Deletes entities in the specified entity type. * @@ -1701,10 +1649,45 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.batchDeleteEntities(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2beta1/entity_types.batch_delete_entities.js + * region_tag:dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntities_async */ + batchDeleteEntities( + request?: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchDeleteEntities( + request: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchDeleteEntities( + request: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchDeleteEntities( request?: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest, optionsOrCallback?: @@ -1762,11 +1745,8 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkBatchDeleteEntitiesProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2beta1/entity_types.batch_delete_entities.js + * region_tag:dialogflow_v2beta1_generated_EntityTypes_BatchDeleteEntities_async */ async checkBatchDeleteEntitiesProgress( name: string @@ -1787,37 +1767,6 @@ export class EntityTypesClient { protos.google.protobuf.Struct >; } - listEntityTypes( - request?: protos.google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.IEntityType[], - protos.google.cloud.dialogflow.v2beta1.IListEntityTypesRequest | null, - protos.google.cloud.dialogflow.v2beta1.IListEntityTypesResponse - ] - >; - listEntityTypes( - request: protos.google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, - | protos.google.cloud.dialogflow.v2beta1.IListEntityTypesResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IEntityType - > - ): void; - listEntityTypes( - request: protos.google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, - | protos.google.cloud.dialogflow.v2beta1.IListEntityTypesResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IEntityType - > - ): void; /** * Returns the list of all entity types in the specified agent. * @@ -1852,6 +1801,37 @@ export class EntityTypesClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listEntityTypes( + request?: protos.google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IEntityType[], + protos.google.cloud.dialogflow.v2beta1.IListEntityTypesRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListEntityTypesResponse + ] + >; + listEntityTypes( + request: protos.google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, + | protos.google.cloud.dialogflow.v2beta1.IListEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IEntityType + > + ): void; + listEntityTypes( + request: protos.google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, + | protos.google.cloud.dialogflow.v2beta1.IListEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IEntityType + > + ): void; listEntityTypes( request?: protos.google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, optionsOrCallback?: @@ -1982,11 +1962,8 @@ export class EntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listEntityTypesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta1/entity_types.list_entity_types.js + * region_tag:dialogflow_v2beta1_generated_EntityTypes_ListEntityTypes_async */ listEntityTypesAsync( request?: protos.google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, @@ -2000,7 +1977,6 @@ export class EntityTypesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listEntityTypes']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2beta1/environments_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/environments_client.ts index 669a6caf063..ba5095042cd 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/environments_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/environments_client.ts @@ -445,6 +445,27 @@ export class EnvironmentsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified agent environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the environment. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Environment]{@link google.cloud.dialogflow.v2beta1.Environment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/environments.get_environment.js + * region_tag:dialogflow_v2beta1_generated_Environments_GetEnvironment_async + */ getEnvironment( request?: protos.google.cloud.dialogflow.v2beta1.IGetEnvironmentRequest, options?: CallOptions @@ -476,27 +497,6 @@ export class EnvironmentsClient { {} | null | undefined > ): void; - /** - * Retrieves the specified agent environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the environment. - * Supported formats: - * - `projects//agent/environments/` - * - `projects//locations//agent/environments/` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Environment]{@link google.cloud.dialogflow.v2beta1.Environment}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getEnvironment(request); - */ getEnvironment( request?: protos.google.cloud.dialogflow.v2beta1.IGetEnvironmentRequest, optionsOrCallback?: @@ -540,6 +540,30 @@ export class EnvironmentsClient { this.initialize(); return this.innerApiCalls.getEnvironment(request, options, callback); } + /** + * Creates an agent environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create an environment for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * @param {google.cloud.dialogflow.v2beta1.Environment} request.environment + * Required. The environment to create. + * @param {string} request.environmentId + * Required. The unique id of the new environment. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Environment]{@link google.cloud.dialogflow.v2beta1.Environment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/environments.create_environment.js + * region_tag:dialogflow_v2beta1_generated_Environments_CreateEnvironment_async + */ createEnvironment( request?: protos.google.cloud.dialogflow.v2beta1.ICreateEnvironmentRequest, options?: CallOptions @@ -574,30 +598,6 @@ export class EnvironmentsClient { {} | null | undefined > ): void; - /** - * Creates an agent environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The agent to create an environment for. - * Supported formats: - * - `projects//agent` - * - `projects//locations//agent` - * @param {google.cloud.dialogflow.v2beta1.Environment} request.environment - * Required. The environment to create. - * @param {string} request.environmentId - * Required. The unique id of the new environment. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Environment]{@link google.cloud.dialogflow.v2beta1.Environment}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createEnvironment(request); - */ createEnvironment( request?: protos.google.cloud.dialogflow.v2beta1.ICreateEnvironmentRequest, optionsOrCallback?: @@ -644,6 +644,41 @@ export class EnvironmentsClient { this.initialize(); return this.innerApiCalls.createEnvironment(request, options, callback); } + /** + * Updates the specified agent environment. + * + * This method allows you to deploy new agent versions into the environment. + * When an environment is pointed to a new agent version by setting + * `environment.agent_version`, the environment is temporarily set to the + * `LOADING` state. During that time, the environment keeps on serving the + * previous version of the agent. After the new agent version is done loading, + * the environment is set back to the `RUNNING` state. + * You can use "-" as Environment ID in environment name to update version + * in "draft" environment. WARNING: this will negate all recent changes to + * draft and can't be undone. You may want to save the draft to a version + * before calling this function. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2beta1.Environment} request.environment + * Required. The environment to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get updated. + * @param {boolean} [request.allowLoadToDraftAndDiscardChanges] + * Optional. This field is used to prevent accidental overwrite of the draft + * environment, which is an operation that cannot be undone. To confirm that + * the caller desires this overwrite, this field must be explicitly set to + * true when updating the draft environment (environment ID = `-`). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Environment]{@link google.cloud.dialogflow.v2beta1.Environment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/environments.update_environment.js + * region_tag:dialogflow_v2beta1_generated_Environments_UpdateEnvironment_async + */ updateEnvironment( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateEnvironmentRequest, options?: CallOptions @@ -678,41 +713,6 @@ export class EnvironmentsClient { {} | null | undefined > ): void; - /** - * Updates the specified agent environment. - * - * This method allows you to deploy new agent versions into the environment. - * When an environment is pointed to a new agent version by setting - * `environment.agent_version`, the environment is temporarily set to the - * `LOADING` state. During that time, the environment keeps on serving the - * previous version of the agent. After the new agent version is done loading, - * the environment is set back to the `RUNNING` state. - * You can use "-" as Environment ID in environment name to update version - * in "draft" environment. WARNING: this will negate all recent changes to - * draft and can't be undone. You may want to save the draft to a version - * before calling this function. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2beta1.Environment} request.environment - * Required. The environment to update. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The mask to control which fields get updated. - * @param {boolean} [request.allowLoadToDraftAndDiscardChanges] - * Optional. This field is used to prevent accidental overwrite of the draft - * environment, which is an operation that cannot be undone. To confirm that - * the caller desires this overwrite, this field must be explicitly set to - * true when updating the draft environment (environment ID = `-`). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Environment]{@link google.cloud.dialogflow.v2beta1.Environment}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateEnvironment(request); - */ updateEnvironment( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateEnvironmentRequest, optionsOrCallback?: @@ -759,6 +759,27 @@ export class EnvironmentsClient { this.initialize(); return this.innerApiCalls.updateEnvironment(request, options, callback); } + /** + * Deletes the specified agent environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the environment to delete. + * / Format: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/environments.delete_environment.js + * region_tag:dialogflow_v2beta1_generated_Environments_DeleteEnvironment_async + */ deleteEnvironment( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteEnvironmentRequest, options?: CallOptions @@ -793,27 +814,6 @@ export class EnvironmentsClient { {} | null | undefined > ): void; - /** - * Deletes the specified agent environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the environment to delete. - * / Format: - * - `projects//agent/environments/` - * - `projects//locations//agent/environments/` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteEnvironment(request); - */ deleteEnvironment( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteEnvironmentRequest, optionsOrCallback?: @@ -861,6 +861,34 @@ export class EnvironmentsClient { return this.innerApiCalls.deleteEnvironment(request, options, callback); } + /** + * Returns the list of all non-draft environments of the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all environments from. + * Format: + * - `projects//agent` + * - `projects//locations//agent` + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Environment]{@link google.cloud.dialogflow.v2beta1.Environment}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listEnvironmentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listEnvironments( request?: protos.google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest, options?: CallOptions @@ -892,34 +920,6 @@ export class EnvironmentsClient { protos.google.cloud.dialogflow.v2beta1.IEnvironment > ): void; - /** - * Returns the list of all non-draft environments of the specified agent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The agent to list all environments from. - * Format: - * - `projects//agent` - * - `projects//locations//agent` - * @param {number} [request.pageSize] - * Optional. The maximum number of items to return in a single page. By default 100 and - * at most 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous list request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Environment]{@link google.cloud.dialogflow.v2beta1.Environment}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listEnvironmentsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listEnvironments( request?: protos.google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest, optionsOrCallback?: @@ -1038,11 +1038,8 @@ export class EnvironmentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listEnvironmentsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta1/environments.list_environments.js + * region_tag:dialogflow_v2beta1_generated_Environments_ListEnvironments_async */ listEnvironmentsAsync( request?: protos.google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest, @@ -1056,7 +1053,6 @@ export class EnvironmentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listEnvironments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1066,6 +1062,35 @@ export class EnvironmentsClient { callSettings ) as AsyncIterable; } + /** + * Gets the history of the specified environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the environment to retrieve history for. + * Supported formats: + * - `projects//agent/environments/` + * - `projects//locations//agent/environments/` + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Entry]{@link google.cloud.dialogflow.v2beta1.EnvironmentHistory.Entry}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `getEnvironmentHistoryAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ getEnvironmentHistory( request?: protos.google.cloud.dialogflow.v2beta1.IGetEnvironmentHistoryRequest, options?: CallOptions @@ -1097,35 +1122,6 @@ export class EnvironmentsClient { protos.google.cloud.dialogflow.v2beta1.EnvironmentHistory.IEntry > ): void; - /** - * Gets the history of the specified environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the environment to retrieve history for. - * Supported formats: - * - `projects//agent/environments/` - * - `projects//locations//agent/environments/` - * @param {number} [request.pageSize] - * Optional. The maximum number of items to return in a single page. By default 100 and - * at most 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous list request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Entry]{@link google.cloud.dialogflow.v2beta1.EnvironmentHistory.Entry}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `getEnvironmentHistoryAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ getEnvironmentHistory( request?: protos.google.cloud.dialogflow.v2beta1.IGetEnvironmentHistoryRequest, optionsOrCallback?: @@ -1246,11 +1242,8 @@ export class EnvironmentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.getEnvironmentHistoryAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta1/environments.get_environment_history.js + * region_tag:dialogflow_v2beta1_generated_Environments_GetEnvironmentHistory_async */ getEnvironmentHistoryAsync( request?: protos.google.cloud.dialogflow.v2beta1.IGetEnvironmentHistoryRequest, @@ -1264,7 +1257,6 @@ export class EnvironmentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['getEnvironmentHistory']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2beta1/fulfillments_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/fulfillments_client.ts index 989776f60fe..8ac735960d9 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/fulfillments_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/fulfillments_client.ts @@ -410,6 +410,26 @@ export class FulfillmentsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the fulfillment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the fulfillment. + * Supported formats: + * - `projects//agent/fulfillment` + * - `projects//locations//agent/fulfillment` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Fulfillment]{@link google.cloud.dialogflow.v2beta1.Fulfillment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/fulfillments.get_fulfillment.js + * region_tag:dialogflow_v2beta1_generated_Fulfillments_GetFulfillment_async + */ getFulfillment( request?: protos.google.cloud.dialogflow.v2beta1.IGetFulfillmentRequest, options?: CallOptions @@ -441,26 +461,6 @@ export class FulfillmentsClient { {} | null | undefined > ): void; - /** - * Retrieves the fulfillment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the fulfillment. - * Supported formats: - * - `projects//agent/fulfillment` - * - `projects//locations//agent/fulfillment` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Fulfillment]{@link google.cloud.dialogflow.v2beta1.Fulfillment}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getFulfillment(request); - */ getFulfillment( request?: protos.google.cloud.dialogflow.v2beta1.IGetFulfillmentRequest, optionsOrCallback?: @@ -504,6 +504,26 @@ export class FulfillmentsClient { this.initialize(); return this.innerApiCalls.getFulfillment(request, options, callback); } + /** + * Updates the fulfillment. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2beta1.Fulfillment} request.fulfillment + * Required. The fulfillment to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Fulfillment]{@link google.cloud.dialogflow.v2beta1.Fulfillment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/fulfillments.update_fulfillment.js + * region_tag:dialogflow_v2beta1_generated_Fulfillments_UpdateFulfillment_async + */ updateFulfillment( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateFulfillmentRequest, options?: CallOptions @@ -538,26 +558,6 @@ export class FulfillmentsClient { {} | null | undefined > ): void; - /** - * Updates the fulfillment. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2beta1.Fulfillment} request.fulfillment - * Required. The fulfillment to update. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The mask to control which fields get updated. If the mask is not - * present, all fields will be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Fulfillment]{@link google.cloud.dialogflow.v2beta1.Fulfillment}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateFulfillment(request); - */ updateFulfillment( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateFulfillmentRequest, optionsOrCallback?: diff --git a/packages/google-cloud-dialogflow/src/v2beta1/intents_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/intents_client.ts index 96322660381..4f79cb908ae 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/intents_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/intents_client.ts @@ -484,6 +484,35 @@ export class IntentsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified intent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the intent. + * Supported formats: + * + * - `projects//agent/intents/` + * - `projects//locations//agent/intents/` + * @param {string} [request.languageCode] + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @param {google.cloud.dialogflow.v2beta1.IntentView} request.intentView + * Optional. The resource view to apply to the returned intent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Intent]{@link google.cloud.dialogflow.v2beta1.Intent}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/intents.get_intent.js + * region_tag:dialogflow_v2beta1_generated_Intents_GetIntent_async + */ getIntent( request?: protos.google.cloud.dialogflow.v2beta1.IGetIntentRequest, options?: CallOptions @@ -515,35 +544,6 @@ export class IntentsClient { {} | null | undefined > ): void; - /** - * Retrieves the specified intent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the intent. - * Supported formats: - * - * - `projects//agent/intents/` - * - `projects//locations//agent/intents/` - * @param {string} [request.languageCode] - * Optional. The language used to access language-specific data. - * If not specified, the agent's default language is used. - * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - * @param {google.cloud.dialogflow.v2beta1.IntentView} request.intentView - * Optional. The resource view to apply to the returned intent. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Intent]{@link google.cloud.dialogflow.v2beta1.Intent}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getIntent(request); - */ getIntent( request?: protos.google.cloud.dialogflow.v2beta1.IGetIntentRequest, optionsOrCallback?: @@ -587,37 +587,6 @@ export class IntentsClient { this.initialize(); return this.innerApiCalls.getIntent(request, options, callback); } - createIntent( - request?: protos.google.cloud.dialogflow.v2beta1.ICreateIntentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.IIntent, - protos.google.cloud.dialogflow.v2beta1.ICreateIntentRequest | undefined, - {} | undefined - ] - >; - createIntent( - request: protos.google.cloud.dialogflow.v2beta1.ICreateIntentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dialogflow.v2beta1.IIntent, - | protos.google.cloud.dialogflow.v2beta1.ICreateIntentRequest - | null - | undefined, - {} | null | undefined - > - ): void; - createIntent( - request: protos.google.cloud.dialogflow.v2beta1.ICreateIntentRequest, - callback: Callback< - protos.google.cloud.dialogflow.v2beta1.IIntent, - | protos.google.cloud.dialogflow.v2beta1.ICreateIntentRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Creates an intent in the specified agent. * @@ -650,9 +619,40 @@ export class IntentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.createIntent(request); + * @example include:samples/generated/v2beta1/intents.create_intent.js + * region_tag:dialogflow_v2beta1_generated_Intents_CreateIntent_async */ + createIntent( + request?: protos.google.cloud.dialogflow.v2beta1.ICreateIntentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IIntent, + protos.google.cloud.dialogflow.v2beta1.ICreateIntentRequest | undefined, + {} | undefined + ] + >; + createIntent( + request: protos.google.cloud.dialogflow.v2beta1.ICreateIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IIntent, + | protos.google.cloud.dialogflow.v2beta1.ICreateIntentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createIntent( + request: protos.google.cloud.dialogflow.v2beta1.ICreateIntentRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IIntent, + | protos.google.cloud.dialogflow.v2beta1.ICreateIntentRequest + | null + | undefined, + {} | null | undefined + > + ): void; createIntent( request?: protos.google.cloud.dialogflow.v2beta1.ICreateIntentRequest, optionsOrCallback?: @@ -696,6 +696,37 @@ export class IntentsClient { this.initialize(); return this.innerApiCalls.createIntent(request, options, callback); } + /** + * Updates the specified intent. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2beta1.Intent} request.intent + * Required. The intent to update. + * @param {string} [request.languageCode] + * Optional. The language used to access language-specific data. + * If not specified, the agent's default language is used. + * For more information, see + * [Multilingual intent and entity + * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). + * @param {google.protobuf.FieldMask} request.updateMask + * Optional. The mask to control which fields get updated. + * @param {google.cloud.dialogflow.v2beta1.IntentView} request.intentView + * Optional. The resource view to apply to the returned intent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Intent]{@link google.cloud.dialogflow.v2beta1.Intent}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/intents.update_intent.js + * region_tag:dialogflow_v2beta1_generated_Intents_UpdateIntent_async + */ updateIntent( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateIntentRequest, options?: CallOptions @@ -727,37 +758,6 @@ export class IntentsClient { {} | null | undefined > ): void; - /** - * Updates the specified intent. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2beta1.Intent} request.intent - * Required. The intent to update. - * @param {string} [request.languageCode] - * Optional. The language used to access language-specific data. - * If not specified, the agent's default language is used. - * For more information, see - * [Multilingual intent and entity - * data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity). - * @param {google.protobuf.FieldMask} request.updateMask - * Optional. The mask to control which fields get updated. - * @param {google.cloud.dialogflow.v2beta1.IntentView} request.intentView - * Optional. The resource view to apply to the returned intent. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Intent]{@link google.cloud.dialogflow.v2beta1.Intent}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateIntent(request); - */ updateIntent( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateIntentRequest, optionsOrCallback?: @@ -801,6 +801,33 @@ export class IntentsClient { this.initialize(); return this.innerApiCalls.updateIntent(request, options, callback); } + /** + * Deletes the specified intent and its direct or indirect followup intents. + * + * Note: You should always train an agent prior to sending it queries. See the + * [training + * documentation](https://cloud.google.com/dialogflow/es/docs/training). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the intent to delete. If this intent has direct or + * indirect followup intents, we also delete them. + * + * Supported formats: + * + * - `projects//agent/intents/` + * - `projects//locations//agent/intents/` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/intents.delete_intent.js + * region_tag:dialogflow_v2beta1_generated_Intents_DeleteIntent_async + */ deleteIntent( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteIntentRequest, options?: CallOptions @@ -832,33 +859,6 @@ export class IntentsClient { {} | null | undefined > ): void; - /** - * Deletes the specified intent and its direct or indirect followup intents. - * - * Note: You should always train an agent prior to sending it queries. See the - * [training - * documentation](https://cloud.google.com/dialogflow/es/docs/training). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the intent to delete. If this intent has direct or - * indirect followup intents, we also delete them. - * - * Supported formats: - * - * - `projects//agent/intents/` - * - `projects//locations//agent/intents/` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteIntent(request); - */ deleteIntent( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteIntentRequest, optionsOrCallback?: @@ -903,42 +903,6 @@ export class IntentsClient { return this.innerApiCalls.deleteIntent(request, options, callback); } - batchUpdateIntents( - request?: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchUpdateIntents( - request: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchUpdateIntents( - request: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest, - callback: Callback< - LROperation< - protos.google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Updates/Creates multiple intents in the specified agent. * @@ -987,10 +951,45 @@ export class IntentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.batchUpdateIntents(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2beta1/intents.batch_update_intents.js + * region_tag:dialogflow_v2beta1_generated_Intents_BatchUpdateIntents_async */ + batchUpdateIntents( + request?: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchUpdateIntents( + request: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchUpdateIntents( + request: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchUpdateIntents( request?: protos.google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest, optionsOrCallback?: @@ -1048,11 +1047,8 @@ export class IntentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkBatchUpdateIntentsProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2beta1/intents.batch_update_intents.js + * region_tag:dialogflow_v2beta1_generated_Intents_BatchUpdateIntents_async */ async checkBatchUpdateIntentsProgress( name: string @@ -1076,42 +1072,6 @@ export class IntentsClient { protos.google.protobuf.Struct >; } - batchDeleteIntents( - request?: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - batchDeleteIntents( - request: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - batchDeleteIntents( - request: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.protobuf.IStruct - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Deletes intents in the specified agent. * @@ -1148,10 +1108,45 @@ export class IntentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.batchDeleteIntents(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v2beta1/intents.batch_delete_intents.js + * region_tag:dialogflow_v2beta1_generated_Intents_BatchDeleteIntents_async */ + batchDeleteIntents( + request?: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + batchDeleteIntents( + request: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + batchDeleteIntents( + request: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.protobuf.IStruct + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; batchDeleteIntents( request?: protos.google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest, optionsOrCallback?: @@ -1209,11 +1204,8 @@ export class IntentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkBatchDeleteIntentsProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v2beta1/intents.batch_delete_intents.js + * region_tag:dialogflow_v2beta1_generated_Intents_BatchDeleteIntents_async */ async checkBatchDeleteIntentsProgress( name: string @@ -1234,37 +1226,6 @@ export class IntentsClient { protos.google.protobuf.Struct >; } - listIntents( - request?: protos.google.cloud.dialogflow.v2beta1.IListIntentsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.IIntent[], - protos.google.cloud.dialogflow.v2beta1.IListIntentsRequest | null, - protos.google.cloud.dialogflow.v2beta1.IListIntentsResponse - ] - >; - listIntents( - request: protos.google.cloud.dialogflow.v2beta1.IListIntentsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListIntentsRequest, - | protos.google.cloud.dialogflow.v2beta1.IListIntentsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IIntent - > - ): void; - listIntents( - request: protos.google.cloud.dialogflow.v2beta1.IListIntentsRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListIntentsRequest, - | protos.google.cloud.dialogflow.v2beta1.IListIntentsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IIntent - > - ): void; /** * Returns the list of all intents in the specified agent. * @@ -1307,6 +1268,37 @@ export class IntentsClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listIntents( + request?: protos.google.cloud.dialogflow.v2beta1.IListIntentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IIntent[], + protos.google.cloud.dialogflow.v2beta1.IListIntentsRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListIntentsResponse + ] + >; + listIntents( + request: protos.google.cloud.dialogflow.v2beta1.IListIntentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListIntentsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListIntentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IIntent + > + ): void; + listIntents( + request: protos.google.cloud.dialogflow.v2beta1.IListIntentsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListIntentsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListIntentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IIntent + > + ): void; listIntents( request?: protos.google.cloud.dialogflow.v2beta1.IListIntentsRequest, optionsOrCallback?: @@ -1453,11 +1445,8 @@ export class IntentsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listIntentsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta1/intents.list_intents.js + * region_tag:dialogflow_v2beta1_generated_Intents_ListIntents_async */ listIntentsAsync( request?: protos.google.cloud.dialogflow.v2beta1.IListIntentsRequest, @@ -1471,7 +1460,6 @@ export class IntentsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listIntents']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2beta1/knowledge_bases_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/knowledge_bases_client.ts index a2eed2b7d7e..e0e912da84f 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/knowledge_bases_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/knowledge_bases_client.ts @@ -439,6 +439,28 @@ export class KnowledgeBasesClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified knowledge base. + * + * Note: The `projects.agent.knowledgeBases` resource is deprecated; + * only use `projects.knowledgeBases`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the knowledge base to retrieve. + * Format `projects//locations//knowledgeBases/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [KnowledgeBase]{@link google.cloud.dialogflow.v2beta1.KnowledgeBase}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/knowledge_bases.get_knowledge_base.js + * region_tag:dialogflow_v2beta1_generated_KnowledgeBases_GetKnowledgeBase_async + */ getKnowledgeBase( request?: protos.google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest, options?: CallOptions @@ -473,28 +495,6 @@ export class KnowledgeBasesClient { {} | null | undefined > ): void; - /** - * Retrieves the specified knowledge base. - * - * Note: The `projects.agent.knowledgeBases` resource is deprecated; - * only use `projects.knowledgeBases`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the knowledge base to retrieve. - * Format `projects//locations//knowledgeBases/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [KnowledgeBase]{@link google.cloud.dialogflow.v2beta1.KnowledgeBase}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getKnowledgeBase(request); - */ getKnowledgeBase( request?: protos.google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest, optionsOrCallback?: @@ -541,6 +541,29 @@ export class KnowledgeBasesClient { this.initialize(); return this.innerApiCalls.getKnowledgeBase(request, options, callback); } + /** + * Creates a knowledge base. + * + * Note: The `projects.agent.knowledgeBases` resource is deprecated; + * only use `projects.knowledgeBases`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to create a knowledge base for. + * Format: `projects//locations/`. + * @param {google.cloud.dialogflow.v2beta1.KnowledgeBase} request.knowledgeBase + * Required. The knowledge base to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [KnowledgeBase]{@link google.cloud.dialogflow.v2beta1.KnowledgeBase}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/knowledge_bases.create_knowledge_base.js + * region_tag:dialogflow_v2beta1_generated_KnowledgeBases_CreateKnowledgeBase_async + */ createKnowledgeBase( request?: protos.google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest, options?: CallOptions @@ -575,29 +598,6 @@ export class KnowledgeBasesClient { {} | null | undefined > ): void; - /** - * Creates a knowledge base. - * - * Note: The `projects.agent.knowledgeBases` resource is deprecated; - * only use `projects.knowledgeBases`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project to create a knowledge base for. - * Format: `projects//locations/`. - * @param {google.cloud.dialogflow.v2beta1.KnowledgeBase} request.knowledgeBase - * Required. The knowledge base to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [KnowledgeBase]{@link google.cloud.dialogflow.v2beta1.KnowledgeBase}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createKnowledgeBase(request); - */ createKnowledgeBase( request?: protos.google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest, optionsOrCallback?: @@ -644,6 +644,31 @@ export class KnowledgeBasesClient { this.initialize(); return this.innerApiCalls.createKnowledgeBase(request, options, callback); } + /** + * Deletes the specified knowledge base. + * + * Note: The `projects.agent.knowledgeBases` resource is deprecated; + * only use `projects.knowledgeBases`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the knowledge base to delete. + * Format: `projects//locations//knowledgeBases/`. + * @param {boolean} [request.force] + * Optional. Force deletes the knowledge base. When set to true, any documents + * in the knowledge base are also deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/knowledge_bases.delete_knowledge_base.js + * region_tag:dialogflow_v2beta1_generated_KnowledgeBases_DeleteKnowledgeBase_async + */ deleteKnowledgeBase( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest, options?: CallOptions @@ -678,31 +703,6 @@ export class KnowledgeBasesClient { {} | null | undefined > ): void; - /** - * Deletes the specified knowledge base. - * - * Note: The `projects.agent.knowledgeBases` resource is deprecated; - * only use `projects.knowledgeBases`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the knowledge base to delete. - * Format: `projects//locations//knowledgeBases/`. - * @param {boolean} [request.force] - * Optional. Force deletes the knowledge base. When set to true, any documents - * in the knowledge base are also deleted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteKnowledgeBase(request); - */ deleteKnowledgeBase( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest, optionsOrCallback?: @@ -749,6 +749,30 @@ export class KnowledgeBasesClient { this.initialize(); return this.innerApiCalls.deleteKnowledgeBase(request, options, callback); } + /** + * Updates the specified knowledge base. + * + * Note: The `projects.agent.knowledgeBases` resource is deprecated; + * only use `projects.knowledgeBases`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2beta1.KnowledgeBase} request.knowledgeBase + * Required. The knowledge base to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Not specified means `update all`. + * Currently, only `display_name` can be updated, an InvalidArgument will be + * returned for attempting to update other fields. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [KnowledgeBase]{@link google.cloud.dialogflow.v2beta1.KnowledgeBase}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/knowledge_bases.update_knowledge_base.js + * region_tag:dialogflow_v2beta1_generated_KnowledgeBases_UpdateKnowledgeBase_async + */ updateKnowledgeBase( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest, options?: CallOptions @@ -783,30 +807,6 @@ export class KnowledgeBasesClient { {} | null | undefined > ): void; - /** - * Updates the specified knowledge base. - * - * Note: The `projects.agent.knowledgeBases` resource is deprecated; - * only use `projects.knowledgeBases`. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2beta1.KnowledgeBase} request.knowledgeBase - * Required. The knowledge base to update. - * @param {google.protobuf.FieldMask} [request.updateMask] - * Optional. Not specified means `update all`. - * Currently, only `display_name` can be updated, an InvalidArgument will be - * returned for attempting to update other fields. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [KnowledgeBase]{@link google.cloud.dialogflow.v2beta1.KnowledgeBase}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateKnowledgeBase(request); - */ updateKnowledgeBase( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest, optionsOrCallback?: @@ -854,37 +854,6 @@ export class KnowledgeBasesClient { return this.innerApiCalls.updateKnowledgeBase(request, options, callback); } - listKnowledgeBases( - request?: protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.IKnowledgeBase[], - protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest | null, - protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse - ] - >; - listKnowledgeBases( - request: protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, - | protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IKnowledgeBase - > - ): void; - listKnowledgeBases( - request: protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, - | protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.IKnowledgeBase - > - ): void; /** * Returns the list of all knowledge bases of the specified agent. * @@ -941,6 +910,37 @@ export class KnowledgeBasesClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listKnowledgeBases( + request?: protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IKnowledgeBase[], + protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse + ] + >; + listKnowledgeBases( + request: protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, + | protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IKnowledgeBase + > + ): void; + listKnowledgeBases( + request: protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, + | protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IKnowledgeBase + > + ): void; listKnowledgeBases( request?: protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, optionsOrCallback?: @@ -1109,11 +1109,8 @@ export class KnowledgeBasesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listKnowledgeBasesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta1/knowledge_bases.list_knowledge_bases.js + * region_tag:dialogflow_v2beta1_generated_KnowledgeBases_ListKnowledgeBases_async */ listKnowledgeBasesAsync( request?: protos.google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, @@ -1127,7 +1124,6 @@ export class KnowledgeBasesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listKnowledgeBases']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2beta1/participants_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/participants_client.ts index 9c233407565..f4e73e55a76 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/participants_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/participants_client.ts @@ -449,6 +449,27 @@ export class ParticipantsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Creates a new participant in a conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource identifier of the conversation adding the participant. + * Format: `projects//locations//conversations/`. + * @param {google.cloud.dialogflow.v2beta1.Participant} request.participant + * Required. The participant to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2beta1.Participant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/participants.create_participant.js + * region_tag:dialogflow_v2beta1_generated_Participants_CreateParticipant_async + */ createParticipant( request?: protos.google.cloud.dialogflow.v2beta1.ICreateParticipantRequest, options?: CallOptions @@ -483,27 +504,6 @@ export class ParticipantsClient { {} | null | undefined > ): void; - /** - * Creates a new participant in a conversation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Resource identifier of the conversation adding the participant. - * Format: `projects//locations//conversations/`. - * @param {google.cloud.dialogflow.v2beta1.Participant} request.participant - * Required. The participant to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2beta1.Participant}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createParticipant(request); - */ createParticipant( request?: protos.google.cloud.dialogflow.v2beta1.ICreateParticipantRequest, optionsOrCallback?: @@ -550,6 +550,25 @@ export class ParticipantsClient { this.initialize(); return this.innerApiCalls.createParticipant(request, options, callback); } + /** + * Retrieves a conversation participant. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the participant. Format: + * `projects//locations//conversations//participants/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2beta1.Participant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/participants.get_participant.js + * region_tag:dialogflow_v2beta1_generated_Participants_GetParticipant_async + */ getParticipant( request?: protos.google.cloud.dialogflow.v2beta1.IGetParticipantRequest, options?: CallOptions @@ -581,25 +600,6 @@ export class ParticipantsClient { {} | null | undefined > ): void; - /** - * Retrieves a conversation participant. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the participant. Format: - * `projects//locations//conversations//participants/`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2beta1.Participant}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getParticipant(request); - */ getParticipant( request?: protos.google.cloud.dialogflow.v2beta1.IGetParticipantRequest, optionsOrCallback?: @@ -643,6 +643,25 @@ export class ParticipantsClient { this.initialize(); return this.innerApiCalls.getParticipant(request, options, callback); } + /** + * Updates the specified participant. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2beta1.Participant} request.participant + * Required. The participant to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to specify which fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2beta1.Participant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/participants.update_participant.js + * region_tag:dialogflow_v2beta1_generated_Participants_UpdateParticipant_async + */ updateParticipant( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest, options?: CallOptions @@ -677,25 +696,6 @@ export class ParticipantsClient { {} | null | undefined > ): void; - /** - * Updates the specified participant. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2beta1.Participant} request.participant - * Required. The participant to update. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The mask to specify which fields to update. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2beta1.Participant}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateParticipant(request); - */ updateParticipant( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest, optionsOrCallback?: @@ -742,37 +742,6 @@ export class ParticipantsClient { this.initialize(); return this.innerApiCalls.updateParticipant(request, options, callback); } - analyzeContent( - request?: protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse, - protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest | undefined, - {} | undefined - ] - >; - analyzeContent( - request: protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse, - | protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest - | null - | undefined, - {} | null | undefined - > - ): void; - analyzeContent( - request: protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest, - callback: Callback< - protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse, - | protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Adds a text (chat, for example), or audio (phone recording, for example) * message from a participant into the conversation. @@ -825,9 +794,40 @@ export class ParticipantsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.analyzeContent(request); + * @example include:samples/generated/v2beta1/participants.analyze_content.js + * region_tag:dialogflow_v2beta1_generated_Participants_AnalyzeContent_async */ + analyzeContent( + request?: protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse, + protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest | undefined, + {} | undefined + ] + >; + analyzeContent( + request: protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse, + | protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeContent( + request: protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse, + | protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; analyzeContent( request?: protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest, optionsOrCallback?: @@ -871,6 +871,40 @@ export class ParticipantsClient { this.initialize(); return this.innerApiCalls.analyzeContent(request, options, callback); } + /** + * Gets suggested articles for a participant based on specific historical + * messages. + * + * Note that {@link google.cloud.dialogflow.v2beta1.Participants.ListSuggestions|ListSuggestions} will only list the auto-generated + * suggestions, while {@link google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion|CompileSuggestion} will try to compile suggestion + * based on the provided conversation context in the real time. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @param {string} [request.latestMessage] + * Optional. The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * + * Format: `projects//locations//conversations//messages/`. + * @param {number} [request.contextSize] + * Optional. Max number of messages prior to and including + * {@link google.cloud.dialogflow.v2beta1.SuggestArticlesRequest.latest_message|latest_message} to use as context + * when compiling the suggestion. By default 20 and at most 50. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SuggestArticlesResponse]{@link google.cloud.dialogflow.v2beta1.SuggestArticlesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/participants.suggest_articles.js + * region_tag:dialogflow_v2beta1_generated_Participants_SuggestArticles_async + */ suggestArticles( request?: protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest, options?: CallOptions @@ -905,40 +939,6 @@ export class ParticipantsClient { {} | null | undefined > ): void; - /** - * Gets suggested articles for a participant based on specific historical - * messages. - * - * Note that {@link google.cloud.dialogflow.v2beta1.Participants.ListSuggestions|ListSuggestions} will only list the auto-generated - * suggestions, while {@link google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion|CompileSuggestion} will try to compile suggestion - * based on the provided conversation context in the real time. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the participant to fetch suggestion for. - * Format: `projects//locations//conversations//participants/`. - * @param {string} [request.latestMessage] - * Optional. The name of the latest conversation message to compile suggestion - * for. If empty, it will be the latest message of the conversation. - * - * Format: `projects//locations//conversations//messages/`. - * @param {number} [request.contextSize] - * Optional. Max number of messages prior to and including - * {@link google.cloud.dialogflow.v2beta1.SuggestArticlesRequest.latest_message|latest_message} to use as context - * when compiling the suggestion. By default 20 and at most 50. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SuggestArticlesResponse]{@link google.cloud.dialogflow.v2beta1.SuggestArticlesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.suggestArticles(request); - */ suggestArticles( request?: protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest, optionsOrCallback?: @@ -985,40 +985,6 @@ export class ParticipantsClient { this.initialize(); return this.innerApiCalls.suggestArticles(request, options, callback); } - suggestFaqAnswers( - request?: protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse, - ( - | protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest - | undefined - ), - {} | undefined - ] - >; - suggestFaqAnswers( - request: protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse, - | protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest - | null - | undefined, - {} | null | undefined - > - ): void; - suggestFaqAnswers( - request: protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest, - callback: Callback< - protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse, - | protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Gets suggested faq answers for a participant based on specific historical * messages. @@ -1046,9 +1012,43 @@ export class ParticipantsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.suggestFaqAnswers(request); + * @example include:samples/generated/v2beta1/participants.suggest_faq_answers.js + * region_tag:dialogflow_v2beta1_generated_Participants_SuggestFaqAnswers_async */ + suggestFaqAnswers( + request?: protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse, + ( + | protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest + | undefined + ), + {} | undefined + ] + >; + suggestFaqAnswers( + request: protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse, + | protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest + | null + | undefined, + {} | null | undefined + > + ): void; + suggestFaqAnswers( + request: protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse, + | protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest + | null + | undefined, + {} | null | undefined + > + ): void; suggestFaqAnswers( request?: protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest, optionsOrCallback?: @@ -1095,6 +1095,40 @@ export class ParticipantsClient { this.initialize(); return this.innerApiCalls.suggestFaqAnswers(request, options, callback); } + /** + * Gets smart replies for a participant based on specific historical + * messages. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @param {google.cloud.dialogflow.v2beta1.TextInput} request.currentTextInput + * The current natural language text segment to compile suggestion + * for. This provides a way for user to get follow up smart reply suggestion + * after a smart reply selection, without sending a text message. + * @param {string} request.latestMessage + * The name of the latest conversation message to compile suggestion + * for. If empty, it will be the latest message of the conversation. + * + * Format: `projects//locations//conversations//messages/`. + * @param {number} request.contextSize + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. By default 20 and at most 50. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SuggestSmartRepliesResponse]{@link google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/participants.suggest_smart_replies.js + * region_tag:dialogflow_v2beta1_generated_Participants_SuggestSmartReplies_async + */ suggestSmartReplies( request?: protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest, options?: CallOptions @@ -1129,40 +1163,6 @@ export class ParticipantsClient { {} | null | undefined > ): void; - /** - * Gets smart replies for a participant based on specific historical - * messages. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The name of the participant to fetch suggestion for. - * Format: `projects//locations//conversations//participants/`. - * @param {google.cloud.dialogflow.v2beta1.TextInput} request.currentTextInput - * The current natural language text segment to compile suggestion - * for. This provides a way for user to get follow up smart reply suggestion - * after a smart reply selection, without sending a text message. - * @param {string} request.latestMessage - * The name of the latest conversation message to compile suggestion - * for. If empty, it will be the latest message of the conversation. - * - * Format: `projects//locations//conversations//messages/`. - * @param {number} request.contextSize - * Optional. Max number of messages prior to and including - * [latest_message] to use as context when compiling the - * suggestion. By default 20 and at most 50. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SuggestSmartRepliesResponse]{@link google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.suggestSmartReplies(request); - */ suggestSmartReplies( request?: protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest, optionsOrCallback?: @@ -1209,40 +1209,6 @@ export class ParticipantsClient { this.initialize(); return this.innerApiCalls.suggestSmartReplies(request, options, callback); } - compileSuggestion( - request?: protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse, - ( - | protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest - | undefined - ), - {} | undefined - ] - >; - compileSuggestion( - request: protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse, - | protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest - | null - | undefined, - {} | null | undefined - > - ): void; - compileSuggestion( - request: protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest, - callback: Callback< - protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse, - | protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Deprecated. use {@link google.cloud.dialogflow.v2beta1.Participants.SuggestArticles|SuggestArticles} and {@link google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers|SuggestFaqAnswers} instead. * @@ -1276,10 +1242,44 @@ export class ParticipantsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.compileSuggestion(request); + * @example include:samples/generated/v2beta1/participants.compile_suggestion.js + * region_tag:dialogflow_v2beta1_generated_Participants_CompileSuggestion_async * @deprecated CompileSuggestion is deprecated and may be removed in a future version. */ + compileSuggestion( + request?: protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse, + ( + | protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest + | undefined + ), + {} | undefined + ] + >; + compileSuggestion( + request: protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse, + | protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + compileSuggestion( + request: protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse, + | protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest + | null + | undefined, + {} | null | undefined + > + ): void; compileSuggestion( request?: protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest, optionsOrCallback?: @@ -1332,6 +1332,33 @@ export class ParticipantsClient { return this.innerApiCalls.compileSuggestion(request, options, callback); } + /** + * Returns the list of all participants in the specified conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Participant]{@link google.cloud.dialogflow.v2beta1.Participant}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listParticipantsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listParticipants( request?: protos.google.cloud.dialogflow.v2beta1.IListParticipantsRequest, options?: CallOptions @@ -1363,33 +1390,6 @@ export class ParticipantsClient { protos.google.cloud.dialogflow.v2beta1.IParticipant > ): void; - /** - * Returns the list of all participants in the specified conversation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The conversation to list all participants from. - * Format: `projects//locations//conversations/`. - * @param {number} [request.pageSize] - * Optional. The maximum number of items to return in a single page. By - * default 100 and at most 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous list request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Participant]{@link google.cloud.dialogflow.v2beta1.Participant}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listParticipantsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listParticipants( request?: protos.google.cloud.dialogflow.v2beta1.IListParticipantsRequest, optionsOrCallback?: @@ -1506,11 +1506,8 @@ export class ParticipantsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listParticipantsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta1/participants.list_participants.js + * region_tag:dialogflow_v2beta1_generated_Participants_ListParticipants_async */ listParticipantsAsync( request?: protos.google.cloud.dialogflow.v2beta1.IListParticipantsRequest, @@ -1524,7 +1521,6 @@ export class ParticipantsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listParticipants']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1534,37 +1530,6 @@ export class ParticipantsClient { callSettings ) as AsyncIterable; } - listSuggestions( - request?: protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.ISuggestion[], - protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest | null, - protos.google.cloud.dialogflow.v2beta1.IListSuggestionsResponse - ] - >; - listSuggestions( - request: protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, - | protos.google.cloud.dialogflow.v2beta1.IListSuggestionsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.ISuggestion - > - ): void; - listSuggestions( - request: protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, - | protos.google.cloud.dialogflow.v2beta1.IListSuggestionsResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.ISuggestion - > - ): void; /** * Deprecated: Use inline suggestion, event based suggestion or * Suggestion* API instead. @@ -1621,6 +1586,37 @@ export class ParticipantsClient { * for more details and examples. * @deprecated ListSuggestions is deprecated and may be removed in a future version. */ + listSuggestions( + request?: protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ISuggestion[], + protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListSuggestionsResponse + ] + >; + listSuggestions( + request: protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListSuggestionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.ISuggestion + > + ): void; + listSuggestions( + request: protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListSuggestionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.ISuggestion + > + ): void; listSuggestions( request?: protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, optionsOrCallback?: @@ -1766,11 +1762,8 @@ export class ParticipantsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listSuggestionsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta1/participants.list_suggestions.js + * region_tag:dialogflow_v2beta1_generated_Participants_ListSuggestions_async * @deprecated ListSuggestions is deprecated and may be removed in a future version. */ listSuggestionsAsync( @@ -1785,7 +1778,6 @@ export class ParticipantsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listSuggestions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2beta1/session_entity_types_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/session_entity_types_client.ts index da650030901..490cd67e9d4 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/session_entity_types_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/session_entity_types_client.ts @@ -443,6 +443,40 @@ export class SessionEntityTypesClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified session entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the session entity type. Supported formats: + * - `projects//agent/sessions//entityTypes/` + * - `projects//locations//agent/sessions//entityTypes/` + * - `projects//agent/environments//users//sessions//entityTypes/` + * - `projects//locations//agent/environments/ + * /users//sessions//entityTypes/` + * + * If `Location ID` is not specified we assume default 'us' location. If + * `Environment ID` is not specified, we assume default 'draft' environment. + * If `User ID` is not specified, we assume default '-' user. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SessionEntityType]{@link google.cloud.dialogflow.v2beta1.SessionEntityType}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/session_entity_types.get_session_entity_type.js + * region_tag:dialogflow_v2beta1_generated_SessionEntityTypes_GetSessionEntityType_async + */ getSessionEntityType( request?: protos.google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest, options?: CallOptions @@ -477,40 +511,6 @@ export class SessionEntityTypesClient { {} | null | undefined > ): void; - /** - * Retrieves the specified session entity type. - * - * This method doesn't work with Google Assistant integration. - * Contact Dialogflow support if you need to use session entities - * with Google Assistant integration. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the session entity type. Supported formats: - * - `projects//agent/sessions//entityTypes/` - * - `projects//locations//agent/sessions//entityTypes/` - * - `projects//agent/environments//users//sessions//entityTypes/` - * - `projects//locations//agent/environments/ - * /users//sessions//entityTypes/` - * - * If `Location ID` is not specified we assume default 'us' location. If - * `Environment ID` is not specified, we assume default 'draft' environment. - * If `User ID` is not specified, we assume default '-' user. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SessionEntityType]{@link google.cloud.dialogflow.v2beta1.SessionEntityType}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getSessionEntityType(request); - */ getSessionEntityType( request?: protos.google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest, optionsOrCallback?: @@ -557,40 +557,6 @@ export class SessionEntityTypesClient { this.initialize(); return this.innerApiCalls.getSessionEntityType(request, options, callback); } - createSessionEntityType( - request?: protos.google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.ISessionEntityType, - ( - | protos.google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest - | undefined - ), - {} | undefined - ] - >; - createSessionEntityType( - request: protos.google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dialogflow.v2beta1.ISessionEntityType, - | protos.google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest - | null - | undefined, - {} | null | undefined - > - ): void; - createSessionEntityType( - request: protos.google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest, - callback: Callback< - protos.google.cloud.dialogflow.v2beta1.ISessionEntityType, - | protos.google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Creates a session entity type. * @@ -627,9 +593,43 @@ export class SessionEntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.createSessionEntityType(request); + * @example include:samples/generated/v2beta1/session_entity_types.create_session_entity_type.js + * region_tag:dialogflow_v2beta1_generated_SessionEntityTypes_CreateSessionEntityType_async */ + createSessionEntityType( + request?: protos.google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ISessionEntityType, + ( + | protos.google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest + | undefined + ), + {} | undefined + ] + >; + createSessionEntityType( + request: protos.google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.ISessionEntityType, + | protos.google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createSessionEntityType( + request: protos.google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.ISessionEntityType, + | protos.google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest + | null + | undefined, + {} | null | undefined + > + ): void; createSessionEntityType( request?: protos.google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest, optionsOrCallback?: @@ -680,6 +680,29 @@ export class SessionEntityTypesClient { callback ); } + /** + * Updates the specified session entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2beta1.SessionEntityType} request.sessionEntityType + * Required. The session entity type to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Optional. The mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SessionEntityType]{@link google.cloud.dialogflow.v2beta1.SessionEntityType}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/session_entity_types.update_session_entity_type.js + * region_tag:dialogflow_v2beta1_generated_SessionEntityTypes_UpdateSessionEntityType_async + */ updateSessionEntityType( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest, options?: CallOptions @@ -714,29 +737,6 @@ export class SessionEntityTypesClient { {} | null | undefined > ): void; - /** - * Updates the specified session entity type. - * - * This method doesn't work with Google Assistant integration. - * Contact Dialogflow support if you need to use session entities - * with Google Assistant integration. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2beta1.SessionEntityType} request.sessionEntityType - * Required. The session entity type to update. - * @param {google.protobuf.FieldMask} request.updateMask - * Optional. The mask to control which fields get updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SessionEntityType]{@link google.cloud.dialogflow.v2beta1.SessionEntityType}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateSessionEntityType(request); - */ updateSessionEntityType( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest, optionsOrCallback?: @@ -787,6 +787,41 @@ export class SessionEntityTypesClient { callback ); } + /** + * Deletes the specified session entity type. + * + * This method doesn't work with Google Assistant integration. + * Contact Dialogflow support if you need to use session entities + * with Google Assistant integration. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the entity type to delete. + * Supported formats: + * - `projects//agent/sessions//entityTypes/` + * - `projects//locations//agent/sessions//entityTypes/` + * - `projects//agent/environments//users//sessions//entityTypes/` + * - `projects//locations//agent/environments/ + * /users//sessions//entityTypes/` + * + * If `Location ID` is not specified we assume default 'us' location. If + * `Environment ID` is not specified, we assume default 'draft' environment. + * If `User ID` is not specified, we assume default '-' user. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/session_entity_types.delete_session_entity_type.js + * region_tag:dialogflow_v2beta1_generated_SessionEntityTypes_DeleteSessionEntityType_async + */ deleteSessionEntityType( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest, options?: CallOptions @@ -821,41 +856,6 @@ export class SessionEntityTypesClient { {} | null | undefined > ): void; - /** - * Deletes the specified session entity type. - * - * This method doesn't work with Google Assistant integration. - * Contact Dialogflow support if you need to use session entities - * with Google Assistant integration. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the entity type to delete. - * Supported formats: - * - `projects//agent/sessions//entityTypes/` - * - `projects//locations//agent/sessions//entityTypes/` - * - `projects//agent/environments//users//sessions//entityTypes/` - * - `projects//locations//agent/environments/ - * /users//sessions//entityTypes/` - * - * If `Location ID` is not specified we assume default 'us' location. If - * `Environment ID` is not specified, we assume default 'draft' environment. - * If `User ID` is not specified, we assume default '-' user. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteSessionEntityType(request); - */ deleteSessionEntityType( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest, optionsOrCallback?: @@ -907,37 +907,6 @@ export class SessionEntityTypesClient { ); } - listSessionEntityTypes( - request?: protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.ISessionEntityType[], - protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest | null, - protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse - ] - >; - listSessionEntityTypes( - request: protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, - | protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.ISessionEntityType - > - ): void; - listSessionEntityTypes( - request: protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, - callback: PaginationCallback< - protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, - | protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse - | null - | undefined, - protos.google.cloud.dialogflow.v2beta1.ISessionEntityType - > - ): void; /** * Returns the list of all session entity types in the specified session. * @@ -980,6 +949,37 @@ export class SessionEntityTypesClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listSessionEntityTypes( + request?: protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ISessionEntityType[], + protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse + ] + >; + listSessionEntityTypes( + request: protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, + | protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.ISessionEntityType + > + ): void; + listSessionEntityTypes( + request: protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, + | protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.ISessionEntityType + > + ): void; listSessionEntityTypes( request?: protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, optionsOrCallback?: @@ -1122,11 +1122,8 @@ export class SessionEntityTypesClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listSessionEntityTypesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta1/session_entity_types.list_session_entity_types.js + * region_tag:dialogflow_v2beta1_generated_SessionEntityTypes_ListSessionEntityTypes_async */ listSessionEntityTypesAsync( request?: protos.google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, @@ -1140,7 +1137,6 @@ export class SessionEntityTypesClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listSessionEntityTypes']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2beta1/sessions_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/sessions_client.ts index f03de918580..d69acaed05a 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/sessions_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/sessions_client.ts @@ -435,37 +435,6 @@ export class SessionsClient { // ------------------- // -- Service calls -- // ------------------- - detectIntent( - request?: protos.google.cloud.dialogflow.v2beta1.IDetectIntentRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.dialogflow.v2beta1.IDetectIntentResponse, - protos.google.cloud.dialogflow.v2beta1.IDetectIntentRequest | undefined, - {} | undefined - ] - >; - detectIntent( - request: protos.google.cloud.dialogflow.v2beta1.IDetectIntentRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dialogflow.v2beta1.IDetectIntentResponse, - | protos.google.cloud.dialogflow.v2beta1.IDetectIntentRequest - | null - | undefined, - {} | null | undefined - > - ): void; - detectIntent( - request: protos.google.cloud.dialogflow.v2beta1.IDetectIntentRequest, - callback: Callback< - protos.google.cloud.dialogflow.v2beta1.IDetectIntentResponse, - | protos.google.cloud.dialogflow.v2beta1.IDetectIntentRequest - | null - | undefined, - {} | null | undefined - > - ): void; /** * Processes a natural language query and returns structured, actionable data * as a result. This method is not idempotent, because it may cause contexts @@ -542,9 +511,40 @@ export class SessionsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) * for more details and examples. - * @example - * const [response] = await client.detectIntent(request); + * @example include:samples/generated/v2beta1/sessions.detect_intent.js + * region_tag:dialogflow_v2beta1_generated_Sessions_DetectIntent_async */ + detectIntent( + request?: protos.google.cloud.dialogflow.v2beta1.IDetectIntentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IDetectIntentResponse, + protos.google.cloud.dialogflow.v2beta1.IDetectIntentRequest | undefined, + {} | undefined + ] + >; + detectIntent( + request: protos.google.cloud.dialogflow.v2beta1.IDetectIntentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IDetectIntentResponse, + | protos.google.cloud.dialogflow.v2beta1.IDetectIntentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + detectIntent( + request: protos.google.cloud.dialogflow.v2beta1.IDetectIntentRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IDetectIntentResponse, + | protos.google.cloud.dialogflow.v2beta1.IDetectIntentRequest + | null + | undefined, + {} | null | undefined + > + ): void; detectIntent( request?: protos.google.cloud.dialogflow.v2beta1.IDetectIntentRequest, optionsOrCallback?: @@ -614,12 +614,8 @@ export class SessionsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming) * for more details and examples. - * @example - * const stream = client.streamingDetectIntent(); - * stream.on('data', (response) => { ... }); - * stream.on('end', () => { ... }); - * stream.write(request); - * stream.end(); + * @example include:samples/generated/v2beta1/sessions.streaming_detect_intent.js + * region_tag:dialogflow_v2beta1_generated_Sessions_StreamingDetectIntent_async */ streamingDetectIntent(options?: CallOptions): gax.CancellableStream { this.initialize(); diff --git a/packages/google-cloud-dialogflow/src/v2beta1/versions_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/versions_client.ts index a164fd380d5..9f2278edfe3 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/versions_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/versions_client.ts @@ -439,6 +439,27 @@ export class VersionsClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Retrieves the specified agent version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the version. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Version]{@link google.cloud.dialogflow.v2beta1.Version}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/versions.get_version.js + * region_tag:dialogflow_v2beta1_generated_Versions_GetVersion_async + */ getVersion( request?: protos.google.cloud.dialogflow.v2beta1.IGetVersionRequest, options?: CallOptions @@ -470,27 +491,6 @@ export class VersionsClient { {} | null | undefined > ): void; - /** - * Retrieves the specified agent version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the version. - * Supported formats: - * - `projects//agent/versions/` - * - `projects//locations//agent/versions/` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Version]{@link google.cloud.dialogflow.v2beta1.Version}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.getVersion(request); - */ getVersion( request?: protos.google.cloud.dialogflow.v2beta1.IGetVersionRequest, optionsOrCallback?: @@ -534,6 +534,30 @@ export class VersionsClient { this.initialize(); return this.innerApiCalls.getVersion(request, options, callback); } + /** + * Creates an agent version. + * + * The new version points to the agent instance in the "default" environment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to create a version for. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * @param {google.cloud.dialogflow.v2beta1.Version} request.version + * Required. The version to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Version]{@link google.cloud.dialogflow.v2beta1.Version}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/versions.create_version.js + * region_tag:dialogflow_v2beta1_generated_Versions_CreateVersion_async + */ createVersion( request?: protos.google.cloud.dialogflow.v2beta1.ICreateVersionRequest, options?: CallOptions @@ -565,30 +589,6 @@ export class VersionsClient { {} | null | undefined > ): void; - /** - * Creates an agent version. - * - * The new version points to the agent instance in the "default" environment. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The agent to create a version for. - * Supported formats: - * - `projects//agent` - * - `projects//locations//agent` - * @param {google.cloud.dialogflow.v2beta1.Version} request.version - * Required. The version to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Version]{@link google.cloud.dialogflow.v2beta1.Version}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createVersion(request); - */ createVersion( request?: protos.google.cloud.dialogflow.v2beta1.ICreateVersionRequest, optionsOrCallback?: @@ -632,6 +632,33 @@ export class VersionsClient { this.initialize(); return this.innerApiCalls.createVersion(request, options, callback); } + /** + * Updates the specified agent version. + * + * Note that this method does not allow you to update the state of the agent + * the given version points to. It allows you to update only mutable + * properties of the version resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2beta1.Version} request.version + * Required. The version to update. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Version]{@link google.cloud.dialogflow.v2beta1.Version}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/versions.update_version.js + * region_tag:dialogflow_v2beta1_generated_Versions_UpdateVersion_async + */ updateVersion( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateVersionRequest, options?: CallOptions @@ -663,33 +690,6 @@ export class VersionsClient { {} | null | undefined > ): void; - /** - * Updates the specified agent version. - * - * Note that this method does not allow you to update the state of the agent - * the given version points to. It allows you to update only mutable - * properties of the version resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dialogflow.v2beta1.Version} request.version - * Required. The version to update. - * Supported formats: - * - `projects//agent/versions/` - * - `projects//locations//agent/versions/` - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The mask to control which fields get updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Version]{@link google.cloud.dialogflow.v2beta1.Version}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.updateVersion(request); - */ updateVersion( request?: protos.google.cloud.dialogflow.v2beta1.IUpdateVersionRequest, optionsOrCallback?: @@ -733,6 +733,27 @@ export class VersionsClient { this.initialize(); return this.innerApiCalls.updateVersion(request, options, callback); } + /** + * Delete the specified agent version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the version to delete. + * Supported formats: + * - `projects//agent/versions/` + * - `projects//locations//agent/versions/` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v2beta1/versions.delete_version.js + * region_tag:dialogflow_v2beta1_generated_Versions_DeleteVersion_async + */ deleteVersion( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteVersionRequest, options?: CallOptions @@ -764,27 +785,6 @@ export class VersionsClient { {} | null | undefined > ): void; - /** - * Delete the specified agent version. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the version to delete. - * Supported formats: - * - `projects//agent/versions/` - * - `projects//locations//agent/versions/` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.deleteVersion(request); - */ deleteVersion( request?: protos.google.cloud.dialogflow.v2beta1.IDeleteVersionRequest, optionsOrCallback?: @@ -829,6 +829,34 @@ export class VersionsClient { return this.innerApiCalls.deleteVersion(request, options, callback); } + /** + * Returns the list of all versions of the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The agent to list all versions from. + * Supported formats: + * - `projects//agent` + * - `projects//locations//agent` + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By default 100 and + * at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Version]{@link google.cloud.dialogflow.v2beta1.Version}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listVersionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ listVersions( request?: protos.google.cloud.dialogflow.v2beta1.IListVersionsRequest, options?: CallOptions @@ -860,34 +888,6 @@ export class VersionsClient { protos.google.cloud.dialogflow.v2beta1.IVersion > ): void; - /** - * Returns the list of all versions of the specified agent. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The agent to list all versions from. - * Supported formats: - * - `projects//agent` - * - `projects//locations//agent` - * @param {number} [request.pageSize] - * Optional. The maximum number of items to return in a single page. By default 100 and - * at most 1000. - * @param {string} [request.pageToken] - * Optional. The next_page_token value returned from a previous list request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [Version]{@link google.cloud.dialogflow.v2beta1.Version}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listVersionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) - * for more details and examples. - */ listVersions( request?: protos.google.cloud.dialogflow.v2beta1.IListVersionsRequest, optionsOrCallback?: @@ -1006,11 +1006,8 @@ export class VersionsClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listVersionsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v2beta1/versions.list_versions.js + * region_tag:dialogflow_v2beta1_generated_Versions_ListVersions_async */ listVersionsAsync( request?: protos.google.cloud.dialogflow.v2beta1.IListVersionsRequest, @@ -1024,7 +1021,6 @@ export class VersionsClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listVersions']; const callSettings = defaultCallSettings.merge(options); this.initialize();