// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.6
// 	protoc        v3.19.0
// source: external/iam/v2/common/rules.proto

package common

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

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

type RuleType int32

const (
	RuleType_RULE_TYPE_UNSET RuleType = 0
	RuleType_NODE            RuleType = 1
	RuleType_EVENT           RuleType = 2
)

// Enum value maps for RuleType.
var (
	RuleType_name = map[int32]string{
		0: "RULE_TYPE_UNSET",
		1: "NODE",
		2: "EVENT",
	}
	RuleType_value = map[string]int32{
		"RULE_TYPE_UNSET": 0,
		"NODE":            1,
		"EVENT":           2,
	}
)

func (x RuleType) Enum() *RuleType {
	p := new(RuleType)
	*p = x
	return p
}

func (x RuleType) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (RuleType) Descriptor() protoreflect.EnumDescriptor {
	return file_external_iam_v2_common_rules_proto_enumTypes[0].Descriptor()
}

func (RuleType) Type() protoreflect.EnumType {
	return &file_external_iam_v2_common_rules_proto_enumTypes[0]
}

func (x RuleType) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use RuleType.Descriptor instead.
func (RuleType) EnumDescriptor() ([]byte, []int) {
	return file_external_iam_v2_common_rules_proto_rawDescGZIP(), []int{0}
}

type ConditionAttribute int32

const (
	ConditionAttribute_CONDITION_ATTRIBUTE_UNSET ConditionAttribute = 0
	ConditionAttribute_CHEF_SERVER               ConditionAttribute = 1
	ConditionAttribute_CHEF_ORGANIZATION         ConditionAttribute = 2
	ConditionAttribute_ENVIRONMENT               ConditionAttribute = 3
	ConditionAttribute_CHEF_ROLE                 ConditionAttribute = 4
	ConditionAttribute_CHEF_TAG                  ConditionAttribute = 5
	ConditionAttribute_CHEF_POLICY_GROUP         ConditionAttribute = 6
	ConditionAttribute_CHEF_POLICY_NAME          ConditionAttribute = 7
)

// Enum value maps for ConditionAttribute.
var (
	ConditionAttribute_name = map[int32]string{
		0: "CONDITION_ATTRIBUTE_UNSET",
		1: "CHEF_SERVER",
		2: "CHEF_ORGANIZATION",
		3: "ENVIRONMENT",
		4: "CHEF_ROLE",
		5: "CHEF_TAG",
		6: "CHEF_POLICY_GROUP",
		7: "CHEF_POLICY_NAME",
	}
	ConditionAttribute_value = map[string]int32{
		"CONDITION_ATTRIBUTE_UNSET": 0,
		"CHEF_SERVER":               1,
		"CHEF_ORGANIZATION":         2,
		"ENVIRONMENT":               3,
		"CHEF_ROLE":                 4,
		"CHEF_TAG":                  5,
		"CHEF_POLICY_GROUP":         6,
		"CHEF_POLICY_NAME":          7,
	}
)

func (x ConditionAttribute) Enum() *ConditionAttribute {
	p := new(ConditionAttribute)
	*p = x
	return p
}

func (x ConditionAttribute) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (ConditionAttribute) Descriptor() protoreflect.EnumDescriptor {
	return file_external_iam_v2_common_rules_proto_enumTypes[1].Descriptor()
}

func (ConditionAttribute) Type() protoreflect.EnumType {
	return &file_external_iam_v2_common_rules_proto_enumTypes[1]
}

func (x ConditionAttribute) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use ConditionAttribute.Descriptor instead.
func (ConditionAttribute) EnumDescriptor() ([]byte, []int) {
	return file_external_iam_v2_common_rules_proto_rawDescGZIP(), []int{1}
}

type ConditionOperator int32

const (
	ConditionOperator_CONDITION_OPERATOR_UNSET ConditionOperator = 0
	ConditionOperator_MEMBER_OF                ConditionOperator = 1
	ConditionOperator_EQUALS                   ConditionOperator = 2
)

// Enum value maps for ConditionOperator.
var (
	ConditionOperator_name = map[int32]string{
		0: "CONDITION_OPERATOR_UNSET",
		1: "MEMBER_OF",
		2: "EQUALS",
	}
	ConditionOperator_value = map[string]int32{
		"CONDITION_OPERATOR_UNSET": 0,
		"MEMBER_OF":                1,
		"EQUALS":                   2,
	}
)

func (x ConditionOperator) Enum() *ConditionOperator {
	p := new(ConditionOperator)
	*p = x
	return p
}

