// To generate the Go code from this proto file, run: `make proto_generate`
// See `proto.mk` for more details.

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.6
// 	protoc        v5.29.3
// source: path/gateway.proto

package observation

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	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)
)

// RequestType captures the origin of the request.
// As of PR #72, it is one of:
//  1. Organic: a real user sent a service request to a PATH instance
//  2. Synthetic: internal infrastructure generated the service request for simulation and data purposes.
type RequestType int32

const (
	RequestType_REQUEST_TYPE_UNSPECIFIED RequestType = 0
	// Organic: Service request sent by a user.
	RequestType_REQUEST_TYPE_ORGANIC RequestType = 1
	// Synthetic: Service request sent by the endpoint hydrator: see gateway/hydrator.go.
	RequestType_REQUEST_TYPE_SYNTHETIC RequestType = 2
)

// Enum value maps for RequestType.
var (
	RequestType_name = map[int32]string{
		0: "REQUEST_TYPE_UNSPECIFIED",
		1: "REQUEST_TYPE_ORGANIC",
		2: "REQUEST_TYPE_SYNTHETIC",
	}
	RequestType_value = map[string]int32{
		"REQUEST_TYPE_UNSPECIFIED": 0,
		"REQUEST_TYPE_ORGANIC":     1,
		"REQUEST_TYPE_SYNTHETIC":   2,
	}
)

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

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

func (RequestType) Descriptor() protoreflect.EnumDescriptor {
	return file_path_gateway_proto_enumTypes[0].Descriptor()
}

func (RequestType) Type() protoreflect.EnumType {
	return &file_path_gateway_proto_enumTypes[0]
}

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

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

type GatewayRequestErrorKind int32

const (
	GatewayRequestErrorKind_GATEWAY_REQUEST_ERROR_KIND_UNSPECIFIED GatewayRequestErrorKind = 0
	// Service ID not specified.
	GatewayRequestErrorKind_GATEWAY_REQUEST_ERROR_KIND_MISSING_SERVICE_ID GatewayRequestErrorKind = 1
	// QoS rejected the request.
	// e.g. malformed payload could not be unmarshaled into JSONRPC
	GatewayRequestErrorKind_GATEWAY_REQUEST_ERROR_KIND_REJECTED_BY_QOS GatewayRequestErrorKind = 2
	// Websocket request was rejected by QoS instance.
	// e.g. Websocket subscription request validation failed.
	GatewayRequestErrorKind_GATEWAY_REQUEST_ERROR_KIND_WEBSOCKET_REJECTED_BY_QOS GatewayRequestErrorKind = 3
	// Websocket connection establishment failed.
	// e.g. Failed to upgrade HTTP connection to Websocket or connect to endpoint.
	GatewayRequestErrorKind_GATEWAY_REQUEST_ERROR_KIND_WEBSOCKET_CONNECTION_FAILED GatewayRequestErrorKind = 4
)

// Enum value maps for GatewayRequestErrorKind.
var (
	GatewayRequestErrorKind_name = map[int32]string{
		0: "GATEWAY_REQUEST_ERROR_KIND_UNSPECIFIED",
		1: "GATEWAY_REQUEST_ERROR_KIND_MISSING_SERVICE_ID",
		2: "GATEWAY_REQUEST_ERROR_KIND_REJECTED_BY_QOS",
		3: "GATEWAY_REQUEST_ERROR_KIND_WEBSOCKET_REJECTED_BY_QOS",
		4: "GATEWAY_REQUEST_ERROR_KIND_WEBSOCKET_CONNECTION_FAILED",
	}
	GatewayRequestErrorKind_value = map[string]int32{
		"GATEWAY_REQUEST_ERROR_KIND_UNSPECIFIED":                 0,
		"GATEWAY_REQUEST_ERROR_KIND_MISSING_SERVICE_ID":          1,
		"GATEWAY_REQUEST_ERROR_KIND_REJECTED_BY_QOS":             2,
		"GATEWAY_REQUEST_ERROR_KIND_WEBSOCKET_REJECTED_BY_QOS":   3,
		"GATEWAY_REQUEST_ERROR_KIND_WEBSOCKET_CONNECTION_FAILED": 4,
	}
)

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

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

