// Copyright 2021 Fraunhofer AISEC
//
// 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.
//
//           $$\                           $$\ $$\   $$\
//           $$ |                          $$ |\__|  $$ |
//  $$$$$$$\ $$ | $$$$$$\  $$\   $$\  $$$$$$$ |$$\ $$$$$$\    $$$$$$\   $$$$$$\
// $$  _____|$$ |$$  __$$\ $$ |  $$ |$$  __$$ |$$ |\_$$  _|  $$  __$$\ $$  __$$\
// $$ /      $$ |$$ /  $$ |$$ |  $$ |$$ /  $$ |$$ |  $$ |    $$ /  $$ |$$ | \__|
// $$ |      $$ |$$ |  $$ |$$ |  $$ |$$ |  $$ |$$ |  $$ |$$\ $$ |  $$ |$$ |
// \$$$$$$\  $$ |\$$$$$   |\$$$$$   |\$$$$$$  |$$ |  \$$$   |\$$$$$   |$$ |
//  \_______|\__| \______/  \______/  \_______|\__|   \____/  \______/ \__|
//
// This file is part of Clouditor Community Edition.

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.6
// 	protoc        (unknown)
// source: api/assessment/metric.proto

package assessment

import (
	_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
	_ "github.com/srikrsna/protoc-gen-gotag/tagger"
	_ "google.golang.org/genproto/googleapis/api/annotations"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	_ "google.golang.org/protobuf/types/known/durationpb"
	structpb "google.golang.org/protobuf/types/known/structpb"
	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
	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 MetricImplementation_Language int32

const (
	MetricImplementation_LANGUAGE_UNSPECIFIED MetricImplementation_Language = 0
	MetricImplementation_LANGUAGE_REGO        MetricImplementation_Language = 1
)

// Enum value maps for MetricImplementation_Language.
var (
	MetricImplementation_Language_name = map[int32]string{
		0: "LANGUAGE_UNSPECIFIED",
		1: "LANGUAGE_REGO",
	}
	MetricImplementation_Language_value = map[string]int32{
		"LANGUAGE_UNSPECIFIED": 0,
		"LANGUAGE_REGO":        1,
	}
)

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

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

func (MetricImplementation_Language) Descriptor() protoreflect.EnumDescriptor {
	return file_api_assessment_metric_proto_enumTypes[0].Descriptor()
}

func (MetricImplementation_Language) Type() protoreflect.EnumType {
	return &file_api_assessment_metric_proto_enumTypes[0]
}

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

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

// A metric resource
type Metric struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Required. The unique identifier of the metric.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The description of the metric
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// The version of this metric
	Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
	// Optional comments that describe the purpose of this metric. They may also describe a scenario in which the metric can be useful.
	Comments string `protobuf:"bytes,4,opt,name=comments,proto3" json:"comments,omitempty"`
	// Semantically, the reference to control catalog category or domain; it must conform to the directory structure of the security-metrics respository
	Category string `protobuf:"bytes,5,opt,name=category,proto3" json:"category,omitempty"`
	// The implementation of this metric. This ensures that we are modelling an
	// association between a Metric and its MetricImplementation.
	Implementation *MetricImplementation `protobuf:"bytes,6,opt,name=implementation,proto3,oneof" json:"implementation,omitempty"`
	// Optional, but required if the metric is removed. The metric is not deleted
	// for backward compatibility and the timestamp is set to the time of removal.
	DeprecatedSince *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=deprecated_since,json=deprecatedSince,proto3,oneof" json:"deprecated_since,omitempty" gorm:"serializer:timestamppb;type:timestamp"`
	unknownFields   protoimpl.UnknownFields
	sizeCache       protoimpl.SizeCache
}

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

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

func (*Metric) ProtoMessage() {}

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

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

func (x *Metric) GetDescription() string {
	if x != nil {
		return x.Description
	}
	return ""
}

func (x *Metric) GetVersion() string {
	if x != nil {
		return x.Version
	}
	return ""
}

