// 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/retail/v2beta/control.proto

package retailpb

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)
)

// Configures dynamic metadata that can be linked to a
// [ServingConfig][google.cloud.retail.v2beta.ServingConfig] and affect search
// or recommendation results at serving time.
type Control struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The behavior/type of the control
	//
	// A behavior/type must be specified on creation. Type cannot be changed once
	// specified (e.g. A Rule control will always be a Rule control.). An
	// INVALID_ARGUMENT will be returned if either condition is violated.
	//
	// Types that are valid to be assigned to Control:
	//
	//	*Control_FacetSpec
	//	*Control_Rule
	Control isControl_Control `protobuf_oneof:"control"`
	// Immutable. Fully qualified name
	// `projects/*/locations/global/catalogs/*/controls/*`
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Required. The human readable control display name. Used in Retail UI.
	//
	// This field must be a UTF-8 encoded string with a length limit of 128
	// characters. Otherwise, an INVALID_ARGUMENT error is thrown.
	DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
	// Output only. List of [serving
	// config][google.cloud.retail.v2beta.ServingConfig] ids that are associated
	// with this control in the same
	// [Catalog][google.cloud.retail.v2beta.Catalog].
	//
	// Note the association is managed via the
	// [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
	// output only denormalized view.
	AssociatedServingConfigIds []string `protobuf:"bytes,5,rep,name=associated_serving_config_ids,json=associatedServingConfigIds,proto3" json:"associated_serving_config_ids,omitempty"`
	// Required. Immutable. The solution types that the control is used for.
	// Currently we support setting only one type of solution at creation time.
	//
	// Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
	// If no solution type is provided at creation time, will default to
	// [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
	SolutionTypes []SolutionType `protobuf:"varint,6,rep,packed,name=solution_types,json=solutionTypes,proto3,enum=google.cloud.retail.v2beta.SolutionType" json:"solution_types,omitempty"`
	// Specifies the use case for the control.
	// Affects what condition fields can be set.
	// Only settable by search controls.
	// Will default to
	// [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
	// if not specified. Currently only allow one search_solution_use_case per
	// control.
	SearchSolutionUseCase []SearchSolutionUseCase `protobuf:"varint,7,rep,packed,name=search_solution_use_case,json=searchSolutionUseCase,proto3,enum=google.cloud.retail.v2beta.SearchSolutionUseCase" json:"search_solution_use_case,omitempty"`
	unknownFields         protoimpl.UnknownFields
	sizeCache             protoimpl.SizeCache
}

func (x *Control) Reset() {
	*x = Control{}
	mi := &file_google_cloud_retail_v2beta_control_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *Control) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*Control) ProtoMessage() {}

func (x *Control) ProtoReflect() protoreflect.Message {
	mi := &file_google_cloud_retail_v2beta_control_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 Control.ProtoReflect.Descriptor instead.
func (*Control) Descriptor() ([]byte, []int) {
	return file_google_cloud_retail_v2beta_control_proto_rawDescGZIP(), []int{0}
}

func (x *Control) GetControl() isControl_Control {
	if x != nil {
		return x.Control
	}
	return nil
}

// Deprecated: Marked as deprecated in google/cloud/retail/v2beta/control.proto.
func (x *Control) GetFacetSpec() *SearchRequest_FacetSpec {
	if x != nil {
		if x, ok := x.Control.(*Control_FacetSpec); ok {
			return x.FacetSpec
		}
	}
	return nil
}

func (x *Control) GetRule() *Rule {
	if x != nil {
		if x, ok := x.Control.(*Control_Rule); ok {
			return x.Rule
		}
	}
	return nil
}

func (x *Control) GetName() string {
	if x != nil {
		return x.Name
	}
	return ""
}

func (x *Control) GetDisplayName() string {
	if x != nil {
		return x.DisplayName
	}
	return ""
}

func (x *Control) GetAssociatedServingConfigIds() []string {
	if x != nil {
		return x.AssociatedServingConfigIds
	}
	return nil
}

func (x *Control) GetSolutionTypes() []SolutionType {
	if x != nil {
		return x.SolutionTypes
	}
	return nil
}

func (x *Control) GetSearchSolutionUseCase() []SearchSolutionUseCase {
	if x != nil {
		return x.SearchSolutionUseCase
	}
	return nil
}

type isControl_Control interface {
	isControl_Control()
}

type Control_FacetSpec struct {
	// A facet specification to perform faceted search.
	//
	// Note that this field is deprecated and will throw NOT_IMPLEMENTED if
	// used for creating a control.
	//
	// Deprecated: Marked as deprecated in google/cloud/retail/v2beta/control.proto.
	FacetSpec *SearchRequest_FacetSpec `protobuf:"bytes,3,opt,name=facet_spec,json=facetSpec,proto3,oneof"`
}

type Control_Rule struct {
	// A rule control - a condition-action pair.
	// Enacts a set action when the condition is triggered.
	// For example: Boost "gShoe" when query full matches "Running Shoes".
	Rule *Rule `protobuf:"bytes,4,opt,name=rule,proto3,oneof"`
}

func (*Control_FacetSpec) isControl_Control() {}

func (*Control_Rule) isControl_Control() {}

var File_google_cloud_retail_v2beta_control_proto protoreflect.FileDescriptor

const file_google_cloud_retail_v2beta_control_proto_rawDesc = "" +
	"\n" +
	"(google/cloud/retail/v2beta/control.proto\x12\x1agoogle.cloud.retail.v2beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a'google/cloud/retail/v2beta/common.proto\x1a/google/cloud/retail/v2beta/search_service.proto\"\xe7\x04\n" +
	"\aControl\x12X\n" +
	"\n" +
	"facet_spec\x18\x03 \x01(\v23.google.cloud.retail.v2beta.SearchRequest.FacetSpecB\x02\x18\x01H\x00R\tfacetSpec\x126\n" +
	"\x04rule\x18\x04 \x01(\v2 .google.cloud.retail.v2beta.RuleH\x00R\x04rule\x12\x17\n" +
	"\x04name\x18\x01 \x01(\tB\x03\xe0A\x05R\x04name\x12&\n" +
	"\fdisplay_name\x18\x02 \x01(\tB\x03\xe0A\x02R\vdisplayName\x12F\n" +
	"\x1dassociated_serving_config_ids\x18\x05 \x03(\tB\x03\xe0A\x03R\x1aassociatedServingConfigIds\x12W\n" +
	"\x0esolution_types\x18\x06 \x03(\x0e2(.google.cloud.retail.v2beta.SolutionTypeB\x06\xe0A\x02\xe0A\x05R\rsolutionTypes\x12j\n" +
	"\x18search_solution_use_case\x18\a \x03(\x0e21.google.cloud.retail.v2beta.SearchSolutionUseCaseR\x15searchSolutionUseCase:q\xeaAn\n" +
	"\x1dretail.googleapis.com/Control\x12Mprojects/{project}/locations/{location}/catalogs/{catalog}/controls/{control}B\t\n" +
	"\acontrolB\xcb\x01\n" +
	"\x1ecom.google.cloud.retail.v2betaB\fControlProtoP\x01Z6cloud.google.com/go/retail/apiv2beta/retailpb;retailpb\xa2\x02\x06RETAIL\xaa\x02\x1aGoogle.Cloud.Retail.V2Beta\xca\x02\x1aGoogle\\Cloud\\Retail\\V2beta\xea\x02\x1dGoogle::Cloud::Retail::V2betab\x06proto3"

var (
	file_google_cloud_retail_v2beta_control_proto_rawDescOnce sync.Once
	file_google_cloud_retail_v2beta_control_proto_rawDescData []byte
)

func file_google_cloud_retail_v2beta_control_proto_rawDescGZIP() []byte {
	file_google_cloud_retail_v2beta_control_proto_rawDescOnce.Do(func() {
		file_google_cloud_retail_v2beta_control_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_google_cloud_retail_v2beta_control_proto_rawDesc), len(file_google_cloud_retail_v2beta_control_proto_rawDesc)))
	})
	return file_google_cloud_retail_v2beta_control_proto_rawDescData
}

