Skip to content

Commit 9dade7a

Browse files
feat: [contactcenterinsights] Launch UploadConversation endpoint (#9319)
* feat: Launch UploadConversation endpoint PiperOrigin-RevId: 522129764 Source-Link: googleapis/googleapis@dabc235 Source-Link: https://github.com/googleapis/googleapis-gen/commit/5609ad088ccf15a1c22df7aaeb3133fbea56799e Copy-Tag: eyJwIjoiamF2YS1jb250YWN0LWNlbnRlci1pbnNpZ2h0cy8uT3dsQm90LnlhbWwiLCJoIjoiNTYwOWFkMDg4Y2NmMTVhMWMyMmRmN2FhZWIzMTMzZmJlYTU2Nzk5ZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 87dc1fc commit 9dade7a

File tree

29 files changed

+6485
-638
lines changed

29 files changed

+6485
-638
lines changed

java-contact-center-insights/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
2020
<dependency>
2121
<groupId>com.google.cloud</groupId>
2222
<artifactId>libraries-bom</artifactId>
23-
<version>26.11.0</version>
23+
<version>26.12.0</version>
2424
<type>pom</type>
2525
<scope>import</scope>
2626
</dependency>

java-contact-center-insights/google-cloud-contact-center-insights/src/main/java/com/google/cloud/contactcenterinsights/v1/ContactCenterInsightsClient.java

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,108 @@ public final UnaryCallable<CreateConversationRequest, Conversation> createConver
357357
return stub.createConversationCallable();
358358
}
359359