func (x ConditionOperator) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (ConditionOperator) Descriptor() protoreflect.EnumDescriptor {
	return file_external_iam_v2_common_rules_proto_enumTypes[2].Descriptor()
}

func (ConditionOperator) Type() protoreflect.EnumType {
	return &file_external_iam_v2_common_rules_proto_enumTypes[2]
}

func (x ConditionOperator) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use ConditionOperator.Descriptor instead.
func (ConditionOperator) EnumDescriptor() ([]byte, []int) {
	return file_external_iam_v2_common_rules_proto_rawDescGZIP(), []int{2}
}

type RuleStatus int32

const (
	RuleStatus_RULE_STATUS_UNSET RuleStatus = 0
	RuleStatus_STAGED            RuleStatus = 1
	RuleStatus_APPLIED           RuleStatus = 2
)

// Enum value maps for RuleStatus.
var (
	RuleStatus_name = map[int32]string{
		0: "RULE_STATUS_UNSET",
		1: "STAGED",
		2: "APPLIED",
	}
	RuleStatus_value = map[string]int32{
		"RULE_STATUS_UNSET": 0,
		"STAGED":            1,
		"APPLIED":           2,
	}
)

func (x RuleStatus) Enum() *RuleStatus {
	p := new(RuleStatus)
	*p = x
	return p
}

func (x RuleStatus) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (RuleStatus) Descriptor() protoreflect.EnumDescriptor {
	return file_external_iam_v2_common_rules_proto_enumTypes[3].Descriptor()
}

func (RuleStatus) Type() protoreflect.EnumType {
	return &file_external_iam_v2_common_rules_proto_enumTypes[3]
}

func (x RuleStatus) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use RuleStatus.Descriptor instead.
func (RuleStatus) EnumDescriptor() ([]byte, []int) {
	return file_external_iam_v2_common_rules_proto_rawDescGZIP(), []int{3}
}

type ProjectRulesStatus int32

const (
	ProjectRulesStatus_PROJECT_RULES_STATUS_UNSET ProjectRulesStatus = 0
	ProjectRulesStatus_RULES_APPLIED              ProjectRulesStatus = 1
	ProjectRulesStatus_EDITS_PENDING              ProjectRulesStatus = 2
	ProjectRulesStatus_NO_RULES                   ProjectRulesStatus = 3
)

// Enum value maps for ProjectRulesStatus.
var (
	ProjectRulesStatus_name = map[int32]string{
		0: "PROJECT_RULES_STATUS_UNSET",
		1: "RULES_APPLIED",
		2: "EDITS_PENDING",
		3: "NO_RULES",
	}
	ProjectRulesStatus_value = map[string]int32{
		"PROJECT_RULES_STATUS_UNSET": 0,
		"RULES_APPLIED":              1,
		"EDITS_PENDING":              2,
		"NO_RULES":                   3,
	}
)

func (x ProjectRulesStatus) Enum() *ProjectRulesStatus {
	p := new(ProjectRulesStatus)
	*p = x
	return p
}

func (x ProjectRulesStatus) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (ProjectRulesStatus) Descriptor() protoreflect.EnumDescriptor {
	return file_external_iam_v2_common_rules_proto_enumTypes[4].Descriptor()
}

func (ProjectRulesStatus) Type() protoreflect.EnumType {
	return &file_external_iam_v2_common_rules_proto_enumTypes[4]
}

func (x ProjectRulesStatus) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use ProjectRulesStatus.Descriptor instead.
func (ProjectRulesStatus) EnumDescriptor() ([]byte, []int) {
	return file_external_iam_v2_common_rules_proto_rawDescGZIP(), []int{4}
}

