//
//Спецификация АПИ управления сущностью User

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             v4.23.1
// source: deviceapis/device/v1/deviceapis_device_user_v1.proto

package deviceapis_device_v1

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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

const (
	UserService_DeleteUser_FullMethodName                = "/deviceapis.device.v1.UserService/DeleteUser"
	UserService_GetUserList_FullMethodName               = "/deviceapis.device.v1.UserService/GetUserList"
	UserService_PostUserNameReplace_FullMethodName       = "/deviceapis.device.v1.UserService/PostUserNameReplace"
	UserService_PostUserPasswordReplace_FullMethodName   = "/deviceapis.device.v1.UserService/PostUserPasswordReplace"
	UserService_PostUserPermissionReplace_FullMethodName = "/deviceapis.device.v1.UserService/PostUserPermissionReplace"
	UserService_SaveUser_FullMethodName                  = "/deviceapis.device.v1.UserService/SaveUser"
)

// UserServiceClient is the client API for UserService 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 UserServiceClient interface {
	// Метод удаления единичной сущности User по ключу
	DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error)
	// Метод получения списка сущностей User по фильтру
	GetUserList(ctx context.Context, in *GetUserListRequest, opts ...grpc.CallOption) (*GetUserListResponse, error)
	// Метод замены имени пользователя
	PostUserNameReplace(ctx context.Context, in *PostUserNameReplaceRequest, opts ...grpc.CallOption) (*PostUserNameReplaceResponse, error)
	// Метод замены пароля пользователя
	PostUserPasswordReplace(ctx context.Context, in *PostUserPasswordReplaceRequest, opts ...grpc.CallOption) (*PostUserPasswordReplaceResponse, error)
	// Метод замены пароля пользователя.
	// Будут изменены только явно переданные в data.permission разрешения
	PostUserPermissionReplace(ctx context.Context, in *PostUserPermissionReplaceRequest, opts ...grpc.CallOption) (*PostUserPermissionReplaceResponse, error)
	// Метод создания/редактирования сущности User
	SaveUser(ctx context.Context, in *SaveUserRequest, opts ...grpc.CallOption) (*SaveUserResponse, error)
}

type userServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient {
	return &userServiceClient{cc}
}

