//
//Сервис реализует функционал домофонного звонка

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             v4.23.1
// source: keyapis/dial/v1/keyapis_dial_call_v1.proto

package keyapis_dial_v1

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

const (
	CallService_PostCall_FullMethodName       = "/keyapis.dial.v1.CallService/PostCall"
	CallService_PostCallCancel_FullMethodName = "/keyapis.dial.v1.CallService/PostCallCancel"
)

// CallServiceClient is the client API for CallService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type CallServiceClient interface {
	// Метод обработки события звонка с домофона.
	// Метод доступен для: ApiKey
	PostCall(ctx context.Context, in *PostCallRequest, opts ...grpc.CallOption) (*PostCallResponse, error)
	// Метод обработки события об окончании группового звонка с домофона.
	// Метод доступен для: ApiKey
	PostCallCancel(ctx context.Context, in *PostCallCancelRequest, opts ...grpc.CallOption) (*PostCallCancelResponse, error)
}

type callServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewCallServiceClient(cc grpc.ClientConnInterface) CallServiceClient {
	return &callServiceClient{cc}
}

func (c *callServiceClient) PostCall(ctx context.Context, in *PostCallRequest, opts ...grpc.CallOption) (*PostCallResponse, error) {
	out := new(PostCallResponse)
	err := c.cc.Invoke(ctx, CallService_PostCall_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *callServiceClient) PostCallCancel(ctx context.Context, in *PostCallCancelRequest, opts ...grpc.CallOption) (*PostCallCancelResponse, error) {
	out := new(PostCallCancelResponse)
	err := c.cc.Invoke(ctx, CallService_PostCallCancel_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// CallServiceServer is the server API for CallService service.
// All implementations should embed UnimplementedCallServiceServer
// for forward compatibility
type CallServiceServer interface {
	// Метод обработки события звонка с домофона.
	// Метод доступен для: ApiKey
	PostCall(context.Context, *PostCallRequest) (*PostCallResponse, error)
	// Метод обработки события об окончании группового звонка с домофона.
	// Метод доступен для: ApiKey
	PostCallCancel(context.Context, *PostCallCancelRequest) (*PostCallCancelResponse, error)
}

// UnimplementedCallServiceServer should be embedded to have forward compatible implementations.
type UnimplementedCallServiceServer struct {
}

func (UnimplementedCallServiceServer) PostCall(context.Context, *PostCallRequest) (*PostCallResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PostCall not implemented")
}
func (UnimplementedCallServiceServer) PostCallCancel(context.Context, *PostCallCancelRequest) (*PostCallCancelResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PostCallCancel not implemented")
}

// UnsafeCallServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to CallServiceServer will
// result in compilation errors.
type UnsafeCallServiceServer interface {
	mustEmbedUnimplementedCallServiceServer()
}

func RegisterCallServiceServer(s grpc.ServiceRegistrar, srv CallServiceServer) {
	s.RegisterService(&CallService_ServiceDesc, srv)
}

func _CallService_PostCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PostCallRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CallServiceServer).PostCall(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: CallService_PostCall_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CallServiceServer).PostCall(ctx, req.(*PostCallRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _CallService_PostCallCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PostCallCancelRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CallServiceServer).PostCallCancel(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: CallService_PostCallCancel_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CallServiceServer).PostCallCancel(ctx, req.(*PostCallCancelRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// CallService_ServiceDesc is the grpc.ServiceDesc for CallService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var CallService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "keyapis.dial.v1.CallService",
	HandlerType: (*CallServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "PostCall",
			Handler:    _CallService_PostCall_Handler,
		},
		{
			MethodName: "PostCallCancel",
			Handler:    _CallService_PostCallCancel_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "keyapis/dial/v1/keyapis_dial_call_v1.proto",
}
