// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.9
// 	protoc        (unknown)
// source: common/v1/context.proto

package commonv1

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

// 所有 RPC 必带
type RequestContext struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	TenantId      int64                  `protobuf:"varint,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"`                                                               // 必填：RLS
	MemberId      int64                  `protobuf:"varint,2,opt,name=member_id,json=memberId,proto3" json:"member_id,omitempty"`                                                               // 可选：调用主体（若有）
	RequestId     string                 `protobuf:"bytes,3,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`                                                             // Trace/审计
	AccessToken   string                 `protobuf:"bytes,4,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`                                                       // JWT/Cap Token（可选，通常走头部）
	Scopes        []string               `protobuf:"bytes,5,rep,name=scopes,proto3" json:"scopes,omitempty"`                                                                                    // 授权范围（可选）
	Attributes    map[string]string      `protobuf:"bytes,10,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // 透传元数据（如 locale、client_id）
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*RequestContext) ProtoMessage() {}

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

func (x *RequestContext) GetTenantId() int64 {
	if x != nil {
		return x.TenantId
	}
	return 0
}

func (x *RequestContext) GetMemberId() int64 {
	if x != nil {
		return x.MemberId
	}
	return 0
}

func (x *RequestContext) GetRequestId() string {
	if x != nil {
		return x.RequestId
	}
	return ""
}

func (x *RequestContext) GetAccessToken() string {
	if x != nil {
		return x.AccessToken
	}
	return ""
}

func (x *RequestContext) GetScopes() []string {
	if x != nil {
		return x.Scopes
	}
	return nil
}

func (x *RequestContext) GetAttributes() map[string]string {
	if x != nil {
		return x.Attributes
	}
	return nil
}

var File_common_v1_context_proto protoreflect.FileDescriptor

const file_common_v1_context_proto_rawDesc = "" +
	"\n" +
	"\x17common/v1/context.proto\x12\tcommon.v1\"\xae\x02\n" +
	"\x0eRequestContext\x12\x1b\n" +
	"\ttenant_id\x18\x01 \x01(\x03R\btenantId\x12\x1b\n" +
	"\tmember_id\x18\x02 \x01(\x03R\bmemberId\x12\x1d\n" +
	"\n" +
	"request_id\x18\x03 \x01(\tR\trequestId\x12!\n" +
	"\faccess_token\x18\x04 \x01(\tR\vaccessToken\x12\x16\n" +
	"\x06scopes\x18\x05 \x03(\tR\x06scopes\x12I\n" +
	"\n" +
	"attributes\x18\n" +
	" \x03(\v2).common.v1.RequestContext.AttributesEntryR\n" +
	"attributes\x1a=\n" +
	"\x0fAttributesEntry\x12\x10\n" +
	"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
	"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01BCZAgithub.com/ArtisanCloud/PowerX/api/grpc/gen/go/common/v1;commonv1b\x06proto3"

var (
	file_common_v1_context_proto_rawDescOnce sync.Once
	file_common_v1_context_proto_rawDescData []byte
)

func file_common_v1_context_proto_rawDescGZIP() []byte {
	file_common_v1_context_proto_rawDescOnce.Do(func() {
		file_common_v1_context_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_common_v1_context_proto_rawDesc), len(file_common_v1_context_proto_rawDesc)))
	})
	return file_common_v1_context_proto_rawDescData
}

var file_common_v1_context_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_common_v1_context_proto_goTypes = []any{
	(*RequestContext)(nil), // 0: common.v1.RequestContext
	nil,                    // 1: common.v1.RequestContext.AttributesEntry
}
var file_common_v1_context_proto_depIdxs = []int32{
	1, // 0: common.v1.RequestContext.attributes:type_name -> common.v1.RequestContext.AttributesEntry
	1, // [1:1] is the sub-list for method output_type
	1, // [1:1] is the sub-list for method input_type
	1, // [1:1] is the sub-list for extension type_name
	1, // [1:1] is the sub-list for extension extendee
	0, // [0:1] is the sub-list for field type_name
}

func init() { file_common_v1_context_proto_init() }
func file_common_v1_context_proto_init() {
	if File_common_v1_context_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_common_v1_context_proto_rawDesc), len(file_common_v1_context_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_common_v1_context_proto_goTypes,
		DependencyIndexes: file_common_v1_context_proto_depIdxs,
		MessageInfos:      file_common_v1_context_proto_msgTypes,
	}.Build()
	File_common_v1_context_proto = out.File
	file_common_v1_context_proto_goTypes = nil
	file_common_v1_context_proto_depIdxs = nil
}
