// Copyright (C) 2024, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

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

package externalsubscriber

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
)

// 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 (
	ExternalSubscriber_Initialize_FullMethodName = "/externalsubscriber.ExternalSubscriber/Initialize"
	ExternalSubscriber_Notify_FullMethodName     = "/externalsubscriber.ExternalSubscriber/Notify"
)

// ExternalSubscriberClient is the client API for ExternalSubscriber 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 ExternalSubscriberClient interface {
	Initialize(ctx context.Context, in *InitializeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Notify(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

type externalSubscriberClient struct {
	cc grpc.ClientConnInterface
}

func NewExternalSubscriberClient(cc grpc.ClientConnInterface) ExternalSubscriberClient {
	return &externalSubscriberClient{cc}
}

func (c *externalSubscriberClient) Initialize(ctx context.Context, in *InitializeRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, ExternalSubscriber_Initialize_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *externalSubscriberClient) Notify(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, ExternalSubscriber_Notify_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ExternalSubscriberServer is the server API for ExternalSubscriber service.
// All implementations must embed UnimplementedExternalSubscriberServer
// for forward compatibility
type ExternalSubscriberServer interface {
	Initialize(context.Context, *InitializeRequest) (*emptypb.Empty, error)
	Notify(context.Context, *BlockRequest) (*emptypb.Empty, error)
	mustEmbedUnimplementedExternalSubscriberServer()
}

// UnimplementedExternalSubscriberServer must be embedded to have forward compatible implementations.
type UnimplementedExternalSubscriberServer struct {
}

func (UnimplementedExternalSubscriberServer) Initialize(context.Context, *InitializeRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Initialize not implemented")
}
func (UnimplementedExternalSubscriberServer) Notify(context.Context, *BlockRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Notify not implemented")
}
func (UnimplementedExternalSubscriberServer) mustEmbedUnimplementedExternalSubscriberServer() {}

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

func RegisterExternalSubscriberServer(s grpc.ServiceRegistrar, srv ExternalSubscriberServer) {
	s.RegisterService(&ExternalSubscriber_ServiceDesc, srv)
}

func _ExternalSubscriber_Initialize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(InitializeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExternalSubscriberServer).Initialize(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ExternalSubscriber_Initialize_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExternalSubscriberServer).Initialize(ctx, req.(*InitializeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ExternalSubscriber_Notify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(BlockRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ExternalSubscriberServer).Notify(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ExternalSubscriber_Notify_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ExternalSubscriberServer).Notify(ctx, req.(*BlockRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// ExternalSubscriber_ServiceDesc is the grpc.ServiceDesc for ExternalSubscriber service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ExternalSubscriber_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "externalsubscriber.ExternalSubscriber",
	HandlerType: (*ExternalSubscriberServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Initialize",
			Handler:    _ExternalSubscriber_Initialize_Handler,
		},
		{
			MethodName: "Notify",
			Handler:    _ExternalSubscriber_Notify_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "externalsubscriber/externalsubscriber.proto",
}