func (x *Metric) GetComments() string {
	if x != nil {
		return x.Comments
	}
	return ""
}

func (x *Metric) GetCategory() string {
	if x != nil {
		return x.Category
	}
	return ""
}

func (x *Metric) GetImplementation() *MetricImplementation {
	if x != nil {
		return x.Implementation
	}
	return nil
}

func (x *Metric) GetDeprecatedSince() *timestamppb.Timestamp {
	if x != nil {
		return x.DeprecatedSince
	}
	return nil
}

// Defines the operator and a target value for an individual metric
type MetricConfiguration struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The operator to compare the metric, such as == or >
	Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"`
	// The target value
	TargetValue *structpb.Value `protobuf:"bytes,2,opt,name=target_value,json=targetValue,proto3" json:"target_value,omitempty" gorm:"serializer:json"`
	// Whether this configuration is a default configuration
	IsDefault bool `protobuf:"varint,3,opt,name=is_default,json=isDefault,proto3" json:"is_default,omitempty"`
	// The last time of update
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty" gorm:"serializer:timestamppb;type:timestamp"`
	// The metric this configuration belongs to
	MetricId string `protobuf:"bytes,5,opt,name=metric_id,json=metricId,proto3" json:"metric_id,omitempty" gorm:"primaryKey"`
	// The target of evaluation this configuration belongs to
	TargetOfEvaluationId string `protobuf:"bytes,6,opt,name=target_of_evaluation_id,json=targetOfEvaluationId,proto3" json:"target_of_evaluation_id,omitempty" gorm:"primaryKey"`
	unknownFields        protoimpl.UnknownFields
	sizeCache            protoimpl.SizeCache
}

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

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

func (*MetricConfiguration) ProtoMessage() {}

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

func (x *MetricConfiguration) GetOperator() string {
	if x != nil {
		return x.Operator
	}
	return ""
}

func (x *MetricConfiguration) GetTargetValue() *structpb.Value {
	if x != nil {
		return x.TargetValue
	}
	return nil
}

func (x *MetricConfiguration) GetIsDefault() bool {
	if x != nil {
		return x.IsDefault
	}
	return false
}

func (x *MetricConfiguration) GetUpdatedAt() *timestamppb.Timestamp {
	if x != nil {
		return x.UpdatedAt
	}
	return nil
}

func (x *MetricConfiguration) GetMetricId() string {
	if x != nil {
		return x.MetricId
	}
	return ""
}

func (x *MetricConfiguration) GetTargetOfEvaluationId() string {
	if x != nil {
		return x.TargetOfEvaluationId
	}
	return ""
}

// MetricImplementation defines the implementation of an individual metric.
type MetricImplementation struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The metric which is implemented
	MetricId string `protobuf:"bytes,1,opt,name=metric_id,json=metricId,proto3" json:"metric_id,omitempty" gorm:"primaryKey"`
	// The language this metric is implemented in
	Lang MetricImplementation_Language `protobuf:"varint,2,opt,name=lang,proto3,enum=clouditor.assessment.v1.MetricImplementation_Language" json:"lang,omitempty"`
	// The actual implementation
	Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"`
	// The last time of update
	UpdatedAt     *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty" gorm:"serializer:timestamppb;type:timestamp"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *MetricImplementation) Reset() {
	*x = MetricImplementation{}
	mi := &file_api_assessment_metric_proto_msgTypes[2]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*MetricImplementation) ProtoMessage() {}

