All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest Maven / Gradle / Ivy

There is a newer version: 4.59.0
Show newest version
/*
 * Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/dialogflow/v2/conversation.proto

// Protobuf Java Version: 3.25.5
package com.google.cloud.dialogflow.v2;

/**
 *
 *
 * 
 * The request message for
 * [Conversations.GenerateStatelessSuggestion][google.cloud.dialogflow.v2.Conversations.GenerateStatelessSuggestion].
 * 
* * Protobuf type {@code google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest} */ public final class GenerateStatelessSuggestionRequest extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest) GenerateStatelessSuggestionRequestOrBuilder { private static final long serialVersionUID = 0L; // Use GenerateStatelessSuggestionRequest.newBuilder() to construct. private GenerateStatelessSuggestionRequest( com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private GenerateStatelessSuggestionRequest() { parent_ = ""; triggerEvents_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new GenerateStatelessSuggestionRequest(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.dialogflow.v2.ConversationProto .internal_static_google_cloud_dialogflow_v2_GenerateStatelessSuggestionRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.dialogflow.v2.ConversationProto .internal_static_google_cloud_dialogflow_v2_GenerateStatelessSuggestionRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest.class, com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest.Builder.class); } private int bitField0_; private int generatorResourceCase_ = 0; @SuppressWarnings("serial") private java.lang.Object generatorResource_; public enum GeneratorResourceCase implements com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { GENERATOR(2), GENERATOR_NAME(3), GENERATORRESOURCE_NOT_SET(0); private final int value; private GeneratorResourceCase(int value) { this.value = value; } /** * @param value The number of the enum to look for. * @return The enum associated with the given number. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static GeneratorResourceCase valueOf(int value) { return forNumber(value); } public static GeneratorResourceCase forNumber(int value) { switch (value) { case 2: return GENERATOR; case 3: return GENERATOR_NAME; case 0: return GENERATORRESOURCE_NOT_SET; default: return null; } } public int getNumber() { return this.value; } }; public GeneratorResourceCase getGeneratorResourceCase() { return GeneratorResourceCase.forNumber(generatorResourceCase_); } public static final int PARENT_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object parent_ = ""; /** * * *
   * Required. The parent resource to charge for the Suggestion's generation.
   * Format: `projects/<Project ID>/locations/<Location ID>`.
   * 
* * * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } * * * @return The parent. */ @java.lang.Override public java.lang.String getParent() { java.lang.Object ref = parent_; if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); parent_ = s; return s; } } /** * * *
   * Required. The parent resource to charge for the Suggestion's generation.
   * Format: `projects/<Project ID>/locations/<Location ID>`.
   * 
* * * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } * * * @return The bytes for parent. */ @java.lang.Override public com.google.protobuf.ByteString getParentBytes() { java.lang.Object ref = parent_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); parent_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int GENERATOR_FIELD_NUMBER = 2; /** * * *
   * Uncreated generator. It should be a complete generator that includes all
   * information about the generator.
   * 
* * .google.cloud.dialogflow.v2.Generator generator = 2; * * @return Whether the generator field is set. */ @java.lang.Override public boolean hasGenerator() { return generatorResourceCase_ == 2; } /** * * *
   * Uncreated generator. It should be a complete generator that includes all
   * information about the generator.
   * 
* * .google.cloud.dialogflow.v2.Generator generator = 2; * * @return The generator. */ @java.lang.Override public com.google.cloud.dialogflow.v2.Generator getGenerator() { if (generatorResourceCase_ == 2) { return (com.google.cloud.dialogflow.v2.Generator) generatorResource_; } return com.google.cloud.dialogflow.v2.Generator.getDefaultInstance(); } /** * * *
   * Uncreated generator. It should be a complete generator that includes all
   * information about the generator.
   * 
* * .google.cloud.dialogflow.v2.Generator generator = 2; */ @java.lang.Override public com.google.cloud.dialogflow.v2.GeneratorOrBuilder getGeneratorOrBuilder() { if (generatorResourceCase_ == 2) { return (com.google.cloud.dialogflow.v2.Generator) generatorResource_; } return com.google.cloud.dialogflow.v2.Generator.getDefaultInstance(); } public static final int GENERATOR_NAME_FIELD_NUMBER = 3; /** * * *
   * The resource name of the existing created generator. Format:
   * `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>`
   * 
* * string generator_name = 3; * * @return Whether the generatorName field is set. */ public boolean hasGeneratorName() { return generatorResourceCase_ == 3; } /** * * *
   * The resource name of the existing created generator. Format:
   * `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>`
   * 
* * string generator_name = 3; * * @return The generatorName. */ public java.lang.String getGeneratorName() { java.lang.Object ref = ""; if (generatorResourceCase_ == 3) { ref = generatorResource_; } if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (generatorResourceCase_ == 3) { generatorResource_ = s; } return s; } } /** * * *
   * The resource name of the existing created generator. Format:
   * `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>`
   * 
* * string generator_name = 3; * * @return The bytes for generatorName. */ public com.google.protobuf.ByteString getGeneratorNameBytes() { java.lang.Object ref = ""; if (generatorResourceCase_ == 3) { ref = generatorResource_; } if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); if (generatorResourceCase_ == 3) { generatorResource_ = b; } return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int CONVERSATION_CONTEXT_FIELD_NUMBER = 5; private com.google.cloud.dialogflow.v2.ConversationContext conversationContext_; /** * * *
   * Optional. Context of the conversation, including transcripts.
   * 
* * * .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; * * * @return Whether the conversationContext field is set. */ @java.lang.Override public boolean hasConversationContext() { return ((bitField0_ & 0x00000001) != 0); } /** * * *
   * Optional. Context of the conversation, including transcripts.
   * 
* * * .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The conversationContext. */ @java.lang.Override public com.google.cloud.dialogflow.v2.ConversationContext getConversationContext() { return conversationContext_ == null ? com.google.cloud.dialogflow.v2.ConversationContext.getDefaultInstance() : conversationContext_; } /** * * *
   * Optional. Context of the conversation, including transcripts.
   * 
* * * .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; * */ @java.lang.Override public com.google.cloud.dialogflow.v2.ConversationContextOrBuilder getConversationContextOrBuilder() { return conversationContext_ == null ? com.google.cloud.dialogflow.v2.ConversationContext.getDefaultInstance() : conversationContext_; } public static final int TRIGGER_EVENTS_FIELD_NUMBER = 6; @SuppressWarnings("serial") private java.util.List triggerEvents_; private static final com.google.protobuf.Internal.ListAdapter.Converter< java.lang.Integer, com.google.cloud.dialogflow.v2.TriggerEvent> triggerEvents_converter_ = new com.google.protobuf.Internal.ListAdapter.Converter< java.lang.Integer, com.google.cloud.dialogflow.v2.TriggerEvent>() { public com.google.cloud.dialogflow.v2.TriggerEvent convert(java.lang.Integer from) { com.google.cloud.dialogflow.v2.TriggerEvent result = com.google.cloud.dialogflow.v2.TriggerEvent.forNumber(from); return result == null ? com.google.cloud.dialogflow.v2.TriggerEvent.UNRECOGNIZED : result; } }; /** * * *
   * Optional. A list of trigger events. Generator will be triggered only if
   * it's trigger event is included here.
   * 
* * * repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @return A list containing the triggerEvents. */ @java.lang.Override public java.util.List getTriggerEventsList() { return new com.google.protobuf.Internal.ListAdapter< java.lang.Integer, com.google.cloud.dialogflow.v2.TriggerEvent>( triggerEvents_, triggerEvents_converter_); } /** * * *
   * Optional. A list of trigger events. Generator will be triggered only if
   * it's trigger event is included here.
   * 
* * * repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The count of triggerEvents. */ @java.lang.Override public int getTriggerEventsCount() { return triggerEvents_.size(); } /** * * *
   * Optional. A list of trigger events. Generator will be triggered only if
   * it's trigger event is included here.
   * 
* * * repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @param index The index of the element to return. * @return The triggerEvents at the given index. */ @java.lang.Override public com.google.cloud.dialogflow.v2.TriggerEvent getTriggerEvents(int index) { return triggerEvents_converter_.convert(triggerEvents_.get(index)); } /** * * *
   * Optional. A list of trigger events. Generator will be triggered only if
   * it's trigger event is included here.
   * 
* * * repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @return A list containing the enum numeric values on the wire for triggerEvents. */ @java.lang.Override public java.util.List getTriggerEventsValueList() { return triggerEvents_; } /** * * *
   * Optional. A list of trigger events. Generator will be triggered only if
   * it's trigger event is included here.
   * 
* * * repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @param index The index of the value to return. * @return The enum numeric value on the wire of triggerEvents at the given index. */ @java.lang.Override public int getTriggerEventsValue(int index) { return triggerEvents_.get(index); } private int triggerEventsMemoizedSerializedSize; private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); } if (generatorResourceCase_ == 2) { output.writeMessage(2, (com.google.cloud.dialogflow.v2.Generator) generatorResource_); } if (generatorResourceCase_ == 3) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, generatorResource_); } if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(5, getConversationContext()); } if (getTriggerEventsList().size() > 0) { output.writeUInt32NoTag(50); output.writeUInt32NoTag(triggerEventsMemoizedSerializedSize); } for (int i = 0; i < triggerEvents_.size(); i++) { output.writeEnumNoTag(triggerEvents_.get(i)); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); } if (generatorResourceCase_ == 2) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 2, (com.google.cloud.dialogflow.v2.Generator) generatorResource_); } if (generatorResourceCase_ == 3) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, generatorResource_); } if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getConversationContext()); } { int dataSize = 0; for (int i = 0; i < triggerEvents_.size(); i++) { dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(triggerEvents_.get(i)); } size += dataSize; if (!getTriggerEventsList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); } triggerEventsMemoizedSerializedSize = dataSize; } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest)) { return super.equals(obj); } com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest other = (com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest) obj; if (!getParent().equals(other.getParent())) return false; if (hasConversationContext() != other.hasConversationContext()) return false; if (hasConversationContext()) { if (!getConversationContext().equals(other.getConversationContext())) return false; } if (!triggerEvents_.equals(other.triggerEvents_)) return false; if (!getGeneratorResourceCase().equals(other.getGeneratorResourceCase())) return false; switch (generatorResourceCase_) { case 2: if (!getGenerator().equals(other.getGenerator())) return false; break; case 3: if (!getGeneratorName().equals(other.getGeneratorName())) return false; break; case 0: default: } if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PARENT_FIELD_NUMBER; hash = (53 * hash) + getParent().hashCode(); if (hasConversationContext()) { hash = (37 * hash) + CONVERSATION_CONTEXT_FIELD_NUMBER; hash = (53 * hash) + getConversationContext().hashCode(); } if (getTriggerEventsCount() > 0) { hash = (37 * hash) + TRIGGER_EVENTS_FIELD_NUMBER; hash = (53 * hash) + triggerEvents_.hashCode(); } switch (generatorResourceCase_) { case 2: hash = (37 * hash) + GENERATOR_FIELD_NUMBER; hash = (53 * hash) + getGenerator().hashCode(); break; case 3: hash = (37 * hash) + GENERATOR_NAME_FIELD_NUMBER; hash = (53 * hash) + getGeneratorName().hashCode(); break; case 0: default: } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest parseFrom( byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder( com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * * *
   * The request message for
   * [Conversations.GenerateStatelessSuggestion][google.cloud.dialogflow.v2.Conversations.GenerateStatelessSuggestion].
   * 
* * Protobuf type {@code google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest) com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.dialogflow.v2.ConversationProto .internal_static_google_cloud_dialogflow_v2_GenerateStatelessSuggestionRequest_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.dialogflow.v2.ConversationProto .internal_static_google_cloud_dialogflow_v2_GenerateStatelessSuggestionRequest_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest.class, com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest.Builder.class); } // Construct using // com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getConversationContextFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; parent_ = ""; if (generatorBuilder_ != null) { generatorBuilder_.clear(); } conversationContext_ = null; if (conversationContextBuilder_ != null) { conversationContextBuilder_.dispose(); conversationContextBuilder_ = null; } triggerEvents_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000010); generatorResourceCase_ = 0; generatorResource_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.dialogflow.v2.ConversationProto .internal_static_google_cloud_dialogflow_v2_GenerateStatelessSuggestionRequest_descriptor; } @java.lang.Override public com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest getDefaultInstanceForType() { return com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest.getDefaultInstance(); } @java.lang.Override public com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest build() { com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest buildPartial() { com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest result = new com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest(this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } buildPartialOneofs(result); onBuilt(); return result; } private void buildPartialRepeatedFields( com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest result) { if (((bitField0_ & 0x00000010) != 0)) { triggerEvents_ = java.util.Collections.unmodifiableList(triggerEvents_); bitField0_ = (bitField0_ & ~0x00000010); } result.triggerEvents_ = triggerEvents_; } private void buildPartial0( com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.parent_ = parent_; } int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000008) != 0)) { result.conversationContext_ = conversationContextBuilder_ == null ? conversationContext_ : conversationContextBuilder_.build(); to_bitField0_ |= 0x00000001; } result.bitField0_ |= to_bitField0_; } private void buildPartialOneofs( com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest result) { result.generatorResourceCase_ = generatorResourceCase_; result.generatorResource_ = this.generatorResource_; if (generatorResourceCase_ == 2 && generatorBuilder_ != null) { result.generatorResource_ = generatorBuilder_.build(); } } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest) { return mergeFrom((com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom( com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest other) { if (other == com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; bitField0_ |= 0x00000001; onChanged(); } if (other.hasConversationContext()) { mergeConversationContext(other.getConversationContext()); } if (!other.triggerEvents_.isEmpty()) { if (triggerEvents_.isEmpty()) { triggerEvents_ = other.triggerEvents_; bitField0_ = (bitField0_ & ~0x00000010); } else { ensureTriggerEventsIsMutable(); triggerEvents_.addAll(other.triggerEvents_); } onChanged(); } switch (other.getGeneratorResourceCase()) { case GENERATOR: { mergeGenerator(other.getGenerator()); break; } case GENERATOR_NAME: { generatorResourceCase_ = 3; generatorResource_ = other.generatorResource_; onChanged(); break; } case GENERATORRESOURCE_NOT_SET: { break; } } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { parent_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case 10 case 18: { input.readMessage(getGeneratorFieldBuilder().getBuilder(), extensionRegistry); generatorResourceCase_ = 2; break; } // case 18 case 26: { java.lang.String s = input.readStringRequireUtf8(); generatorResourceCase_ = 3; generatorResource_ = s; break; } // case 26 case 42: { input.readMessage( getConversationContextFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000008; break; } // case 42 case 48: { int tmpRaw = input.readEnum(); ensureTriggerEventsIsMutable(); triggerEvents_.add(tmpRaw); break; } // case 48 case 50: { int length = input.readRawVarint32(); int oldLimit = input.pushLimit(length); while (input.getBytesUntilLimit() > 0) { int tmpRaw = input.readEnum(); ensureTriggerEventsIsMutable(); triggerEvents_.add(tmpRaw); } input.popLimit(oldLimit); break; } // case 50 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag } break; } // default: } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int generatorResourceCase_ = 0; private java.lang.Object generatorResource_; public GeneratorResourceCase getGeneratorResourceCase() { return GeneratorResourceCase.forNumber(generatorResourceCase_); } public Builder clearGeneratorResource() { generatorResourceCase_ = 0; generatorResource_ = null; onChanged(); return this; } private int bitField0_; private java.lang.Object parent_ = ""; /** * * *
     * Required. The parent resource to charge for the Suggestion's generation.
     * Format: `projects/<Project ID>/locations/<Location ID>`.
     * 
* * * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } * * * @return The parent. */ public java.lang.String getParent() { java.lang.Object ref = parent_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); parent_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
     * Required. The parent resource to charge for the Suggestion's generation.
     * Format: `projects/<Project ID>/locations/<Location ID>`.
     * 
* * * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } * * * @return The bytes for parent. */ public com.google.protobuf.ByteString getParentBytes() { java.lang.Object ref = parent_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); parent_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * Required. The parent resource to charge for the Suggestion's generation.
     * Format: `projects/<Project ID>/locations/<Location ID>`.
     * 
* * * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } * * * @param value The parent to set. * @return This builder for chaining. */ public Builder setParent(java.lang.String value) { if (value == null) { throw new NullPointerException(); } parent_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * * *
     * Required. The parent resource to charge for the Suggestion's generation.
     * Format: `projects/<Project ID>/locations/<Location ID>`.
     * 
* * * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } * * * @return This builder for chaining. */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * * *
     * Required. The parent resource to charge for the Suggestion's generation.
     * Format: `projects/<Project ID>/locations/<Location ID>`.
     * 
* * * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } * * * @param value The bytes for parent to set. * @return This builder for chaining. */ public Builder setParentBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); parent_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.Generator, com.google.cloud.dialogflow.v2.Generator.Builder, com.google.cloud.dialogflow.v2.GeneratorOrBuilder> generatorBuilder_; /** * * *
     * Uncreated generator. It should be a complete generator that includes all
     * information about the generator.
     * 
* * .google.cloud.dialogflow.v2.Generator generator = 2; * * @return Whether the generator field is set. */ @java.lang.Override public boolean hasGenerator() { return generatorResourceCase_ == 2; } /** * * *
     * Uncreated generator. It should be a complete generator that includes all
     * information about the generator.
     * 
* * .google.cloud.dialogflow.v2.Generator generator = 2; * * @return The generator. */ @java.lang.Override public com.google.cloud.dialogflow.v2.Generator getGenerator() { if (generatorBuilder_ == null) { if (generatorResourceCase_ == 2) { return (com.google.cloud.dialogflow.v2.Generator) generatorResource_; } return com.google.cloud.dialogflow.v2.Generator.getDefaultInstance(); } else { if (generatorResourceCase_ == 2) { return generatorBuilder_.getMessage(); } return com.google.cloud.dialogflow.v2.Generator.getDefaultInstance(); } } /** * * *
     * Uncreated generator. It should be a complete generator that includes all
     * information about the generator.
     * 
* * .google.cloud.dialogflow.v2.Generator generator = 2; */ public Builder setGenerator(com.google.cloud.dialogflow.v2.Generator value) { if (generatorBuilder_ == null) { if (value == null) { throw new NullPointerException(); } generatorResource_ = value; onChanged(); } else { generatorBuilder_.setMessage(value); } generatorResourceCase_ = 2; return this; } /** * * *
     * Uncreated generator. It should be a complete generator that includes all
     * information about the generator.
     * 
* * .google.cloud.dialogflow.v2.Generator generator = 2; */ public Builder setGenerator(com.google.cloud.dialogflow.v2.Generator.Builder builderForValue) { if (generatorBuilder_ == null) { generatorResource_ = builderForValue.build(); onChanged(); } else { generatorBuilder_.setMessage(builderForValue.build()); } generatorResourceCase_ = 2; return this; } /** * * *
     * Uncreated generator. It should be a complete generator that includes all
     * information about the generator.
     * 
* * .google.cloud.dialogflow.v2.Generator generator = 2; */ public Builder mergeGenerator(com.google.cloud.dialogflow.v2.Generator value) { if (generatorBuilder_ == null) { if (generatorResourceCase_ == 2 && generatorResource_ != com.google.cloud.dialogflow.v2.Generator.getDefaultInstance()) { generatorResource_ = com.google.cloud.dialogflow.v2.Generator.newBuilder( (com.google.cloud.dialogflow.v2.Generator) generatorResource_) .mergeFrom(value) .buildPartial(); } else { generatorResource_ = value; } onChanged(); } else { if (generatorResourceCase_ == 2) { generatorBuilder_.mergeFrom(value); } else { generatorBuilder_.setMessage(value); } } generatorResourceCase_ = 2; return this; } /** * * *
     * Uncreated generator. It should be a complete generator that includes all
     * information about the generator.
     * 
* * .google.cloud.dialogflow.v2.Generator generator = 2; */ public Builder clearGenerator() { if (generatorBuilder_ == null) { if (generatorResourceCase_ == 2) { generatorResourceCase_ = 0; generatorResource_ = null; onChanged(); } } else { if (generatorResourceCase_ == 2) { generatorResourceCase_ = 0; generatorResource_ = null; } generatorBuilder_.clear(); } return this; } /** * * *
     * Uncreated generator. It should be a complete generator that includes all
     * information about the generator.
     * 
* * .google.cloud.dialogflow.v2.Generator generator = 2; */ public com.google.cloud.dialogflow.v2.Generator.Builder getGeneratorBuilder() { return getGeneratorFieldBuilder().getBuilder(); } /** * * *
     * Uncreated generator. It should be a complete generator that includes all
     * information about the generator.
     * 
* * .google.cloud.dialogflow.v2.Generator generator = 2; */ @java.lang.Override public com.google.cloud.dialogflow.v2.GeneratorOrBuilder getGeneratorOrBuilder() { if ((generatorResourceCase_ == 2) && (generatorBuilder_ != null)) { return generatorBuilder_.getMessageOrBuilder(); } else { if (generatorResourceCase_ == 2) { return (com.google.cloud.dialogflow.v2.Generator) generatorResource_; } return com.google.cloud.dialogflow.v2.Generator.getDefaultInstance(); } } /** * * *
     * Uncreated generator. It should be a complete generator that includes all
     * information about the generator.
     * 
* * .google.cloud.dialogflow.v2.Generator generator = 2; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.Generator, com.google.cloud.dialogflow.v2.Generator.Builder, com.google.cloud.dialogflow.v2.GeneratorOrBuilder> getGeneratorFieldBuilder() { if (generatorBuilder_ == null) { if (!(generatorResourceCase_ == 2)) { generatorResource_ = com.google.cloud.dialogflow.v2.Generator.getDefaultInstance(); } generatorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.Generator, com.google.cloud.dialogflow.v2.Generator.Builder, com.google.cloud.dialogflow.v2.GeneratorOrBuilder>( (com.google.cloud.dialogflow.v2.Generator) generatorResource_, getParentForChildren(), isClean()); generatorResource_ = null; } generatorResourceCase_ = 2; onChanged(); return generatorBuilder_; } /** * * *
     * The resource name of the existing created generator. Format:
     * `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>`
     * 
* * string generator_name = 3; * * @return Whether the generatorName field is set. */ @java.lang.Override public boolean hasGeneratorName() { return generatorResourceCase_ == 3; } /** * * *
     * The resource name of the existing created generator. Format:
     * `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>`
     * 
* * string generator_name = 3; * * @return The generatorName. */ @java.lang.Override public java.lang.String getGeneratorName() { java.lang.Object ref = ""; if (generatorResourceCase_ == 3) { ref = generatorResource_; } if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (generatorResourceCase_ == 3) { generatorResource_ = s; } return s; } else { return (java.lang.String) ref; } } /** * * *
     * The resource name of the existing created generator. Format:
     * `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>`
     * 
* * string generator_name = 3; * * @return The bytes for generatorName. */ @java.lang.Override public com.google.protobuf.ByteString getGeneratorNameBytes() { java.lang.Object ref = ""; if (generatorResourceCase_ == 3) { ref = generatorResource_; } if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); if (generatorResourceCase_ == 3) { generatorResource_ = b; } return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * The resource name of the existing created generator. Format:
     * `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>`
     * 