func (GatewayRequestErrorKind) Descriptor() protoreflect.EnumDescriptor {
	return file_path_gateway_proto_enumTypes[1].Descriptor()
}

func (GatewayRequestErrorKind) Type() protoreflect.EnumType {
	return &file_path_gateway_proto_enumTypes[1]
}

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

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

// GatewayObservations is the set of observations on a service request, made from the perspective of a gateway.
// Examples include the geographic region of the request, the request type, etc.
type GatewayObservations struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// request_auth stores any fields related to the identification/authentication of the request.
	RequestAuth *RequestAuth `protobuf:"bytes,1,opt,name=request_auth,json=requestAuth,proto3" json:"request_auth,omitempty"`
	// Specifies the request origin.
	// For example, wWhether the request was sent by a user or synthetically generated (e.g. by the endpoint hydrator).
	RequestType RequestType `protobuf:"varint,2,opt,name=request_type,json=requestType,proto3,enum=path.RequestType" json:"request_type,omitempty"`
	// service_id is the identifier specified via custom HTTP header.
	// As of PR #72, this can only be specified through a custom header on the HTTP request, extracted in `request/parser.go`.
	ServiceId string `protobuf:"bytes,3,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	// received_time is when the request was initially received
	//   - For HTTP requests: when the HTTP request was received
	//   - For Websocket requests: when the Websocket connection was established
	ReceivedTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=received_time,json=receivedTime,proto3" json:"received_time,omitempty"`
	// completed_time is when request processing finished and response was returned
	//   - For HTTP requests: when the HTTP response was sent
	//   - For Websocket requests: when the Websocket connection was terminated
	CompletedTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=completed_time,json=completedTime,proto3" json:"completed_time,omitempty"`
	// response_size is the size in bytes of the response payload
	ResponseSize uint64 `protobuf:"varint,6,opt,name=response_size,json=responseSize,proto3" json:"response_size,omitempty"`
	// gateway-level request error, if any.
	// e.g. no service ID specified.
	RequestError *GatewayRequestError `protobuf:"bytes,7,opt,name=request_error,json=requestError,proto3,oneof" json:"request_error,omitempty"`
	// parallel_request_observations tracks the outcome of parallel requests within a batch.
	GatewayParallelRequestObservations *GatewayParallelRequestObservations `protobuf:"bytes,8,opt,name=gateway_parallel_request_observations,json=gatewayParallelRequestObservations,proto3,oneof" json:"gateway_parallel_request_observations,omitempty"`
	unknownFields                      protoimpl.UnknownFields
	sizeCache                          protoimpl.SizeCache
}

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

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

func (*GatewayObservations) ProtoMessage() {}

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

func (x *GatewayObservations) GetRequestAuth() *RequestAuth {
	if x != nil {
		return x.RequestAuth
	}
	return nil
}

func (x *GatewayObservations) GetRequestType() RequestType {
	if x != nil {
		return x.RequestType
	}
	return RequestType_REQUEST_TYPE_UNSPECIFIED
}

func (x *GatewayObservations) GetServiceId() string {
	if x != nil {
		return x.ServiceId
	}
	return ""
}

func (x *GatewayObservations) GetReceivedTime() *timestamppb.Timestamp {
	if x != nil {
		return x.ReceivedTime
	}
	return nil
}

func (x *GatewayObservations) GetCompletedTime() *timestamppb.Timestamp {
	if x != nil {
		return x.CompletedTime
	}
	return nil
}

func (x *GatewayObservations) GetResponseSize() uint64 {
	if x != nil {
		return x.ResponseSize
	}
	return 0
}

func (x *GatewayObservations) GetRequestError() *GatewayRequestError {
	if x != nil {
		return x.RequestError
	}
	return nil
}

func (x *GatewayObservations) GetGatewayParallelRequestObservations() *GatewayParallelRequestObservations {
	if x != nil {
		return x.GatewayParallelRequestObservations
	}
	return nil
}

