// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.0
// - protoc             v3.12.4
// source: internal/infrastructure/transport/grpc/proto/permission/v1/permission.proto

package permissionV1

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 (
	RolPermissionService_GetRolePermissionTree_FullMethodName = "/permission.v1.RolPermissionService/GetRolePermissionTree"
)

// RolPermissionServiceClient is the client API for RolPermissionService 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.
//
// Definisi service.
type RolPermissionServiceClient interface {
	// Mengambil permission tree untuk role dan/atau group tertentu.
	GetRolePermissionTree(ctx context.Context, in *GetRolePermissionTreeRequest, opts ...grpc.CallOption) (*RolePermissionTreeResponse, error)
}

type rolPermissionServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewRolPermissionServiceClient(cc grpc.ClientConnInterface) RolPermissionServiceClient {
	return &rolPermissionServiceClient{cc}
}

func (c *rolPermissionServiceClient) GetRolePermissionTree(ctx context.Context, in *GetRolePermissionTreeRequest, opts ...grpc.CallOption) (*RolePermissionTreeResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RolePermissionTreeResponse)
	err := c.cc.Invoke(ctx, RolPermissionService_GetRolePermissionTree_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// RolPermissionServiceServer is the server API for RolPermissionService service.
// All implementations must embed UnimplementedRolPermissionServiceServer
// for forward compatibility.
//
// Definisi service.
type RolPermissionServiceServer interface {
	// Mengambil permission tree untuk role dan/atau group tertentu.
	GetRolePermissionTree(context.Context, *GetRolePermissionTreeRequest) (*RolePermissionTreeResponse, error)
	mustEmbedUnimplementedRolPermissionServiceServer()
}

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

func (UnimplementedRolPermissionServiceServer) GetRolePermissionTree(context.Context, *GetRolePermissionTreeRequest) (*RolePermissionTreeResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method GetRolePermissionTree not implemented")
}
func (UnimplementedRolPermissionServiceServer) mustEmbedUnimplementedRolPermissionServiceServer() {}
func (UnimplementedRolPermissionServiceServer) testEmbeddedByValue()                              {}

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

func RegisterRolPermissionServiceServer(s grpc.ServiceRegistrar, srv RolPermissionServiceServer) {
	// If the following call panics, it indicates UnimplementedRolPermissionServiceServer 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(&RolPermissionService_ServiceDesc, srv)
}

func _RolPermissionService_GetRolePermissionTree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetRolePermissionTreeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RolPermissionServiceServer).GetRolePermissionTree(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: RolPermissionService_GetRolePermissionTree_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RolPermissionServiceServer).GetRolePermissionTree(ctx, req.(*GetRolePermissionTreeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// RolPermissionService_ServiceDesc is the grpc.ServiceDesc for RolPermissionService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var RolPermissionService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "permission.v1.RolPermissionService",
	HandlerType: (*RolPermissionServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetRolePermissionTree",
			Handler:    _RolPermissionService_GetRolePermissionTree_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "internal/infrastructure/transport/grpc/proto/permission/v1/permission.proto",
}
