Skip to content
This repository was archived by the owner on Dec 3, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,116 @@ public final UnaryCallable<CreateDocumentRequest, Operation> createDocumentCalla
return stub.createDocumentCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates documents by importing data from external sources. Dialogflow supports up to 350
* documents in each request. If you try to import more, Dialogflow will return an error.
*
* <p>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:
*
* <p>- `metadata`:
* [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] -
* `response`: [ImportDocumentsResponse][google.cloud.dialogflow.v2.ImportDocumentsResponse]
*
* <p>Sample code:
*
* <pre>{@code
* try (DocumentsClient documentsClient = DocumentsClient.create()) {
* ImportDocumentsRequest request =
* ImportDocumentsRequest.newBuilder()
* .setParent(
* KnowledgeBaseName.ofProjectKnowledgeBaseName("[PROJECT]", "[KNOWLEDGE_BASE]")
* .toString())
* .setDocumentTemplate(ImportDocumentTemplate.newBuilder().build())
* .setImportGcsCustomMetadata(true)
* .build();
* ImportDocumentsResponse response = documentsClient.importDocumentsAsync(request).get();
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<ImportDocumentsResponse, KnowledgeOperationMetadata>
importDocumentsAsync(ImportDocumentsRequest request) {
return importDocumentsOperationCallable().futureCall(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates documents by importing data from external sources. Dialogflow supports up to 350
* documents in each request. If you try to import more, Dialogflow will return an error.
*
* <p>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:
*
* <p>- `metadata`:
* [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] -
* `response`: [ImportDocumentsResponse][google.cloud.dialogflow.v2.ImportDocumentsResponse]
*
* <p>Sample code:
*
* <pre>{@code
* try (DocumentsClient documentsClient = DocumentsClient.create()) {
* ImportDocumentsRequest request =
* ImportDocumentsRequest.newBuilder()
* .setParent(
* KnowledgeBaseName.ofProjectKnowledgeBaseName("[PROJECT]", "[KNOWLEDGE_BASE]")
* .toString())
* .setDocumentTemplate(ImportDocumentTemplate.newBuilder().build())
* .setImportGcsCustomMetadata(true)
* .build();
* OperationFuture<ImportDocumentsResponse, KnowledgeOperationMetadata> future =
* documentsClient.importDocumentsOperationCallable().futureCall(request);
* // Do something.
* ImportDocumentsResponse response = future.get();
* }
* }</pre>
*/
public final OperationCallable<
ImportDocumentsRequest, ImportDocumentsResponse, KnowledgeOperationMetadata>
importDocumentsOperationCallable() {
return stub.importDocumentsOperationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates documents by importing data from external sources. Dialogflow supports up to 350
* documents in each request. If you try to import more, Dialogflow will return an error.
*
* <p>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:
*
* <p>- `metadata`:
* [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] -
* `response`: [ImportDocumentsResponse][google.cloud.dialogflow.v2.ImportDocumentsResponse]
*
* <p>Sample code:
*
* <pre>{@code
* try (DocumentsClient documentsClient = DocumentsClient.create()) {
* ImportDocumentsRequest request =
* ImportDocumentsRequest.newBuilder()
* .setParent(
* KnowledgeBaseName.ofProjectKnowledgeBaseName("[PROJECT]", "[KNOWLEDGE_BASE]")
* .toString())
* .setDocumentTemplate(ImportDocumentTemplate.newBuilder().build())
* .setImportGcsCustomMetadata(true)
* .build();
* ApiFuture<Operation> future = documentsClient.importDocumentsCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<ImportDocumentsRequest, Operation> importDocumentsCallable() {
return stub.importDocumentsCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes the specified document.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@ public UnaryCallSettings<CreateDocumentRequest, Operation> createDocumentSetting
return ((DocumentsStubSettings) getStubSettings()).createDocumentOperationSettings();
}

/** Returns the object with the settings used for calls to importDocuments. */
public UnaryCallSettings<ImportDocumentsRequest, Operation> importDocumentsSettings() {
return ((DocumentsStubSettings) getStubSettings()).importDocumentsSettings();
}

/** Returns the object with the settings used for calls to importDocuments. */
public OperationCallSettings<
ImportDocumentsRequest, ImportDocumentsResponse, KnowledgeOperationMetadata>
importDocumentsOperationSettings() {
return ((DocumentsStubSettings) getStubSettings()).importDocumentsOperationSettings();
}

/** Returns the object with the settings used for calls to deleteDocument. */
public UnaryCallSettings<DeleteDocumentRequest, Operation> deleteDocumentSettings() {
return ((DocumentsStubSettings) getStubSettings()).deleteDocumentSettings();
Expand Down Expand Up @@ -257,6 +269,18 @@ public UnaryCallSettings.Builder<CreateDocumentRequest, Operation> createDocumen
return getStubSettingsBuilder().createDocumentOperationSettings();
}

/** Returns the builder for the settings used for calls to importDocuments. */
public UnaryCallSettings.Builder<ImportDocumentsRequest, Operation> importDocumentsSettings() {
return getStubSettingsBuilder().importDocumentsSettings();
}

/** Returns the builder for the settings used for calls to importDocuments. */
public OperationCallSettings.Builder<
ImportDocumentsRequest, ImportDocumentsResponse, KnowledgeOperationMetadata>
importDocumentsOperationSettings() {
return getStubSettingsBuilder().importDocumentsOperationSettings();
}

/** Returns the builder for the settings used for calls to deleteDocument. */
public UnaryCallSettings.Builder<DeleteDocumentRequest, Operation> deleteDocumentSettings() {
return getStubSettingsBuilder().deleteDocumentSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,126 @@ public final SuggestFaqAnswersResponse suggestFaqAnswers(SuggestFaqAnswersReques
return stub.suggestFaqAnswersCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets smart replies for a participant based on specific historical messages.
*
* <p>Sample code:
*
* <pre>{@code
* try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
* ParticipantName parent =
* ParticipantName.ofProjectConversationParticipantName(
* "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]");
* SuggestSmartRepliesResponse response = participantsClient.suggestSmartReplies(parent);
* }
* }</pre>
*
* @param parent Required. The name of the participant to fetch suggestion for. Format:
* `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/conversations/&lt;Conversation
* ID&gt;/participants/&lt;Participant ID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final SuggestSmartRepliesResponse suggestSmartReplies(ParticipantName parent) {
SuggestSmartRepliesRequest request =
SuggestSmartRepliesRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.build();
return suggestSmartReplies(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets smart replies for a participant based on specific historical messages.
*
* <p>Sample code:
*
* <pre>{@code
* try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
* String parent =
* ParticipantName.ofProjectConversationParticipantName(
* "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
* .toString();
* SuggestSmartRepliesResponse response = participantsClient.suggestSmartReplies(parent);
* }
* }</pre>
*
* @param parent Required. The name of the participant to fetch suggestion for. Format:
* `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/conversations/&lt;Conversation
* ID&gt;/participants/&lt;Participant ID&gt;`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final SuggestSmartRepliesResponse suggestSmartReplies(String parent) {
SuggestSmartRepliesRequest request =
SuggestSmartRepliesRequest.newBuilder().setParent(parent).build();
return suggestSmartReplies(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets smart replies for a participant based on specific historical messages.
*
* <p>Sample code:
*
* <pre>{@code
* try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
* SuggestSmartRepliesRequest request =
* SuggestSmartRepliesRequest.newBuilder()
* .setParent(
* ParticipantName.ofProjectConversationParticipantName(
* "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
* .toString())
* .setCurrentTextInput(TextInput.newBuilder().build())
* .setLatestMessage(
* MessageName.ofProjectConversationMessageName(
* "[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
* .toString())
* .setContextSize(1116903569)
* .build();
* SuggestSmartRepliesResponse response = participantsClient.suggestSmartReplies(request);
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final SuggestSmartRepliesResponse suggestSmartReplies(SuggestSmartRepliesRequest request) {
return suggestSmartRepliesCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Gets smart replies for a participant based on specific historical messages.
*
* <p>Sample code:
*
* <pre>{@code
* try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
* SuggestSmartRepliesRequest request =
* SuggestSmartRepliesRequest.newBuilder()
* .setParent(
* ParticipantName.ofProjectConversationParticipantName(
* "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
* .toString())
* .setCurrentTextInput(TextInput.newBuilder().build())
* .setLatestMessage(
* MessageName.ofProjectConversationMessageName(
* "[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
* .toString())
* .setContextSize(1116903569)
* .build();
* ApiFuture<SuggestSmartRepliesResponse> future =
* participantsClient.suggestSmartRepliesCallable().futureCall(request);
* // Do something.
* SuggestSmartRepliesResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<SuggestSmartRepliesRequest, SuggestSmartRepliesResponse>
suggestSmartRepliesCallable() {
return stub.suggestSmartRepliesCallable();
}

@Override
public final void close() {
stub.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ public UnaryCallSettings<AnalyzeContentRequest, AnalyzeContentResponse> analyzeC
return ((ParticipantsStubSettings) getStubSettings()).suggestFaqAnswersSettings();
}

/** Returns the object with the settings used for calls to suggestSmartReplies. */
public UnaryCallSettings<SuggestSmartRepliesRequest, SuggestSmartRepliesResponse>
suggestSmartRepliesSettings() {
return ((ParticipantsStubSettings) getStubSettings()).suggestSmartRepliesSettings();
}

public static final ParticipantsSettings create(ParticipantsStubSettings stub)
throws IOException {
return new ParticipantsSettings.Builder(stub.toBuilder()).build();
Expand Down Expand Up @@ -246,6 +252,12 @@ public UnaryCallSettings.Builder<GetParticipantRequest, Participant> getParticip
return getStubSettingsBuilder().suggestFaqAnswersSettings();
}

/** Returns the builder for the settings used for calls to suggestSmartReplies. */
public UnaryCallSettings.Builder<SuggestSmartRepliesRequest, SuggestSmartRepliesResponse>
suggestSmartRepliesSettings() {
return getStubSettingsBuilder().suggestSmartRepliesSettings();
}

@Override
public ParticipantsSettings build() throws IOException {
return new ParticipantsSettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@
"GetDocument": {
"methods": ["getDocument", "getDocument", "getDocument", "getDocumentCallable"]
},
"ImportDocuments": {
"methods": ["importDocumentsAsync", "importDocumentsOperationCallable", "importDocumentsCallable"]
},
"ListDocuments": {
"methods": ["listDocuments", "listDocuments", "listDocuments", "listDocumentsPagedCallable", "listDocumentsCallable"]
},
Expand Down Expand Up @@ -319,6 +322,9 @@
"SuggestFaqAnswers": {
"methods": ["suggestFaqAnswers", "suggestFaqAnswers", "suggestFaqAnswers", "suggestFaqAnswersCallable"]
},
"SuggestSmartReplies": {
"methods": ["suggestSmartReplies", "suggestSmartReplies", "suggestSmartReplies", "suggestSmartRepliesCallable"]
},
"UpdateParticipant": {
"methods": ["updateParticipant", "updateParticipant", "updateParticipantCallable"]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import com.google.cloud.dialogflow.v2.Document;
import com.google.cloud.dialogflow.v2.ExportDocumentRequest;
import com.google.cloud.dialogflow.v2.GetDocumentRequest;
import com.google.cloud.dialogflow.v2.ImportDocumentsRequest;
import com.google.cloud.dialogflow.v2.ImportDocumentsResponse;
import com.google.cloud.dialogflow.v2.KnowledgeOperationMetadata;
import com.google.cloud.dialogflow.v2.ListDocumentsRequest;
import com.google.cloud.dialogflow.v2.ListDocumentsResponse;
Expand Down Expand Up @@ -71,6 +73,16 @@ public UnaryCallable<CreateDocumentRequest, Operation> createDocumentCallable()
throw new UnsupportedOperationException("Not implemented: createDocumentCallable()");
}

public OperationCallable<
ImportDocumentsRequest, ImportDocumentsResponse, KnowledgeOperationMetadata>
importDocumentsOperationCallable() {
throw new UnsupportedOperationException("Not implemented: importDocumentsOperationCallable()");
}

public UnaryCallable<ImportDocumentsRequest, Operation> importDocumentsCallable() {
throw new UnsupportedOperationException("Not implemented: importDocumentsCallable()");
}

public OperationCallable<DeleteDocumentRequest, Empty, KnowledgeOperationMetadata>
deleteDocumentOperationCallable() {
throw new UnsupportedOperationException("Not implemented: deleteDocumentOperationCallable()");
Expand Down
Loading