// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.4.0
// - protoc             (unknown)
// source: fulmine/v1/notification.proto

package fulminev1

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.62.0 or later.
const _ = grpc.SupportPackageIsVersion8

const (
	NotificationService_SubscribeForAddresses_FullMethodName   = "/fulmine.v1.NotificationService/SubscribeForAddresses"
	NotificationService_UnsubscribeForAddresses_FullMethodName = "/fulmine.v1.NotificationService/UnsubscribeForAddresses"
	NotificationService_GetVtxoNotifications_FullMethodName    = "/fulmine.v1.NotificationService/GetVtxoNotifications"
	NotificationService_RoundNotifications_FullMethodName      = "/fulmine.v1.NotificationService/RoundNotifications"
	NotificationService_AddWebhook_FullMethodName              = "/fulmine.v1.NotificationService/AddWebhook"
	NotificationService_RemoveWebhook_FullMethodName           = "/fulmine.v1.NotificationService/RemoveWebhook"
	NotificationService_ListWebhooks_FullMethodName            = "/fulmine.v1.NotificationService/ListWebhooks"
)

// NotificationServiceClient is the client API for NotificationService 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.
//
// NotificationService is used to get notification about wallet events.
// It offers 2 way of getting notified about events: with the help of grpc
// server-side stream or by subscribing webhooks invoked whenever an event
// occurs.
type NotificationServiceClient interface {
	// SubscribeForAddresses subscribes for notifications for given addresses
	SubscribeForAddresses(ctx context.Context, in *SubscribeForAddressesRequest, opts ...grpc.CallOption) (*SubscribeForAddressesResponse, error)
	// UnsubscribeForAddresses unsubscribes from notifications for given addresses
	UnsubscribeForAddresses(ctx context.Context, in *UnsubscribeForAddressesRequest, opts ...grpc.CallOption) (*UnsubscribeForAddressesResponse, error)
	// GetVtxoNotifications streams notifications for subscribed addresses
	GetVtxoNotifications(ctx context.Context, in *GetVtxoNotificationsRequest, opts ...grpc.CallOption) (NotificationService_GetVtxoNotificationsClient, error)
	// Notifies about events related to wallet transactions.
	RoundNotifications(ctx context.Context, in *RoundNotificationsRequest, opts ...grpc.CallOption) (NotificationService_RoundNotificationsClient, error)
	// Adds a webhook registered for some kind of event.
	AddWebhook(ctx context.Context, in *AddWebhookRequest, opts ...grpc.CallOption) (*AddWebhookResponse, error)
	// Removes some previously added webhook.
	RemoveWebhook(ctx context.Context, in *RemoveWebhookRequest, opts ...grpc.CallOption) (*RemoveWebhookResponse, error)
	// Returns registered webhooks.
	ListWebhooks(ctx context.Context, in *ListWebhooksRequest, opts ...grpc.CallOption) (*ListWebhooksResponse, error)
}

type notificationServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewNotificationServiceClient(cc grpc.ClientConnInterface) NotificationServiceClient {
	return &notificationServiceClient{cc}
}

