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

package v1

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 (
	PresenceService_GetMyPresence_FullMethodName           = "/openspeak.v1.PresenceService/GetMyPresence"
	PresenceService_GetUserPresence_FullMethodName         = "/openspeak.v1.PresenceService/GetUserPresence"
	PresenceService_ListOnlineUsers_FullMethodName         = "/openspeak.v1.PresenceService/ListOnlineUsers"
	PresenceService_ListChannelMembers_FullMethodName      = "/openspeak.v1.PresenceService/ListChannelMembers"
	PresenceService_SubscribePresenceEvents_FullMethodName = "/openspeak.v1.PresenceService/SubscribePresenceEvents"
	PresenceService_ReportActivity_FullMethodName          = "/openspeak.v1.PresenceService/ReportActivity"
	PresenceService_SetPresenceStatus_FullMethodName       = "/openspeak.v1.PresenceService/SetPresenceStatus"
	PresenceService_SetMuteStatus_FullMethodName           = "/openspeak.v1.PresenceService/SetMuteStatus"
)

// PresenceServiceClient is the client API for PresenceService 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 PresenceServiceClient interface {
	GetMyPresence(ctx context.Context, in *GetPresenceRequest, opts ...grpc.CallOption) (*UserPresence, error)
	GetUserPresence(ctx context.Context, in *GetPresenceRequest, opts ...grpc.CallOption) (*UserPresence, error)
	ListOnlineUsers(ctx context.Context, in *ListOnlineUsersRequest, opts ...grpc.CallOption) (*ListOnlineUsersResponse, error)
	ListChannelMembers(ctx context.Context, in *ListChannelMembersRequest, opts ...grpc.CallOption) (*ListChannelMembersResponse, error)
	SubscribePresenceEvents(ctx context.Context, in *SubscribePresenceRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PresenceEvent], error)
	ReportActivity(ctx context.Context, in *ReportActivityRequest, opts ...grpc.CallOption) (*Status, error)
	SetPresenceStatus(ctx context.Context, in *SetPresenceStatusRequest, opts ...grpc.CallOption) (*UserPresence, error)
	SetMuteStatus(ctx context.Context, in *SetMuteStatusRequest, opts ...grpc.CallOption) (*UserPresence, error)
}

type presenceServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewPresenceServiceClient(cc grpc.ClientConnInterface) PresenceServiceClient {
	return &presenceServiceClient{cc}
}

