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

Commit 0b7f7e9

Browse files
feat: added export documentation method (#800)
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: https://github.com/googleapis/googleapis-gen/commit/13951268b009d98d82355ccd9647f4350590609d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTM5NTEyNjhiMDA5ZDk4ZDgyMzU1Y2NkOTY0N2Y0MzUwNTkwNjA5ZCJ9
1 parent feac480 commit 0b7f7e9

31 files changed

+4219
-540
lines changed

google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/DocumentsClient.java

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ public final ListDocumentsPagedResponse listDocuments(String parent) {
234234
* .toString())
235235
* .setPageSize(883849137)
236236
* .setPageToken("pageToken873572522")
237+
* .setFilter("filter-1274492040")
237238
* .build();
238239
* for (Document element : documentsClient.listDocuments(request).iterateAll()) {
239240
* // doThingsWith(element);
@@ -263,6 +264,7 @@ public final ListDocumentsPagedResponse listDocuments(ListDocumentsRequest reque
263264
* .toString())
264265
* .setPageSize(883849137)
265266
* .setPageToken("pageToken873572522")
267+
* .setFilter("filter-1274492040")
266268
* .build();
267269
* ApiFuture<Document> future = documentsClient.listDocumentsPagedCallable().futureCall(request);
268270
* // Do something.
@@ -292,6 +294,7 @@ public final ListDocumentsPagedResponse listDocuments(ListDocumentsRequest reque
292294
* .toString())
293295
* .setPageSize(883849137)
294296
* .setPageToken("pageToken873572522")
297+
* .setFilter("filter-1274492040")
295298
* .build();
296299
* while (true) {
297300
* ListDocumentsResponse response = documentsClient.listDocumentsCallable().call(request);
@@ -1025,6 +1028,8 @@ public final OperationFuture<Document, KnowledgeOperationMetadata> reloadDocumen
10251028
* DocumentName.ofProjectKnowledgeBaseDocumentName(
10261029
* "[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]")
10271030
* .toString())
1031+
* .setImportGcsCustomMetadata(true)
1032+
* .setSmartMessagingPartialUpdate(true)
10281033
* .build();
10291034
* Document response = documentsClient.reloadDocumentAsync(request).get();
10301035
* }
@@ -1066,6 +1071,8 @@ public final OperationFuture<Document, KnowledgeOperationMetadata> reloadDocumen
10661071
* DocumentName.ofProjectKnowledgeBaseDocumentName(
10671072
* "[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]")
10681073
* .toString())
1074+
* .setImportGcsCustomMetadata(true)
1075+
* .setSmartMessagingPartialUpdate(true)
10691076
* .build();
10701077
* OperationFuture<Document, KnowledgeOperationMetadata> future =
10711078
* documentsClient.reloadDocumentOperationCallable().futureCall(request);
@@ -1107,6 +1114,8 @@ public final OperationFuture<Document, KnowledgeOperationMetadata> reloadDocumen
11071114
* DocumentName.ofProjectKnowledgeBaseDocumentName(
11081115
* "[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]")
11091116
* .toString())
1117+
* .setImportGcsCustomMetadata(true)
1118+
* .setSmartMessagingPartialUpdate(true)
11101119
* .build();
11111120
* ApiFuture<Operation> future = documentsClient.reloadDocumentCallable().futureCall(request);
11121121
* // Do something.
@@ -1118,6 +1127,115 @@ public final UnaryCallable<ReloadDocumentRequest, Operation> reloadDocumentCalla
11181127
return stub.reloadDocumentCallable();
11191128
}
11201129

