// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             (unknown)
// source: pushtypes/bertypushtypes.proto

package pushtypes

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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	PushService_ServerInfo_FullMethodName = "/berty.push.v1.PushService/ServerInfo"
	PushService_Send_FullMethodName       = "/berty.push.v1.PushService/Send"
)

// PushServiceClient is the client API for PushService 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.
//
// PushService
type PushServiceClient interface {
	// ServerInfo retrieves metadata about the current push service
	ServerInfo(ctx context.Context, in *PushServiceServerInfo_Request, opts ...grpc.CallOption) (*PushServiceServerInfo_Reply, error)
	// Send dispatch a push payload to one or multiple recipients
	Send(ctx context.Context, in *PushServiceSend_Request, opts ...grpc.CallOption) (*PushServiceSend_Reply, error)
}

type pushServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewPushServiceClient(cc grpc.ClientConnInterface) PushServiceClient {
	return &pushServiceClient{cc}
}

func (c *pushServiceClient) ServerInfo(ctx context.Context, in *PushServiceServerInfo_Request, opts ...grpc.CallOption) (*PushServiceServerInfo_Reply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(PushServiceServerInfo_Reply)
	err := c.cc.Invoke(ctx, PushService_ServerInfo_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *pushServiceClient) Send(ctx context.Context, in *PushServiceSend_Request, opts ...grpc.CallOption) (*PushServiceSend_Reply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(PushServiceSend_Reply)
	err := c.cc.Invoke(ctx, PushService_Send_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// PushServiceServer is the server API for PushService service.
// All implementations must embed UnimplementedPushServiceServer
// for forward compatibility.
//
// PushService
type PushServiceServer interface {
	// ServerInfo retrieves metadata about the current push service
	ServerInfo(context.Context, *PushServiceServerInfo_Request) (*PushServiceServerInfo_Reply, error)
	// Send dispatch a push payload to one or multiple recipients
	Send(context.Context, *PushServiceSend_Request) (*PushServiceSend_Reply, error)
	mustEmbedUnimplementedPushServiceServer()
}

// UnimplementedPushServiceServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedPushServiceServer struct{}

func (UnimplementedPushServiceServer) ServerInfo(context.Context, *PushServiceServerInfo_Request) (*PushServiceServerInfo_Reply, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ServerInfo not implemented")
}
func (UnimplementedPushServiceServer) Send(context.Context, *PushServiceSend_Request) (*PushServiceSend_Reply, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Send not implemented")
}
func (UnimplementedPushServiceServer) mustEmbedUnimplementedPushServiceServer() {}
func (UnimplementedPushServiceServer) testEmbeddedByValue()                     {}

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

func RegisterPushServiceServer(s grpc.ServiceRegistrar, srv PushServiceServer) {
	// If the following call pancis, it indicates UnimplementedPushServiceServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&PushService_ServiceDesc, srv)
}

func _PushService_ServerInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PushServiceServerInfo_Request)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PushServiceServer).ServerInfo(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PushService_ServerInfo_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PushServiceServer).ServerInfo(ctx, req.(*PushServiceServerInfo_Request))
	}
	return interceptor(ctx, in, info, handler)
}

func _PushService_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PushServiceSend_Request)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PushServiceServer).Send(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PushService_Send_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PushServiceServer).Send(ctx, req.(*PushServiceSend_Request))
	}
	return interceptor(ctx, in, info, handler)
}

// PushService_ServiceDesc is the grpc.ServiceDesc for PushService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var PushService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "berty.push.v1.PushService",
	HandlerType: (*PushServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ServerInfo",
			Handler:    _PushService_ServerInfo_Handler,
		},
		{
			MethodName: "Send",
			Handler:    _PushService_Send_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pushtypes/bertypushtypes.proto",
}