// Tracks any errors encountered at the gateway level.
// e.g.: No Service ID specified by the request's HTTP headers.
type GatewayRequestError struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Categorizes the error
	ErrorKind GatewayRequestErrorKind `protobuf:"varint,1,opt,name=error_kind,json=errorKind,proto3,enum=path.GatewayRequestErrorKind" json:"error_kind,omitempty"`
	// Detailed reason
	Details       string `protobuf:"bytes,2,opt,name=details,proto3" json:"details,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*GatewayRequestError) ProtoMessage() {}

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

func (x *GatewayRequestError) GetErrorKind() GatewayRequestErrorKind {
	if x != nil {
		return x.ErrorKind
	}
	return GatewayRequestErrorKind_GATEWAY_REQUEST_ERROR_KIND_UNSPECIFIED
}

func (x *GatewayRequestError) GetDetails() string {
	if x != nil {
		return x.Details
	}
	return ""
}

// Tracks the outcome of parallel requests within a batch.
type GatewayParallelRequestObservations struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The number of requests made
	NumRequests int32 `protobuf:"varint,1,opt,name=num_requests,json=numRequests,proto3" json:"num_requests,omitempty"`
	// The number of successful requests
	NumSuccessful int32 `protobuf:"varint,2,opt,name=num_successful,json=numSuccessful,proto3" json:"num_successful,omitempty"`
	// The number of failed requests
	NumFailed int32 `protobuf:"varint,3,opt,name=num_failed,json=numFailed,proto3" json:"num_failed,omitempty"`
	// The number of canceled requests
	NumCanceled   int32 `protobuf:"varint,4,opt,name=num_canceled,json=numCanceled,proto3" json:"num_canceled,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*GatewayParallelRequestObservations) ProtoMessage() {}

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

func (x *GatewayParallelRequestObservations) GetNumRequests() int32 {
	if x != nil {
		return x.NumRequests
	}
	return 0
}

func (x *GatewayParallelRequestObservations) GetNumSuccessful() int32 {
	if x != nil {
		return x.NumSuccessful
	}
	return 0
}

func (x *GatewayParallelRequestObservations) GetNumFailed() int32 {
	if x != nil {
		return x.NumFailed
	}
	return 0
}

func (x *GatewayParallelRequestObservations) GetNumCanceled() int32 {
	if x != nil {
		return x.NumCanceled
	}
	return 0
}

var File_path_gateway_proto protoreflect.FileDescriptor

const file_path_gateway_proto_rawDesc = "" +
	"\n" +
	"\x12path/gateway.proto\x12\x04path\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0fpath/auth.proto\"\xcd\x04\n" +
	"\x13GatewayObservations\x124\n" +
	"\frequest_auth\x18\x01 \x01(\v2\x11.path.RequestAuthR\vrequestAuth\x124\n" +
	"\frequest_type\x18\x02 \x01(\x0e2\x11.path.RequestTypeR\vrequestType\x12\x1d\n" +
	"\n" +
	"service_id\x18\x03 \x01(\tR\tserviceId\x12?\n" +
	"\rreceived_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\freceivedTime\x12A\n" +
	"\x0ecompleted_time\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\rcompletedTime\x12#\n" +
	"\rresponse_size\x18\x06 \x01(\x04R\fresponseSize\x12C\n" +
	"\rrequest_error\x18\a \x01(\v2\x19.path.GatewayRequestErrorH\x00R\frequestError\x88\x01\x01\x12\x80\x01\n" +
	"%gateway_parallel_request_observations\x18\b \x01(\v2(.path.GatewayParallelRequestObservationsH\x01R\"gatewayParallelRequestObservations\x88\x01\x01B\x10\n" +
	"\x0e_request_errorB(\n" +
	"&_gateway_parallel_request_observations\"m\n" +
	"\x13GatewayRequestError\x12<\n" +
	"\n" +
	"error_kind\x18\x01 \x01(\x0e2\x1d.path.GatewayRequestErrorKindR\terrorKind\x12\x18\n" +
	"\adetails\x18\x02 \x01(\tR\adetails\"\xb0\x01\n" +
	"\"GatewayParallelRequestObservations\x12!\n" +
	"\fnum_requests\x18\x01 \x01(\x05R\vnumRequests\x12%\n" +
	"\x0enum_successful\x18\x02 \x01(\x05R\rnumSuccessful\x12\x1d\n" +
	"\n" +
	"num_failed\x18\x03 \x01(\x05R\tnumFailed\x12!\n" +
	"\fnum_canceled\x18\x04 \x01(\x05R\vnumCanceled*a\n" +
	"\vRequestType\x12\x1c\n" +
	"\x18REQUEST_TYPE_UNSPECIFIED\x10\x00\x12\x18\n" +
	"\x14REQUEST_TYPE_ORGANIC\x10\x01\x12\x1a\n" +
	"\x16REQUEST_TYPE_SYNTHETIC\x10\x02*\x9e\x02\n" +
	"\x17GatewayRequestErrorKind\x12*\n" +
	"&GATEWAY_REQUEST_ERROR_KIND_UNSPECIFIED\x10\x00\x121\n" +
	"-GATEWAY_REQUEST_ERROR_KIND_MISSING_SERVICE_ID\x10\x01\x12.\n" +
	"*GATEWAY_REQUEST_ERROR_KIND_REJECTED_BY_QOS\x10\x02\x128\n" +
	"4GATEWAY_REQUEST_ERROR_KIND_WEBSOCKET_REJECTED_BY_QOS\x10\x03\x12:\n" +
	"6GATEWAY_REQUEST_ERROR_KIND_WEBSOCKET_CONNECTION_FAILED\x10\x04B,Z*github.com/buildwithgrove/path/observationb\x06proto3"

