// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             v5.28.3
// source: api/relay.proto

package api

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 (
	RelayService_List_FullMethodName         = "/api.RelayService/List"
	RelayService_AddDevice_FullMethodName    = "/api.RelayService/AddDevice"
	RelayService_RemoveDevice_FullMethodName = "/api.RelayService/RemoveDevice"
	RelayService_ListDevices_FullMethodName  = "/api.RelayService/ListDevices"
)

// RelayServiceClient is the client API for RelayService 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 RelayServiceClient interface {
	// List lists the relays for the given application id.
	List(ctx context.Context, in *ListRelaysRequest, opts ...grpc.CallOption) (*ListRelaysResponse, error)
	// AddDevice adds the given device to the relay.
	AddDevice(ctx context.Context, in *AddRelayDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// RemoveDevice removes the given device from the relay.
	RemoveDevice(ctx context.Context, in *RemoveRelayDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// ListDevices lists the devices for the given relay.
	ListDevices(ctx context.Context, in *ListRelayDevicesRequest, opts ...grpc.CallOption) (*ListRelayDevicesResponse, error)
}

type relayServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewRelayServiceClient(cc grpc.ClientConnInterface) RelayServiceClient {
	return &relayServiceClient{cc}
}

func (c *relayServiceClient) List(ctx context.Context, in *ListRelaysRequest, opts ...grpc.CallOption) (*ListRelaysResponse, error) {
	out := new(ListRelaysResponse)
	err := c.cc.Invoke(ctx, RelayService_List_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *relayServiceClient) AddDevice(ctx context.Context, in *AddRelayDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, RelayService_AddDevice_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *relayServiceClient) RemoveDevice(ctx context.Context, in *RemoveRelayDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, RelayService_RemoveDevice_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *relayServiceClient) ListDevices(ctx context.Context, in *ListRelayDevicesRequest, opts ...grpc.CallOption) (*ListRelayDevicesResponse, error) {
	out := new(ListRelayDevicesResponse)
	err := c.cc.Invoke(ctx, RelayService_ListDevices_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// RelayServiceServer is the server API for RelayService service.
// All implementations must embed UnimplementedRelayServiceServer
// for forward compatibility
type RelayServiceServer interface {
	// List lists the relays for the given application id.
	List(context.Context, *ListRelaysRequest) (*ListRelaysResponse, error)
	// AddDevice adds the given device to the relay.
	AddDevice(context.Context, *AddRelayDeviceRequest) (*emptypb.Empty, error)
	// RemoveDevice removes the given device from the relay.
	RemoveDevice(context.Context, *RemoveRelayDeviceRequest) (*emptypb.Empty, error)
	// ListDevices lists the devices for the given relay.
	ListDevices(context.Context, *ListRelayDevicesRequest) (*ListRelayDevicesResponse, error)
	mustEmbedUnimplementedRelayServiceServer()
}

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

func (UnimplementedRelayServiceServer) List(context.Context, *ListRelaysRequest) (*ListRelaysResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedRelayServiceServer) AddDevice(context.Context, *AddRelayDeviceRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method AddDevice not implemented")
}
func (UnimplementedRelayServiceServer) RemoveDevice(context.Context, *RemoveRelayDeviceRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method RemoveDevice not implemented")
}
func (UnimplementedRelayServiceServer) ListDevices(context.Context, *ListRelayDevicesRequest) (*ListRelayDevicesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListDevices not implemented")
}
func (UnimplementedRelayServiceServer) mustEmbedUnimplementedRelayServiceServer() {}

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

func RegisterRelayServiceServer(s grpc.ServiceRegistrar, srv RelayServiceServer) {
	s.RegisterService(&RelayService_ServiceDesc, srv)
}

func _RelayService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListRelaysRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RelayServiceServer).List(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RelayService_List_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RelayServiceServer).List(ctx, req.(*ListRelaysRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RelayService_AddDevice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AddRelayDeviceRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RelayServiceServer).AddDevice(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RelayService_AddDevice_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RelayServiceServer).AddDevice(ctx, req.(*AddRelayDeviceRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RelayService_RemoveDevice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RemoveRelayDeviceRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RelayServiceServer).RemoveDevice(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RelayService_RemoveDevice_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RelayServiceServer).RemoveDevice(ctx, req.(*RemoveRelayDeviceRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RelayService_ListDevices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListRelayDevicesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RelayServiceServer).ListDevices(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RelayService_ListDevices_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RelayServiceServer).ListDevices(ctx, req.(*ListRelayDevicesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// RelayService_ServiceDesc is the grpc.ServiceDesc for RelayService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var RelayService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.RelayService",
	HandlerType: (*RelayServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _RelayService_List_Handler,
		},
		{
			MethodName: "AddDevice",
			Handler:    _RelayService_AddDevice_Handler,
		},
		{
			MethodName: "RemoveDevice",
			Handler:    _RelayService_RemoveDevice_Handler,
		},
		{
			MethodName: "ListDevices",
			Handler:    _RelayService_ListDevices_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/relay.proto",
}
