Skip to content
Permalink
Browse files
feat: add output_config request field (#684)
- [ ] Regenerate this pull request now.

Committer: @cherba
PiperOrigin-RevId: 397621106

Source-Link: googleapis/googleapis@1872f45

Source-Link: https://github.com/googleapis/googleapis-gen/commit/fd4bb9f3fcc6b7bf498808c443eae9bf0d4447df
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZmQ0YmI5ZjNmY2M2YjdiZjQ5ODgwOGM0NDNlYWU5YmYwZDQ0NDdkZiJ9
  • Loading branch information
gcf-owl-bot[bot] committed Sep 20, 2021
1 parent 69f501b commit 4353458f1aa1615c6b44663de91ac3801fc060cc
@@ -272,6 +272,7 @@ public final UnaryCallable<RecognizeRequest, RecognizeResponse> recognizeCallabl
* LongRunningRecognizeRequest.newBuilder()
* .setConfig(RecognitionConfig.newBuilder().build())
* .setAudio(RecognitionAudio.newBuilder().build())
* .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
* .build();
* LongRunningRecognizeResponse response = speechClient.longRunningRecognizeAsync(request).get();
* }
@@ -300,6 +301,7 @@ public final UnaryCallable<RecognizeRequest, RecognizeResponse> recognizeCallabl
* LongRunningRecognizeRequest.newBuilder()
* .setConfig(RecognitionConfig.newBuilder().build())
* .setAudio(RecognitionAudio.newBuilder().build())
* .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
* .build();
* OperationFuture<LongRunningRecognizeResponse, LongRunningRecognizeMetadata> future =
* speechClient.longRunningRecognizeOperationCallable().futureCall(request);
@@ -329,6 +331,7 @@ public final UnaryCallable<RecognizeRequest, RecognizeResponse> recognizeCallabl
* LongRunningRecognizeRequest.newBuilder()
* .setConfig(RecognitionConfig.newBuilder().build())
* .setAudio(RecognitionAudio.newBuilder().build())
* .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
* .build();
* ApiFuture<Operation> future = speechClient.longRunningRecognizeCallable().futureCall(request);
* // Do something.
@@ -99,6 +99,23 @@ private LongRunningRecognizeRequest(
audio_ = subBuilder.buildPartial();
}

break;
}
case 34:
{
com.google.cloud.speech.v1.TranscriptOutputConfig.Builder subBuilder = null;
if (outputConfig_ != null) {
subBuilder = outputConfig_.toBuilder();
}
outputConfig_ =
input.readMessage(
com.google.cloud.speech.v1.TranscriptOutputConfig.parser(),
extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(outputConfig_);
outputConfig_ = subBuilder.buildPartial();
}

break;
}
default:
@@ -246,6 +263,60 @@ public com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder()
return getAudio();
}