func (x *MetricImplementation) ProtoReflect() protoreflect.Message {
	mi := &file_api_assessment_metric_proto_msgTypes[2]
	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 MetricImplementation.ProtoReflect.Descriptor instead.
func (*MetricImplementation) Descriptor() ([]byte, []int) {
	return file_api_assessment_metric_proto_rawDescGZIP(), []int{2}
}

func (x *MetricImplementation) GetMetricId() string {
	if x != nil {
		return x.MetricId
	}
	return ""
}

func (x *MetricImplementation) GetLang() MetricImplementation_Language {
	if x != nil {
		return x.Lang
	}
	return MetricImplementation_LANGUAGE_UNSPECIFIED
}

func (x *MetricImplementation) GetCode() string {
	if x != nil {
		return x.Code
	}
	return ""
}

func (x *MetricImplementation) GetUpdatedAt() *timestamppb.Timestamp {
	if x != nil {
		return x.UpdatedAt
	}
	return nil
}

var File_api_assessment_metric_proto protoreflect.FileDescriptor

const file_api_assessment_metric_proto_rawDesc = "" +
	"\n" +
	"\x1bapi/assessment/metric.proto\x12\x17clouditor.assessment.v1\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x13tagger/tagger.proto\"\xbf\x03\n" +
	"\x06Metric\x12\x1a\n" +
	"\x02id\x18\x01 \x01(\tB\n" +
	"\xe0A\x02\xbaH\x04r\x02\x10\x01R\x02id\x12,\n" +
	"\vdescription\x18\x02 \x01(\tB\n" +
	"\xe0A\x02\xbaH\x04r\x02\x10\x01R\vdescription\x12$\n" +
	"\aversion\x18\x03 \x01(\tB\n" +
	"\xe0A\x02\xbaH\x04r\x02\x10\x01R\aversion\x12\x1a\n" +
	"\bcomments\x18\x04 \x01(\tR\bcomments\x12&\n" +
	"\bcategory\x18\x05 \x01(\tB\n" +
	"\xe0A\x02\xbaH\x04r\x02\x10\x01R\bcategory\x12Z\n" +
	"\x0eimplementation\x18\x06 \x01(\v2-.clouditor.assessment.v1.MetricImplementationH\x00R\x0eimplementation\x88\x01\x01\x12}\n" +
	"\x10deprecated_since\x18\a \x01(\v2\x1a.google.protobuf.TimestampB1\x9a\x84\x9e\x03,gorm:\"serializer:timestamppb;type:timestamp\"H\x01R\x0fdeprecatedSince\x88\x01\x01B\x11\n" +
	"\x0f_implementationB\x13\n" +
	"\x11_deprecated_since\"\xe4\x03\n" +
	"\x13MetricConfiguration\x12A\n" +
	"\boperator\x18\x01 \x01(\tB%\xe0A\x02\xbaH\x1fr\x1d2\x1b^(<|>|<=|>=|==|isIn|allIn)$R\boperator\x12_\n" +
	"\ftarget_value\x18\x02 \x01(\v2\x16.google.protobuf.ValueB$\xe0A\x02\xbaH\x03\xc8\x01\x01\x9a\x84\x9e\x03\x16gorm:\"serializer:json\"R\vtargetValue\x12\"\n" +
	"\n" +
	"is_default\x18\x03 \x01(\bB\x03\xe0A\x02R\tisDefault\x12l\n" +
	"\n" +
	"updated_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampB1\x9a\x84\x9e\x03,gorm:\"serializer:timestamppb;type:timestamp\"R\tupdatedAt\x12=\n" +
	"\tmetric_id\x18\x05 \x01(\tB \xe0A\x02\xbaH\x04r\x02\x10\x01\x9a\x84\x9e\x03\x11gorm:\"primaryKey\"R\bmetricId\x12X\n" +
	"\x17target_of_evaluation_id\x18\x06 \x01(\tB!\xe0A\x02\xbaH\x05r\x03\xb0\x01\x01\x9a\x84\x9e\x03\x11gorm:\"primaryKey\"R\x14targetOfEvaluationId\"\xf2\x02\n" +
	"\x14MetricImplementation\x12=\n" +
	"\tmetric_id\x18\x01 \x01(\tB \xe0A\x02\xbaH\x04r\x02\x10\x01\x9a\x84\x9e\x03\x11gorm:\"primaryKey\"R\bmetricId\x12T\n" +
	"\x04lang\x18\x02 \x01(\x0e26.clouditor.assessment.v1.MetricImplementation.LanguageB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04lang\x12\x1e\n" +
	"\x04code\x18\x03 \x01(\tB\n" +
	"\xe0A\x02\xbaH\x04r\x02\x10\x01R\x04code\x12l\n" +
	"\n" +
	"updated_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampB1\x9a\x84\x9e\x03,gorm:\"serializer:timestamppb;type:timestamp\"R\tupdatedAt\"7\n" +
	"\bLanguage\x12\x18\n" +
	"\x14LANGUAGE_UNSPECIFIED\x10\x00\x12\x11\n" +
	"\rLANGUAGE_REGO\x10\x01B*Z(clouditor.io/clouditor/v2/api/assessmentb\x06proto3"

var (
	file_api_assessment_metric_proto_rawDescOnce sync.Once
	file_api_assessment_metric_proto_rawDescData []byte
)

func file_api_assessment_metric_proto_rawDescGZIP() []byte {
	file_api_assessment_metric_proto_rawDescOnce.Do(func() {
		file_api_assessment_metric_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_api_assessment_metric_proto_rawDesc), len(file_api_assessment_metric_proto_rawDesc)))
	})
	return file_api_assessment_metric_proto_rawDescData
}