type Rule struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Unique ID. Cannot be changed.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Unique ID of the project this rule belongs to. Cannot be changed.
	ProjectId string `protobuf:"bytes,2,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"`
	// Name for the project rule.
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	// Whether the rule applies to ingested `NODE` or `EVENT resources.
	// Cannot be changed.
	Type RuleType `protobuf:"varint,4,opt,name=type,proto3,enum=chef.automate.api.iam.v2.RuleType" json:"type,omitempty"`
	// Conditions that ingested resources must match to belong to the project.
	// Will contain one or more.
	Conditions []*Condition `protobuf:"bytes,5,rep,name=conditions,proto3" json:"conditions,omitempty"`
	// Whether the rule is `STAGED` (not in effect) or `APPLIED` (in effect).
	Status        RuleStatus `protobuf:"varint,6,opt,name=status,proto3,enum=chef.automate.api.iam.v2.RuleStatus" json:"status,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*Rule) ProtoMessage() {}

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

func (x *Rule) GetId() string {
	if x != nil {
		return x.Id
	}
	return ""
}

func (x *Rule) GetProjectId() string {
	if x != nil {
		return x.ProjectId
	}
	return ""
}

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

func (x *Rule) GetType() RuleType {
	if x != nil {
		return x.Type
	}
	return RuleType_RULE_TYPE_UNSET
}

func (x *Rule) GetConditions() []*Condition {
	if x != nil {
		return x.Conditions
	}
	return nil
}

func (x *Rule) GetStatus() RuleStatus {
	if x != nil {
		return x.Status
	}
	return RuleStatus_RULE_STATUS_UNSET
}

type Condition struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Represents a property of an ingested resource. Depends on the rule type.
	Attribute ConditionAttribute `protobuf:"varint,1,opt,name=attribute,proto3,enum=chef.automate.api.iam.v2.ConditionAttribute" json:"attribute,omitempty"`
	// The value(s) of the attribute that an ingested resource must match.
	Values []string `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"`
	// Whether the attribute matches a single value (`EQUALS`) or
	// matches at least one of a set of values (`MEMBER_OF`).
	Operator      ConditionOperator `protobuf:"varint,3,opt,name=operator,proto3,enum=chef.automate.api.iam.v2.ConditionOperator" json:"operator,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *Condition) Reset() {
	*x = Condition{}
	mi := &file_external_iam_v2_common_rules_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*Condition) ProtoMessage() {}

func (x *Condition) ProtoReflect() protoreflect.Message {
	mi := &file_external_iam_v2_common_rules_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 Condition.ProtoReflect.Descriptor instead.
func (*Condition) Descriptor() ([]byte, []int) {
	return file_external_iam_v2_common_rules_proto_rawDescGZIP(), []int{1}
}

func (x *Condition) GetAttribute() ConditionAttribute {
	if x != nil {
		return x.Attribute
	}
	return ConditionAttribute_CONDITION_ATTRIBUTE_UNSET
}

func (x *Condition) GetValues() []string {
	if x != nil {
		return x.Values
	}
	return nil
}

func (x *Condition) GetOperator() ConditionOperator {
	if x != nil {
		return x.Operator
	}
	return ConditionOperator_CONDITION_OPERATOR_UNSET
}

var File_external_iam_v2_common_rules_proto protoreflect.FileDescriptor

const file_external_iam_v2_common_rules_proto_rawDesc = "" +
	"\n" +
	"\"external/iam/v2/common/rules.proto\x12\x18chef.automate.api.iam.v2\"\x84\x02\n" +
	"\x04Rule\x12\x0e\n" +
	"\x02id\x18\x01 \x01(\tR\x02id\x12\x1d\n" +
	"\n" +
	"project_id\x18\x02 \x01(\tR\tprojectId\x12\x12\n" +
	"\x04name\x18\x03 \x01(\tR\x04name\x126\n" +
	"\x04type\x18\x04 \x01(\x0e2\".chef.automate.api.iam.v2.RuleTypeR\x04type\x12C\n" +
	"\n" +
	"conditions\x18\x05 \x03(\v2#.chef.automate.api.iam.v2.ConditionR\n" +
	"conditions\x12<\n" +
	"\x06status\x18\x06 \x01(\x0e2$.chef.automate.api.iam.v2.RuleStatusR\x06status\"\xb8\x01\n" +
	"\tCondition\x12J\n" +
	"\tattribute\x18\x01 \x01(\x0e2,.chef.automate.api.iam.v2.ConditionAttributeR\tattribute\x12\x16\n" +
	"\x06values\x18\x02 \x03(\tR\x06values\x12G\n" +
	"\boperator\x18\x03 \x01(\x0e2+.chef.automate.api.iam.v2.ConditionOperatorR\boperator*4\n" +
	"\bRuleType\x12\x13\n" +
	"\x0fRULE_TYPE_UNSET\x10\x00\x12\b\n" +
	"\x04NODE\x10\x01\x12\t\n" +
	"\x05EVENT\x10\x02*\xb6\x01\n" +
	"\x12ConditionAttribute\x12\x1d\n" +
	"\x19CONDITION_ATTRIBUTE_UNSET\x10\x00\x12\x0f\n" +
	"\vCHEF_SERVER\x10\x01\x12\x15\n" +
	"\x11CHEF_ORGANIZATION\x10\x02\x12\x0f\n" +
	"\vENVIRONMENT\x10\x03\x12\r\n" +
	"\tCHEF_ROLE\x10\x04\x12\f\n" +
	"\bCHEF_TAG\x10\x05\x12\x15\n" +
	"\x11CHEF_POLICY_GROUP\x10\x06\x12\x14\n" +
	"\x10CHEF_POLICY_NAME\x10\a*L\n" +
	"\x11ConditionOperator\x12\x1c\n" +
	"\x18CONDITION_OPERATOR_UNSET\x10\x00\x12\r\n" +
	"\tMEMBER_OF\x10\x01\x12\n" +
	"\n" +
	"\x06EQUALS\x10\x02*<\n" +
	"\n" +
	"RuleStatus\x12\x15\n" +
	"\x11RULE_STATUS_UNSET\x10\x00\x12\n" +
	"\n" +
	"\x06STAGED\x10\x01\x12\v\n" +
	"\aAPPLIED\x10\x02*h\n" +
	"\x12ProjectRulesStatus\x12\x1e\n" +
	"\x1aPROJECT_RULES_STATUS_UNSET\x10\x00\x12\x11\n" +
	"\rRULES_APPLIED\x10\x01\x12\x11\n" +
	"\rEDITS_PENDING\x10\x02\x12\f\n" +
	"\bNO_RULES\x10\x03B5Z3github.com/chef/automate/api/external/iam/v2/commonb\x06proto3"

var (
	file_external_iam_v2_common_rules_proto_rawDescOnce sync.Once
	file_external_iam_v2_common_rules_proto_rawDescData []byte
)

func file_external_iam_v2_common_rules_proto_rawDescGZIP() []byte {
	file_external_iam_v2_common_rules_proto_rawDescOnce.Do(func() {
		file_external_iam_v2_common_rules_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_external_iam_v2_common_rules_proto_rawDesc), len(file_external_iam_v2_common_rules_proto_rawDesc)))
	})
	return file_external_iam_v2_common_rules_proto_rawDescData
}

var file_external_iam_v2_common_rules_proto_enumTypes = make([]protoimpl.EnumInfo, 5)
var file_external_iam_v2_common_rules_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_external_iam_v2_common_rules_proto_goTypes = []any{
	(RuleType)(0),           // 0: chef.automate.api.iam.v2.RuleType
	(ConditionAttribute)(0), // 1: chef.automate.api.iam.v2.ConditionAttribute
	(ConditionOperator)(0),  // 2: chef.automate.api.iam.v2.ConditionOperator
	(RuleStatus)(0),         // 3: chef.automate.api.iam.v2.RuleStatus
	(ProjectRulesStatus)(0), // 4: chef.automate.api.iam.v2.ProjectRulesStatus
	(*Rule)(nil),            // 5: chef.automate.api.iam.v2.Rule
	(*Condition)(nil),       // 6: chef.automate.api.iam.v2.Condition
}
var file_external_iam_v2_common_rules_proto_depIdxs = []int32{
	0, // 0: chef.automate.api.iam.v2.Rule.type:type_name -> chef.automate.api.iam.v2.RuleType
	6, // 1: chef.automate.api.iam.v2.Rule.conditions:type_name -> chef.automate.api.iam.v2.Condition
	3, // 2: chef.automate.api.iam.v2.Rule.status:type_name -> chef.automate.api.iam.v2.RuleStatus
	1, // 3: chef.automate.api.iam.v2.Condition.attribute:type_name -> chef.automate.api.iam.v2.ConditionAttribute
	2, // 4: chef.automate.api.iam.v2.Condition.operator:type_name -> chef.automate.api.iam.v2.ConditionOperator
	5, // [5:5] is the sub-list for method output_type
	5, // [5:5] is the sub-list for method input_type
	5, // [5:5] is the sub-list for extension type_name
	5, // [5:5] is the sub-list for extension extendee
	0, // [0:5] is the sub-list for field type_name
}

func init() { file_external_iam_v2_common_rules_proto_init() }
func file_external_iam_v2_common_rules_proto_init() {
	if File_external_iam_v2_common_rules_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_external_iam_v2_common_rules_proto_rawDesc), len(file_external_iam_v2_common_rules_proto_rawDesc)),
			NumEnums:      5,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_external_iam_v2_common_rules_proto_goTypes,
		DependencyIndexes: file_external_iam_v2_common_rules_proto_depIdxs,
		EnumInfos:         file_external_iam_v2_common_rules_proto_enumTypes,
		MessageInfos:      file_external_iam_v2_common_rules_proto_msgTypes,
	}.Build()
	File_external_iam_v2_common_rules_proto = out.File
	file_external_iam_v2_common_rules_proto_goTypes = nil
	file_external_iam_v2_common_rules_proto_depIdxs = nil
}