360+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
361+
/**
362+
* Create a longrunning conversation upload operation. This method differs from CreateConversation
363+
* by allowing audio transcription and optional DLP redaction.
364+
*
365+
* <p>Sample code:
366+
*
367+
* <pre>{@code
368+
* // This snippet has been automatically generated and should be regarded as a code template only.
369+
* // It will require modifications to work:
370+
* // - It may require correct/in-range values for request initialization.
371+
* // - It may require specifying regional endpoints when creating the service client as shown in
372+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
373+
* try (ContactCenterInsightsClient contactCenterInsightsClient =
374+
* ContactCenterInsightsClient.create()) {
375+
* UploadConversationRequest request =
376+
* UploadConversationRequest.newBuilder()
377+
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
378+
* .setConversation(Conversation.newBuilder().build())
379+
* .setConversationId("conversationId-1676095234")
380+
* .setRedactionConfig(RedactionConfig.newBuilder().build())
381+
* .build();
382+
* Conversation response = contactCenterInsightsClient.uploadConversationAsync(request).get();
383+
* }
384+
* }</pre>
385+
*
386+
* @param request The request object containing all of the parameters for the API call.
387+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
388+
*/
389+
public final OperationFuture<Conversation, UploadConversationMetadata> uploadConversationAsync(
390+
UploadConversationRequest request) {
391+
return uploadConversationOperationCallable().futureCall(request);
392+
}
393+
394+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
395+
/**
396+
* Create a longrunning conversation upload operation. This method differs from CreateConversation
397+
* by allowing audio transcription and optional DLP redaction.
398+
*
399+
* <p>Sample code:
400+
*
401+
* <pre>{@code
402+
* // This snippet has been automatically generated and should be regarded as a code template only.
403+
* // It will require modifications to work:
404+
* // - It may require correct/in-range values for request initialization.
405+
* // - It may require specifying regional endpoints when creating the service client as shown in
406+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
407+
* try (ContactCenterInsightsClient contactCenterInsightsClient =
408+
* ContactCenterInsightsClient.create()) {
409+
* UploadConversationRequest request =
410+
* UploadConversationRequest.newBuilder()
411+
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
412+
* .setConversation(Conversation.newBuilder().build())
413+
* .setConversationId("conversationId-1676095234")
414+
* .setRedactionConfig(RedactionConfig.newBuilder().build())
415+
* .build();
416+
* OperationFuture<Conversation, UploadConversationMetadata> future =
417+
* contactCenterInsightsClient.uploadConversationOperationCallable().futureCall(request);
418+
* // Do something.
419+
* Conversation response = future.get();
420+
* }
421+
* }</pre>
422+
*/
423+
public final OperationCallable<
424+
UploadConversationRequest, Conversation, UploadConversationMetadata>
425+
uploadConversationOperationCallable() {
426+
return stub.uploadConversationOperationCallable();
427+
}
428+
429+
// AUTO-GENERATED DOCUMENTATION AND METHOD.
430+
/**
431+
* Create a longrunning conversation upload operation. This method differs from CreateConversation
432+
* by allowing audio transcription and optional DLP redaction.
433+
*
434+
* <p>Sample code:
435+
*
436+
* <pre>{@code
437+
* // This snippet has been automatically generated and should be regarded as a code template only.
438+
* // It will require modifications to work:
439+
* // - It may require correct/in-range values for request initialization.
440+
* // - It may require specifying regional endpoints when creating the service client as shown in
441+
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
442+
* try (ContactCenterInsightsClient contactCenterInsightsClient =
443+
* ContactCenterInsightsClient.create()) {
444+
* UploadConversationRequest request =
445+
* UploadConversationRequest.newBuilder()
446+
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
447+
* .setConversation(Conversation.newBuilder().build())
448+
* .setConversationId("conversationId-1676095234")
449+
* .setRedactionConfig(RedactionConfig.newBuilder().build())
450+
* .build();
451+
* ApiFuture<Operation> future =
452+
* contactCenterInsightsClient.uploadConversationCallable().futureCall(request);
453+
* // Do something.
454+
* Operation response = future.get();
455+
* }
456+
* }</pre>
457+
*/
458+
public final UnaryCallable<UploadConversationRequest, Operation> uploadConversationCallable() {
459+
return stub.uploadConversationCallable();
460+
}
461+
360462
// AUTO-GENERATED DOCUMENTATION AND METHOD.
361463
/**
362464
* Updates a conversation.

java-contact-center-insights/google-cloud-contact-center-insights/src/main/java/com/google/cloud/contactcenterinsights/v1/ContactCenterInsightsSettings.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@ public UnaryCallSettings<CreateConversationRequest, Conversation> createConversa
8888
return ((ContactCenterInsightsStubSettings) getStubSettings()).createConversationSettings();
8989
}
9090

91+
/** Returns the object with the settings used for calls to uploadConversation. */
92+
public UnaryCallSettings<UploadConversationRequest, Operation> uploadConversationSettings() {
93+
return ((ContactCenterInsightsStubSettings) getStubSettings()).uploadConversationSettings();
94+
}
95+
96+
/** Returns the object with the settings used for calls to uploadConversation. */
97+
public OperationCallSettings<UploadConversationRequest, Conversation, UploadConversationMetadata>
98+
uploadConversationOperationSettings() {
99+
return ((ContactCenterInsightsStubSettings) getStubSettings())
100+
.uploadConversationOperationSettings();
101+
}
102+
91103
/** Returns the object with the settings used for calls to updateConversation. */
92104
public UnaryCallSettings<UpdateConversationRequest, Conversation> updateConversationSettings() {
93105
return ((ContactCenterInsightsStubSettings) getStubSettings()).updateConversationSettings();
@@ -466,6 +478,19 @@ public Builder applyToAllUnaryMethods(
466478
return getStubSettingsBuilder().createConversationSettings();
467479
}
468480

481+
/** Returns the builder for the settings used for calls to uploadConversation. */
482+
public UnaryCallSettings.Builder<UploadConversationRequest, Operation>
483+
uploadConversationSettings() {
484+
return getStubSettingsBuilder().uploadConversationSettings();
485+
}
486+
487+
/** Returns the builder for the settings used for calls to uploadConversation. */
488+
public OperationCallSettings.Builder<
489+
UploadConversationRequest, Conversation, UploadConversationMetadata>
490+
uploadConversationOperationSettings() {
491+
return getStubSettingsBuilder().uploadConversationOperationSettings();
492+
}
493+
469494
/** Returns the builder for the settings used for calls to updateConversation. */
470495
public UnaryCallSettings.Builder<UpdateConversationRequest, Conversation>
471496
updateConversationSettings() {

java-contact-center-insights/google-cloud-contact-center-insights/src/main/java/com/google/cloud/contactcenterinsights/v1/gapic_metadata.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@
120120
},
121121
"UpdateView": {
122122
"methods": ["updateView", "updateView", "updateViewCallable"]
123+
},
124+
"UploadConversation": {
125+
"methods": ["uploadConversationAsync", "uploadConversationOperationCallable", "uploadConversationCallable"]
123126
}
124127
}
125128
}

java-contact-center-insights/google-cloud-contact-center-insights/src/main/java/com/google/cloud/contactcenterinsights/v1/stub/ContactCenterInsightsStub.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@
8888
import com.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest;
8989
import com.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest;
9090
import com.google.cloud.contactcenterinsights.v1.UpdateViewRequest;
91+
import com.google.cloud.contactcenterinsights.v1.UploadConversationMetadata;
92+
import com.google.cloud.contactcenterinsights.v1.UploadConversationRequest;
9193
import com.google.cloud.contactcenterinsights.v1.View;
9294
import com.google.longrunning.Operation;
9395
import com.google.longrunning.stub.OperationsStub;
@@ -115,6 +117,16 @@ public UnaryCallable<CreateConversationRequest, Conversation> createConversation
115117
throw new UnsupportedOperationException("Not implemented: createConversationCallable()");
116118
}
117119