var (
	file_path_gateway_proto_rawDescOnce sync.Once
	file_path_gateway_proto_rawDescData []byte
)

func file_path_gateway_proto_rawDescGZIP() []byte {
	file_path_gateway_proto_rawDescOnce.Do(func() {
		file_path_gateway_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_path_gateway_proto_rawDesc), len(file_path_gateway_proto_rawDesc)))
	})
	return file_path_gateway_proto_rawDescData
}

var file_path_gateway_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_path_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_path_gateway_proto_goTypes = []any{
	(RequestType)(0),                           // 0: path.RequestType
	(GatewayRequestErrorKind)(0),               // 1: path.GatewayRequestErrorKind
	(*GatewayObservations)(nil),                // 2: path.GatewayObservations
	(*GatewayRequestError)(nil),                // 3: path.GatewayRequestError
	(*GatewayParallelRequestObservations)(nil), // 4: path.GatewayParallelRequestObservations
	(*RequestAuth)(nil),                        // 5: path.RequestAuth
	(*timestamppb.Timestamp)(nil),              // 6: google.protobuf.Timestamp
}
var file_path_gateway_proto_depIdxs = []int32{
	5, // 0: path.GatewayObservations.request_auth:type_name -> path.RequestAuth
	0, // 1: path.GatewayObservations.request_type:type_name -> path.RequestType
	6, // 2: path.GatewayObservations.received_time:type_name -> google.protobuf.Timestamp
	6, // 3: path.GatewayObservations.completed_time:type_name -> google.protobuf.Timestamp
	3, // 4: path.GatewayObservations.request_error:type_name -> path.GatewayRequestError
	4, // 5: path.GatewayObservations.gateway_parallel_request_observations:type_name -> path.GatewayParallelRequestObservations
	1, // 6: path.GatewayRequestError.error_kind:type_name -> path.GatewayRequestErrorKind
	7, // [7:7] is the sub-list for method output_type
	7, // [7:7] is the sub-list for method input_type
	7, // [7:7] is the sub-list for extension type_name
	7, // [7:7] is the sub-list for extension extendee
	0, // [0:7] is the sub-list for field type_name
}

func init() { file_path_gateway_proto_init() }
func file_path_gateway_proto_init() {
	if File_path_gateway_proto != nil {
		return
	}
	file_path_auth_proto_init()
	file_path_gateway_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_path_gateway_proto_rawDesc), len(file_path_gateway_proto_rawDesc)),
			NumEnums:      2,
			NumMessages:   3,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_path_gateway_proto_goTypes,
		DependencyIndexes: file_path_gateway_proto_depIdxs,
		EnumInfos:         file_path_gateway_proto_enumTypes,
		MessageInfos:      file_path_gateway_proto_msgTypes,
	}.Build()
	File_path_gateway_proto = out.File
	file_path_gateway_proto_goTypes = nil
	file_path_gateway_proto_depIdxs = nil
}
