| // Copyright 2025 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 |
| // |
| // http://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. |
| |
| // Code generated by protoc-gen-go. DO NOT EDIT. |
| // versions: |
| // protoc-gen-go v1.36.11 |
| // protoc v6.33.2 |
| // source: google/cloud/discoveryengine/v1/completion.proto |
| |
| package discoveryenginepb |
| |
| import ( |
| reflect "reflect" |
| sync "sync" |
| unsafe "unsafe" |
| |
| _ "google.golang.org/genproto/googleapis/api/annotations" |
| protoreflect "google.golang.org/protobuf/reflect/protoreflect" |
| protoimpl "google.golang.org/protobuf/runtime/protoimpl" |
| ) |
| |
| const ( |
| // Verify that this generated code is sufficiently up-to-date. |
| _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) |
| // Verify that runtime/protoimpl is sufficiently up-to-date. |
| _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) |
| ) |
| |
| // Operator for matching with the generated suggestions. |
| type SuggestionDenyListEntry_MatchOperator int32 |
| |
| const ( |
| // Default value. Should not be used |
| SuggestionDenyListEntry_MATCH_OPERATOR_UNSPECIFIED SuggestionDenyListEntry_MatchOperator = 0 |
| // If the suggestion is an exact match to the block_phrase, then block it. |
| SuggestionDenyListEntry_EXACT_MATCH SuggestionDenyListEntry_MatchOperator = 1 |
| // If the suggestion contains the block_phrase, then block it. |
| SuggestionDenyListEntry_CONTAINS SuggestionDenyListEntry_MatchOperator = 2 |
| ) |
| |
| // Enum value maps for SuggestionDenyListEntry_MatchOperator. |
| var ( |
| SuggestionDenyListEntry_MatchOperator_name = map[int32]string{ |
| 0: "MATCH_OPERATOR_UNSPECIFIED", |
| 1: "EXACT_MATCH", |
| 2: "CONTAINS", |
| } |
| SuggestionDenyListEntry_MatchOperator_value = map[string]int32{ |
| "MATCH_OPERATOR_UNSPECIFIED": 0, |
| "EXACT_MATCH": 1, |
| "CONTAINS": 2, |
| } |
| ) |
| |
| func (x SuggestionDenyListEntry_MatchOperator) Enum() *SuggestionDenyListEntry_MatchOperator { |
| p := new(SuggestionDenyListEntry_MatchOperator) |
| *p = x |
| return p |
| } |
| |
| func (x SuggestionDenyListEntry_MatchOperator) String() string { |
| return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) |
| } |
| |
| func (SuggestionDenyListEntry_MatchOperator) Descriptor() protoreflect.EnumDescriptor { |
| return file_google_cloud_discoveryengine_v1_completion_proto_enumTypes[0].Descriptor() |
| } |
| |
| func (SuggestionDenyListEntry_MatchOperator) Type() protoreflect.EnumType { |
| return &file_google_cloud_discoveryengine_v1_completion_proto_enumTypes[0] |
| } |
| |
| func (x SuggestionDenyListEntry_MatchOperator) Number() protoreflect.EnumNumber { |
| return protoreflect.EnumNumber(x) |
| } |
| |
| // Deprecated: Use SuggestionDenyListEntry_MatchOperator.Descriptor instead. |
| func (SuggestionDenyListEntry_MatchOperator) EnumDescriptor() ([]byte, []int) { |
| return file_google_cloud_discoveryengine_v1_completion_proto_rawDescGZIP(), []int{0, 0} |
| } |
| |
| // Suggestion deny list entry identifying the phrase to block from suggestions |
| // and the applied operation for the phrase. |
| type SuggestionDenyListEntry struct { |
| state protoimpl.MessageState `protogen:"open.v1"` |
| // Required. Phrase to block from suggestions served. Can be maximum 125 |
| // characters. |
| BlockPhrase string `protobuf:"bytes,1,opt,name=block_phrase,json=blockPhrase,proto3" json:"block_phrase,omitempty"` |
| // Required. The match operator to apply for this phrase. Whether to block the |
| // exact phrase, or block any suggestions containing this phrase. |
| MatchOperator SuggestionDenyListEntry_MatchOperator `protobuf:"varint,2,opt,name=match_operator,json=matchOperator,proto3,enum=google.cloud.discoveryengine.v1.SuggestionDenyListEntry_MatchOperator" json:"match_operator,omitempty"` |
| unknownFields protoimpl.UnknownFields |
| sizeCache protoimpl.SizeCache |
| } |
| |
| func (x *SuggestionDenyListEntry) Reset() { |
| *x = SuggestionDenyListEntry{} |
| mi := &file_google_cloud_discoveryengine_v1_completion_proto_msgTypes[0] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| |
| func (x *SuggestionDenyListEntry) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*SuggestionDenyListEntry) ProtoMessage() {} |
| |
| func (x *SuggestionDenyListEntry) ProtoReflect() protoreflect.Message { |
| mi := &file_google_cloud_discoveryengine_v1_completion_proto_msgTypes[0] |
| if x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use SuggestionDenyListEntry.ProtoReflect.Descriptor instead. |
| func (*SuggestionDenyListEntry) Descriptor() ([]byte, []int) { |
| return file_google_cloud_discoveryengine_v1_completion_proto_rawDescGZIP(), []int{0} |
| } |
| |
| func (x *SuggestionDenyListEntry) GetBlockPhrase() string { |
| if x != nil { |
| return x.BlockPhrase |
| } |
| return "" |
| } |
| |
| func (x *SuggestionDenyListEntry) GetMatchOperator() SuggestionDenyListEntry_MatchOperator { |
| if x != nil { |
| return x.MatchOperator |
| } |
| return SuggestionDenyListEntry_MATCH_OPERATOR_UNSPECIFIED |
| } |
| |
| // Autocomplete suggestions that are imported from Customer. |
| type CompletionSuggestion struct { |
| state protoimpl.MessageState `protogen:"open.v1"` |
| // Ranking metrics of this suggestion. |
| // |
| // Types that are valid to be assigned to RankingInfo: |
| // |
| // *CompletionSuggestion_GlobalScore |
| // *CompletionSuggestion_Frequency |
| RankingInfo isCompletionSuggestion_RankingInfo `protobuf_oneof:"ranking_info"` |
| // Required. The suggestion text. |
| Suggestion string `protobuf:"bytes,1,opt,name=suggestion,proto3" json:"suggestion,omitempty"` |
| // BCP-47 language code of this suggestion. |
| LanguageCode string `protobuf:"bytes,4,opt,name=language_code,json=languageCode,proto3" json:"language_code,omitempty"` |
| // If two suggestions have the same groupId, they will not be |
| // returned together. Instead the one ranked higher will be returned. This can |
| // be used to deduplicate semantically identical suggestions. |
| GroupId string `protobuf:"bytes,5,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` |
| // The score of this suggestion within its group. |
| GroupScore float64 `protobuf:"fixed64,6,opt,name=group_score,json=groupScore,proto3" json:"group_score,omitempty"` |
| // Alternative matching phrases for this suggestion. |
| AlternativePhrases []string `protobuf:"bytes,7,rep,name=alternative_phrases,json=alternativePhrases,proto3" json:"alternative_phrases,omitempty"` |
| unknownFields protoimpl.UnknownFields |
| sizeCache protoimpl.SizeCache |
| } |
| |
| func (x *CompletionSuggestion) Reset() { |
| *x = CompletionSuggestion{} |
| mi := &file_google_cloud_discoveryengine_v1_completion_proto_msgTypes[1] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| |
| func (x *CompletionSuggestion) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*CompletionSuggestion) ProtoMessage() {} |
| |
| func (x *CompletionSuggestion) ProtoReflect() protoreflect.Message { |
| mi := &file_google_cloud_discoveryengine_v1_completion_proto_msgTypes[1] |
| if x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use CompletionSuggestion.ProtoReflect.Descriptor instead. |
| func (*CompletionSuggestion) Descriptor() ([]byte, []int) { |
| return file_google_cloud_discoveryengine_v1_completion_proto_rawDescGZIP(), []int{1} |
| } |
| |
| func (x *CompletionSuggestion) GetRankingInfo() isCompletionSuggestion_RankingInfo { |
| if x != nil { |
| return x.RankingInfo |
| } |
| return nil |
| } |
| |
| func (x *CompletionSuggestion) GetGlobalScore() float64 { |
| if x != nil { |
| if x, ok := x.RankingInfo.(*CompletionSuggestion_GlobalScore); ok { |
| return x.GlobalScore |
| } |
| } |
| return 0 |
| } |
| |
| func (x *CompletionSuggestion) GetFrequency() int64 { |
| if x != nil { |
| if x, ok := x.RankingInfo.(*CompletionSuggestion_Frequency); ok { |
| return x.Frequency |
| } |
| } |
| return 0 |
| } |
| |
| func (x *CompletionSuggestion) GetSuggestion() string { |
| if x != nil { |
| return x.Suggestion |
| } |
| return "" |
| } |
| |
| func (x *CompletionSuggestion) GetLanguageCode() string { |
| if x != nil { |
| return x.LanguageCode |
| } |
| return "" |
| } |
| |
| func (x *CompletionSuggestion) GetGroupId() string { |
| if x != nil { |
| return x.GroupId |
| } |
| return "" |
| } |
| |
| func (x *CompletionSuggestion) GetGroupScore() float64 { |
| if x != nil { |
| return x.GroupScore |
| } |
| return 0 |
| } |
| |
| func (x *CompletionSuggestion) GetAlternativePhrases() []string { |
| if x != nil { |
| return x.AlternativePhrases |
| } |
| return nil |
| } |
| |
| type isCompletionSuggestion_RankingInfo interface { |
| isCompletionSuggestion_RankingInfo() |
| } |
| |
| type CompletionSuggestion_GlobalScore struct { |
| // Global score of this suggestion. Control how this suggestion would be |
| // scored / ranked. |
| GlobalScore float64 `protobuf:"fixed64,2,opt,name=global_score,json=globalScore,proto3,oneof"` |
| } |
| |
| type CompletionSuggestion_Frequency struct { |
| // Frequency of this suggestion. Will be used to rank suggestions when score |
| // is not available. |
| Frequency int64 `protobuf:"varint,3,opt,name=frequency,proto3,oneof"` |
| } |
| |
| func (*CompletionSuggestion_GlobalScore) isCompletionSuggestion_RankingInfo() {} |
| |
| func (*CompletionSuggestion_Frequency) isCompletionSuggestion_RankingInfo() {} |
| |
| var File_google_cloud_discoveryengine_v1_completion_proto protoreflect.FileDescriptor |
| |
| const file_google_cloud_discoveryengine_v1_completion_proto_rawDesc = "" + |
| "\n" + |
| "0google/cloud/discoveryengine/v1/completion.proto\x12\x1fgoogle.cloud.discoveryengine.v1\x1a\x1fgoogle/api/field_behavior.proto\"\x85\x02\n" + |
| "\x17SuggestionDenyListEntry\x12&\n" + |
| "\fblock_phrase\x18\x01 \x01(\tB\x03\xe0A\x02R\vblockPhrase\x12r\n" + |
| "\x0ematch_operator\x18\x02 \x01(\x0e2F.google.cloud.discoveryengine.v1.SuggestionDenyListEntry.MatchOperatorB\x03\xe0A\x02R\rmatchOperator\"N\n" + |
| "\rMatchOperator\x12\x1e\n" + |
| "\x1aMATCH_OPERATOR_UNSPECIFIED\x10\x00\x12\x0f\n" + |
| "\vEXACT_MATCH\x10\x01\x12\f\n" + |
| "\bCONTAINS\x10\x02\"\xa2\x02\n" + |
| "\x14CompletionSuggestion\x12#\n" + |
| "\fglobal_score\x18\x02 \x01(\x01H\x00R\vglobalScore\x12\x1e\n" + |
| "\tfrequency\x18\x03 \x01(\x03H\x00R\tfrequency\x12#\n" + |
| "\n" + |
| "suggestion\x18\x01 \x01(\tB\x03\xe0A\x02R\n" + |
| "suggestion\x12#\n" + |
| "\rlanguage_code\x18\x04 \x01(\tR\flanguageCode\x12\x19\n" + |
| "\bgroup_id\x18\x05 \x01(\tR\agroupId\x12\x1f\n" + |
| "\vgroup_score\x18\x06 \x01(\x01R\n" + |
| "groupScore\x12/\n" + |
| "\x13alternative_phrases\x18\a \x03(\tR\x12alternativePhrasesB\x0e\n" + |
| "\franking_infoB\x82\x02\n" + |
| "#com.google.cloud.discoveryengine.v1B\x0fCompletionProtoP\x01ZMcloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb\xa2\x02\x0fDISCOVERYENGINE\xaa\x02\x1fGoogle.Cloud.DiscoveryEngine.V1\xca\x02\x1fGoogle\\Cloud\\DiscoveryEngine\\V1\xea\x02\"Google::Cloud::DiscoveryEngine::V1b\x06proto3" |
| |
| var ( |
| file_google_cloud_discoveryengine_v1_completion_proto_rawDescOnce sync.Once |
| file_google_cloud_discoveryengine_v1_completion_proto_rawDescData []byte |
| ) |
| |
| func file_google_cloud_discoveryengine_v1_completion_proto_rawDescGZIP() []byte { |
| file_google_cloud_discoveryengine_v1_completion_proto_rawDescOnce.Do(func() { |
| file_google_cloud_discoveryengine_v1_completion_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_cloud_discoveryengine_v1_completion_proto_rawDesc), len(file_google_cloud_discoveryengine_v1_completion_proto_rawDesc))) |
| }) |
| return file_google_cloud_discoveryengine_v1_completion_proto_rawDescData |
| } |
| |
| var file_google_cloud_discoveryengine_v1_completion_proto_enumTypes = make([]protoimpl.EnumInfo, 1) |
| var file_google_cloud_discoveryengine_v1_completion_proto_msgTypes = make([]protoimpl.MessageInfo, 2) |
| var file_google_cloud_discoveryengine_v1_completion_proto_goTypes = []any{ |
| (SuggestionDenyListEntry_MatchOperator)(0), // 0: google.cloud.discoveryengine.v1.SuggestionDenyListEntry.MatchOperator |
| (*SuggestionDenyListEntry)(nil), // 1: google.cloud.discoveryengine.v1.SuggestionDenyListEntry |
| (*CompletionSuggestion)(nil), // 2: google.cloud.discoveryengine.v1.CompletionSuggestion |
| } |
| var file_google_cloud_discoveryengine_v1_completion_proto_depIdxs = []int32{ |
| 0, // 0: google.cloud.discoveryengine.v1.SuggestionDenyListEntry.match_operator:type_name -> google.cloud.discoveryengine.v1.SuggestionDenyListEntry.MatchOperator |
| 1, // [1:1] is the sub-list for method output_type |
| 1, // [1:1] is the sub-list for method input_type |
| 1, // [1:1] is the sub-list for extension type_name |
| 1, // [1:1] is the sub-list for extension extendee |
| 0, // [0:1] is the sub-list for field type_name |
| } |
| |
| func init() { file_google_cloud_discoveryengine_v1_completion_proto_init() } |
| func file_google_cloud_discoveryengine_v1_completion_proto_init() { |
| if File_google_cloud_discoveryengine_v1_completion_proto != nil { |
| return |
| } |
| file_google_cloud_discoveryengine_v1_completion_proto_msgTypes[1].OneofWrappers = []any{ |
| (*CompletionSuggestion_GlobalScore)(nil), |
| (*CompletionSuggestion_Frequency)(nil), |
| } |
| type x struct{} |
| out := protoimpl.TypeBuilder{ |
| File: protoimpl.DescBuilder{ |
| GoPackagePath: reflect.TypeOf(x{}).PkgPath(), |
| RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_cloud_discoveryengine_v1_completion_proto_rawDesc), len(file_google_cloud_discoveryengine_v1_completion_proto_rawDesc)), |
| NumEnums: 1, |
| NumMessages: 2, |
| NumExtensions: 0, |
| NumServices: 0, |
| }, |
| GoTypes: file_google_cloud_discoveryengine_v1_completion_proto_goTypes, |
| DependencyIndexes: file_google_cloud_discoveryengine_v1_completion_proto_depIdxs, |
| EnumInfos: file_google_cloud_discoveryengine_v1_completion_proto_enumTypes, |
| MessageInfos: file_google_cloud_discoveryengine_v1_completion_proto_msgTypes, |
| }.Build() |
| File_google_cloud_discoveryengine_v1_completion_proto = out.File |
| file_google_cloud_discoveryengine_v1_completion_proto_goTypes = nil |
| file_google_cloud_discoveryengine_v1_completion_proto_depIdxs = nil |
| } |