Skip to content

Commit 4e9b04a

Browse files
feat: [dialogflow] added support for custom content types (#9185)
- [ ] Regenerate this pull request now. docs: clarified wording around quota usage PiperOrigin-RevId: 513764591 Source-Link: https://github.com/googleapis/googleapis/commit/79acb42407d32ed8e3ebbdb3ed7ea31616c60c02 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f6fabc9251235d35ea642896f2c30b5ee3d3b82c Copy-Tag: eyJwIjoiamF2YS1kaWFsb2dmbG93Ly5Pd2xCb3QueWFtbCIsImgiOiJmNmZhYmM5MjUxMjM1ZDM1ZWE2NDI4OTZmMmMzMGI1ZWUzZDNiODJjIn0= BEGIN_NESTED_COMMIT feat: [dialogflow] added support for custom content types docs: clarified wording around quota usage PiperOrigin-RevId: 513681148 Source-Link: https://github.com/googleapis/googleapis/commit/3b8869b89a700b57d3054136c45532abbdb884cf Source-Link: https://github.com/googleapis/googleapis-gen/commit/c1c7570b315ff2cc965c17a3c9a834b2af18ae0c Copy-Tag: eyJwIjoiamF2YS1kaWFsb2dmbG93Ly5Pd2xCb3QueWFtbCIsImgiOiJjMWM3NTcwYjMxNWZmMmNjOTY1YzE3YTNjOWE4MzRiMmFmMThhZTBjIn0= END_NESTED_COMMIT
1 parent 460b25b commit 4e9b04a

File tree

43 files changed

+4138
-869
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4138
-869
lines changed

java-dialogflow/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Java idiomatic client for [Dialogflow API][product-docs].
1414

1515
If you are using Maven, add this to your pom.xml file:
1616

17-
<!--- {x-version-update-start:google-cloud-dialogflow:released} -->
1817

1918
```xml
2019
<dependency>
@@ -35,7 +34,6 @@ If you are using SBT, add this to your dependencies:
3534
```Scala
3635
libraryDependencies += "com.google.cloud" % "google-cloud-dialogflow" % "4.18.0"
3736
```
38-
<!--- {x-version-update-end} -->
3937

4038
## Authentication
4139

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

+118
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,69 @@ public final void deleteConversationProfile(DeleteConversationProfileRequest req
10451045
return setSuggestionFeatureConfigAsync(request);
10461046
}
10471047

1048+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1049+
/**
1050+
* Adds or updates a suggestion feature in a conversation profile. If the conversation profile
1051+
* contains the type of suggestion feature for the participant role, it will update it. Otherwise
1052+
* it will insert the suggestion feature.
1053+
*
1054+
* <p>This method is a [long-running
1055+
* operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The
1056+
* returned `Operation` type has the following method-specific fields:
1057+
*
1058+
* <p>- `metadata`:
1059+
* [SetSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata]
1060+
* - `response`: [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile]
1061+
*
1062+
* <p>If a long running operation to add or update suggestion feature config for the same
1063+
* conversation profile, participant role and suggestion feature type exists, please cancel the
1064+
* existing long running operation before sending such request, otherwise the request will be
1065+
* rejected.
1066+
*
1067+
* <p>Sample code:
1068+
*
1069+
* <pre>{@code
1070+
* // This snippet has been automatically generated and should be regarded as a code template only.
1071+
* // It will require modifications to work:
1072+
* // - It may require correct/in-range values for request initialization.
1073+
* // - It may require specifying regional endpoints when creating the service client as shown in
1074+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1075+
* try (ConversationProfilesClient conversationProfilesClient =
1076+
* ConversationProfilesClient.create()) {
1077+
* String conversationProfile = "conversationProfile1691597734";
1078+
* Participant.Role participantRole = Participant.Role.forNumber(0);
1079+
* HumanAgentAssistantConfig.SuggestionFeatureConfig suggestionFeatureConfig =
1080+
* HumanAgentAssistantConfig.SuggestionFeatureConfig.newBuilder().build();
1081+
* ConversationProfile response =
1082+
* conversationProfilesClient
1083+
* .setSuggestionFeatureConfigAsync(
1084+
* conversationProfile, participantRole, suggestionFeatureConfig)
1085+
* .get();
1086+
* }
1087+
* }</pre>
1088+
*
1089+
* @param conversationProfile Required. The Conversation Profile to add or update the suggestion
1090+
* feature config. Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
1091+
* ID&gt;/conversationProfiles/&lt;Conversation Profile ID&gt;`.
1092+
* @param participantRole Required. The participant role to add or update the suggestion feature
1093+
* config. Only HUMAN_AGENT or END_USER can be used.
1094+
* @param suggestionFeatureConfig Required. The suggestion feature config to add or update.
1095+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1096+
*/
1097+
public final OperationFuture<ConversationProfile, SetSuggestionFeatureConfigOperationMetadata>
1098+
setSuggestionFeatureConfigAsync(
1099+
String conversationProfile,
1100+
Participant.Role participantRole,
1101+
HumanAgentAssistantConfig.SuggestionFeatureConfig suggestionFeatureConfig) {
1102+
SetSuggestionFeatureConfigRequest request =
1103+
SetSuggestionFeatureConfigRequest.newBuilder()
1104+
.setConversationProfile(conversationProfile)
1105+
.setParticipantRole(participantRole)
1106+
.setSuggestionFeatureConfig(suggestionFeatureConfig)
1107+
.build();
1108+
return setSuggestionFeatureConfigAsync(request);
1109+
}
1110+
10481111
// AUTO-GENERATED DOCUMENTATION AND METHOD.
10491112
/**
10501113
* Adds or updates a suggestion feature in a conversation profile. If the conversation profile
@@ -1234,6 +1297,61 @@ public final void deleteConversationProfile(DeleteConversationProfileRequest req
12341297
return clearSuggestionFeatureConfigAsync(request);
12351298
}
12361299

1300+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1301+
/**
1302+
* Clears a suggestion feature from a conversation profile for the given participant role.
1303+
*
1304+
* <p>This method is a [long-running
1305+
* operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The
1306+
* returned `Operation` type has the following method-specific fields:
1307+
*
1308+
* <p>- `metadata`:
1309+
* [ClearSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata]
1310+
* - `response`: [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile]
1311+
*
1312+
* <p>Sample code:
1313+
*
1314+
* <pre>{@code
1315+
* // This snippet has been automatically generated and should be regarded as a code template only.
1316+
* // It will require modifications to work:
1317+
* // - It may require correct/in-range values for request initialization.
1318+
* // - It may require specifying regional endpoints when creating the service client as shown in
1319+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1320+
* try (ConversationProfilesClient conversationProfilesClient =
1321+
* ConversationProfilesClient.create()) {
1322+
* String conversationProfile = "conversationProfile1691597734";
1323+
* Participant.Role participantRole = Participant.Role.forNumber(0);
1324+
* SuggestionFeature.Type suggestionFeatureType = SuggestionFeature.Type.forNumber(0);
1325+
* ConversationProfile response =
1326+
* conversationProfilesClient
1327+
* .clearSuggestionFeatureConfigAsync(
1328+
* conversationProfile, participantRole, suggestionFeatureType)
1329+
* .get();
1330+
* }
1331+
* }</pre>
1332+
*
1333+
* @param conversationProfile Required. The Conversation Profile to add or update the suggestion
1334+
* feature config. Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
1335+
* ID&gt;/conversationProfiles/&lt;Conversation Profile ID&gt;`.
1336+
* @param participantRole Required. The participant role to remove the suggestion feature config.
1337+
* Only HUMAN_AGENT or END_USER can be used.
1338+
* @param suggestionFeatureType Required. The type of the suggestion feature to remove.
1339+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1340+
*/
1341+
public final OperationFuture<ConversationProfile, ClearSuggestionFeatureConfigOperationMetadata>
1342+
clearSuggestionFeatureConfigAsync(
1343+
String conversationProfile,
1344+
Participant.Role participantRole,
1345+
SuggestionFeature.Type suggestionFeatureType) {
1346+
ClearSuggestionFeatureConfigRequest request =
1347+
ClearSuggestionFeatureConfigRequest.newBuilder()
1348+
.setConversationProfile(conversationProfile)
1349+
.setParticipantRole(participantRole)
1350+
.setSuggestionFeatureType(suggestionFeatureType)
1351+
.build();
1352+
return clearSuggestionFeatureConfigAsync(request);
1353+
}
1354+
12371355
// AUTO-GENERATED DOCUMENTATION AND METHOD.
12381356
/**
12391357
* Clears a suggestion feature from a conversation profile for the given participant role.

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@
212212
"libraryClient": "ConversationProfilesClient",
213213
"rpcs": {
214214
"ClearSuggestionFeatureConfig": {
215-
"methods": ["clearSuggestionFeatureConfigAsync", "clearSuggestionFeatureConfigAsync", "clearSuggestionFeatureConfigOperationCallable", "clearSuggestionFeatureConfigCallable"]
215+
"methods": ["clearSuggestionFeatureConfigAsync", "clearSuggestionFeatureConfigAsync", "clearSuggestionFeatureConfigAsync", "clearSuggestionFeatureConfigOperationCallable", "clearSuggestionFeatureConfigCallable"]
216216
},
217217
"CreateConversationProfile": {
218218
"methods": ["createConversationProfile", "createConversationProfile", "createConversationProfile", "createConversationProfile", "createConversationProfileCallable"]
@@ -233,7 +233,7 @@
233233
"methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"]
234234
},
235235
"SetSuggestionFeatureConfig": {
236-
"methods": ["setSuggestionFeatureConfigAsync", "setSuggestionFeatureConfigAsync", "setSuggestionFeatureConfigOperationCallable", "setSuggestionFeatureConfigCallable"]
236+
"methods": ["setSuggestionFeatureConfigAsync", "setSuggestionFeatureConfigAsync", "setSuggestionFeatureConfigAsync", "setSuggestionFeatureConfigOperationCallable", "setSuggestionFeatureConfigCallable"]
237237
},
238238
"UpdateConversationProfile": {
239239
"methods": ["updateConversationProfile", "updateConversationProfile", "updateConversationProfileCallable"]

java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2beta1/ConversationProfilesClient.java

+118
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,69 @@ public final void deleteConversationProfile(DeleteConversationProfileRequest req
10461046
return setSuggestionFeatureConfigAsync(request);
10471047
}
10481048

1049+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1050+
/**
1051+
* Adds or updates a suggestion feature in a conversation profile. If the conversation profile
1052+
* contains the type of suggestion feature for the participant role, it will update it. Otherwise
1053+
* it will insert the suggestion feature.
1054+
*
1055+
* <p>This method is a [long-running
1056+
* operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The
1057+
* returned `Operation` type has the following method-specific fields:
1058+
*
1059+
* <p>- `metadata`:
1060+
* [SetSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2beta1.SetSuggestionFeatureConfigOperationMetadata]
1061+
* - `response`: [ConversationProfile][google.cloud.dialogflow.v2beta1.ConversationProfile]
1062+
*
1063+
* <p>If a long running operation to add or update suggestion feature config for the same
1064+
* conversation profile, participant role and suggestion feature type exists, please cancel the
1065+
* existing long running operation before sending such request, otherwise the request will be
1066+
* rejected.
1067+
*
1068+
* <p>Sample code:
1069+
*
1070+
* <pre>{@code
1071+
* // This snippet has been automatically generated and should be regarded as a code template only.
1072+
* // It will require modifications to work:
1073+
* // - It may require correct/in-range values for request initialization.
1074+
* // - It may require specifying regional endpoints when creating the service client as shown in
1075+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1076+
* try (ConversationProfilesClient conversationProfilesClient =
1077+
* ConversationProfilesClient.create()) {
1078+
* String conversationProfile = "conversationProfile1691597734";
1079+
* Participant.Role participantRole = Participant.Role.forNumber(0);
1080+
* HumanAgentAssistantConfig.SuggestionFeatureConfig suggestionFeatureConfig =
1081+
* HumanAgentAssistantConfig.SuggestionFeatureConfig.newBuilder().build();
1082+
* ConversationProfile response =
1083+
* conversationProfilesClient
1084+
* .setSuggestionFeatureConfigAsync(
1085+
* conversationProfile, participantRole, suggestionFeatureConfig)
1086+
* .get();
1087+
* }
1088+
* }</pre>
1089+
*
1090+
* @param conversationProfile Required. The Conversation Profile to add or update the suggestion
1091+
* feature config. Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
1092+
* ID&gt;/conversationProfiles/&lt;Conversation Profile ID&gt;`.
1093+
* @param participantRole Required. The participant role to add or update the suggestion feature
1094+
* config. Only HUMAN_AGENT or END_USER can be used.
1095+
* @param suggestionFeatureConfig Required. The suggestion feature config to add or update.
1096+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1097+
*/
1098+
public final OperationFuture<ConversationProfile, SetSuggestionFeatureConfigOperationMetadata>
1099+
setSuggestionFeatureConfigAsync(
1100+
String conversationProfile,
1101+
Participant.Role participantRole,
1102+
HumanAgentAssistantConfig.SuggestionFeatureConfig suggestionFeatureConfig) {
1103+
SetSuggestionFeatureConfigRequest request =
1104+
SetSuggestionFeatureConfigRequest.newBuilder()
1105+
.setConversationProfile(conversationProfile)
1106+
.setParticipantRole(participantRole)
1107+
.setSuggestionFeatureConfig(suggestionFeatureConfig)
1108+
.build();
1109+
return setSuggestionFeatureConfigAsync(request);
1110+
}
1111+
10491112
// AUTO-GENERATED DOCUMENTATION AND METHOD.
10501113
/**
10511114
* Adds or updates a suggestion feature in a conversation profile. If the conversation profile
@@ -1235,6 +1298,61 @@ public final void deleteConversationProfile(DeleteConversationProfileRequest req
12351298
return clearSuggestionFeatureConfigAsync(request);
12361299
}
12371300

1301+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
1302+
/**
1303+
* Clears a suggestion feature from a conversation profile for the given participant role.
1304+
*
1305+
* <p>This method is a [long-running
1306+
* operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The
1307+
* returned `Operation` type has the following method-specific fields:
1308+
*
1309+
* <p>- `metadata`:
1310+
* [ClearSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2beta1.ClearSuggestionFeatureConfigOperationMetadata]
1311+
* - `response`: [ConversationProfile][google.cloud.dialogflow.v2beta1.ConversationProfile]
1312+
*
1313+
* <p>Sample code:
1314+
*
1315+
* <pre>{@code
1316+
* // This snippet has been automatically generated and should be regarded as a code template only.
1317+
* // It will require modifications to work:
1318+
* // - It may require correct/in-range values for request initialization.
1319+
* // - It may require specifying regional endpoints when creating the service client as shown in
1320+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1321+
* try (ConversationProfilesClient conversationProfilesClient =
1322+
* ConversationProfilesClient.create()) {
1323+
* String conversationProfile = "conversationProfile1691597734";
1324+
* Participant.Role participantRole = Participant.Role.forNumber(0);
1325+
* SuggestionFeature.Type suggestionFeatureType = SuggestionFeature.Type.forNumber(0);
1326+
* ConversationProfile response =
1327+
* conversationProfilesClient
1328+
* .clearSuggestionFeatureConfigAsync(
1329+
* conversationProfile, participantRole, suggestionFeatureType)
1330+
* .get();
1331+
* }
1332+
* }</pre>
1333+
*
1334+
* @param conversationProfile Required. The Conversation Profile to add or update the suggestion
1335+
* feature config. Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
1336+
* ID&gt;/conversationProfiles/&lt;Conversation Profile ID&gt;`.
1337+
* @param participantRole Required. The participant role to remove the suggestion feature config.
1338+
* Only HUMAN_AGENT or END_USER can be used.
1339+
* @param suggestionFeatureType Required. The type of the suggestion feature to remove.
1340+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1341+
*/
1342+
public final OperationFuture<ConversationProfile, ClearSuggestionFeatureConfigOperationMetadata>
1343+
clearSuggestionFeatureConfigAsync(
1344+
String conversationProfile,
1345+
Participant.Role participantRole,
1346+
SuggestionFeature.Type suggestionFeatureType) {
1347+
ClearSuggestionFeatureConfigRequest request =
1348+
ClearSuggestionFeatureConfigRequest.newBuilder()
1349+
.setConversationProfile(conversationProfile)
1350+
.setParticipantRole(participantRole)
1351+
.setSuggestionFeatureType(suggestionFeatureType)
1352+
.build();
1353+
return clearSuggestionFeatureConfigAsync(request);
1354+
}
1355+
12381356
// AUTO-GENERATED DOCUMENTATION AND METHOD.
12391357
/**
12401358
* Clears a suggestion feature from a conversation profile for the given participant role.

java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2beta1/ConversationsClient.java

+2
Original file line numberDiff line numberDiff line change
@@ -1276,6 +1276,7 @@ public final SuggestConversationSummaryResponse suggestConversationSummary(Strin
12761276
* "[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
12771277
* .toString())
12781278
* .setContextSize(1116903569)
1279+
* .setAssistQueryParams(AssistQueryParameters.newBuilder().build())
12791280
* .build();
12801281
* SuggestConversationSummaryResponse response =
12811282
* conversationsClient.suggestConversationSummary(request);
@@ -1314,6 +1315,7 @@ public final SuggestConversationSummaryResponse suggestConversationSummary(
13141315
* "[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
13151316
* .toString())
13161317
* .setContextSize(1116903569)
1318+
* .setAssistQueryParams(AssistQueryParameters.newBuilder().build())
13171319
* .build();
13181320
* ApiFuture<SuggestConversationSummaryResponse> future =
13191321
* conversationsClient.suggestConversationSummaryCallable().futureCall(request);

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
"libraryClient": "ConversationProfilesClient",
147147
"rpcs": {
148148
"ClearSuggestionFeatureConfig": {
149-
"methods": ["clearSuggestionFeatureConfigAsync", "clearSuggestionFeatureConfigAsync", "clearSuggestionFeatureConfigOperationCallable", "clearSuggestionFeatureConfigCallable"]
149+
"methods": ["clearSuggestionFeatureConfigAsync", "clearSuggestionFeatureConfigAsync", "clearSuggestionFeatureConfigAsync", "clearSuggestionFeatureConfigOperationCallable", "clearSuggestionFeatureConfigCallable"]
150150
},
151151
"CreateConversationProfile": {
152152
"methods": ["createConversationProfile", "createConversationProfile", "createConversationProfile", "createConversationProfile", "createConversationProfileCallable"]
@@ -167,7 +167,7 @@
167167
"methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"]
168168
},
169169
"SetSuggestionFeatureConfig": {
170-
"methods": ["setSuggestionFeatureConfigAsync", "setSuggestionFeatureConfigAsync", "setSuggestionFeatureConfigOperationCallable", "setSuggestionFeatureConfigCallable"]
170+
"methods": ["setSuggestionFeatureConfigAsync", "setSuggestionFeatureConfigAsync", "setSuggestionFeatureConfigAsync", "setSuggestionFeatureConfigOperationCallable", "setSuggestionFeatureConfigCallable"]
171171
},
172172
"UpdateConversationProfile": {
173173
"methods": ["updateConversationProfile", "updateConversationProfile", "updateConversationProfileCallable"]

0 commit comments

Comments
 (0)