Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
feat: added export documentation method (#800)
Browse files Browse the repository at this point in the history
feat: added filter in list documentations request 
feat: added option to import custom metadata from Google Cloud Storage in reload document request 
feat: added option to apply partial update to the smart messaging allowlist in reload document request 
feat: added filter in list knowledge bases request

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 417030293

Source-Link: googleapis/googleapis@ebef8e6

Source-Link: googleapis/googleapis-gen@1395126
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTM5NTEyNjhiMDA5ZDk4ZDgyMzU1Y2NkOTY0N2Y0MzUwNTkwNjA5ZCJ9
  • Loading branch information
gcf-owl-bot[bot] committed Dec 28, 2021
1 parent feac480 commit 0b7f7e9
Show file tree
Hide file tree
Showing 31 changed files with 4,219 additions and 540 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ public final ListDocumentsPagedResponse listDocuments(String parent) {
* .toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .build();
* for (Document element : documentsClient.listDocuments(request).iterateAll()) {
* // doThingsWith(element);
Expand Down Expand Up @@ -263,6 +264,7 @@ public final ListDocumentsPagedResponse listDocuments(ListDocumentsRequest reque
* .toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .build();
* ApiFuture<Document> future = documentsClient.listDocumentsPagedCallable().futureCall(request);
* // Do something.
Expand Down Expand Up @@ -292,6 +294,7 @@ public final ListDocumentsPagedResponse listDocuments(ListDocumentsRequest reque
* .toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .build();
* while (true) {
* ListDocumentsResponse response = documentsClient.listDocumentsCallable().call(request);
Expand Down Expand Up @@ -1025,6 +1028,8 @@ public final OperationFuture<Document, KnowledgeOperationMetadata> reloadDocumen
* DocumentName.ofProjectKnowledgeBaseDocumentName(
* "[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]")
* .toString())
* .setImportGcsCustomMetadata(true)
* .setSmartMessagingPartialUpdate(true)
* .build();
* Document response = documentsClient.reloadDocumentAsync(request).get();
* }
Expand Down Expand Up @@ -1066,6 +1071,8 @@ public final OperationFuture<Document, KnowledgeOperationMetadata> reloadDocumen
* DocumentName.ofProjectKnowledgeBaseDocumentName(
* "[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]")
* .toString())
* .setImportGcsCustomMetadata(true)
* .setSmartMessagingPartialUpdate(true)
* .build();
* OperationFuture<Document, KnowledgeOperationMetadata> future =
* documentsClient.reloadDocumentOperationCallable().futureCall(request);
Expand Down Expand Up @@ -1107,6 +1114,8 @@ public final OperationFuture<Document, KnowledgeOperationMetadata> reloadDocumen
* DocumentName.ofProjectKnowledgeBaseDocumentName(
* "[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]")
* .toString())
* .setImportGcsCustomMetadata(true)
* .setSmartMessagingPartialUpdate(true)
* .build();
* ApiFuture<Operation> future = documentsClient.reloadDocumentCallable().futureCall(request);
* // Do something.
Expand All @@ -1118,6 +1127,115 @@ public final UnaryCallable<ReloadDocumentRequest, Operation> reloadDocumentCalla
return stub.reloadDocumentCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Exports a smart messaging candidate document into the specified destination.
*
* <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`: [Document][google.cloud.dialogflow.v2.Document]
*
* <p>Sample code:
*
* <pre>{@code
* try (DocumentsClient documentsClient = DocumentsClient.create()) {
* ExportDocumentRequest request =
* ExportDocumentRequest.newBuilder()
* .setName(
* DocumentName.ofProjectKnowledgeBaseDocumentName(
* "[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]")
* .toString())
* .setExportFullContent(true)
* .setSmartMessagingPartialUpdate(true)
* .build();
* Document response = documentsClient.exportDocumentAsync(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<Document, KnowledgeOperationMetadata> exportDocumentAsync(
ExportDocumentRequest request) {
return exportDocumentOperationCallable().futureCall(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Exports a smart messaging candidate document into the specified destination.
*
* <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`: [Document][google.cloud.dialogflow.v2.Document]
*
* <p>Sample code:
*
* <pre>{@code
* try (DocumentsClient documentsClient = DocumentsClient.create()) {
* ExportDocumentRequest request =
* ExportDocumentRequest.newBuilder()
* .setName(
* DocumentName.ofProjectKnowledgeBaseDocumentName(
* "[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]")
* .toString())
* .setExportFullContent(true)
* .setSmartMessagingPartialUpdate(true)
* .build();
* OperationFuture<Document, KnowledgeOperationMetadata> future =
* documentsClient.exportDocumentOperationCallable().futureCall(request);
* // Do something.
* Document response = future.get();
* }
* }</pre>
*/
public final OperationCallable<ExportDocumentRequest, Document, KnowledgeOperationMetadata>
exportDocumentOperationCallable() {
return stub.exportDocumentOperationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Exports a smart messaging candidate document into the specified destination.
*
* <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`: [Document][google.cloud.dialogflow.v2.Document]
*
* <p>Sample code:
*
* <pre>{@code
* try (DocumentsClient documentsClient = DocumentsClient.create()) {
* ExportDocumentRequest request =
* ExportDocumentRequest.newBuilder()
* .setName(
* DocumentName.ofProjectKnowledgeBaseDocumentName(
* "[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]")
* .toString())
* .setExportFullContent(true)
* .setSmartMessagingPartialUpdate(true)
* .build();
* ApiFuture<Operation> future = documentsClient.exportDocumentCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<ExportDocumentRequest, Operation> exportDocumentCallable() {
return stub.exportDocumentCallable();
}

@Override
public final void close() {
stub.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,17 @@ public UnaryCallSettings<ReloadDocumentRequest, Operation> reloadDocumentSetting
return ((DocumentsStubSettings) getStubSettings()).reloadDocumentOperationSettings();
}

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

/** Returns the object with the settings used for calls to exportDocument. */
public OperationCallSettings<ExportDocumentRequest, Document, KnowledgeOperationMetadata>
exportDocumentOperationSettings() {
return ((DocumentsStubSettings) getStubSettings()).exportDocumentOperationSettings();
}

public static final DocumentsSettings create(DocumentsStubSettings stub) throws IOException {
return new DocumentsSettings.Builder(stub.toBuilder()).build();
}
Expand Down Expand Up @@ -281,6 +292,18 @@ public UnaryCallSettings.Builder<ReloadDocumentRequest, Operation> reloadDocumen
return getStubSettingsBuilder().reloadDocumentOperationSettings();
}

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

/** Returns the builder for the settings used for calls to exportDocument. */
public OperationCallSettings.Builder<
ExportDocumentRequest, Document, KnowledgeOperationMetadata>
exportDocumentOperationSettings() {
return getStubSettingsBuilder().exportDocumentOperationSettings();
}

@Override
public DocumentsSettings build() throws IOException {
return new DocumentsSettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ public final ListKnowledgeBasesPagedResponse listKnowledgeBases(String parent) {
* .setParent(ProjectName.of("[PROJECT]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .build();
* for (KnowledgeBase element : knowledgeBasesClient.listKnowledgeBases(request).iterateAll()) {
* // doThingsWith(element);
Expand Down Expand Up @@ -270,6 +271,7 @@ public final ListKnowledgeBasesPagedResponse listKnowledgeBases(
* .setParent(ProjectName.of("[PROJECT]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .build();
* ApiFuture<KnowledgeBase> future =
* knowledgeBasesClient.listKnowledgeBasesPagedCallable().futureCall(request);
Expand Down Expand Up @@ -298,6 +300,7 @@ public final ListKnowledgeBasesPagedResponse listKnowledgeBases(
* .setParent(ProjectName.of("[PROJECT]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .setFilter("filter-1274492040")
* .build();
* while (true) {
* ListKnowledgeBasesResponse response =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@
"DeleteDocument": {
"methods": ["deleteDocumentAsync", "deleteDocumentAsync", "deleteDocumentAsync", "deleteDocumentOperationCallable", "deleteDocumentCallable"]
},
"ExportDocument": {
"methods": ["exportDocumentAsync", "exportDocumentOperationCallable", "exportDocumentCallable"]
},
"GetDocument": {
"methods": ["getDocument", "getDocument", "getDocument", "getDocumentCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.google.cloud.dialogflow.v2.CreateDocumentRequest;
import com.google.cloud.dialogflow.v2.DeleteDocumentRequest;
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.KnowledgeOperationMetadata;
import com.google.cloud.dialogflow.v2.ListDocumentsRequest;
Expand Down Expand Up @@ -97,6 +98,15 @@ public UnaryCallable<ReloadDocumentRequest, Operation> reloadDocumentCallable()
throw new UnsupportedOperationException("Not implemented: reloadDocumentCallable()");
}

public OperationCallable<ExportDocumentRequest, Document, KnowledgeOperationMetadata>
exportDocumentOperationCallable() {
throw new UnsupportedOperationException("Not implemented: exportDocumentOperationCallable()");
}

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

@Override
public abstract void close();
}
Loading

0 comments on commit 0b7f7e9

Please sign in to comment.