1130+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1131+
/**
1132+
* Exports a smart messaging candidate document into the specified destination.
1133+
*
1134+
* <p>This method is a [long-running
1135+
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The
1136+
* returned `Operation` type has the following method-specific fields:
1137+
*
1138+
* <p>- `metadata`:
1139+
* [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] -
1140+
* `response`: [Document][google.cloud.dialogflow.v2.Document]
1141+
*
1142+
* <p>Sample code:
1143+
*
1144+
* <pre>{@code
1145+
* try (DocumentsClient documentsClient = DocumentsClient.create()) {
1146+
* ExportDocumentRequest request =
1147+
* ExportDocumentRequest.newBuilder()
1148+
* .setName(
1149+
* DocumentName.ofProjectKnowledgeBaseDocumentName(
1150+
* "[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]")
1151+
* .toString())
1152+
* .setExportFullContent(true)
1153+
* .setSmartMessagingPartialUpdate(true)
1154+
* .build();
1155+
* Document response = documentsClient.exportDocumentAsync(request).get();
1156+
* }
1157+
* }</pre>
1158+
*
1159+
* @param request The request object containing all of the parameters for the API call.
1160+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1161+
*/
1162+
public final OperationFuture<Document, KnowledgeOperationMetadata> exportDocumentAsync(
1163+
ExportDocumentRequest request) {
1164+
return exportDocumentOperationCallable().futureCall(request);
1165+
}
1166+
1167+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1168+
/**
1169+
* Exports a smart messaging candidate document into the specified destination.
1170+
*
1171+
* <p>This method is a [long-running
1172+
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The
1173+
* returned `Operation` type has the following method-specific fields:
1174+
*
1175+
* <p>- `metadata`:
1176+
* [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] -
1177+
* `response`: [Document][google.cloud.dialogflow.v2.Document]
1178+
*
1179+
* <p>Sample code:
1180+
*
1181+
* <pre>{@code
1182+
* try (DocumentsClient documentsClient = DocumentsClient.create()) {
1183+
* ExportDocumentRequest request =
1184+
* ExportDocumentRequest.newBuilder()
1185+
* .setName(
1186+
* DocumentName.ofProjectKnowledgeBaseDocumentName(
1187+
* "[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]")
1188+
* .toString())
1189+
* .setExportFullContent(true)
1190+
* .setSmartMessagingPartialUpdate(true)
1191+
* .build();
1192+
* OperationFuture<Document, KnowledgeOperationMetadata> future =
1193+
* documentsClient.exportDocumentOperationCallable().futureCall(request);
1194+
* // Do something.
1195+
* Document response = future.get();
1196+
* }
1197+
* }</pre>
1198+
*/
1199+
public final OperationCallable<ExportDocumentRequest, Document, KnowledgeOperationMetadata>
1200+
exportDocumentOperationCallable() {
1201+
return stub.exportDocumentOperationCallable();
1202+
}
1203+
1204+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1205+
/**
1206+
* Exports a smart messaging candidate document into the specified destination.
1207+
*
1208+
* <p>This method is a [long-running
1209+
* operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation). The
1210+
* returned `Operation` type has the following method-specific fields:
1211+
*
1212+
* <p>- `metadata`:
1213+
* [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata] -
1214+
* `response`: [Document][google.cloud.dialogflow.v2.Document]
1215+
*
1216+
* <p>Sample code:
1217+
*
1218+
* <pre>{@code
1219+
* try (DocumentsClient documentsClient = DocumentsClient.create()) {
1220+
* ExportDocumentRequest request =
1221+
* ExportDocumentRequest.newBuilder()
1222+
* .setName(
1223+
* DocumentName.ofProjectKnowledgeBaseDocumentName(
1224+
* "[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]")
1225+
* .toString())
1226+
* .setExportFullContent(true)
1227+
* .setSmartMessagingPartialUpdate(true)
1228+
* .build();
1229+
* ApiFuture<Operation> future = documentsClient.exportDocumentCallable().futureCall(request);
1230+
* // Do something.
1231+
* Operation response = future.get();
1232+
* }
1233+
* }</pre>
1234+
*/
1235+
public final UnaryCallable<ExportDocumentRequest, Operation> exportDocumentCallable() {
1236+
return stub.exportDocumentCallable();
1237+
}
1238+
11211239
@Override
11221240
public final void close() {
11231241
stub.close();

google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/DocumentsSettings.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,17 @@ public UnaryCallSettings<ReloadDocumentRequest, Operation> reloadDocumentSetting
126126
return ((DocumentsStubSettings) getStubSettings()).reloadDocumentOperationSettings();
127127
}
128128

129+
/** Returns the object with the settings used for calls to exportDocument. */
130+
public UnaryCallSettings<ExportDocumentRequest, Operation> exportDocumentSettings() {
131+
return ((DocumentsStubSettings) getStubSettings()).exportDocumentSettings();
132+
}
133+
134+
/** Returns the object with the settings used for calls to exportDocument. */
135+
public OperationCallSettings<ExportDocumentRequest, Document, KnowledgeOperationMetadata>
136+
exportDocumentOperationSettings() {
137+
return ((DocumentsStubSettings) getStubSettings()).exportDocumentOperationSettings();
138+
}
139+
129140
public static final DocumentsSettings create(DocumentsStubSettings stub) throws IOException {
130141
return new DocumentsSettings.Builder(stub.toBuilder()).build();
131142
}
@@ -281,6 +292,18 @@ public UnaryCallSettings.Builder<ReloadDocumentRequest, Operation> reloadDocumen
281292
return getStubSettingsBuilder().reloadDocumentOperationSettings();
282293
}
283294

295+
/** Returns the builder for the settings used for calls to exportDocument. */
296+
public UnaryCallSettings.Builder<ExportDocumentRequest, Operation> exportDocumentSettings() {
297+
return getStubSettingsBuilder().exportDocumentSettings();
298+
}
299+
300+
/** Returns the builder for the settings used for calls to exportDocument. */
301+
public OperationCallSettings.Builder<
302+
ExportDocumentRequest, Document, KnowledgeOperationMetadata>
303+
exportDocumentOperationSettings() {
304+
return getStubSettingsBuilder().exportDocumentOperationSettings();
305+
}
306+
284307
@Override
285308
public DocumentsSettings build() throws IOException {
286309
return new DocumentsSettings(this);

google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/KnowledgeBasesClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ public final ListKnowledgeBasesPagedResponse listKnowledgeBases(String parent) {
242242
* .setParent(ProjectName.of("[PROJECT]").toString())
243243
* .setPageSize(883849137)
244244
* .setPageToken("pageToken873572522")
245+
* .setFilter("filter-1274492040")
245246
* .build();
246247
* for (KnowledgeBase element : knowledgeBasesClient.listKnowledgeBases(request).iterateAll()) {
247248
* // doThingsWith(element);
@@ -270,6 +271,7 @@ public final ListKnowledgeBasesPagedResponse listKnowledgeBases(
270271
* .setParent(ProjectName.of("[PROJECT]").toString())
271272
* .setPageSize(883849137)
272273
* .setPageToken("pageToken873572522")
274+
* .setFilter("filter-1274492040")
273275
* .build();
274276
* ApiFuture<KnowledgeBase> future =
275277
* knowledgeBasesClient.listKnowledgeBasesPagedCallable().futureCall(request);
@@ -298,6 +300,7 @@ public final ListKnowledgeBasesPagedResponse listKnowledgeBases(
298300
* .setParent(ProjectName.of("[PROJECT]").toString())
299301
* .setPageSize(883849137)
300302
* .setPageToken("pageToken873572522")
303+
* .setFilter("filter-1274492040")
301304
* .build();
302305
* while (true) {
303306
* ListKnowledgeBasesResponse response =

google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/gapic_metadata.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@
142142
"DeleteDocument": {
143143
"methods": ["deleteDocumentAsync", "deleteDocumentAsync", "deleteDocumentAsync", "deleteDocumentOperationCallable", "deleteDocumentCallable"]
144144
},
145+
"ExportDocument": {
146+
"methods": ["exportDocumentAsync", "exportDocumentOperationCallable", "exportDocumentCallable"]
147+
},
145148
"GetDocument": {
146149
"methods": ["getDocument", "getDocument", "getDocument", "getDocumentCallable"]
147150
},

google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/stub/DocumentsStub.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.google.cloud.dialogflow.v2.CreateDocumentRequest;
2525
import com.google.cloud.dialogflow.v2.DeleteDocumentRequest;
2626
import com.google.cloud.dialogflow.v2.Document;
27+
import com.google.cloud.dialogflow.v2.ExportDocumentRequest;
2728
import com.google.cloud.dialogflow.v2.GetDocumentRequest;
2829
import com.google.cloud.dialogflow.v2.KnowledgeOperationMetadata;
2930
import com.google.cloud.dialogflow.v2.ListDocumentsRequest;
@@ -97,6 +98,15 @@ public UnaryCallable<ReloadDocumentRequest, Operation> reloadDocumentCallable()
9798
throw new UnsupportedOperationException("Not implemented: reloadDocumentCallable()");
9899
}
99100

101+
public OperationCallable<ExportDocumentRequest, Document, KnowledgeOperationMetadata>
102+
exportDocumentOperationCallable() {
103+
throw new UnsupportedOperationException("Not implemented: exportDocumentOperationCallable()");
104+
}
105+
106+
public UnaryCallable<ExportDocumentRequest, Operation> exportDocumentCallable() {
107+
throw new UnsupportedOperationException("Not implemented: exportDocumentCallable()");
108+
}
109+
100110
@Override
101111
public abstract void close();
102112
}

0 commit comments

Comments
 (0)