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

package saasv1alpha1

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 (
	AgentDirService_PushRecord_FullMethodName = "/saas.v1alpha1.AgentDirService/PushRecord"
	AgentDirService_PullRecord_FullMethodName = "/saas.v1alpha1.AgentDirService/PullRecord"
)

// AgentDirServiceClient is the client API for AgentDirService 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.
//
// This API is primarily intended for use by CLI tools. Implementations of these APIs should interact with the Agent Directory service to perform their operations.
type AgentDirServiceClient interface {
	PushRecord(ctx context.Context, opts ...grpc.CallOption) (AgentDirService_PushRecordClient, error)
	PullRecord(ctx context.Context, in *PullRecordRequest, opts ...grpc.CallOption) (AgentDirService_PullRecordClient, error)
}

type agentDirServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewAgentDirServiceClient(cc grpc.ClientConnInterface) AgentDirServiceClient {
	return &agentDirServiceClient{cc}
}

func (c *agentDirServiceClient) PushRecord(ctx context.Context, opts ...grpc.CallOption) (AgentDirService_PushRecordClient, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &AgentDirService_ServiceDesc.Streams[0], AgentDirService_PushRecord_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &agentDirServicePushRecordClient{ClientStream: stream}
	return x, nil
}

type AgentDirService_PushRecordClient interface {
	Send(*PushRecordRequest) error
	CloseAndRecv() (*PushRecordResponse, error)
	grpc.ClientStream
}

type agentDirServicePushRecordClient struct {
	grpc.ClientStream
}

func (x *agentDirServicePushRecordClient) Send(m *PushRecordRequest) error {
	return x.ClientStream.SendMsg(m)
}

func (x *agentDirServicePushRecordClient) CloseAndRecv() (*PushRecordResponse, error) {
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	m := new(PushRecordResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *agentDirServiceClient) PullRecord(ctx context.Context, in *PullRecordRequest, opts ...grpc.CallOption) (AgentDirService_PullRecordClient, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &AgentDirService_ServiceDesc.Streams[1], AgentDirService_PullRecord_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &agentDirServicePullRecordClient{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 AgentDirService_PullRecordClient interface {
	Recv() (*PullRecordResponse, error)
	grpc.ClientStream
}

type agentDirServicePullRecordClient struct {
	grpc.ClientStream
}

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

// AgentDirServiceServer is the server API for AgentDirService service.
// All implementations should embed UnimplementedAgentDirServiceServer
// for forward compatibility.
//
// This API is primarily intended for use by CLI tools. Implementations of these APIs should interact with the Agent Directory service to perform their operations.
type AgentDirServiceServer interface {
	PushRecord(AgentDirService_PushRecordServer) error
	PullRecord(*PullRecordRequest, AgentDirService_PullRecordServer) error
}

// UnimplementedAgentDirServiceServer should 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 UnimplementedAgentDirServiceServer struct{}

func (UnimplementedAgentDirServiceServer) PushRecord(AgentDirService_PushRecordServer) error {
	return status.Errorf(codes.Unimplemented, "method PushRecord not implemented")
}
func (UnimplementedAgentDirServiceServer) PullRecord(*PullRecordRequest, AgentDirService_PullRecordServer) error {
	return status.Errorf(codes.Unimplemented, "method PullRecord not implemented")
}
func (UnimplementedAgentDirServiceServer) testEmbeddedByValue() {}

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

func RegisterAgentDirServiceServer(s grpc.ServiceRegistrar, srv AgentDirServiceServer) {
	// If the following call pancis, it indicates UnimplementedAgentDirServiceServer 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(&AgentDirService_ServiceDesc, srv)
}

func _AgentDirService_PushRecord_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(AgentDirServiceServer).PushRecord(&agentDirServicePushRecordServer{ServerStream: stream})
}

type AgentDirService_PushRecordServer interface {
	SendAndClose(*PushRecordResponse) error
	Recv() (*PushRecordRequest, error)
	grpc.ServerStream
}

type agentDirServicePushRecordServer struct {
	grpc.ServerStream
}

func (x *agentDirServicePushRecordServer) SendAndClose(m *PushRecordResponse) error {
	return x.ServerStream.SendMsg(m)
}

func (x *agentDirServicePushRecordServer) Recv() (*PushRecordRequest, error) {
	m := new(PushRecordRequest)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func _AgentDirService_PullRecord_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(PullRecordRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(AgentDirServiceServer).PullRecord(m, &agentDirServicePullRecordServer{ServerStream: stream})
}

type AgentDirService_PullRecordServer interface {
	Send(*PullRecordResponse) error
	grpc.ServerStream
}

type agentDirServicePullRecordServer struct {
	grpc.ServerStream
}

func (x *agentDirServicePullRecordServer) Send(m *PullRecordResponse) error {
	return x.ServerStream.SendMsg(m)
}

// AgentDirService_ServiceDesc is the grpc.ServiceDesc for AgentDirService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AgentDirService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "saas.v1alpha1.AgentDirService",
	HandlerType: (*AgentDirServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "PushRecord",
			Handler:       _AgentDirService_PushRecord_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "PullRecord",
			Handler:       _AgentDirService_PullRecord_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "saas/v1alpha1/record_dir_service.proto",
}