func (c *presenceServiceClient) GetMyPresence(ctx context.Context, in *GetPresenceRequest, opts ...grpc.CallOption) (*UserPresence, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(UserPresence)
	err := c.cc.Invoke(ctx, PresenceService_GetMyPresence_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *presenceServiceClient) GetUserPresence(ctx context.Context, in *GetPresenceRequest, opts ...grpc.CallOption) (*UserPresence, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(UserPresence)
	err := c.cc.Invoke(ctx, PresenceService_GetUserPresence_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *presenceServiceClient) ListOnlineUsers(ctx context.Context, in *ListOnlineUsersRequest, opts ...grpc.CallOption) (*ListOnlineUsersResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListOnlineUsersResponse)
	err := c.cc.Invoke(ctx, PresenceService_ListOnlineUsers_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *presenceServiceClient) ListChannelMembers(ctx context.Context, in *ListChannelMembersRequest, opts ...grpc.CallOption) (*ListChannelMembersResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListChannelMembersResponse)
	err := c.cc.Invoke(ctx, PresenceService_ListChannelMembers_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *presenceServiceClient) SubscribePresenceEvents(ctx context.Context, in *SubscribePresenceRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PresenceEvent], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &PresenceService_ServiceDesc.Streams[0], PresenceService_SubscribePresenceEvents_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[SubscribePresenceRequest, PresenceEvent]{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
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type PresenceService_SubscribePresenceEventsClient = grpc.ServerStreamingClient[PresenceEvent]

func (c *presenceServiceClient) ReportActivity(ctx context.Context, in *ReportActivityRequest, opts ...grpc.CallOption) (*Status, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Status)
	err := c.cc.Invoke(ctx, PresenceService_ReportActivity_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *presenceServiceClient) SetPresenceStatus(ctx context.Context, in *SetPresenceStatusRequest, opts ...grpc.CallOption) (*UserPresence, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(UserPresence)
	err := c.cc.Invoke(ctx, PresenceService_SetPresenceStatus_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *presenceServiceClient) SetMuteStatus(ctx context.Context, in *SetMuteStatusRequest, opts ...grpc.CallOption) (*UserPresence, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(UserPresence)
	err := c.cc.Invoke(ctx, PresenceService_SetMuteStatus_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// PresenceServiceServer is the server API for PresenceService service.
// All implementations must embed UnimplementedPresenceServiceServer
// for forward compatibility.
type PresenceServiceServer interface {
	GetMyPresence(context.Context, *GetPresenceRequest) (*UserPresence, error)
	GetUserPresence(context.Context, *GetPresenceRequest) (*UserPresence, error)
	ListOnlineUsers(context.Context, *ListOnlineUsersRequest) (*ListOnlineUsersResponse, error)
	ListChannelMembers(context.Context, *ListChannelMembersRequest) (*ListChannelMembersResponse, error)
	SubscribePresenceEvents(*SubscribePresenceRequest, grpc.ServerStreamingServer[PresenceEvent]) error
	ReportActivity(context.Context, *ReportActivityRequest) (*Status, error)
	SetPresenceStatus(context.Context, *SetPresenceStatusRequest) (*UserPresence, error)
	SetMuteStatus(context.Context, *SetMuteStatusRequest) (*UserPresence, error)
	mustEmbedUnimplementedPresenceServiceServer()
}

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

func (UnimplementedPresenceServiceServer) GetMyPresence(context.Context, *GetPresenceRequest) (*UserPresence, error) {
	return nil, status.Error(codes.Unimplemented, "method GetMyPresence not implemented")
}
func (UnimplementedPresenceServiceServer) GetUserPresence(context.Context, *GetPresenceRequest) (*UserPresence, error) {
	return nil, status.Error(codes.Unimplemented, "method GetUserPresence not implemented")
}
func (UnimplementedPresenceServiceServer) ListOnlineUsers(context.Context, *ListOnlineUsersRequest) (*ListOnlineUsersResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ListOnlineUsers not implemented")
}
func (UnimplementedPresenceServiceServer) ListChannelMembers(context.Context, *ListChannelMembersRequest) (*ListChannelMembersResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ListChannelMembers not implemented")
}
func (UnimplementedPresenceServiceServer) SubscribePresenceEvents(*SubscribePresenceRequest, grpc.ServerStreamingServer[PresenceEvent]) error {
	return status.Error(codes.Unimplemented, "method SubscribePresenceEvents not implemented")
}
func (UnimplementedPresenceServiceServer) ReportActivity(context.Context, *ReportActivityRequest) (*Status, error) {
	return nil, status.Error(codes.Unimplemented, "method ReportActivity not implemented")
}
func (UnimplementedPresenceServiceServer) SetPresenceStatus(context.Context, *SetPresenceStatusRequest) (*UserPresence, error) {
	return nil, status.Error(codes.Unimplemented, "method SetPresenceStatus not implemented")
}
func (UnimplementedPresenceServiceServer) SetMuteStatus(context.Context, *SetMuteStatusRequest) (*UserPresence, error) {
	return nil, status.Error(codes.Unimplemented, "method SetMuteStatus not implemented")
}
func (UnimplementedPresenceServiceServer) mustEmbedUnimplementedPresenceServiceServer() {}
func (UnimplementedPresenceServiceServer) testEmbeddedByValue()                         {}

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

func RegisterPresenceServiceServer(s grpc.ServiceRegistrar, srv PresenceServiceServer) {
	// If the following call panics, it indicates UnimplementedPresenceServiceServer 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(&PresenceService_ServiceDesc, srv)
}

func _PresenceService_GetMyPresence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetPresenceRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PresenceServiceServer).GetMyPresence(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PresenceService_GetMyPresence_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PresenceServiceServer).GetMyPresence(ctx, req.(*GetPresenceRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PresenceService_GetUserPresence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetPresenceRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PresenceServiceServer).GetUserPresence(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PresenceService_GetUserPresence_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PresenceServiceServer).GetUserPresence(ctx, req.(*GetPresenceRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PresenceService_ListOnlineUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListOnlineUsersRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PresenceServiceServer).ListOnlineUsers(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PresenceService_ListOnlineUsers_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PresenceServiceServer).ListOnlineUsers(ctx, req.(*ListOnlineUsersRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PresenceService_ListChannelMembers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListChannelMembersRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PresenceServiceServer).ListChannelMembers(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PresenceService_ListChannelMembers_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PresenceServiceServer).ListChannelMembers(ctx, req.(*ListChannelMembersRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PresenceService_SubscribePresenceEvents_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(SubscribePresenceRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(PresenceServiceServer).SubscribePresenceEvents(m, &grpc.GenericServerStream[SubscribePresenceRequest, PresenceEvent]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type PresenceService_SubscribePresenceEventsServer = grpc.ServerStreamingServer[PresenceEvent]

func _PresenceService_ReportActivity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ReportActivityRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PresenceServiceServer).ReportActivity(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PresenceService_ReportActivity_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PresenceServiceServer).ReportActivity(ctx, req.(*ReportActivityRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PresenceService_SetPresenceStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SetPresenceStatusRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PresenceServiceServer).SetPresenceStatus(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PresenceService_SetPresenceStatus_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PresenceServiceServer).SetPresenceStatus(ctx, req.(*SetPresenceStatusRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PresenceService_SetMuteStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SetMuteStatusRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PresenceServiceServer).SetMuteStatus(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PresenceService_SetMuteStatus_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PresenceServiceServer).SetMuteStatus(ctx, req.(*SetMuteStatusRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// PresenceService_ServiceDesc is the grpc.ServiceDesc for PresenceService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var PresenceService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "openspeak.v1.PresenceService",
	HandlerType: (*PresenceServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetMyPresence",
			Handler:    _PresenceService_GetMyPresence_Handler,
		},
		{
			MethodName: "GetUserPresence",
			Handler:    _PresenceService_GetUserPresence_Handler,
		},
		{
			MethodName: "ListOnlineUsers",
			Handler:    _PresenceService_ListOnlineUsers_Handler,
		},
		{
			MethodName: "ListChannelMembers",
			Handler:    _PresenceService_ListChannelMembers_Handler,
		},
		{
			MethodName: "ReportActivity",
			Handler:    _PresenceService_ReportActivity_Handler,
		},
		{
			MethodName: "SetPresenceStatus",
			Handler:    _PresenceService_SetPresenceStatus_Handler,
		},
		{
			MethodName: "SetMuteStatus",
			Handler:    _PresenceService_SetMuteStatus_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SubscribePresenceEvents",
			Handler:       _PresenceService_SubscribePresenceEvents_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "proto/presence.proto",
}
