// Canonical machine-readable error reasons for TARS.
//
// Every TARS error carries a `google.rpc.ErrorInfo.reason` string in
// SCREAMING_SNAKE_CASE. On the gRPC/Connect surface the reason rides in the
// `details` of `google.rpc.Status`; on the REST surface the response-shaping
// filter projects it into the `reason` member of the RFC 7807 `Problem`
// envelope (see api/tars/common/v1/types.proto).
//
// This file is the closed registry of those reason strings. It is the
// counterpart of IA's `api/ia/errors/v1/reasons.proto`. The enum exists so the
// set is enumerable and append-only; the *wire* value is the bare reason name
// with the `ERROR_REASON_` prefix stripped -- e.g. enum value
// `ERROR_REASON_MODEL_NOT_FOUND` corresponds to the wire reason
// `MODEL_NOT_FOUND`. The canonical bare strings are mirrored as Go constants in
// `svc/internal/apierr`, which services and the default-reason interceptor use
// directly.
//
// Adding a reason is a backward-compatible change: append a new enum value with
// the next number. Removing or renumbering a value is breaking.

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        (unknown)
// source: tars/errors/v1/reasons.proto

package errorsv1

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

// ErrorReason enumerates the closed set of machine-readable reasons TARS emits.
//
// The wire reason (what lands in `ErrorInfo.reason` / `Problem.reason`) is the
// value name with the `ERROR_REASON_` prefix removed.
type ErrorReason int32

const (
	// Default / unset. Maps to the wire reason `UNKNOWN`. Used when no more
	// specific reason applies and the error code is itself non-specific.
	ErrorReason_ERROR_REASON_UNSPECIFIED ErrorReason = 0
	// The request was malformed or carried an invalid argument. Pairs with
	// connect code `invalid_argument`. Wire reason `INVALID_ARGUMENT`.
	ErrorReason_ERROR_REASON_INVALID_ARGUMENT ErrorReason = 1
	// The caller is not authenticated. Pairs with connect code
	// `unauthenticated`. Wire reason `UNAUTHENTICATED`.
	ErrorReason_ERROR_REASON_UNAUTHENTICATED ErrorReason = 2
	// The caller is authenticated but not authorized for this operation. Pairs
	// with connect code `permission_denied`. Wire reason `PERMISSION_DENIED`.
	ErrorReason_ERROR_REASON_PERMISSION_DENIED ErrorReason = 3
	// The requested resource does not exist. Pairs with connect code
	// `not_found`. Wire reason `NOT_FOUND`.
	ErrorReason_ERROR_REASON_NOT_FOUND ErrorReason = 4
	// The resource the caller tried to create already exists. Pairs with connect
	// code `already_exists`. Wire reason `ALREADY_EXISTS`.
	ErrorReason_ERROR_REASON_ALREADY_EXISTS ErrorReason = 5
	// The system is not in the required state for the operation. Pairs with
	// connect code `failed_precondition`. Wire reason `FAILED_PRECONDITION`.
	ErrorReason_ERROR_REASON_FAILED_PRECONDITION ErrorReason = 6
	// An unexpected internal error occurred. Pairs with connect code `internal`.
	// Wire reason `INTERNAL`.
	ErrorReason_ERROR_REASON_INTERNAL ErrorReason = 7
	// The service is currently unavailable; the caller may retry. Pairs with
	// connect code `unavailable`. Wire reason `UNAVAILABLE`.
	ErrorReason_ERROR_REASON_UNAVAILABLE ErrorReason = 8
	// The requested model selector matched no catalog model. Wire reason
	// `MODEL_NOT_FOUND`.
	ErrorReason_ERROR_REASON_MODEL_NOT_FOUND ErrorReason = 100
	// A bare model name matched models under more than one provider; the caller
	// must qualify it as `provider/model`. Wire reason `MODEL_AMBIGUOUS`.
	ErrorReason_ERROR_REASON_MODEL_AMBIGUOUS ErrorReason = 101
	// The named catalog provider does not exist. Wire reason
	// `PROVIDER_NOT_FOUND`.
	ErrorReason_ERROR_REASON_PROVIDER_NOT_FOUND ErrorReason = 102
	// The caller attempted to act on a (customer, project) tuple they are not a
	// member of. Wire reason `CROSS_TENANT_DENIED`.
	ErrorReason_ERROR_REASON_CROSS_TENANT_DENIED ErrorReason = 103
	// The caller omitted a required tenancy field (customer_id / project_id) and
	// no session default could be resolved from their memberships. Wire reason
	// `SESSION_DEFAULT_UNRESOLVED`.
	ErrorReason_ERROR_REASON_SESSION_DEFAULT_UNRESOLVED ErrorReason = 104
)

