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

package commonv1

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

// 对齐 HTTP BaseResponse/SuccessResponse/ErrorResponse
type ResponseMeta struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Code          int32                  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`                           // 200=success；非 200 代表业务错误
	Message       string                 `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`                      // "success" 或错误摘要
	Timestamp     int64                  `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`                 // unix 秒
	RequestId     string                 `protobuf:"bytes,4,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // Trace/审计
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*ResponseMeta) ProtoMessage() {}

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

func (x *ResponseMeta) GetCode() int32 {
	if x != nil {
		return x.Code
	}
	return 0
}

func (x *ResponseMeta) GetMessage() string {
	if x != nil {
		return x.Message
	}
	return ""
}

func (x *ResponseMeta) GetTimestamp() int64 {
	if x != nil {
		return x.Timestamp
	}
	return 0
}

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

// 可选：错误附加信息（与 HTTP ErrorResponse 对齐）
type ErrorExtra struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Error         string                 `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`     // raw error string
	Details       *structpb.Struct       `protobuf:"bytes,2,opt,name=details,proto3" json:"details,omitempty"` // k-v 详情（校验错误等）
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*ErrorExtra) ProtoMessage() {}

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

func (x *ErrorExtra) GetError() string {
	if x != nil {
		return x.Error
	}
	return ""
}

func (x *ErrorExtra) GetDetails() *structpb.Struct {
	if x != nil {
		return x.Details
	}
	return nil
}

var File_common_v1_response_proto protoreflect.FileDescriptor

const file_common_v1_response_proto_rawDesc = "" +
	"\n" +
	"\x18common/v1/response.proto\x12\tcommon.v1\x1a\x1cgoogle/protobuf/struct.proto\"y\n" +
	"\fResponseMeta\x12\x12\n" +
	"\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" +
	"\amessage\x18\x02 \x01(\tR\amessage\x12\x1c\n" +
	"\ttimestamp\x18\x03 \x01(\x03R\ttimestamp\x12\x1d\n" +
	"\n" +
	"request_id\x18\x04 \x01(\tR\trequestId\"U\n" +
	"\n" +
	"ErrorExtra\x12\x14\n" +
	"\x05error\x18\x01 \x01(\tR\x05error\x121\n" +
	"\adetails\x18\x02 \x01(\v2\x17.google.protobuf.StructR\adetailsBCZAgithub.com/ArtisanCloud/PowerX/api/grpc/gen/go/common/v1;commonv1b\x06proto3"

var (
	file_common_v1_response_proto_rawDescOnce sync.Once
	file_common_v1_response_proto_rawDescData []byte
)

func file_common_v1_response_proto_rawDescGZIP() []byte {
	file_common_v1_response_proto_rawDescOnce.Do(func() {
		file_common_v1_response_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_common_v1_response_proto_rawDesc), len(file_common_v1_response_proto_rawDesc)))
	})
	return file_common_v1_response_proto_rawDescData
}

var file_common_v1_response_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_common_v1_response_proto_goTypes = []any{
	(*ResponseMeta)(nil),    // 0: common.v1.ResponseMeta
	(*ErrorExtra)(nil),      // 1: common.v1.ErrorExtra
	(*structpb.Struct)(nil), // 2: google.protobuf.Struct
}
var file_common_v1_response_proto_depIdxs = []int32{
	2, // 0: common.v1.ErrorExtra.details:type_name -> google.protobuf.Struct
	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_response_proto_init() }
func file_common_v1_response_proto_init() {
	if File_common_v1_response_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_response_proto_rawDesc), len(file_common_v1_response_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_common_v1_response_proto_goTypes,
		DependencyIndexes: file_common_v1_response_proto_depIdxs,
		MessageInfos:      file_common_v1_response_proto_msgTypes,
	}.Build()
	File_common_v1_response_proto = out.File
	file_common_v1_response_proto_goTypes = nil
	file_common_v1_response_proto_depIdxs = nil
}
