Skip to content

Commit

Permalink
feat: [contactcenterinsights] Launch UploadConversation endpoint (#9319)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Apr 12, 2023
1 parent 87dc1fc commit 9dade7a
Show file tree
Hide file tree
Showing 29 changed files with 6,485 additions and 638 deletions.
2 changes: 1 addition & 1 deletion java-contact-center-insights/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.11.0</version>
<version>26.12.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,108 @@ public final UnaryCallable<CreateConversationRequest, Conversation> createConver
return stub.createConversationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Create a longrunning conversation upload operation. This method differs from CreateConversation
* by allowing audio transcription and optional DLP redaction.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (ContactCenterInsightsClient contactCenterInsightsClient =
* ContactCenterInsightsClient.create()) {
* UploadConversationRequest request =
* UploadConversationRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setConversation(Conversation.newBuilder().build())
* .setConversationId("conversationId-1676095234")
* .setRedactionConfig(RedactionConfig.newBuilder().build())
* .build();
* Conversation response = contactCenterInsightsClient.uploadConversationAsync(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<Conversation, UploadConversationMetadata> uploadConversationAsync(
UploadConversationRequest request) {
return uploadConversationOperationCallable().futureCall(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Create a longrunning conversation upload operation. This method differs from CreateConversation
* by allowing audio transcription and optional DLP redaction.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (ContactCenterInsightsClient contactCenterInsightsClient =
* ContactCenterInsightsClient.create()) {
* UploadConversationRequest request =
* UploadConversationRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setConversation(Conversation.newBuilder().build())
* .setConversationId("conversationId-1676095234")
* .setRedactionConfig(RedactionConfig.newBuilder().build())
* .build();
* OperationFuture<Conversation, UploadConversationMetadata> future =
* contactCenterInsightsClient.uploadConversationOperationCallable().futureCall(request);
* // Do something.
* Conversation response = future.get();
* }
* }</pre>
*/
public final OperationCallable<
UploadConversationRequest, Conversation, UploadConversationMetadata>
uploadConversationOperationCallable() {
return stub.uploadConversationOperationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Create a longrunning conversation upload operation. This method differs from CreateConversation
* by allowing audio transcription and optional DLP redaction.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (ContactCenterInsightsClient contactCenterInsightsClient =
* ContactCenterInsightsClient.create()) {
* UploadConversationRequest request =
* UploadConversationRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setConversation(Conversation.newBuilder().build())
* .setConversationId("conversationId-1676095234")
* .setRedactionConfig(RedactionConfig.newBuilder().build())
* .build();
* ApiFuture<Operation> future =
* contactCenterInsightsClient.uploadConversationCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<UploadConversationRequest, Operation> uploadConversationCallable() {
return stub.uploadConversationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates a conversation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ public UnaryCallSettings<CreateConversationRequest, Conversation> createConversa
return ((ContactCenterInsightsStubSettings) getStubSettings()).createConversationSettings();
}

/** Returns the object with the settings used for calls to uploadConversation. */
public UnaryCallSettings<UploadConversationRequest, Operation> uploadConversationSettings() {
return ((ContactCenterInsightsStubSettings) getStubSettings()).uploadConversationSettings();
}

/** Returns the object with the settings used for calls to uploadConversation. */
public OperationCallSettings<UploadConversationRequest, Conversation, UploadConversationMetadata>
uploadConversationOperationSettings() {
return ((ContactCenterInsightsStubSettings) getStubSettings())
.uploadConversationOperationSettings();
}

/** Returns the object with the settings used for calls to updateConversation. */
public UnaryCallSettings<UpdateConversationRequest, Conversation> updateConversationSettings() {
return ((ContactCenterInsightsStubSettings) getStubSettings()).updateConversationSettings();
Expand Down Expand Up @@ -466,6 +478,19 @@ public Builder applyToAllUnaryMethods(
return getStubSettingsBuilder().createConversationSettings();
}

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

/** Returns the builder for the settings used for calls to uploadConversation. */
public OperationCallSettings.Builder<
UploadConversationRequest, Conversation, UploadConversationMetadata>
uploadConversationOperationSettings() {
return getStubSettingsBuilder().uploadConversationOperationSettings();
}

/** Returns the builder for the settings used for calls to updateConversation. */
public UnaryCallSettings.Builder<UpdateConversationRequest, Conversation>
updateConversationSettings() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
},
"UpdateView": {
"methods": ["updateView", "updateView", "updateViewCallable"]
},
"UploadConversation": {
"methods": ["uploadConversationAsync", "uploadConversationOperationCallable", "uploadConversationCallable"]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
import com.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest;
import com.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest;
import com.google.cloud.contactcenterinsights.v1.UpdateViewRequest;
import com.google.cloud.contactcenterinsights.v1.UploadConversationMetadata;
import com.google.cloud.contactcenterinsights.v1.UploadConversationRequest;
import com.google.cloud.contactcenterinsights.v1.View;
import com.google.longrunning.Operation;
import com.google.longrunning.stub.OperationsStub;
Expand Down Expand Up @@ -115,6 +117,16 @@ public UnaryCallable<CreateConversationRequest, Conversation> createConversation
throw new UnsupportedOperationException("Not implemented: createConversationCallable()");
}

public OperationCallable<UploadConversationRequest, Conversation, UploadConversationMetadata>
uploadConversationOperationCallable() {
throw new UnsupportedOperationException(
"Not implemented: uploadConversationOperationCallable()");
}

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

public UnaryCallable<UpdateConversationRequest, Conversation> updateConversationCallable() {
throw new UnsupportedOperationException("Not implemented: updateConversationCallable()");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@
import com.google.cloud.contactcenterinsights.v1.UpdatePhraseMatcherRequest;
import com.google.cloud.contactcenterinsights.v1.UpdateSettingsRequest;
import com.google.cloud.contactcenterinsights.v1.UpdateViewRequest;
import com.google.cloud.contactcenterinsights.v1.UploadConversationMetadata;
import com.google.cloud.contactcenterinsights.v1.UploadConversationRequest;
import com.google.cloud.contactcenterinsights.v1.View;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
Expand Down Expand Up @@ -174,6 +176,10 @@ public class ContactCenterInsightsStubSettings

private final UnaryCallSettings<CreateConversationRequest, Conversation>
createConversationSettings;
private final UnaryCallSettings<UploadConversationRequest, Operation> uploadConversationSettings;
private final OperationCallSettings<
UploadConversationRequest, Conversation, UploadConversationMetadata>
uploadConversationOperationSettings;
private final UnaryCallSettings<UpdateConversationRequest, Conversation>
updateConversationSettings;
private final UnaryCallSettings<GetConversationRequest, Conversation> getConversationSettings;
Expand Down Expand Up @@ -483,6 +489,17 @@ public UnaryCallSettings<CreateConversationRequest, Conversation> createConversa
return createConversationSettings;
}

/** Returns the object with the settings used for calls to uploadConversation. */
public UnaryCallSettings<UploadConversationRequest, Operation> uploadConversationSettings() {
return uploadConversationSettings;
}

/** Returns the object with the settings used for calls to uploadConversation. */
public OperationCallSettings<UploadConversationRequest, Conversation, UploadConversationMetadata>
uploadConversationOperationSettings() {
return uploadConversationOperationSettings;
}

/** Returns the object with the settings used for calls to updateConversation. */
public UnaryCallSettings<UpdateConversationRequest, Conversation> updateConversationSettings() {
return updateConversationSettings;
Expand Down Expand Up @@ -836,6 +853,9 @@ protected ContactCenterInsightsStubSettings(Builder settingsBuilder) throws IOEx
super(settingsBuilder);

createConversationSettings = settingsBuilder.createConversationSettings().build();
uploadConversationSettings = settingsBuilder.uploadConversationSettings().build();
uploadConversationOperationSettings =
settingsBuilder.uploadConversationOperationSettings().build();
updateConversationSettings = settingsBuilder.updateConversationSettings().build();
getConversationSettings = settingsBuilder.getConversationSettings().build();
listConversationsSettings = settingsBuilder.listConversationsSettings().build();
Expand Down Expand Up @@ -892,6 +912,11 @@ public static class Builder
private final ImmutableList<UnaryCallSettings.Builder<?, ?>> unaryMethodSettingsBuilders;
private final UnaryCallSettings.Builder<CreateConversationRequest, Conversation>
createConversationSettings;
private final UnaryCallSettings.Builder<UploadConversationRequest, Operation>
uploadConversationSettings;
private final OperationCallSettings.Builder<
UploadConversationRequest, Conversation, UploadConversationMetadata>
uploadConversationOperationSettings;
private final UnaryCallSettings.Builder<UpdateConversationRequest, Conversation>
updateConversationSettings;
private final UnaryCallSettings.Builder<GetConversationRequest, Conversation>
Expand Down Expand Up @@ -1022,6 +1047,8 @@ protected Builder(ClientContext clientContext) {
super(clientContext);

createConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
uploadConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
uploadConversationOperationSettings = OperationCallSettings.newBuilder();
updateConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
getConversationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
listConversationsSettings = PagedCallSettings.newBuilder(LIST_CONVERSATIONS_PAGE_STR_FACT);
Expand Down Expand Up @@ -1070,6 +1097,7 @@ protected Builder(ClientContext clientContext) {
unaryMethodSettingsBuilders =
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
createConversationSettings,
uploadConversationSettings,
updateConversationSettings,
getConversationSettings,
listConversationsSettings,
Expand Down Expand Up @@ -1113,6 +1141,9 @@ protected Builder(ContactCenterInsightsStubSettings settings) {
super(settings);

createConversationSettings = settings.createConversationSettings.toBuilder();
uploadConversationSettings = settings.uploadConversationSettings.toBuilder();
uploadConversationOperationSettings =
settings.uploadConversationOperationSettings.toBuilder();
updateConversationSettings = settings.updateConversationSettings.toBuilder();
getConversationSettings = settings.getConversationSettings.toBuilder();
listConversationsSettings = settings.listConversationsSettings.toBuilder();
Expand Down Expand Up @@ -1165,6 +1196,7 @@ protected Builder(ContactCenterInsightsStubSettings settings) {
unaryMethodSettingsBuilders =
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
createConversationSettings,
uploadConversationSettings,
updateConversationSettings,
getConversationSettings,
listConversationsSettings,
Expand Down Expand Up @@ -1235,6 +1267,11 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));

builder
.uploadConversationSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));

builder
.updateConversationSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
Expand Down Expand Up @@ -1415,6 +1452,31 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));

builder
.uploadConversationOperationSettings()
.setInitialCallSettings(
UnaryCallSettings
.<UploadConversationRequest, OperationSnapshot>newUnaryCallSettingsBuilder()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"))
.build())
.setResponseTransformer(
ProtoOperationTransformers.ResponseTransformer.create(Conversation.class))
.setMetadataTransformer(
ProtoOperationTransformers.MetadataTransformer.create(
UploadConversationMetadata.class))
.setPollingAlgorithm(
OperationTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelay(Duration.ofMillis(5000L))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelay(Duration.ofMillis(45000L))
.setInitialRpcTimeout(Duration.ZERO)
.setRpcTimeoutMultiplier(1.0)
.setMaxRpcTimeout(Duration.ZERO)
.setTotalTimeout(Duration.ofMillis(300000L))
.build()));

builder
.createAnalysisOperationSettings()
.setInitialCallSettings(
Expand Down Expand Up @@ -1640,6 +1702,21 @@ public Builder applyToAllUnaryMethods(
return createConversationSettings;
}

/** Returns the builder for the settings used for calls to uploadConversation. */
public UnaryCallSettings.Builder<UploadConversationRequest, Operation>
uploadConversationSettings() {
return uploadConversationSettings;
}

/** Returns the builder for the settings used for calls to uploadConversation. */
@BetaApi(
"The surface for use by generated code is not stable yet and may change in the future.")
public OperationCallSettings.Builder<
UploadConversationRequest, Conversation, UploadConversationMetadata>
uploadConversationOperationSettings() {
return uploadConversationOperationSettings;
}

/** Returns the builder for the settings used for calls to updateConversation. */
public UnaryCallSettings.Builder<UpdateConversationRequest, Conversation>
updateConversationSettings() {
Expand Down
Loading

0 comments on commit 9dade7a

Please sign in to comment.