120+
public OperationCallable<UploadConversationRequest, Conversation, UploadConversationMetadata>
121+
uploadConversationOperationCallable() {
122+
throw new UnsupportedOperationException(
123+
"Not implemented: uploadConversationOperationCallable()");
124+
}
125+
126+
public UnaryCallable<UploadConversationRequest, Operation> uploadConversationCallable() {
127+
throw new UnsupportedOperationException("Not implemented: uploadConversationCallable()");
128+
}
129+
118130
public UnaryCallable<UpdateConversationRequest, Conversation> updateConversationCallable() {
119131
throw new UnsupportedOperationException("Not implemented: updateConversationCallable()");
120132
}

java-contact-center-insights/google-cloud-contact-center-insights/src/main/java/com/google/cloud/contactcenterinsights/v1/stub/ContactCenterInsightsStubSettings.java

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@
114114
import com.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest;
115115
import com.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest;
116116
import com.google.cloud.contactcenterinsights.v1.UpdateViewRequest;
117+
import com.google.cloud.contactcenterinsights.v1.UploadConversationMetadata;
118+
import com.google.cloud.contactcenterinsights.v1.UploadConversationRequest;
117119
import com.google.cloud.contactcenterinsights.v1.View;
118120
import com.google.common.collect.ImmutableList;
119121
import com.google.common.collect.ImmutableMap;
@@ -174,6 +176,10 @@ public class ContactCenterInsightsStubSettings
174176

175177
private final UnaryCallSettings<CreateConversationRequest, Conversation>
176178
createConversationSettings;
179+
private final UnaryCallSettings<UploadConversationRequest, Operation> uploadConversationSettings;
180+
private final OperationCallSettings<
181+
UploadConversationRequest, Conversation, UploadConversationMetadata>
182+
uploadConversationOperationSettings;
177183
private final UnaryCallSettings<UpdateConversationRequest, Conversation>
178184
updateConversationSettings;
179185
private final UnaryCallSettings<GetConversationRequest, Conversation> getConversationSettings;
@@ -483,6 +489,17 @@ public UnaryCallSettings<CreateConversationRequest, Conversation> createConversa
483489
return createConversationSettings;
484490
}
485491

