// Code generated by protoc-gen-go-grpc. DO NOT EDIT.

package api_permission

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	common "server/app_comm/api/common"
)

// 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

// PermissionServiceClient is the client API for PermissionService 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 PermissionServiceClient interface {
	// === DB information
	GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*PermissionBasicInfo, error)
	// References
	GetRoleIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error)
	// Common
	GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error)
}

type permissionServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewPermissionServiceClient(cc grpc.ClientConnInterface) PermissionServiceClient {
	return &permissionServiceClient{cc}
}

func (c *permissionServiceClient) GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*PermissionBasicInfo, error) {
	out := new(PermissionBasicInfo)
	err := c.cc.Invoke(ctx, "/pagerino.permission.PermissionService/GetInfo", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *permissionServiceClient) GetRoleIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) {
	out := new(common.References)
	err := c.cc.Invoke(ctx, "/pagerino.permission.PermissionService/GetRoleIds", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *permissionServiceClient) GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) {
	out := new(common.Meta)
	err := c.cc.Invoke(ctx, "/pagerino.permission.PermissionService/GetMeta", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// PermissionServiceServer is the server API for PermissionService service.
// All implementations must embed UnimplementedPermissionServiceServer
// for forward compatibility
type PermissionServiceServer interface {
	// === DB information
	GetInfo(context.Context, *common.StrIndex) (*PermissionBasicInfo, error)
	// References
	GetRoleIds(context.Context, *common.StrIndex) (*common.References, error)
	// Common
	GetMeta(context.Context, *common.StrIndex) (*common.Meta, error)
	mustEmbedUnimplementedPermissionServiceServer()
}

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

func (UnimplementedPermissionServiceServer) GetInfo(context.Context, *common.StrIndex) (*PermissionBasicInfo, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented")
}
func (UnimplementedPermissionServiceServer) GetRoleIds(context.Context, *common.StrIndex) (*common.References, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetRoleIds not implemented")
}
func (UnimplementedPermissionServiceServer) GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented")
}
func (UnimplementedPermissionServiceServer) mustEmbedUnimplementedPermissionServiceServer() {}

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

func RegisterPermissionServiceServer(s grpc.ServiceRegistrar, srv PermissionServiceServer) {
	s.RegisterService(&PermissionService_ServiceDesc, srv)
}

func _PermissionService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(common.StrIndex)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PermissionServiceServer).GetInfo(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/pagerino.permission.PermissionService/GetInfo",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PermissionServiceServer).GetInfo(ctx, req.(*common.StrIndex))
	}
	return interceptor(ctx, in, info, handler)
}

func _PermissionService_GetRoleIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(common.StrIndex)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PermissionServiceServer).GetRoleIds(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/pagerino.permission.PermissionService/GetRoleIds",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PermissionServiceServer).GetRoleIds(ctx, req.(*common.StrIndex))
	}
	return interceptor(ctx, in, info, handler)
}

func _PermissionService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(common.StrIndex)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PermissionServiceServer).GetMeta(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/pagerino.permission.PermissionService/GetMeta",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PermissionServiceServer).GetMeta(ctx, req.(*common.StrIndex))
	}
	return interceptor(ctx, in, info, handler)
}

// PermissionService_ServiceDesc is the grpc.ServiceDesc for PermissionService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var PermissionService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pagerino.permission.PermissionService",
	HandlerType: (*PermissionServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetInfo",
			Handler:    _PermissionService_GetInfo_Handler,
		},
		{
			MethodName: "GetRoleIds",
			Handler:    _PermissionService_GetRoleIds_Handler,
		},
		{
			MethodName: "GetMeta",
			Handler:    _PermissionService_GetMeta_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "permission.proto",
}