public static final int OUTPUT_CONFIG_FIELD_NUMBER = 4;
private com.google.cloud.speech.v1.TranscriptOutputConfig outputConfig_;
/**
*
*
* <pre>
* Optional. Specifies an optional destination for the recognition results.
* </pre>
*
* <code>
* .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the outputConfig field is set.
*/
@java.lang.Override
public boolean hasOutputConfig() {
return outputConfig_ != null;
}
/**
*
*
* <pre>
* Optional. Specifies an optional destination for the recognition results.
* </pre>
*
* <code>
* .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The outputConfig.
*/
@java.lang.Override
public com.google.cloud.speech.v1.TranscriptOutputConfig getOutputConfig() {
return outputConfig_ == null
? com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance()
: outputConfig_;
}
/**
*
*
* <pre>
* Optional. Specifies an optional destination for the recognition results.
* </pre>
*
* <code>
* .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
@java.lang.Override
public com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() {
return getOutputConfig();
}

private byte memoizedIsInitialized = -1;

@java.lang.Override
@@ -266,6 +337,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (audio_ != null) {
output.writeMessage(2, getAudio());
}
if (outputConfig_ != null) {
output.writeMessage(4, getOutputConfig());
}
unknownFields.writeTo(output);
}

@@ -281,6 +355,9 @@ public int getSerializedSize() {
if (audio_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAudio());
}
if (outputConfig_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getOutputConfig());
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
@@ -305,6 +382,10 @@ public boolean equals(final java.lang.Object obj) {
if (hasAudio()) {
if (!getAudio().equals(other.getAudio())) return false;
}
if (hasOutputConfig() != other.hasOutputConfig()) return false;
if (hasOutputConfig()) {
if (!getOutputConfig().equals(other.getOutputConfig())) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@@ -324,6 +405,10 @@ public int hashCode() {
hash = (37 * hash) + AUDIO_FIELD_NUMBER;
hash = (53 * hash) + getAudio().hashCode();
}
if (hasOutputConfig()) {
hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER;
hash = (53 * hash) + getOutputConfig().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
@@ -483,6 +568,12 @@ public Builder clear() {
audio_ = null;
audioBuilder_ = null;
}
if (outputConfigBuilder_ == null) {
outputConfig_ = null;
} else {
outputConfig_ = null;
outputConfigBuilder_ = null;
}
return this;
}

@@ -520,6 +611,11 @@ public com.google.cloud.speech.v1.LongRunningRecognizeRequest buildPartial() {
} else {
result.audio_ = audioBuilder_.build();
}
if (outputConfigBuilder_ == null) {
result.outputConfig_ = outputConfig_;
} else {
result.outputConfig_ = outputConfigBuilder_.build();
}
onBuilt();
return result;
}
@@ -576,6 +672,9 @@ public Builder mergeFrom(com.google.cloud.speech.v1.LongRunningRecognizeRequest
if (other.hasAudio()) {
mergeAudio(other.getAudio());
}
if (other.hasOutputConfig()) {
mergeOutputConfig(other.getOutputConfig());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
@@ -1021,6 +1120,210 @@ public com.google.cloud.speech.v1.RecognitionAudioOrBuilder getAudioOrBuilder()
return audioBuilder_;
}

private com.google.cloud.speech.v1.TranscriptOutputConfig outputConfig_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.speech.v1.TranscriptOutputConfig,
com.google.cloud.speech.v1.TranscriptOutputConfig.Builder,
com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder>
outputConfigBuilder_;
/**
*
*
* <pre>
* Optional. Specifies an optional destination for the recognition results.
* </pre>
*
* <code>
* .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return Whether the outputConfig field is set.
*/
public boolean hasOutputConfig() {
return outputConfigBuilder_ != null || outputConfig_ != null;
}
/**
*
*
* <pre>
* Optional. Specifies an optional destination for the recognition results.
* </pre>
*
* <code>
* .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*
* @return The outputConfig.
*/
public com.google.cloud.speech.v1.TranscriptOutputConfig getOutputConfig() {
if (outputConfigBuilder_ == null) {
return outputConfig_ == null
? com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance()
: outputConfig_;
} else {
return outputConfigBuilder_.getMessage();
}
}
/**
*
*
* <pre>
* Optional. Specifies an optional destination for the recognition results.
* </pre>
*
* <code>
* .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setOutputConfig(com.google.cloud.speech.v1.TranscriptOutputConfig value) {
if (outputConfigBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
outputConfig_ = value;
onChanged();
} else {
outputConfigBuilder_.setMessage(value);
}

return this;
}
/**
*
*
* <pre>
* Optional. Specifies an optional destination for the recognition results.
* </pre>
*
* <code>
* .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder setOutputConfig(
com.google.cloud.speech.v1.TranscriptOutputConfig.Builder builderForValue) {
if (outputConfigBuilder_ == null) {
outputConfig_ = builderForValue.build();
onChanged();
} else {
outputConfigBuilder_.setMessage(builderForValue.build());
}

return this;
}
/**
*
*
* <pre>
* Optional. Specifies an optional destination for the recognition results.
* </pre>
*
* <code>
* .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder mergeOutputConfig(com.google.cloud.speech.v1.TranscriptOutputConfig value) {
if (outputConfigBuilder_ == null) {
if (outputConfig_ != null) {
outputConfig_ =
com.google.cloud.speech.v1.TranscriptOutputConfig.newBuilder(outputConfig_)
.mergeFrom(value)
.buildPartial();
} else {
outputConfig_ = value;
}
onChanged();
} else {
outputConfigBuilder_.mergeFrom(value);
}

return this;
}
/**
*
*
* <pre>
* Optional. Specifies an optional destination for the recognition results.
* </pre>
*
* <code>
* .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public Builder clearOutputConfig() {
if (outputConfigBuilder_ == null) {
outputConfig_ = null;
onChanged();
} else {
outputConfig_ = null;
outputConfigBuilder_ = null;
}

return this;
}
/**
*
*
* <pre>
* Optional. Specifies an optional destination for the recognition results.
* </pre>
*
* <code>
* .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.speech.v1.TranscriptOutputConfig.Builder getOutputConfigBuilder() {

onChanged();
return getOutputConfigFieldBuilder().getBuilder();
}
/**
*
*
* <pre>
* Optional. Specifies an optional destination for the recognition results.
* </pre>
*
* <code>
* .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
public com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder getOutputConfigOrBuilder() {
if (outputConfigBuilder_ != null) {
return outputConfigBuilder_.getMessageOrBuilder();
} else {
return outputConfig_ == null
? com.google.cloud.speech.v1.TranscriptOutputConfig.getDefaultInstance()
: outputConfig_;
}
}
/**
*
*
* <pre>
* Optional. Specifies an optional destination for the recognition results.
* </pre>
*
* <code>
* .google.cloud.speech.v1.TranscriptOutputConfig output_config = 4 [(.google.api.field_behavior) = OPTIONAL];
* </code>
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.speech.v1.TranscriptOutputConfig,
com.google.cloud.speech.v1.TranscriptOutputConfig.Builder,
com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder>
getOutputConfigFieldBuilder() {
if (outputConfigBuilder_ == null) {
outputConfigBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.speech.v1.TranscriptOutputConfig,
com.google.cloud.speech.v1.TranscriptOutputConfig.Builder,
com.google.cloud.speech.v1.TranscriptOutputConfigOrBuilder>(
getOutputConfig(), getParentForChildren(), isClean());
outputConfig_ = null;
}
return outputConfigBuilder_;
}

@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);

0 comments on commit 4353458

Please sign in to comment.