func (c *userServiceClient) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*DeleteUserResponse, error) {
	out := new(DeleteUserResponse)
	err := c.cc.Invoke(ctx, UserService_DeleteUser_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *userServiceClient) GetUserList(ctx context.Context, in *GetUserListRequest, opts ...grpc.CallOption) (*GetUserListResponse, error) {
	out := new(GetUserListResponse)
	err := c.cc.Invoke(ctx, UserService_GetUserList_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *userServiceClient) PostUserNameReplace(ctx context.Context, in *PostUserNameReplaceRequest, opts ...grpc.CallOption) (*PostUserNameReplaceResponse, error) {
	out := new(PostUserNameReplaceResponse)
	err := c.cc.Invoke(ctx, UserService_PostUserNameReplace_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *userServiceClient) PostUserPasswordReplace(ctx context.Context, in *PostUserPasswordReplaceRequest, opts ...grpc.CallOption) (*PostUserPasswordReplaceResponse, error) {
	out := new(PostUserPasswordReplaceResponse)
	err := c.cc.Invoke(ctx, UserService_PostUserPasswordReplace_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *userServiceClient) PostUserPermissionReplace(ctx context.Context, in *PostUserPermissionReplaceRequest, opts ...grpc.CallOption) (*PostUserPermissionReplaceResponse, error) {
	out := new(PostUserPermissionReplaceResponse)
	err := c.cc.Invoke(ctx, UserService_PostUserPermissionReplace_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *userServiceClient) SaveUser(ctx context.Context, in *SaveUserRequest, opts ...grpc.CallOption) (*SaveUserResponse, error) {
	out := new(SaveUserResponse)
	err := c.cc.Invoke(ctx, UserService_SaveUser_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// UserServiceServer is the server API for UserService service.
// All implementations should embed UnimplementedUserServiceServer
// for forward compatibility
type UserServiceServer interface {
	// Метод удаления единичной сущности User по ключу
	DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error)
	// Метод получения списка сущностей User по фильтру
	GetUserList(context.Context, *GetUserListRequest) (*GetUserListResponse, error)
	// Метод замены имени пользователя
	PostUserNameReplace(context.Context, *PostUserNameReplaceRequest) (*PostUserNameReplaceResponse, error)
	// Метод замены пароля пользователя
	PostUserPasswordReplace(context.Context, *PostUserPasswordReplaceRequest) (*PostUserPasswordReplaceResponse, error)
	// Метод замены пароля пользователя.
	// Будут изменены только явно переданные в data.permission разрешения
	PostUserPermissionReplace(context.Context, *PostUserPermissionReplaceRequest) (*PostUserPermissionReplaceResponse, error)
	// Метод создания/редактирования сущности User
	SaveUser(context.Context, *SaveUserRequest) (*SaveUserResponse, error)
}

// UnimplementedUserServiceServer should be embedded to have forward compatible implementations.
type UnimplementedUserServiceServer struct {
}

func (UnimplementedUserServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*DeleteUserResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented")
}
func (UnimplementedUserServiceServer) GetUserList(context.Context, *GetUserListRequest) (*GetUserListResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetUserList not implemented")
}
func (UnimplementedUserServiceServer) PostUserNameReplace(context.Context, *PostUserNameReplaceRequest) (*PostUserNameReplaceResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PostUserNameReplace not implemented")
}
func (UnimplementedUserServiceServer) PostUserPasswordReplace(context.Context, *PostUserPasswordReplaceRequest) (*PostUserPasswordReplaceResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PostUserPasswordReplace not implemented")
}
func (UnimplementedUserServiceServer) PostUserPermissionReplace(context.Context, *PostUserPermissionReplaceRequest) (*PostUserPermissionReplaceResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PostUserPermissionReplace not implemented")
}
func (UnimplementedUserServiceServer) SaveUser(context.Context, *SaveUserRequest) (*SaveUserResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SaveUser not implemented")
}

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

func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) {
	s.RegisterService(&UserService_ServiceDesc, srv)
}

func _UserService_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteUserRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UserServiceServer).DeleteUser(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UserService_DeleteUser_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UserServiceServer).DeleteUser(ctx, req.(*DeleteUserRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _UserService_GetUserList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetUserListRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UserServiceServer).GetUserList(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UserService_GetUserList_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UserServiceServer).GetUserList(ctx, req.(*GetUserListRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _UserService_PostUserNameReplace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PostUserNameReplaceRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UserServiceServer).PostUserNameReplace(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UserService_PostUserNameReplace_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UserServiceServer).PostUserNameReplace(ctx, req.(*PostUserNameReplaceRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _UserService_PostUserPasswordReplace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PostUserPasswordReplaceRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UserServiceServer).PostUserPasswordReplace(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UserService_PostUserPasswordReplace_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UserServiceServer).PostUserPasswordReplace(ctx, req.(*PostUserPasswordReplaceRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _UserService_PostUserPermissionReplace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PostUserPermissionReplaceRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UserServiceServer).PostUserPermissionReplace(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UserService_PostUserPermissionReplace_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UserServiceServer).PostUserPermissionReplace(ctx, req.(*PostUserPermissionReplaceRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _UserService_SaveUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SaveUserRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UserServiceServer).SaveUser(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UserService_SaveUser_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UserServiceServer).SaveUser(ctx, req.(*SaveUserRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var UserService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "deviceapis.device.v1.UserService",
	HandlerType: (*UserServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "DeleteUser",
			Handler:    _UserService_DeleteUser_Handler,
		},
		{
			MethodName: "GetUserList",
			Handler:    _UserService_GetUserList_Handler,
		},
		{
			MethodName: "PostUserNameReplace",
			Handler:    _UserService_PostUserNameReplace_Handler,
		},
		{
			MethodName: "PostUserPasswordReplace",
			Handler:    _UserService_PostUserPasswordReplace_Handler,
		},
		{
			MethodName: "PostUserPermissionReplace",
			Handler:    _UserService_PostUserPermissionReplace_Handler,
		},
		{
			MethodName: "SaveUser",
			Handler:    _UserService_SaveUser_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "deviceapis/device/v1/deviceapis_device_user_v1.proto",
}