* * string generator_name = 3; * * @param value The generatorName to set. * @return This builder for chaining. */ public Builder setGeneratorName(java.lang.String value) { if (value == null) { throw new NullPointerException(); } generatorResourceCase_ = 3; generatorResource_ = value; onChanged(); return this; } /** * * *
     * The resource name of the existing created generator. Format:
     * `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>`
     * 
* * string generator_name = 3; * * @return This builder for chaining. */ public Builder clearGeneratorName() { if (generatorResourceCase_ == 3) { generatorResourceCase_ = 0; generatorResource_ = null; onChanged(); } return this; } /** * * *
     * The resource name of the existing created generator. Format:
     * `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>`
     * 
* * string generator_name = 3; * * @param value The bytes for generatorName to set. * @return This builder for chaining. */ public Builder setGeneratorNameBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); generatorResourceCase_ = 3; generatorResource_ = value; onChanged(); return this; } private com.google.cloud.dialogflow.v2.ConversationContext conversationContext_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.ConversationContext, com.google.cloud.dialogflow.v2.ConversationContext.Builder, com.google.cloud.dialogflow.v2.ConversationContextOrBuilder> conversationContextBuilder_; /** * * *
     * Optional. Context of the conversation, including transcripts.
     * 
* * * .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; * * * @return Whether the conversationContext field is set. */ public boolean hasConversationContext() { return ((bitField0_ & 0x00000008) != 0); } /** * * *
     * Optional. Context of the conversation, including transcripts.
     * 
* * * .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The conversationContext. */ public com.google.cloud.dialogflow.v2.ConversationContext getConversationContext() { if (conversationContextBuilder_ == null) { return conversationContext_ == null ? com.google.cloud.dialogflow.v2.ConversationContext.getDefaultInstance() : conversationContext_; } else { return conversationContextBuilder_.getMessage(); } } /** * * *
     * Optional. Context of the conversation, including transcripts.
     * 
* * * .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder setConversationContext( com.google.cloud.dialogflow.v2.ConversationContext value) { if (conversationContextBuilder_ == null) { if (value == null) { throw new NullPointerException(); } conversationContext_ = value; } else { conversationContextBuilder_.setMessage(value); } bitField0_ |= 0x00000008; onChanged(); return this; } /** * * *
     * Optional. Context of the conversation, including transcripts.
     * 
* * * .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder setConversationContext( com.google.cloud.dialogflow.v2.ConversationContext.Builder builderForValue) { if (conversationContextBuilder_ == null) { conversationContext_ = builderForValue.build(); } else { conversationContextBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000008; onChanged(); return this; } /** * * *
     * Optional. Context of the conversation, including transcripts.
     * 
* * * .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder mergeConversationContext( com.google.cloud.dialogflow.v2.ConversationContext value) { if (conversationContextBuilder_ == null) { if (((bitField0_ & 0x00000008) != 0) && conversationContext_ != null && conversationContext_ != com.google.cloud.dialogflow.v2.ConversationContext.getDefaultInstance()) { getConversationContextBuilder().mergeFrom(value); } else { conversationContext_ = value; } } else { conversationContextBuilder_.mergeFrom(value); } if (conversationContext_ != null) { bitField0_ |= 0x00000008; onChanged(); } return this; } /** * * *
     * Optional. Context of the conversation, including transcripts.
     * 
* * * .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; * */ public Builder clearConversationContext() { bitField0_ = (bitField0_ & ~0x00000008); conversationContext_ = null; if (conversationContextBuilder_ != null) { conversationContextBuilder_.dispose(); conversationContextBuilder_ = null; } onChanged(); return this; } /** * * *
     * Optional. Context of the conversation, including transcripts.
     * 
* * * .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.cloud.dialogflow.v2.ConversationContext.Builder getConversationContextBuilder() { bitField0_ |= 0x00000008; onChanged(); return getConversationContextFieldBuilder().getBuilder(); } /** * * *
     * Optional. Context of the conversation, including transcripts.
     * 
* * * .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; * */ public com.google.cloud.dialogflow.v2.ConversationContextOrBuilder getConversationContextOrBuilder() { if (conversationContextBuilder_ != null) { return conversationContextBuilder_.getMessageOrBuilder(); } else { return conversationContext_ == null ? com.google.cloud.dialogflow.v2.ConversationContext.getDefaultInstance() : conversationContext_; } } /** * * *
     * Optional. Context of the conversation, including transcripts.
     * 
* * * .google.cloud.dialogflow.v2.ConversationContext conversation_context = 5 [(.google.api.field_behavior) = OPTIONAL]; * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.ConversationContext, com.google.cloud.dialogflow.v2.ConversationContext.Builder, com.google.cloud.dialogflow.v2.ConversationContextOrBuilder> getConversationContextFieldBuilder() { if (conversationContextBuilder_ == null) { conversationContextBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.dialogflow.v2.ConversationContext, com.google.cloud.dialogflow.v2.ConversationContext.Builder, com.google.cloud.dialogflow.v2.ConversationContextOrBuilder>( getConversationContext(), getParentForChildren(), isClean()); conversationContext_ = null; } return conversationContextBuilder_; } private java.util.List triggerEvents_ = java.util.Collections.emptyList(); private void ensureTriggerEventsIsMutable() { if (!((bitField0_ & 0x00000010) != 0)) { triggerEvents_ = new java.util.ArrayList(triggerEvents_); bitField0_ |= 0x00000010; } } /** * * *
     * Optional. A list of trigger events. Generator will be triggered only if
     * it's trigger event is included here.
     * 
* * * repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @return A list containing the triggerEvents. */ public java.util.List getTriggerEventsList() { return new com.google.protobuf.Internal.ListAdapter< java.lang.Integer, com.google.cloud.dialogflow.v2.TriggerEvent>( triggerEvents_, triggerEvents_converter_); } /** * * *
     * Optional. A list of trigger events. Generator will be triggered only if
     * it's trigger event is included here.
     * 
* * * repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @return The count of triggerEvents. */ public int getTriggerEventsCount() { return triggerEvents_.size(); } /** * * *
     * Optional. A list of trigger events. Generator will be triggered only if
     * it's trigger event is included here.
     * 
* * * repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @param index The index of the element to return. * @return The triggerEvents at the given index. */ public com.google.cloud.dialogflow.v2.TriggerEvent getTriggerEvents(int index) { return triggerEvents_converter_.convert(triggerEvents_.get(index)); } /** * * *
     * Optional. A list of trigger events. Generator will be triggered only if
     * it's trigger event is included here.
     * 
* * * repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @param index The index to set the value at. * @param value The triggerEvents to set. * @return This builder for chaining. */ public Builder setTriggerEvents(int index, com.google.cloud.dialogflow.v2.TriggerEvent value) { if (value == null) { throw new NullPointerException(); } ensureTriggerEventsIsMutable(); triggerEvents_.set(index, value.getNumber()); onChanged(); return this; } /** * * *
     * Optional. A list of trigger events. Generator will be triggered only if
     * it's trigger event is included here.
     * 
* * * repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @param value The triggerEvents to add. * @return This builder for chaining. */ public Builder addTriggerEvents(com.google.cloud.dialogflow.v2.TriggerEvent value) { if (value == null) { throw new NullPointerException(); } ensureTriggerEventsIsMutable(); triggerEvents_.add(value.getNumber()); onChanged(); return this; } /** * * *
     * Optional. A list of trigger events. Generator will be triggered only if
     * it's trigger event is included here.
     * 
* * * repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @param values The triggerEvents to add. * @return This builder for chaining. */ public Builder addAllTriggerEvents( java.lang.Iterable values) { ensureTriggerEventsIsMutable(); for (com.google.cloud.dialogflow.v2.TriggerEvent value : values) { triggerEvents_.add(value.getNumber()); } onChanged(); return this; } /** * * *
     * Optional. A list of trigger events. Generator will be triggered only if
     * it's trigger event is included here.
     * 
* * * repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @return This builder for chaining. */ public Builder clearTriggerEvents() { triggerEvents_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000010); onChanged(); return this; } /** * * *
     * Optional. A list of trigger events. Generator will be triggered only if
     * it's trigger event is included here.
     * 
* * * repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @return A list containing the enum numeric values on the wire for triggerEvents. */ public java.util.List getTriggerEventsValueList() { return java.util.Collections.unmodifiableList(triggerEvents_); } /** * * *
     * Optional. A list of trigger events. Generator will be triggered only if
     * it's trigger event is included here.
     * 
* * * repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @param index The index of the value to return. * @return The enum numeric value on the wire of triggerEvents at the given index. */ public int getTriggerEventsValue(int index) { return triggerEvents_.get(index); } /** * * *
     * Optional. A list of trigger events. Generator will be triggered only if
     * it's trigger event is included here.
     * 
* * * repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @param index The index to set the value at. * @param value The enum numeric value on the wire for triggerEvents to set. * @return This builder for chaining. */ public Builder setTriggerEventsValue(int index, int value) { ensureTriggerEventsIsMutable(); triggerEvents_.set(index, value); onChanged(); return this; } /** * * *
     * Optional. A list of trigger events. Generator will be triggered only if
     * it's trigger event is included here.
     * 
* * * repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @param value The enum numeric value on the wire for triggerEvents to add. * @return This builder for chaining. */ public Builder addTriggerEventsValue(int value) { ensureTriggerEventsIsMutable(); triggerEvents_.add(value); onChanged(); return this; } /** * * *
     * Optional. A list of trigger events. Generator will be triggered only if
     * it's trigger event is included here.
     * 
* * * repeated .google.cloud.dialogflow.v2.TriggerEvent trigger_events = 6 [(.google.api.field_behavior) = OPTIONAL]; * * * @param values The enum numeric values on the wire for triggerEvents to add. * @return This builder for chaining. */ public Builder addAllTriggerEventsValue(java.lang.Iterable values) { ensureTriggerEventsIsMutable(); for (int value : values) { triggerEvents_.add(value); } onChanged(); return this; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest) } // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest) private static final com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest(); } public static com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public GenerateStatelessSuggestionRequest parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { Builder builder = newBuilder(); try { builder.mergeFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(builder.buildPartial()); } catch (com.google.protobuf.UninitializedMessageException e) { throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e) .setUnfinishedMessage(builder.buildPartial()); } return builder.buildPartial(); } }; public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override public com.google.cloud.dialogflow.v2.GenerateStatelessSuggestionRequest getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy