package api

import (
	context "context"
	proto "github.com/golang/protobuf/proto"
	common "github.com/scoir/canis/pkg/protogen/common"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
)

const (

	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)

	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

const _ = proto.ProtoPackageIsVersion4

var File_canis_didcomm_mediator_proto protoreflect.FileDescriptor

var file_canis_didcomm_mediator_proto_rawDesc = []byte{
	0x0a, 0x1c, 0x63, 0x61, 0x6e, 0x69, 0x73, 0x2d, 0x64, 0x69, 0x64, 0x63, 0x6f, 0x6d, 0x6d, 0x2d,
	0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07,
	0x64, 0x69, 0x64, 0x63, 0x6f, 0x6d, 0x6d, 0x1a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f,
	0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xaa,
	0x01, 0x0a, 0x08, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x5a, 0x0a, 0x11, 0x52,
	0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x45, 0x64, 0x67, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74,
	0x12, 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74,
	0x65, 0x72, 0x45, 0x64, 0x67, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
	0x73, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x67, 0x69,
	0x73, 0x74, 0x65, 0x72, 0x45, 0x64, 0x67, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73,
	0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x45, 0x6e,
	0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
	0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
	0x18, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e,
	0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x16, 0x5a, 0x14, 0x64,
	0x69, 0x64, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x6f, 0x72, 0x2f,
	0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}

var file_canis_didcomm_mediator_proto_goTypes = []interface{}{
	(*common.RegisterEdgeAgentRequest)(nil),  
	(*common.EndpointRequest)(nil),           
	(*common.RegisterEdgeAgentResponse)(nil), 
	(*common.EndpointResponse)(nil),          
}
var file_canis_didcomm_mediator_proto_depIdxs = []int32{
	0, 
	1, 
	2, 
	3, 
	2, 
	0, 
	0, 
	0, 
	0, 
}

func init() { file_canis_didcomm_mediator_proto_init() }
func file_canis_didcomm_mediator_proto_init() {
	if File_canis_didcomm_mediator_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: file_canis_didcomm_mediator_proto_rawDesc,
			NumEnums:      0,
			NumMessages:   0,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_canis_didcomm_mediator_proto_goTypes,
		DependencyIndexes: file_canis_didcomm_mediator_proto_depIdxs,
	}.Build()
	File_canis_didcomm_mediator_proto = out.File
	file_canis_didcomm_mediator_proto_rawDesc = nil
	file_canis_didcomm_mediator_proto_goTypes = nil
	file_canis_didcomm_mediator_proto_depIdxs = nil
}

var _ context.Context
var _ grpc.ClientConnInterface

const _ = grpc.SupportPackageIsVersion6

type MediatorClient interface {
	RegisterEdgeAgent(ctx context.Context, in *common.RegisterEdgeAgentRequest, opts ...grpc.CallOption) (*common.RegisterEdgeAgentResponse, error)
	GetEndpoint(ctx context.Context, in *common.EndpointRequest, opts ...grpc.CallOption) (*common.EndpointResponse, error)
}

type mediatorClient struct {
	cc grpc.ClientConnInterface
}

func NewMediatorClient(cc grpc.ClientConnInterface) MediatorClient {
	return &mediatorClient{cc}
}

