// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v6.30.2
// 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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

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.
//
// RelayService is the service providing API methos for managing relays.
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) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListRelaysResponse)
	err := c.cc.Invoke(ctx, RelayService_List_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

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

func (c *relayServiceClient) ListDevices(ctx context.Context, in *ListRelayDevicesRequest, opts ...grpc.CallOption) (*ListRelayDevicesResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListRelayDevicesResponse)
	err := c.cc.Invoke(ctx, RelayService_ListDevices_FullMethodName, in, out, cOpts...)
	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.
//
// RelayService is the service providing API methos for managing relays.
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.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
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() {}
func (UnimplementedRelayServiceServer) testEmbeddedByValue()                      {}

// 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) {
	// If the following call pancis, it indicates UnimplementedRelayServiceServer 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(&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",
}
