// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             v4.25.3
// source: invite.proto

package server

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 (
	Invite_Generate_FullMethodName = "/gateway.Invite/Generate"
	Invite_Revoke_FullMethodName   = "/gateway.Invite/Revoke"
)

// InviteClient is the client API for Invite 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 InviteClient interface {
	// Generate a new invitation code
	Generate(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GenerateResponse, error)
	// Revoke the generated invitation code
	Revoke(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

type inviteClient struct {
	cc grpc.ClientConnInterface
}

func NewInviteClient(cc grpc.ClientConnInterface) InviteClient {
	return &inviteClient{cc}
}

func (c *inviteClient) Generate(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GenerateResponse, error) {
	out := new(GenerateResponse)
	err := c.cc.Invoke(ctx, Invite_Generate_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

// InviteServer is the server API for Invite service.
// All implementations must embed UnimplementedInviteServer
// for forward compatibility
type InviteServer interface {
	// Generate a new invitation code
	Generate(context.Context, *emptypb.Empty) (*GenerateResponse, error)
	// Revoke the generated invitation code
	Revoke(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	mustEmbedUnimplementedInviteServer()
}

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

func (UnimplementedInviteServer) Generate(context.Context, *emptypb.Empty) (*GenerateResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Generate not implemented")
}
func (UnimplementedInviteServer) Revoke(context.Context, *emptypb.Empty) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Revoke not implemented")
}
func (UnimplementedInviteServer) mustEmbedUnimplementedInviteServer() {}

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

func RegisterInviteServer(s grpc.ServiceRegistrar, srv InviteServer) {
	s.RegisterService(&Invite_ServiceDesc, srv)
}

func _Invite_Generate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(emptypb.Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(InviteServer).Generate(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Invite_Generate_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(InviteServer).Generate(ctx, req.(*emptypb.Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _Invite_Revoke_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(emptypb.Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(InviteServer).Revoke(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Invite_Revoke_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(InviteServer).Revoke(ctx, req.(*emptypb.Empty))
	}
	return interceptor(ctx, in, info, handler)
}

// Invite_ServiceDesc is the grpc.ServiceDesc for Invite service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Invite_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gateway.Invite",
	HandlerType: (*InviteServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Generate",
			Handler:    _Invite_Generate_Handler,
		},
		{
			MethodName: "Revoke",
			Handler:    _Invite_Revoke_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "invite.proto",
}
