// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             v3.21.12
// source: nats_envelope.proto

package natspb

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 (
	EnvelopeService_Ingest_FullMethodName = "/natspb.EnvelopeService/Ingest"
)

// EnvelopeServiceClient is the client API for EnvelopeService 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 EnvelopeServiceClient interface {
	Ingest(ctx context.Context, in *Envelope, opts ...grpc.CallOption) (*Ack, error)
}

type envelopeServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewEnvelopeServiceClient(cc grpc.ClientConnInterface) EnvelopeServiceClient {
	return &envelopeServiceClient{cc}
}

func (c *envelopeServiceClient) Ingest(ctx context.Context, in *Envelope, opts ...grpc.CallOption) (*Ack, error) {
	out := new(Ack)
	err := c.cc.Invoke(ctx, EnvelopeService_Ingest_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// EnvelopeServiceServer is the server API for EnvelopeService service.
// All implementations must embed UnimplementedEnvelopeServiceServer
// for forward compatibility
type EnvelopeServiceServer interface {
	Ingest(context.Context, *Envelope) (*Ack, error)
	mustEmbedUnimplementedEnvelopeServiceServer()
}

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

func (UnimplementedEnvelopeServiceServer) Ingest(context.Context, *Envelope) (*Ack, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Ingest not implemented")
}
func (UnimplementedEnvelopeServiceServer) mustEmbedUnimplementedEnvelopeServiceServer() {}

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

func RegisterEnvelopeServiceServer(s grpc.ServiceRegistrar, srv EnvelopeServiceServer) {
	s.RegisterService(&EnvelopeService_ServiceDesc, srv)
}

func _EnvelopeService_Ingest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Envelope)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(EnvelopeServiceServer).Ingest(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: EnvelopeService_Ingest_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(EnvelopeServiceServer).Ingest(ctx, req.(*Envelope))
	}
	return interceptor(ctx, in, info, handler)
}

// EnvelopeService_ServiceDesc is the grpc.ServiceDesc for EnvelopeService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var EnvelopeService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "natspb.EnvelopeService",
	HandlerType: (*EnvelopeServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Ingest",
			Handler:    _EnvelopeService_Ingest_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "nats_envelope.proto",
}