var file_google_cloud_retail_v2beta_control_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_google_cloud_retail_v2beta_control_proto_goTypes = []any{
	(*Control)(nil),                 // 0: google.cloud.retail.v2beta.Control
	(*SearchRequest_FacetSpec)(nil), // 1: google.cloud.retail.v2beta.SearchRequest.FacetSpec
	(*Rule)(nil),                    // 2: google.cloud.retail.v2beta.Rule
	(SolutionType)(0),               // 3: google.cloud.retail.v2beta.SolutionType
	(SearchSolutionUseCase)(0),      // 4: google.cloud.retail.v2beta.SearchSolutionUseCase
}
var file_google_cloud_retail_v2beta_control_proto_depIdxs = []int32{
	1, // 0: google.cloud.retail.v2beta.Control.facet_spec:type_name -> google.cloud.retail.v2beta.SearchRequest.FacetSpec
	2, // 1: google.cloud.retail.v2beta.Control.rule:type_name -> google.cloud.retail.v2beta.Rule
	3, // 2: google.cloud.retail.v2beta.Control.solution_types:type_name -> google.cloud.retail.v2beta.SolutionType
	4, // 3: google.cloud.retail.v2beta.Control.search_solution_use_case:type_name -> google.cloud.retail.v2beta.SearchSolutionUseCase
	4, // [4:4] is the sub-list for method output_type
	4, // [4:4] is the sub-list for method input_type
	4, // [4:4] is the sub-list for extension type_name
	4, // [4:4] is the sub-list for extension extendee
	0, // [0:4] is the sub-list for field type_name
}

func init() { file_google_cloud_retail_v2beta_control_proto_init() }
func file_google_cloud_retail_v2beta_control_proto_init() {
	if File_google_cloud_retail_v2beta_control_proto != nil {
		return
	}
	file_google_cloud_retail_v2beta_common_proto_init()
	file_google_cloud_retail_v2beta_search_service_proto_init()
	file_google_cloud_retail_v2beta_control_proto_msgTypes[0].OneofWrappers = []any{
		(*Control_FacetSpec)(nil),
		(*Control_Rule)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_cloud_retail_v2beta_control_proto_rawDesc), len(file_google_cloud_retail_v2beta_control_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   1,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_google_cloud_retail_v2beta_control_proto_goTypes,
		DependencyIndexes: file_google_cloud_retail_v2beta_control_proto_depIdxs,
		MessageInfos:      file_google_cloud_retail_v2beta_control_proto_msgTypes,
	}.Build()
	File_google_cloud_retail_v2beta_control_proto = out.File
	file_google_cloud_retail_v2beta_control_proto_goTypes = nil
	file_google_cloud_retail_v2beta_control_proto_depIdxs = nil
}
