#
# Generated by erpcgen 1.14.0 on Tue Apr 28 12:25:45 2026.
#
# AUTOGENERATED - DO NOT EDIT
#

import erpc
from . import common, interface

# Client for file_service
class file_serviceClient(interface.Ifile_service):
    def __init__(self, manager):
        super(file_serviceClient, self).__init__()
        self._clientManager = manager

    def fileWriteBegin(self, path, total_size):
        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.FILEWRITEBEGIN_ID,
                sequence=request.sequence))
        if path is None:
            raise ValueError("path is None")
        codec.write_string(path)
        if total_size is None:
            raise ValueError("total_size is None")
        codec.write_uint32(total_size)

        # Send request and process reply.
        self._clientManager.perform_request(request)
        _result = codec.read_int32()
        return _result

    def fileWriteChunk(self, data):
        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.FILEWRITECHUNK_ID,
                sequence=request.sequence))
        if data is None:
            raise ValueError("data is None")
        codec.write_binary(data)

        # Send request and process reply.
        self._clientManager.perform_request(request)
        _result = codec.read_int32()
        return _result

    def fileWriteEnd(self):
        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.FILEWRITEEND_ID,
                sequence=request.sequence))

        # Send request and process reply.
        self._clientManager.perform_request(request)
        _result = codec.read_int32()
        return _result

    def fileWriteAbort(self):
        # Build remote function invocation message.
        request = self._clientManager.create_request()
        codec = request.codec
        codec.start_write_message(erpc.codec.MessageInfo(
                type=erpc.codec.MessageType.kInvocationMessage,
                service=self.SERVICE_ID,
                request=self.FILEWRITEABORT_ID,
                sequence=request.sequence))

        # Send request and process reply.
        self._clientManager.perform_request(request)
        _result = codec.read_int32()
        return _result