492+
/** Returns the object with the settings used for calls to uploadConversation. */
493+
public UnaryCallSettings<UploadConversationRequest, Operation> uploadConversationSettings() {
494+
return uploadConversationSettings;
495+
}
496+
497+
/** Returns the object with the settings used for calls to uploadConversation. */
498+
public OperationCallSettings<UploadConversationRequest, Conversation, UploadConversationMetadata>
499+
uploadConversationOperationSettings() {
500+
return uploadConversationOperationSettings;
501+
}
502+
486503
/** Returns the object with the settings used for calls to updateConversation. */
487504
public UnaryCallSettings<UpdateConversationRequest, Conversation> updateConversationSettings() {
488505
return updateConversationSettings;
@@ -836,6 +853,9 @@ protected ContactCenterInsightsStubSettings(Builder settingsBuilder) throws IOEx
836853
super(settingsBuilder);
837854

838855
createConversationSettings = settingsBuilder.createConversationSettings().build();
856+
uploadConversationSettings = settingsBuilder.uploadConversationSettings().build();
857+
uploadConversationOperationSettings =
858+
settingsBuilder.uploadConversationOperationSettings().build();
839859
updateConversationSettings = settingsBuilder.updateConversationSettings().build();
840860
getConversationSettings = settingsBuilder.getConversationSettings().build();
841861
listConversationsSettings = settingsBuilder.listConversationsSettings().build();
@@ -892,6 +912,11 @@ public static class Builder
892912
private final ImmutableList<UnaryCallSettings.Builder<?, ?>> unaryMethodSettingsBuilders;
893913
private final UnaryCallSettings.Builder<CreateConversationRequest, Conversation>
894914
createConversationSettings;
915+
private final UnaryCallSettings.Builder<UploadConversationRequest, Operation>
916+
uploadConversationSettings;
917+
private final OperationCallSettings.Builder<
918+
UploadConversationRequest, Conversation, UploadConversationMetadata>
919+
uploadConversationOperationSettings;
895920
private final UnaryCallSettings.Builder<UpdateConversationRequest, Conversation>
896921
updateConversationSettings;
897922
private final UnaryCallSettings.Builder<GetConversationRequest, Conversation>
@@ -1022,6 +1047,8 @@ protected Builder(ClientContext clientContext) {
10221047
super(clientContext);
10231048

10241049
createConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
1050+
uploadConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
1051+
uploadConversationOperationSettings = OperationCallSettings.newBuilder();
10251052
updateConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
10261053
getConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
10271054
listConversationsSettings = PagedCallSettings.newBuilder(LIST_CONVERSATIONS_PAGE_STR_FACT);
@@ -1070,6 +1097,7 @@ protected Builder(ClientContext clientContext) {
10701097
unaryMethodSettingsBuilders =
10711098
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
10721099
createConversationSettings,
1100+
uploadConversationSettings,
10731101
updateConversationSettings,
10741102
getConversationSettings,
10751103
listConversationsSettings,
@@ -1113,6 +1141,9 @@ protected Builder(ContactCenterInsightsStubSettings settings) {
11131141
super(settings);
11141142

11151143
createConversationSettings = settings.createConversationSettings.toBuilder();
1144+
uploadConversationSettings = settings.uploadConversationSettings.toBuilder();
1145+
uploadConversationOperationSettings =
1146+
settings.uploadConversationOperationSettings.toBuilder();
11161147
updateConversationSettings = settings.updateConversationSettings.toBuilder();
11171148
getConversationSettings = settings.getConversationSettings.toBuilder();
11181149
listConversationsSettings = settings.listConversationsSettings.toBuilder();
@@ -1165,6 +1196,7 @@ protected Builder(ContactCenterInsightsStubSettings settings) {
11651196
unaryMethodSettingsBuilders =
11661197
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
11671198
createConversationSettings,
1199+
uploadConversationSettings,
11681200
updateConversationSettings,
11691201
getConversationSettings,
11701202
listConversationsSettings,
@@ -1235,6 +1267,11 @@ private static Builder initDefaults(Builder builder) {
12351267
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
12361268
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
12371269

1270+
builder
1271+
.uploadConversationSettings()
1272+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
1273+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
1274+
12381275
builder
12391276
.updateConversationSettings()
12401277
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
@@ -1415,6 +1452,31 @@ private static Builder initDefaults(Builder builder) {
14151452
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
14161453
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
14171454

1455+
builder
1456+
.uploadConversationOperationSettings()
1457+
.setInitialCallSettings(
1458+
UnaryCallSettings
1459+
.<UploadConversationRequest, OperationSnapshot>newUnaryCallSettingsBuilder()
1460+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
1461+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"))
1462+
.build())
1463+
.setResponseTransformer(
1464+
ProtoOperationTransformers.ResponseTransformer.create(Conversation.class))
1465+
.setMetadataTransformer(
1466+
ProtoOperationTransformers.MetadataTransformer.create(
1467+
UploadConversationMetadata.class))
1468+
.setPollingAlgorithm(
1469+
OperationTimedPollAlgorithm.create(
1470+
RetrySettings.newBuilder()
1471+
.setInitialRetryDelay(Duration.ofMillis(5000L))
1472+
.setRetryDelayMultiplier(1.5)
1473+
.setMaxRetryDelay(Duration.ofMillis(45000L))
1474+
.setInitialRpcTimeout(Duration.ZERO)
1475+
.setRpcTimeoutMultiplier(1.0)
1476+
.setMaxRpcTimeout(Duration.ZERO)
1477+
.setTotalTimeout(Duration.ofMillis(300000L))
1478+
.build()));
1479+
14181480
builder
14191481
.createAnalysisOperationSettings()
14201482
.setInitialCallSettings(
@@ -1640,6 +1702,21 @@ public Builder applyToAllUnaryMethods(
16401702
return createConversationSettings;
16411703
}
16421704

1705+
/** Returns the builder for the settings used for calls to uploadConversation. */
1706+
public UnaryCallSettings.Builder<UploadConversationRequest, Operation>
1707+
uploadConversationSettings() {
1708+
return uploadConversationSettings;
1709+
}
1710+
1711+
/** Returns the builder for the settings used for calls to uploadConversation. */
1712+
@BetaApi(
1713+
"The surface for use by generated code is not stable yet and may change in the future.")
1714+
public OperationCallSettings.Builder<
1715+
UploadConversationRequest, Conversation, UploadConversationMetadata>
1716+
uploadConversationOperationSettings() {
1717+
return uploadConversationOperationSettings;
1718+
}
1719+
16431720
/** Returns the builder for the settings used for calls to updateConversation. */
16441721
public UnaryCallSettings.Builder<UpdateConversationRequest, Conversation>
16451722
updateConversationSettings() {

0 commit comments

Comments
 (0)