func (c *mediatorClient) RegisterEdgeAgent(ctx context.Context, in *common.RegisterEdgeAgentRequest, opts ...grpc.CallOption) (*common.RegisterEdgeAgentResponse, error) {
	out := new(common.RegisterEdgeAgentResponse)
	err := c.cc.Invoke(ctx, "/didcomm.Mediator/RegisterEdgeAgent", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *mediatorClient) GetEndpoint(ctx context.Context, in *common.EndpointRequest, opts ...grpc.CallOption) (*common.EndpointResponse, error) {
	out := new(common.EndpointResponse)
	err := c.cc.Invoke(ctx, "/didcomm.Mediator/GetEndpoint", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

type MediatorServer interface {
	RegisterEdgeAgent(context.Context, *common.RegisterEdgeAgentRequest) (*common.RegisterEdgeAgentResponse, error)
	GetEndpoint(context.Context, *common.EndpointRequest) (*common.EndpointResponse, error)
}

type UnimplementedMediatorServer struct {
}

func (*UnimplementedMediatorServer) RegisterEdgeAgent(context.Context, *common.RegisterEdgeAgentRequest) (*common.RegisterEdgeAgentResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method RegisterEdgeAgent not implemented")
}
func (*UnimplementedMediatorServer) GetEndpoint(context.Context, *common.EndpointRequest) (*common.EndpointResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetEndpoint not implemented")
}

func RegisterMediatorServer(s *grpc.Server, srv MediatorServer) {
	s.RegisterService(&_Mediator_serviceDesc, srv)
}

func _Mediator_RegisterEdgeAgent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(common.RegisterEdgeAgentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(MediatorServer).RegisterEdgeAgent(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/didcomm.Mediator/RegisterEdgeAgent",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(MediatorServer).RegisterEdgeAgent(ctx, req.(*common.RegisterEdgeAgentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Mediator_GetEndpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(common.EndpointRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(MediatorServer).GetEndpoint(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/didcomm.Mediator/GetEndpoint",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(MediatorServer).GetEndpoint(ctx, req.(*common.EndpointRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _Mediator_serviceDesc = grpc.ServiceDesc{
	ServiceName: "didcomm.Mediator",
	HandlerType: (*MediatorServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RegisterEdgeAgent",
			Handler:    _Mediator_RegisterEdgeAgent_Handler,
		},
		{
			MethodName: "GetEndpoint",
			Handler:    _Mediator_GetEndpoint_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "canis-didcomm-mediator.proto",
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.25.0
// 	protoc        v3.6.1
// source: canis-didcomm-mediator.proto

package api

import (
	context "context"
	proto "github.com/golang/protobuf/proto"
	common "github.com/scoir/canis/pkg/protogen/common"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
)

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

// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4

var File_canis_didcomm_mediator_proto protoreflect.FileDescriptor

var file_canis_didcomm_mediator_proto_rawDesc = []byte{
	0x0a, 0x1c, 0x63, 0x61, 0x6e, 0x69, 0x73, 0x2d, 0x64, 0x69, 0x64, 0x63, 0x6f, 0x6d, 0x6d, 0x2d,
	0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07,
	0x64, 0x69, 0x64, 0x63, 0x6f, 0x6d, 0x6d, 0x1a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f,
	0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0xaa,
	0x01, 0x0a, 0x08, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x5a, 0x0a, 0x11, 0x52,
	0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x45, 0x64, 0x67, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74,
	0x12, 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74,
	0x65, 0x72, 0x45, 0x64, 0x67, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
	0x73, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x67, 0x69,
	0x73, 0x74, 0x65, 0x72, 0x45, 0x64, 0x67, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73,
	0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x45, 0x6e,
	0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
	0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
	0x18, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e,
	0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x16, 0x5a, 0x14, 0x64,
	0x69, 0x64, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x6f, 0x72, 0x2f,
	0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}

var file_canis_didcomm_mediator_proto_goTypes = []interface{}{
	(*common.RegisterEdgeAgentRequest)(nil),  // 0: common.RegisterEdgeAgentRequest
	(*common.EndpointRequest)(nil),           // 1: common.EndpointRequest
	(*common.RegisterEdgeAgentResponse)(nil), // 2: common.RegisterEdgeAgentResponse
	(*common.EndpointResponse)(nil),          // 3: common.EndpointResponse
}
var file_canis_didcomm_mediator_proto_depIdxs = []int32{
	0, // 0: didcomm.Mediator.RegisterEdgeAgent:input_type -> common.RegisterEdgeAgentRequest
	1, // 1: didcomm.Mediator.GetEndpoint:input_type -> common.EndpointRequest
	2, // 2: didcomm.Mediator.RegisterEdgeAgent:output_type -> common.RegisterEdgeAgentResponse
	3, // 3: didcomm.Mediator.GetEndpoint:output_type -> common.EndpointResponse
	2, // [2:4] is the sub-list for method output_type
	0, // [0:2] 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_canis_didcomm_mediator_proto_init() }
func file_canis_didcomm_mediator_proto_init() {
	if File_canis_didcomm_mediator_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: file_canis_didcomm_mediator_proto_rawDesc,
			NumEnums:      0,
			NumMessages:   0,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_canis_didcomm_mediator_proto_goTypes,
		DependencyIndexes: file_canis_didcomm_mediator_proto_depIdxs,
	}.Build()
	File_canis_didcomm_mediator_proto = out.File
	file_canis_didcomm_mediator_proto_rawDesc = nil
	file_canis_didcomm_mediator_proto_goTypes = nil
	file_canis_didcomm_mediator_proto_depIdxs = nil
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6

// MediatorClient is the client API for Mediator service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type MediatorClient interface {
	RegisterEdgeAgent(ctx context.Context, in *common.RegisterEdgeAgentRequest, opts ...grpc.CallOption) (*common.RegisterEdgeAgentResponse, error)
	GetEndpoint(ctx context.Context, in *common.EndpointRequest, opts ...grpc.CallOption) (*common.EndpointResponse, error)
}

type mediatorClient struct {
	cc grpc.ClientConnInterface
}

func NewMediatorClient(cc grpc.ClientConnInterface) MediatorClient {
	return &mediatorClient{cc}
}

func (c *mediatorClient) RegisterEdgeAgent(ctx context.Context, in *common.RegisterEdgeAgentRequest, opts ...grpc.CallOption) (*common.RegisterEdgeAgentResponse, error) {
	out := new(common.RegisterEdgeAgentResponse)
	err := c.cc.Invoke(ctx, "/didcomm.Mediator/RegisterEdgeAgent", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *mediatorClient) GetEndpoint(ctx context.Context, in *common.EndpointRequest, opts ...grpc.CallOption) (*common.EndpointResponse, error) {
	out := new(common.EndpointResponse)
	err := c.cc.Invoke(ctx, "/didcomm.Mediator/GetEndpoint", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// MediatorServer is the server API for Mediator service.
type MediatorServer interface {
	RegisterEdgeAgent(context.Context, *common.RegisterEdgeAgentRequest) (*common.RegisterEdgeAgentResponse, error)
	GetEndpoint(context.Context, *common.EndpointRequest) (*common.EndpointResponse, error)
}

// UnimplementedMediatorServer can be embedded to have forward compatible implementations.
type UnimplementedMediatorServer struct {
}

func (*UnimplementedMediatorServer) RegisterEdgeAgent(context.Context, *common.RegisterEdgeAgentRequest) (*common.RegisterEdgeAgentResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method RegisterEdgeAgent not implemented")
}
func (*UnimplementedMediatorServer) GetEndpoint(context.Context, *common.EndpointRequest) (*common.EndpointResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetEndpoint not implemented")
}

func RegisterMediatorServer(s *grpc.Server, srv MediatorServer) {
	s.RegisterService(&_Mediator_serviceDesc, srv)
}

func _Mediator_RegisterEdgeAgent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(common.RegisterEdgeAgentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(MediatorServer).RegisterEdgeAgent(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/didcomm.Mediator/RegisterEdgeAgent",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(MediatorServer).RegisterEdgeAgent(ctx, req.(*common.RegisterEdgeAgentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Mediator_GetEndpoint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(common.EndpointRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(MediatorServer).GetEndpoint(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/didcomm.Mediator/GetEndpoint",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(MediatorServer).GetEndpoint(ctx, req.(*common.EndpointRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _Mediator_serviceDesc = grpc.ServiceDesc{
	ServiceName: "didcomm.Mediator",
	HandlerType: (*MediatorServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RegisterEdgeAgent",
			Handler:    _Mediator_RegisterEdgeAgent_Handler,
		},
		{
			MethodName: "GetEndpoint",
			Handler:    _Mediator_GetEndpoint_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "canis-didcomm-mediator.proto",
}