// Enum value maps for ErrorReason.
var (
	ErrorReason_name = map[int32]string{
		0:   "ERROR_REASON_UNSPECIFIED",
		1:   "ERROR_REASON_INVALID_ARGUMENT",
		2:   "ERROR_REASON_UNAUTHENTICATED",
		3:   "ERROR_REASON_PERMISSION_DENIED",
		4:   "ERROR_REASON_NOT_FOUND",
		5:   "ERROR_REASON_ALREADY_EXISTS",
		6:   "ERROR_REASON_FAILED_PRECONDITION",
		7:   "ERROR_REASON_INTERNAL",
		8:   "ERROR_REASON_UNAVAILABLE",
		100: "ERROR_REASON_MODEL_NOT_FOUND",
		101: "ERROR_REASON_MODEL_AMBIGUOUS",
		102: "ERROR_REASON_PROVIDER_NOT_FOUND",
		103: "ERROR_REASON_CROSS_TENANT_DENIED",
		104: "ERROR_REASON_SESSION_DEFAULT_UNRESOLVED",
	}
	ErrorReason_value = map[string]int32{
		"ERROR_REASON_UNSPECIFIED":                0,
		"ERROR_REASON_INVALID_ARGUMENT":           1,
		"ERROR_REASON_UNAUTHENTICATED":            2,
		"ERROR_REASON_PERMISSION_DENIED":          3,
		"ERROR_REASON_NOT_FOUND":                  4,
		"ERROR_REASON_ALREADY_EXISTS":             5,
		"ERROR_REASON_FAILED_PRECONDITION":        6,
		"ERROR_REASON_INTERNAL":                   7,
		"ERROR_REASON_UNAVAILABLE":                8,
		"ERROR_REASON_MODEL_NOT_FOUND":            100,
		"ERROR_REASON_MODEL_AMBIGUOUS":            101,
		"ERROR_REASON_PROVIDER_NOT_FOUND":         102,
		"ERROR_REASON_CROSS_TENANT_DENIED":        103,
		"ERROR_REASON_SESSION_DEFAULT_UNRESOLVED": 104,
	}
)

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

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

func (ErrorReason) Descriptor() protoreflect.EnumDescriptor {
	return file_tars_errors_v1_reasons_proto_enumTypes[0].Descriptor()
}

func (ErrorReason) Type() protoreflect.EnumType {
	return &file_tars_errors_v1_reasons_proto_enumTypes[0]
}

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

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

var File_tars_errors_v1_reasons_proto protoreflect.FileDescriptor

const file_tars_errors_v1_reasons_proto_rawDesc = "" +
	"\n" +
	"\x1ctars/errors/v1/reasons.proto\x12\x0etars.errors.v1*\xec\x03\n" +
	"\vErrorReason\x12\x1c\n" +
	"\x18ERROR_REASON_UNSPECIFIED\x10\x00\x12!\n" +
	"\x1dERROR_REASON_INVALID_ARGUMENT\x10\x01\x12 \n" +
	"\x1cERROR_REASON_UNAUTHENTICATED\x10\x02\x12\"\n" +
	"\x1eERROR_REASON_PERMISSION_DENIED\x10\x03\x12\x1a\n" +
	"\x16ERROR_REASON_NOT_FOUND\x10\x04\x12\x1f\n" +
	"\x1bERROR_REASON_ALREADY_EXISTS\x10\x05\x12$\n" +
	" ERROR_REASON_FAILED_PRECONDITION\x10\x06\x12\x19\n" +
	"\x15ERROR_REASON_INTERNAL\x10\a\x12\x1c\n" +
	"\x18ERROR_REASON_UNAVAILABLE\x10\b\x12 \n" +
	"\x1cERROR_REASON_MODEL_NOT_FOUND\x10d\x12 \n" +
	"\x1cERROR_REASON_MODEL_AMBIGUOUS\x10e\x12#\n" +
	"\x1fERROR_REASON_PROVIDER_NOT_FOUND\x10f\x12$\n" +
	" ERROR_REASON_CROSS_TENANT_DENIED\x10g\x12+\n" +
	"'ERROR_REASON_SESSION_DEFAULT_UNRESOLVED\x10hB\xb5\x01\n" +
	"\x12com.tars.errors.v1B\fReasonsProtoP\x01Z7github.com/tetrateio/fraser/api/tars/errors/v1;errorsv1\xa2\x02\x03TEX\xaa\x02\x0eTars.Errors.V1\xca\x02\x0eTars\\Errors\\V1\xe2\x02\x1aTars\\Errors\\V1\\GPBMetadata\xea\x02\x10Tars::Errors::V1b\x06proto3"

var (
	file_tars_errors_v1_reasons_proto_rawDescOnce sync.Once
	file_tars_errors_v1_reasons_proto_rawDescData []byte
)

func file_tars_errors_v1_reasons_proto_rawDescGZIP() []byte {
	file_tars_errors_v1_reasons_proto_rawDescOnce.Do(func() {
		file_tars_errors_v1_reasons_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_tars_errors_v1_reasons_proto_rawDesc), len(file_tars_errors_v1_reasons_proto_rawDesc)))
	})
	return file_tars_errors_v1_reasons_proto_rawDescData
}

var file_tars_errors_v1_reasons_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_tars_errors_v1_reasons_proto_goTypes = []any{
	(ErrorReason)(0), // 0: tars.errors.v1.ErrorReason
}
var file_tars_errors_v1_reasons_proto_depIdxs = []int32{
	0, // [0:0] is the sub-list for method output_type
	0, // [0:0] is the sub-list for method input_type
	0, // [0:0] is the sub-list for extension type_name
	0, // [0:0] is the sub-list for extension extendee
	0, // [0:0] is the sub-list for field type_name
}

func init() { file_tars_errors_v1_reasons_proto_init() }
func file_tars_errors_v1_reasons_proto_init() {
	if File_tars_errors_v1_reasons_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_tars_errors_v1_reasons_proto_rawDesc), len(file_tars_errors_v1_reasons_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   0,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_tars_errors_v1_reasons_proto_goTypes,
		DependencyIndexes: file_tars_errors_v1_reasons_proto_depIdxs,
		EnumInfos:         file_tars_errors_v1_reasons_proto_enumTypes,
	}.Build()
	File_tars_errors_v1_reasons_proto = out.File
	file_tars_errors_v1_reasons_proto_goTypes = nil
	file_tars_errors_v1_reasons_proto_depIdxs = nil
}