func (c *notificationServiceClient) SubscribeForAddresses(ctx context.Context, in *SubscribeForAddressesRequest, opts ...grpc.CallOption) (*SubscribeForAddressesResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubscribeForAddressesResponse)
	err := c.cc.Invoke(ctx, NotificationService_SubscribeForAddresses_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *notificationServiceClient) UnsubscribeForAddresses(ctx context.Context, in *UnsubscribeForAddressesRequest, opts ...grpc.CallOption) (*UnsubscribeForAddressesResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(UnsubscribeForAddressesResponse)
	err := c.cc.Invoke(ctx, NotificationService_UnsubscribeForAddresses_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *notificationServiceClient) GetVtxoNotifications(ctx context.Context, in *GetVtxoNotificationsRequest, opts ...grpc.CallOption) (NotificationService_GetVtxoNotificationsClient, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &NotificationService_ServiceDesc.Streams[0], NotificationService_GetVtxoNotifications_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &notificationServiceGetVtxoNotificationsClient{ClientStream: stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type NotificationService_GetVtxoNotificationsClient interface {
	Recv() (*GetVtxoNotificationsResponse, error)
	grpc.ClientStream
}

type notificationServiceGetVtxoNotificationsClient struct {
	grpc.ClientStream
}

func (x *notificationServiceGetVtxoNotificationsClient) Recv() (*GetVtxoNotificationsResponse, error) {
	m := new(GetVtxoNotificationsResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *notificationServiceClient) RoundNotifications(ctx context.Context, in *RoundNotificationsRequest, opts ...grpc.CallOption) (NotificationService_RoundNotificationsClient, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &NotificationService_ServiceDesc.Streams[1], NotificationService_RoundNotifications_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &notificationServiceRoundNotificationsClient{ClientStream: stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type NotificationService_RoundNotificationsClient interface {
	Recv() (*RoundNotificationsResponse, error)
	grpc.ClientStream
}

type notificationServiceRoundNotificationsClient struct {
	grpc.ClientStream
}

func (x *notificationServiceRoundNotificationsClient) Recv() (*RoundNotificationsResponse, error) {
	m := new(RoundNotificationsResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *notificationServiceClient) AddWebhook(ctx context.Context, in *AddWebhookRequest, opts ...grpc.CallOption) (*AddWebhookResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AddWebhookResponse)
	err := c.cc.Invoke(ctx, NotificationService_AddWebhook_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *notificationServiceClient) RemoveWebhook(ctx context.Context, in *RemoveWebhookRequest, opts ...grpc.CallOption) (*RemoveWebhookResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RemoveWebhookResponse)
	err := c.cc.Invoke(ctx, NotificationService_RemoveWebhook_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *notificationServiceClient) ListWebhooks(ctx context.Context, in *ListWebhooksRequest, opts ...grpc.CallOption) (*ListWebhooksResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListWebhooksResponse)
	err := c.cc.Invoke(ctx, NotificationService_ListWebhooks_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// NotificationServiceServer is the server API for NotificationService service.
// All implementations should embed UnimplementedNotificationServiceServer
// for forward compatibility
//
// NotificationService is used to get notification about wallet events.
// It offers 2 way of getting notified about events: with the help of grpc
// server-side stream or by subscribing webhooks invoked whenever an event
// occurs.
type NotificationServiceServer interface {
	// SubscribeForAddresses subscribes for notifications for given addresses
	SubscribeForAddresses(context.Context, *SubscribeForAddressesRequest) (*SubscribeForAddressesResponse, error)
	// UnsubscribeForAddresses unsubscribes from notifications for given addresses
	UnsubscribeForAddresses(context.Context, *UnsubscribeForAddressesRequest) (*UnsubscribeForAddressesResponse, error)
	// GetVtxoNotifications streams notifications for subscribed addresses
	GetVtxoNotifications(*GetVtxoNotificationsRequest, NotificationService_GetVtxoNotificationsServer) error
	// Notifies about events related to wallet transactions.
	RoundNotifications(*RoundNotificationsRequest, NotificationService_RoundNotificationsServer) error
	// Adds a webhook registered for some kind of event.
	AddWebhook(context.Context, *AddWebhookRequest) (*AddWebhookResponse, error)
	// Removes some previously added webhook.
	RemoveWebhook(context.Context, *RemoveWebhookRequest) (*RemoveWebhookResponse, error)
	// Returns registered webhooks.
	ListWebhooks(context.Context, *ListWebhooksRequest) (*ListWebhooksResponse, error)
}

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

func (UnimplementedNotificationServiceServer) SubscribeForAddresses(context.Context, *SubscribeForAddressesRequest) (*SubscribeForAddressesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SubscribeForAddresses not implemented")
}
func (UnimplementedNotificationServiceServer) UnsubscribeForAddresses(context.Context, *UnsubscribeForAddressesRequest) (*UnsubscribeForAddressesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UnsubscribeForAddresses not implemented")
}
func (UnimplementedNotificationServiceServer) GetVtxoNotifications(*GetVtxoNotificationsRequest, NotificationService_GetVtxoNotificationsServer) error {
	return status.Errorf(codes.Unimplemented, "method GetVtxoNotifications not implemented")
}
func (UnimplementedNotificationServiceServer) RoundNotifications(*RoundNotificationsRequest, NotificationService_RoundNotificationsServer) error {
	return status.Errorf(codes.Unimplemented, "method RoundNotifications not implemented")
}
func (UnimplementedNotificationServiceServer) AddWebhook(context.Context, *AddWebhookRequest) (*AddWebhookResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method AddWebhook not implemented")
}
func (UnimplementedNotificationServiceServer) RemoveWebhook(context.Context, *RemoveWebhookRequest) (*RemoveWebhookResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method RemoveWebhook not implemented")
}
func (UnimplementedNotificationServiceServer) ListWebhooks(context.Context, *ListWebhooksRequest) (*ListWebhooksResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListWebhooks not implemented")
}

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

func RegisterNotificationServiceServer(s grpc.ServiceRegistrar, srv NotificationServiceServer) {
	s.RegisterService(&NotificationService_ServiceDesc, srv)
}

func _NotificationService_SubscribeForAddresses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SubscribeForAddressesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationServiceServer).SubscribeForAddresses(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: NotificationService_SubscribeForAddresses_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationServiceServer).SubscribeForAddresses(ctx, req.(*SubscribeForAddressesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _NotificationService_UnsubscribeForAddresses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UnsubscribeForAddressesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationServiceServer).UnsubscribeForAddresses(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: NotificationService_UnsubscribeForAddresses_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationServiceServer).UnsubscribeForAddresses(ctx, req.(*UnsubscribeForAddressesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _NotificationService_GetVtxoNotifications_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(GetVtxoNotificationsRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(NotificationServiceServer).GetVtxoNotifications(m, &notificationServiceGetVtxoNotificationsServer{ServerStream: stream})
}

type NotificationService_GetVtxoNotificationsServer interface {
	Send(*GetVtxoNotificationsResponse) error
	grpc.ServerStream
}

type notificationServiceGetVtxoNotificationsServer struct {
	grpc.ServerStream
}

func (x *notificationServiceGetVtxoNotificationsServer) Send(m *GetVtxoNotificationsResponse) error {
	return x.ServerStream.SendMsg(m)
}

func _NotificationService_RoundNotifications_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(RoundNotificationsRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(NotificationServiceServer).RoundNotifications(m, &notificationServiceRoundNotificationsServer{ServerStream: stream})
}

type NotificationService_RoundNotificationsServer interface {
	Send(*RoundNotificationsResponse) error
	grpc.ServerStream
}

type notificationServiceRoundNotificationsServer struct {
	grpc.ServerStream
}

func (x *notificationServiceRoundNotificationsServer) Send(m *RoundNotificationsResponse) error {
	return x.ServerStream.SendMsg(m)
}

func _NotificationService_AddWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AddWebhookRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationServiceServer).AddWebhook(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: NotificationService_AddWebhook_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationServiceServer).AddWebhook(ctx, req.(*AddWebhookRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _NotificationService_RemoveWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RemoveWebhookRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationServiceServer).RemoveWebhook(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: NotificationService_RemoveWebhook_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationServiceServer).RemoveWebhook(ctx, req.(*RemoveWebhookRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _NotificationService_ListWebhooks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListWebhooksRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationServiceServer).ListWebhooks(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: NotificationService_ListWebhooks_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationServiceServer).ListWebhooks(ctx, req.(*ListWebhooksRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// NotificationService_ServiceDesc is the grpc.ServiceDesc for NotificationService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var NotificationService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "fulmine.v1.NotificationService",
	HandlerType: (*NotificationServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SubscribeForAddresses",
			Handler:    _NotificationService_SubscribeForAddresses_Handler,
		},
		{
			MethodName: "UnsubscribeForAddresses",
			Handler:    _NotificationService_UnsubscribeForAddresses_Handler,
		},
		{
			MethodName: "AddWebhook",
			Handler:    _NotificationService_AddWebhook_Handler,
		},
		{
			MethodName: "RemoveWebhook",
			Handler:    _NotificationService_RemoveWebhook_Handler,
		},
		{
			MethodName: "ListWebhooks",
			Handler:    _NotificationService_ListWebhooks_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetVtxoNotifications",
			Handler:       _NotificationService_GetVtxoNotifications_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "RoundNotifications",
			Handler:       _NotificationService_RoundNotifications_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "fulmine/v1/notification.proto",
}