var file_api_assessment_metric_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_api_assessment_metric_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_api_assessment_metric_proto_goTypes = []any{
	(MetricImplementation_Language)(0), // 0: clouditor.assessment.v1.MetricImplementation.Language
	(*Metric)(nil),                     // 1: clouditor.assessment.v1.Metric
	(*MetricConfiguration)(nil),        // 2: clouditor.assessment.v1.MetricConfiguration
	(*MetricImplementation)(nil),       // 3: clouditor.assessment.v1.MetricImplementation
	(*timestamppb.Timestamp)(nil),      // 4: google.protobuf.Timestamp
	(*structpb.Value)(nil),             // 5: google.protobuf.Value
}
var file_api_assessment_metric_proto_depIdxs = []int32{
	3, // 0: clouditor.assessment.v1.Metric.implementation:type_name -> clouditor.assessment.v1.MetricImplementation
	4, // 1: clouditor.assessment.v1.Metric.deprecated_since:type_name -> google.protobuf.Timestamp
	5, // 2: clouditor.assessment.v1.MetricConfiguration.target_value:type_name -> google.protobuf.Value
	4, // 3: clouditor.assessment.v1.MetricConfiguration.updated_at:type_name -> google.protobuf.Timestamp
	0, // 4: clouditor.assessment.v1.MetricImplementation.lang:type_name -> clouditor.assessment.v1.MetricImplementation.Language
	4, // 5: clouditor.assessment.v1.MetricImplementation.updated_at:type_name -> google.protobuf.Timestamp
	6, // [6:6] is the sub-list for method output_type
	6, // [6:6] is the sub-list for method input_type
	6, // [6:6] is the sub-list for extension type_name
	6, // [6:6] is the sub-list for extension extendee
	0, // [0:6] is the sub-list for field type_name
}

func init() { file_api_assessment_metric_proto_init() }
func file_api_assessment_metric_proto_init() {
	if File_api_assessment_metric_proto != nil {
		return
	}
	file_api_assessment_metric_proto_msgTypes[0].OneofWrappers = []any{}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_api_assessment_metric_proto_rawDesc), len(file_api_assessment_metric_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   3,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_api_assessment_metric_proto_goTypes,
		DependencyIndexes: file_api_assessment_metric_proto_depIdxs,
		EnumInfos:         file_api_assessment_metric_proto_enumTypes,
		MessageInfos:      file_api_assessment_metric_proto_msgTypes,
	}.Build()
	File_api_assessment_metric_proto = out.File
	file_api_assessment_metric_proto_goTypes = nil
	file_api_assessment_metric_proto_depIdxs = nil
}
