Exemplo n.º 1
0
 def Collect(self):
     args = vfs_pb2.ApiUpdateVfsFileContentArgs(client_id=self.client_id,
                                                file_path=self.path)
     result = self._context.SendRequest("UpdateVfsFileContent", args)
     return CollectOperation(client_id=self.client_id,
                             operation_id=result.operation_id,
                             target_file=self,
                             context=self._context)
Exemplo n.º 2
0
    def Collect(self) -> "CollectOperation":
        args = vfs_pb2.ApiUpdateVfsFileContentArgs(client_id=self.client_id,
                                                   file_path=self.path)

        result = self._context.SendRequest("UpdateVfsFileContent", args)
        if not isinstance(result, vfs_pb2.ApiUpdateVfsFileContentResult):
            raise TypeError(f"Unexpected result type: {type(result)}")

        return CollectOperation(client_id=self.client_id,
                                operation_id=result.operation_id,
                                target_file=self,
                                context=self._context)