// GENERATED — DO NOT EDIT

///|
/// [Upstream documentation](https://docs.gtk.org/gio/iface.File.html).
pub type File

///|
pub(open) trait IFile {
  fn as_file(Self) -> File
  fn append_to(Self, FileCreateFlags, &ICancellable?) -> FileOutputStream raise @glib.Error_ = _
  fn build_attribute_list_for_copy(Self, FileCopyFlags, &ICancellable?) -> String raise @glib.Error_ = _
  fn copy_attributes(Self, &IFile, FileCopyFlags, &ICancellable?) -> Bool raise @glib.Error_ = _
  fn copy_finish(Self, &IAsyncResult) -> Bool raise @glib.Error_ = _
  fn create(Self, FileCreateFlags, &ICancellable?) -> FileOutputStream raise @glib.Error_ = _
  fn create_readwrite(Self, FileCreateFlags, &ICancellable?) -> FileIOStream raise @glib.Error_ = _
  fn delete(Self, &ICancellable?) -> Bool raise @glib.Error_ = _
  fn dup(Self) -> File = _
  fn enumerate_children(Self, String, FileQueryInfoFlags, &ICancellable?) -> FileEnumerator raise @glib.Error_ = _
  fn equal(Self, &IFile) -> Bool = _
  fn find_enclosing_mount(Self, &ICancellable?) -> Mount raise @glib.Error_ = _
  fn get_basename(Self) -> String? = _
  fn get_child(Self, String) -> File = _
  fn get_child_for_display_name(Self, String) -> File raise @glib.Error_ = _
  fn get_parent(Self) -> File? = _
  fn get_parse_name(Self) -> String = _
  fn get_path(Self) -> String? = _
  fn get_relative_path(Self, &IFile) -> String? = _
  fn get_uri(Self) -> String = _
  fn get_uri_scheme(Self) -> String? = _
  fn has_parent(Self, &IFile?) -> Bool = _
  fn has_prefix(Self, &IFile) -> Bool = _
  fn has_uri_scheme(Self, String) -> Bool = _
  fn hash(Self) -> UInt = _
  fn is_native(Self) -> Bool = _
  fn load_bytes(Self, &ICancellable?) -> (Bytes, String?) raise @glib.Error_ = _
  fn load_bytes_finish(Self, &IAsyncResult) -> (Bytes, String?) raise @glib.Error_ = _
  fn make_directory(Self, &ICancellable?) -> Bool raise @glib.Error_ = _
  fn make_directory_with_parents(Self, &ICancellable?) -> Bool raise @glib.Error_ = _
  fn make_symbolic_link(Self, String, &ICancellable?) -> Bool raise @glib.Error_ = _
  fn measure_disk_usage_finish(Self, &IAsyncResult) -> (
    Bool,
    UInt64,
    UInt64,
    UInt64,
  ) raise @glib.Error_ = _
  fn monitor(Self, FileMonitorFlags, &ICancellable?) -> FileMonitor raise @glib.Error_ = _
  fn monitor_directory(Self, FileMonitorFlags, &ICancellable?) -> FileMonitor raise @glib.Error_ = _
  fn monitor_file(Self, FileMonitorFlags, &ICancellable?) -> FileMonitor raise @glib.Error_ = _
  fn move_finish(Self, &IAsyncResult) -> Bool raise @glib.Error_ = _
  fn open_readwrite(Self, &ICancellable?) -> FileIOStream raise @glib.Error_ = _
  fn peek_path(Self) -> String? = _
  fn query_default_handler(Self, &ICancellable?) -> AppInfo raise @glib.Error_ = _
  fn query_exists(Self, &ICancellable?) -> Bool = _
  fn query_file_type(Self, FileQueryInfoFlags, &ICancellable?) -> FileType = _
  fn query_filesystem_info(Self, String, &ICancellable?) -> FileInfo raise @glib.Error_ = _
  fn query_info(Self, String, FileQueryInfoFlags, &ICancellable?) -> FileInfo raise @glib.Error_ = _
  fn read(Self, &ICancellable?) -> FileInputStream raise @glib.Error_ = _
  fn replace(Self, String?, Bool, FileCreateFlags, &ICancellable?) -> FileOutputStream raise @glib.Error_ = _
  fn replace_contents_finish(Self, &IAsyncResult) -> (Bool, String?) raise @glib.Error_ = _
  fn replace_readwrite(Self, String?, Bool, FileCreateFlags, &ICancellable?) -> FileIOStream raise @glib.Error_ = _
  fn resolve_relative_path(Self, String) -> File = _
  fn set_attribute_byte_string(
    Self,
    String,
    String,
    FileQueryInfoFlags,
    &ICancellable?,
  ) -> Bool raise @glib.Error_ = _
  fn set_attribute_int32(Self, String, Int, FileQueryInfoFlags, &ICancellable?) -> Bool raise @glib.Error_ = _
  fn set_attribute_int64(
    Self,
    String,
    Int64,
    FileQueryInfoFlags,
    &ICancellable?,
  ) -> Bool raise @glib.Error_ = _
  fn set_attribute_string(
    Self,
    String,
    String,
    FileQueryInfoFlags,
    &ICancellable?,
  ) -> Bool raise @glib.Error_ = _
  fn set_attribute_uint32(
    Self,
    String,
    UInt,
    FileQueryInfoFlags,
    &ICancellable?,
  ) -> Bool raise @glib.Error_ = _
  fn set_attribute_uint64(
    Self,
    String,
    UInt64,
    FileQueryInfoFlags,
    &ICancellable?,
  ) -> Bool raise @glib.Error_ = _
  fn set_attributes_from_info(
    Self,
    &IFileInfo,
    FileQueryInfoFlags,
    &ICancellable?,
  ) -> Bool raise @glib.Error_ = _
  fn set_display_name(Self, String, &ICancellable?) -> File raise @glib.Error_ = _
  fn supports_thread_contexts(Self) -> Bool = _
  fn trash(Self, &ICancellable?) -> Bool raise @glib.Error_ = _
  fn append_to_async(
    Self,
    FileCreateFlags,
    Int,
    &ICancellable?,
    (Result[FileOutputStream, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn create_async(
    Self,
    FileCreateFlags,
    Int,
    &ICancellable?,
    (Result[FileOutputStream, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn create_readwrite_async(
    Self,
    FileCreateFlags,
    Int,
    &ICancellable?,
    (Result[FileIOStream, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn delete_async(
    Self,
    Int,
    &ICancellable?,
    (Result[Bool, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn eject_mountable_with_operation(
    Self,
    MountUnmountFlags,
    &IMountOperation?,
    &ICancellable?,
    (Result[Bool, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn enumerate_children_async(
    Self,
    String,
    FileQueryInfoFlags,
    Int,
    &ICancellable?,
    (Result[FileEnumerator, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn find_enclosing_mount_async(
    Self,
    Int,
    &ICancellable?,
    (Result[Mount, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn make_directory_async(
    Self,
    Int,
    &ICancellable?,
    (Result[Bool, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn make_symbolic_link_async(
    Self,
    String,
    Int,
    &ICancellable?,
    (Result[Bool, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn mount_enclosing_volume(
    Self,
    MountMountFlags,
    &IMountOperation?,
    &ICancellable?,
    (Result[Bool, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn mount_mountable(
    Self,
    MountMountFlags,
    &IMountOperation?,
    &ICancellable?,
    (Result[File, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn open_readwrite_async(
    Self,
    Int,
    &ICancellable?,
    (Result[FileIOStream, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn poll_mountable(Self, &ICancellable?, (Result[Bool, @glib.Error_]) -> Unit) -> Unit = _
  fn query_default_handler_async(
    Self,
    Int,
    &ICancellable?,
    (Result[AppInfo, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn query_filesystem_info_async(
    Self,
    String,
    Int,
    &ICancellable?,
    (Result[FileInfo, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn query_info_async(
    Self,
    String,
    FileQueryInfoFlags,
    Int,
    &ICancellable?,
    (Result[FileInfo, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn read_async(
    Self,
    Int,
    &ICancellable?,
    (Result[FileInputStream, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn replace_async(
    Self,
    String?,
    Bool,
    FileCreateFlags,
    Int,
    &ICancellable?,
    (Result[FileOutputStream, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn replace_readwrite_async(
    Self,
    String?,
    Bool,
    FileCreateFlags,
    Int,
    &ICancellable?,
    (Result[FileIOStream, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn set_display_name_async(
    Self,
    String,
    Int,
    &ICancellable?,
    (Result[File, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn start_mountable(
    Self,
    DriveStartFlags,
    &IMountOperation?,
    &ICancellable?,
    (Result[Bool, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn stop_mountable(
    Self,
    MountUnmountFlags,
    &IMountOperation?,
    &ICancellable?,
    (Result[Bool, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn trash_async(
    Self,
    Int,
    &ICancellable?,
    (Result[Bool, @glib.Error_]) -> Unit,
  ) -> Unit = _
  fn unmount_mountable_with_operation(
    Self,
    MountUnmountFlags,
    &IMountOperation?,
    &ICancellable?,
    (Result[Bool, @glib.Error_]) -> Unit,
  ) -> Unit = _
}

///|
pub impl IFile for File with fn as_file(self) {
  self
}

///|
#borrow(__sa_args)
extern "c" fn moonbit_g_file_new_build_filenamev(
  __sa_args : FixedArray[Bytes],
) -> File = "moonbit_g_file_new_build_filenamev"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.File.new_build_filenamev.html).
pub fn File::new_build_filenamev(args : Array[String]) -> File {
  moonbit_g_file_new_build_filenamev(
    FixedArray::from_array(args.map(fn(s) { @encoding/utf8.encode(s) })),
  )
}

///|
#borrow(arg)
extern "c" fn moonbit_g_file_new_for_commandline_arg(arg : Bytes) -> File = "moonbit_g_file_new_for_commandline_arg"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.File.new_for_commandline_arg.html).
pub fn File::new_for_commandline_arg(arg : String) -> File {
  moonbit_g_file_new_for_commandline_arg(@encoding/utf8.encode(arg))
}

///|
#borrow(arg, cwd)
extern "c" fn moonbit_g_file_new_for_commandline_arg_and_cwd(
  arg : Bytes,
  cwd : Bytes,
) -> File = "moonbit_g_file_new_for_commandline_arg_and_cwd"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.File.new_for_commandline_arg_and_cwd.html).
pub fn File::new_for_commandline_arg_and_cwd(
  arg : String,
  cwd : String,
) -> File {
  moonbit_g_file_new_for_commandline_arg_and_cwd(
    @encoding/utf8.encode(arg),
    @encoding/utf8.encode(cwd),
  )
}

///|
#borrow(path)
extern "c" fn moonbit_g_file_new_for_path(path : Bytes) -> File = "moonbit_g_file_new_for_path"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.File.new_for_path.html).
pub fn File::new_for_path(path : String) -> File {
  moonbit_g_file_new_for_path(@encoding/utf8.encode(path))
}

///|
#borrow(uri)
extern "c" fn moonbit_g_file_new_for_uri(uri : Bytes) -> File = "moonbit_g_file_new_for_uri"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.File.new_for_uri.html).
pub fn File::new_for_uri(uri : String) -> File {
  moonbit_g_file_new_for_uri(@encoding/utf8.encode(uri))
}

///|
#borrow(result, error)
extern "c" fn moonbit_g_file_new_tmp_dir_finish(
  result : AsyncResult,
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> File = "moonbit_g_file_new_tmp_dir_finish"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.File.new_tmp_dir_finish.html).
pub fn File::new_tmp_dir_finish(
  result : &IAsyncResult,
) -> File raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_new_tmp_dir_finish(
    result.as_async_result(),
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => result
  }
}

///|
#borrow(parse_name)
extern "c" fn moonbit_g_file_parse_name(parse_name : Bytes) -> File = "moonbit_g_file_parse_name"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/type_func.File.parse_name.html).
pub fn File::parse_name(parse_name : String) -> File {
  moonbit_g_file_parse_name(@encoding/utf8.encode(parse_name))
}

///|
#borrow(self_, cancellable, error)
extern "c" fn moonbit_g_file_append_to(
  self_ : File,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> FileOutputStream = "moonbit_g_file_append_to"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.append_to.html).
pub fn File::append_to(
  self : File,
  flags : FileCreateFlags,
  cancellable : &ICancellable?,
) -> FileOutputStream raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_append_to(
    self,
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, cancellable, error)
extern "c" fn moonbit_g_file_build_attribute_list_for_copy(
  self_ : File,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bytes = "moonbit_g_file_build_attribute_list_for_copy"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.build_attribute_list_for_copy.html).
pub fn File::build_attribute_list_for_copy(
  self : File,
  flags : FileCopyFlags,
  cancellable : &ICancellable?,
) -> String raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result_ = moonbit_g_file_build_attribute_list_for_copy(
    self,
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  let result = @encoding/utf8.decode_lossy(result_)
  result
}

///|
#borrow(self_, destination, cancellable, error)
extern "c" fn moonbit_g_file_copy_attributes(
  self_ : File,
  destination : File,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_file_copy_attributes"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.copy_attributes.html).
pub fn File::copy_attributes(
  self : File,
  destination : &IFile,
  flags : FileCopyFlags,
  cancellable : &ICancellable?,
) -> Bool raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_copy_attributes(
    self,
    destination.as_file(),
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, res, error)
extern "c" fn moonbit_g_file_copy_finish(
  self_ : File,
  res : AsyncResult,
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_file_copy_finish"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.copy_finish.html).
pub fn File::copy_finish(
  self : File,
  res : &IAsyncResult,
) -> Bool raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_copy_finish(self, res.as_async_result(), error_)
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, cancellable, error)
extern "c" fn moonbit_g_file_create(
  self_ : File,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> FileOutputStream = "moonbit_g_file_create"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.create.html).
pub fn File::create(
  self : File,
  flags : FileCreateFlags,
  cancellable : &ICancellable?,
) -> FileOutputStream raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_create(
    self,
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, cancellable, error)
extern "c" fn moonbit_g_file_create_readwrite(
  self_ : File,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> FileIOStream = "moonbit_g_file_create_readwrite"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.create_readwrite.html).
pub fn File::create_readwrite(
  self : File,
  flags : FileCreateFlags,
  cancellable : &ICancellable?,
) -> FileIOStream raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_create_readwrite(
    self,
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, cancellable, error)
extern "c" fn moonbit_g_file_delete(
  self_ : File,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_file_delete"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.delete.html).
pub fn File::delete(
  self : File,
  cancellable : &ICancellable?,
) -> Bool raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_delete(
    self,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.dup.html).
#borrow(self)
pub extern "c" fn File::dup(self : File) -> File = "moonbit_g_file_dup"

///|
#borrow(self_, attributes, cancellable, error)
extern "c" fn moonbit_g_file_enumerate_children(
  self_ : File,
  attributes : Bytes,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> FileEnumerator = "moonbit_g_file_enumerate_children"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.enumerate_children.html).
pub fn File::enumerate_children(
  self : File,
  attributes : String,
  flags : FileQueryInfoFlags,
  cancellable : &ICancellable?,
) -> FileEnumerator raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_enumerate_children(
    self,
    @encoding/utf8.encode(attributes),
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, file2)
extern "c" fn moonbit_g_file_equal(self_ : File, file2 : File) -> Bool = "moonbit_g_file_equal"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.equal.html).
pub fn File::equal(self : File, file2 : &IFile) -> Bool {
  moonbit_g_file_equal(self, file2.as_file())
}

///|
#borrow(self_, cancellable, error)
extern "c" fn moonbit_g_file_find_enclosing_mount(
  self_ : File,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Mount = "moonbit_g_file_find_enclosing_mount"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.find_enclosing_mount.html).
pub fn File::find_enclosing_mount(
  self : File,
  cancellable : &ICancellable?,
) -> Mount raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_find_enclosing_mount(
    self,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_)
extern "c" fn moonbit_g_file_get_basename(
  self_ : File,
) -> @glib.Nullable[Bytes] = "moonbit_g_file_get_basename"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.get_basename.html).
pub fn File::get_basename(self : File) -> String? {
  let result = moonbit_g_file_get_basename(self)
  match result.to_option() {
    Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
    None => None
  }
}

///|
#borrow(self_, name)
extern "c" fn moonbit_g_file_get_child(self_ : File, name : Bytes) -> File = "moonbit_g_file_get_child"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.get_child.html).
pub fn File::get_child(self : File, name : String) -> File {
  moonbit_g_file_get_child(self, @encoding/utf8.encode(name))
}

///|
#borrow(self_, display_name, error)
extern "c" fn moonbit_g_file_get_child_for_display_name(
  self_ : File,
  display_name : Bytes,
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> File = "moonbit_g_file_get_child_for_display_name"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.get_child_for_display_name.html).
pub fn File::get_child_for_display_name(
  self : File,
  display_name : String,
) -> File raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_get_child_for_display_name(
    self,
    @encoding/utf8.encode(display_name),
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_)
extern "c" fn moonbit_g_file_get_parent(self_ : File) -> @glib.Nullable[File] = "moonbit_g_file_get_parent"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.get_parent.html).
pub fn File::get_parent(self : File) -> File? {
  let raw_result = moonbit_g_file_get_parent(self)
  raw_result.to_option()
}

///|
#borrow(self_)
extern "c" fn moonbit_g_file_get_parse_name(self_ : File) -> Bytes = "moonbit_g_file_get_parse_name"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.get_parse_name.html).
pub fn File::get_parse_name(self : File) -> String {
  @encoding/utf8.decode_lossy(moonbit_g_file_get_parse_name(self))
}

///|
#borrow(self_)
extern "c" fn moonbit_g_file_get_path(self_ : File) -> @glib.Nullable[Bytes] = "moonbit_g_file_get_path"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.get_path.html).
pub fn File::get_path(self : File) -> String? {
  let result = moonbit_g_file_get_path(self)
  match result.to_option() {
    Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
    None => None
  }
}

///|
#borrow(self_, descendant)
extern "c" fn moonbit_g_file_get_relative_path(
  self_ : File,
  descendant : File,
) -> @glib.Nullable[Bytes] = "moonbit_g_file_get_relative_path"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.get_relative_path.html).
pub fn File::get_relative_path(self : File, descendant : &IFile) -> String? {
  let result = moonbit_g_file_get_relative_path(self, descendant.as_file())
  match result.to_option() {
    Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
    None => None
  }
}

///|
#borrow(self_)
extern "c" fn moonbit_g_file_get_uri(self_ : File) -> Bytes = "moonbit_g_file_get_uri"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.get_uri.html).
pub fn File::get_uri(self : File) -> String {
  @encoding/utf8.decode_lossy(moonbit_g_file_get_uri(self))
}

///|
#borrow(self_)
extern "c" fn moonbit_g_file_get_uri_scheme(
  self_ : File,
) -> @glib.Nullable[Bytes] = "moonbit_g_file_get_uri_scheme"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.get_uri_scheme.html).
pub fn File::get_uri_scheme(self : File) -> String? {
  let result = moonbit_g_file_get_uri_scheme(self)
  match result.to_option() {
    Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
    None => None
  }
}

///|
#borrow(self_, parent)
extern "c" fn moonbit_g_file_has_parent(
  self_ : File,
  parent : @glib.Nullable[File],
) -> Bool = "moonbit_g_file_has_parent"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.has_parent.html).
pub fn File::has_parent(self : File, parent : &IFile?) -> Bool {
  moonbit_g_file_has_parent(
    self,
    match parent {
      Some(v) => @glib.Nullable::some(v.as_file())
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_, prefix)
extern "c" fn moonbit_g_file_has_prefix(self_ : File, prefix : File) -> Bool = "moonbit_g_file_has_prefix"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.has_prefix.html).
pub fn File::has_prefix(self : File, prefix : &IFile) -> Bool {
  moonbit_g_file_has_prefix(self, prefix.as_file())
}

///|
#borrow(self_, uri_scheme)
extern "c" fn moonbit_g_file_has_uri_scheme(
  self_ : File,
  uri_scheme : Bytes,
) -> Bool = "moonbit_g_file_has_uri_scheme"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.has_uri_scheme.html).
pub fn File::has_uri_scheme(self : File, uri_scheme : String) -> Bool {
  moonbit_g_file_has_uri_scheme(self, @encoding/utf8.encode(uri_scheme))
}

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.hash.html).
#borrow(self)
pub extern "c" fn File::hash(self : File) -> UInt = "moonbit_g_file_hash"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.is_native.html).
#borrow(self)
pub extern "c" fn File::is_native(self : File) -> Bool = "moonbit_g_file_is_native"

///|
#borrow(self_, cancellable, etag_out, error)
extern "c" fn moonbit_g_file_load_bytes(
  self_ : File,
  cancellable : @glib.Nullable[Cancellable],
  etag_out : Ref[@glib.Nullable[Bytes]],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bytes = "moonbit_g_file_load_bytes"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.load_bytes.html).
pub fn File::load_bytes(
  self : File,
  cancellable : &ICancellable?,
) -> (Bytes, String?) raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let etag_out : Ref[@glib.Nullable[Bytes]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_load_bytes(
    self,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    etag_out,
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  (
    result,
    match etag_out.val.to_option() {
      Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
      None => None
    },
  )
}

///|
#borrow(self_, result, etag_out, error)
extern "c" fn moonbit_g_file_load_bytes_finish(
  self_ : File,
  result : AsyncResult,
  etag_out : Ref[@glib.Nullable[Bytes]],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bytes = "moonbit_g_file_load_bytes_finish"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.load_bytes_finish.html).
pub fn File::load_bytes_finish(
  self : File,
  result : &IAsyncResult,
) -> (Bytes, String?) raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let etag_out : Ref[@glib.Nullable[Bytes]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_load_bytes_finish(
    self,
    result.as_async_result(),
    etag_out,
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  (
    result,
    match etag_out.val.to_option() {
      Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
      None => None
    },
  )
}

///|
#borrow(self_, cancellable, error)
extern "c" fn moonbit_g_file_make_directory(
  self_ : File,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_file_make_directory"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.make_directory.html).
pub fn File::make_directory(
  self : File,
  cancellable : &ICancellable?,
) -> Bool raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_make_directory(
    self,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, cancellable, error)
extern "c" fn moonbit_g_file_make_directory_with_parents(
  self_ : File,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_file_make_directory_with_parents"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.make_directory_with_parents.html).
pub fn File::make_directory_with_parents(
  self : File,
  cancellable : &ICancellable?,
) -> Bool raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_make_directory_with_parents(
    self,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, symlink_value, cancellable, error)
extern "c" fn moonbit_g_file_make_symbolic_link(
  self_ : File,
  symlink_value : Bytes,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_file_make_symbolic_link"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.make_symbolic_link.html).
pub fn File::make_symbolic_link(
  self : File,
  symlink_value : String,
  cancellable : &ICancellable?,
) -> Bool raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_make_symbolic_link(
    self,
    @encoding/utf8.encode(symlink_value),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, result, disk_usage, num_dirs, num_files, error)
extern "c" fn moonbit_g_file_measure_disk_usage_finish(
  self_ : File,
  result : AsyncResult,
  disk_usage : Ref[UInt64],
  num_dirs : Ref[UInt64],
  num_files : Ref[UInt64],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_file_measure_disk_usage_finish"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.measure_disk_usage_finish.html).
pub fn File::measure_disk_usage_finish(
  self : File,
  result : &IAsyncResult,
) -> (Bool, UInt64, UInt64, UInt64) raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let disk_usage = Ref(0UL)
  let num_dirs = Ref(0UL)
  let num_files = Ref(0UL)
  let result = moonbit_g_file_measure_disk_usage_finish(
    self,
    result.as_async_result(),
    disk_usage,
    num_dirs,
    num_files,
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  (result, disk_usage.val, num_dirs.val, num_files.val)
}

///|
#borrow(self_, cancellable, error)
extern "c" fn moonbit_g_file_monitor(
  self_ : File,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> FileMonitor = "moonbit_g_file_monitor"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.monitor.html).
pub fn File::monitor(
  self : File,
  flags : FileMonitorFlags,
  cancellable : &ICancellable?,
) -> FileMonitor raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_monitor(
    self,
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, cancellable, error)
extern "c" fn moonbit_g_file_monitor_directory(
  self_ : File,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> FileMonitor = "moonbit_g_file_monitor_directory"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.monitor_directory.html).
pub fn File::monitor_directory(
  self : File,
  flags : FileMonitorFlags,
  cancellable : &ICancellable?,
) -> FileMonitor raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_monitor_directory(
    self,
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, cancellable, error)
extern "c" fn moonbit_g_file_monitor_file(
  self_ : File,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> FileMonitor = "moonbit_g_file_monitor_file"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.monitor_file.html).
pub fn File::monitor_file(
  self : File,
  flags : FileMonitorFlags,
  cancellable : &ICancellable?,
) -> FileMonitor raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_monitor_file(
    self,
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, result, error)
extern "c" fn moonbit_g_file_move_finish(
  self_ : File,
  result : AsyncResult,
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_file_move_finish"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.move_finish.html).
pub fn File::move_finish(
  self : File,
  result : &IAsyncResult,
) -> Bool raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_move_finish(
    self,
    result.as_async_result(),
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, cancellable, error)
extern "c" fn moonbit_g_file_open_readwrite(
  self_ : File,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> FileIOStream = "moonbit_g_file_open_readwrite"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.open_readwrite.html).
pub fn File::open_readwrite(
  self : File,
  cancellable : &ICancellable?,
) -> FileIOStream raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_open_readwrite(
    self,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_)
extern "c" fn moonbit_g_file_peek_path(self_ : File) -> @glib.Nullable[Bytes] = "moonbit_g_file_peek_path"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.peek_path.html).
pub fn File::peek_path(self : File) -> String? {
  let result = moonbit_g_file_peek_path(self)
  match result.to_option() {
    Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
    None => None
  }
}

///|
#borrow(self_, cancellable, error)
extern "c" fn moonbit_g_file_query_default_handler(
  self_ : File,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> AppInfo = "moonbit_g_file_query_default_handler"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.query_default_handler.html).
pub fn File::query_default_handler(
  self : File,
  cancellable : &ICancellable?,
) -> AppInfo raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_query_default_handler(
    self,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, cancellable)
extern "c" fn moonbit_g_file_query_exists(
  self_ : File,
  cancellable : @glib.Nullable[Cancellable],
) -> Bool = "moonbit_g_file_query_exists"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.query_exists.html).
pub fn File::query_exists(self : File, cancellable : &ICancellable?) -> Bool {
  moonbit_g_file_query_exists(
    self,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_, cancellable)
extern "c" fn moonbit_g_file_query_file_type(
  self_ : File,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
) -> FileType = "moonbit_g_file_query_file_type"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.query_file_type.html).
pub fn File::query_file_type(
  self : File,
  flags : FileQueryInfoFlags,
  cancellable : &ICancellable?,
) -> FileType {
  moonbit_g_file_query_file_type(
    self,
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
  )
}

///|
#borrow(self_, attributes, cancellable, error)
extern "c" fn moonbit_g_file_query_filesystem_info(
  self_ : File,
  attributes : Bytes,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> FileInfo = "moonbit_g_file_query_filesystem_info"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.query_filesystem_info.html).
pub fn File::query_filesystem_info(
  self : File,
  attributes : String,
  cancellable : &ICancellable?,
) -> FileInfo raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_query_filesystem_info(
    self,
    @encoding/utf8.encode(attributes),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, attributes, cancellable, error)
extern "c" fn moonbit_g_file_query_info(
  self_ : File,
  attributes : Bytes,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> FileInfo = "moonbit_g_file_query_info"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.query_info.html).
pub fn File::query_info(
  self : File,
  attributes : String,
  flags : FileQueryInfoFlags,
  cancellable : &ICancellable?,
) -> FileInfo raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_query_info(
    self,
    @encoding/utf8.encode(attributes),
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, cancellable, error)
extern "c" fn moonbit_g_file_read(
  self_ : File,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> FileInputStream = "moonbit_g_file_read"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.read.html).
pub fn File::read(
  self : File,
  cancellable : &ICancellable?,
) -> FileInputStream raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_read(
    self,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, etag, cancellable, error)
extern "c" fn moonbit_g_file_replace(
  self_ : File,
  etag : @glib.Nullable[Bytes],
  make_backup : Bool,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> FileOutputStream = "moonbit_g_file_replace"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.replace.html).
pub fn File::replace(
  self : File,
  etag : String?,
  make_backup : Bool,
  flags : FileCreateFlags,
  cancellable : &ICancellable?,
) -> FileOutputStream raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_replace(
    self,
    match etag {
      Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
      None => @glib.Nullable::null()
    },
    make_backup,
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, res, new_etag, error)
extern "c" fn moonbit_g_file_replace_contents_finish(
  self_ : File,
  res : AsyncResult,
  new_etag : Ref[@glib.Nullable[Bytes]],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_file_replace_contents_finish"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.replace_contents_finish.html).
pub fn File::replace_contents_finish(
  self : File,
  res : &IAsyncResult,
) -> (Bool, String?) raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let new_etag : Ref[@glib.Nullable[Bytes]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_replace_contents_finish(
    self,
    res.as_async_result(),
    new_etag,
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  (
    result,
    match new_etag.val.to_option() {
      Some(bytes) => Some(@encoding/utf8.decode_lossy(bytes))
      None => None
    },
  )
}

///|
#borrow(self_, etag, cancellable, error)
extern "c" fn moonbit_g_file_replace_readwrite(
  self_ : File,
  etag : @glib.Nullable[Bytes],
  make_backup : Bool,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> FileIOStream = "moonbit_g_file_replace_readwrite"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.replace_readwrite.html).
pub fn File::replace_readwrite(
  self : File,
  etag : String?,
  make_backup : Bool,
  flags : FileCreateFlags,
  cancellable : &ICancellable?,
) -> FileIOStream raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_replace_readwrite(
    self,
    match etag {
      Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
      None => @glib.Nullable::null()
    },
    make_backup,
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, relative_path)
extern "c" fn moonbit_g_file_resolve_relative_path(
  self_ : File,
  relative_path : Bytes,
) -> File = "moonbit_g_file_resolve_relative_path"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.resolve_relative_path.html).
pub fn File::resolve_relative_path(self : File, relative_path : String) -> File {
  moonbit_g_file_resolve_relative_path(
    self,
    @encoding/utf8.encode(relative_path),
  )
}

///|
#borrow(self_, attribute, value, cancellable, error)
extern "c" fn moonbit_g_file_set_attribute_byte_string(
  self_ : File,
  attribute : Bytes,
  value : Bytes,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_file_set_attribute_byte_string"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.set_attribute_byte_string.html).
pub fn File::set_attribute_byte_string(
  self : File,
  attribute : String,
  value : String,
  flags : FileQueryInfoFlags,
  cancellable : &ICancellable?,
) -> Bool raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_set_attribute_byte_string(
    self,
    @encoding/utf8.encode(attribute),
    @encoding/utf8.encode(value),
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, attribute, cancellable, error)
extern "c" fn moonbit_g_file_set_attribute_int32(
  self_ : File,
  attribute : Bytes,
  value : Int,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_file_set_attribute_int32"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.set_attribute_int32.html).
pub fn File::set_attribute_int32(
  self : File,
  attribute : String,
  value : Int,
  flags : FileQueryInfoFlags,
  cancellable : &ICancellable?,
) -> Bool raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_set_attribute_int32(
    self,
    @encoding/utf8.encode(attribute),
    value,
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, attribute, cancellable, error)
extern "c" fn moonbit_g_file_set_attribute_int64(
  self_ : File,
  attribute : Bytes,
  value : Int64,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_file_set_attribute_int64"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.set_attribute_int64.html).
pub fn File::set_attribute_int64(
  self : File,
  attribute : String,
  value : Int64,
  flags : FileQueryInfoFlags,
  cancellable : &ICancellable?,
) -> Bool raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_set_attribute_int64(
    self,
    @encoding/utf8.encode(attribute),
    value,
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, attribute, value, cancellable, error)
extern "c" fn moonbit_g_file_set_attribute_string(
  self_ : File,
  attribute : Bytes,
  value : Bytes,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_file_set_attribute_string"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.set_attribute_string.html).
pub fn File::set_attribute_string(
  self : File,
  attribute : String,
  value : String,
  flags : FileQueryInfoFlags,
  cancellable : &ICancellable?,
) -> Bool raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_set_attribute_string(
    self,
    @encoding/utf8.encode(attribute),
    @encoding/utf8.encode(value),
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, attribute, cancellable, error)
extern "c" fn moonbit_g_file_set_attribute_uint32(
  self_ : File,
  attribute : Bytes,
  value : UInt,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_file_set_attribute_uint32"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.set_attribute_uint32.html).
pub fn File::set_attribute_uint32(
  self : File,
  attribute : String,
  value : UInt,
  flags : FileQueryInfoFlags,
  cancellable : &ICancellable?,
) -> Bool raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_set_attribute_uint32(
    self,
    @encoding/utf8.encode(attribute),
    value,
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, attribute, cancellable, error)
extern "c" fn moonbit_g_file_set_attribute_uint64(
  self_ : File,
  attribute : Bytes,
  value : UInt64,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_file_set_attribute_uint64"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.set_attribute_uint64.html).
pub fn File::set_attribute_uint64(
  self : File,
  attribute : String,
  value : UInt64,
  flags : FileQueryInfoFlags,
  cancellable : &ICancellable?,
) -> Bool raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_set_attribute_uint64(
    self,
    @encoding/utf8.encode(attribute),
    value,
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, info, cancellable, error)
extern "c" fn moonbit_g_file_set_attributes_from_info(
  self_ : File,
  info : FileInfo,
  flags : Int,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_file_set_attributes_from_info"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.set_attributes_from_info.html).
pub fn File::set_attributes_from_info(
  self : File,
  info : &IFileInfo,
  flags : FileQueryInfoFlags,
  cancellable : &ICancellable?,
) -> Bool raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_set_attributes_from_info(
    self,
    info.as_file_info(),
    flags.to_int(),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, display_name, cancellable, error)
extern "c" fn moonbit_g_file_set_display_name(
  self_ : File,
  display_name : Bytes,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> File = "moonbit_g_file_set_display_name"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.set_display_name.html).
pub fn File::set_display_name(
  self : File,
  display_name : String,
  cancellable : &ICancellable?,
) -> File raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_set_display_name(
    self,
    @encoding/utf8.encode(display_name),
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.supports_thread_contexts.html).
#borrow(self)
pub extern "c" fn File::supports_thread_contexts(self : File) -> Bool = "moonbit_g_file_supports_thread_contexts"

///|
#borrow(self_, cancellable, error)
extern "c" fn moonbit_g_file_trash(
  self_ : File,
  cancellable : @glib.Nullable[Cancellable],
  error : Ref[@glib.Nullable[@glib.Error_]],
) -> Bool = "moonbit_g_file_trash"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.trash.html).
pub fn File::trash(
  self : File,
  cancellable : &ICancellable?,
) -> Bool raise @glib.Error_ {
  let error_ : Ref[@glib.Nullable[@glib.Error_]] = Ref(@glib.Nullable::null())
  let result = moonbit_g_file_trash(
    self,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    error_,
  )
  match error_.val.to_option() {
    Some(e) => raise e
    None => ()
  }
  result
}

///|
#borrow(self_, cancellable)
extern "c" fn g_file_append_to_async(
  self_ : File,
  flags : Int,
  io_priority : Int,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      @glib.Nullable[FileOutputStream],
      @glib.Nullable[@glib.Error_],
      (@glib.Nullable[FileOutputStream], @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (@glib.Nullable[FileOutputStream], @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_append_to_async"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.append_to_async.html).
pub fn File::append_to_async(
  self : File,
  flags : FileCreateFlags,
  io_priority : Int,
  cancellable : &ICancellable?,
  callback : (Result[FileOutputStream, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_append_to_async(
    self,
    flags.to_int(),
    io_priority,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None =>
          match result.to_option() {
            Some(v) => callback(Ok(v))
            None => ()
          }
      }
    },
  )
}

///|
#borrow(self_, cancellable)
extern "c" fn g_file_create_async(
  self_ : File,
  flags : Int,
  io_priority : Int,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      @glib.Nullable[FileOutputStream],
      @glib.Nullable[@glib.Error_],
      (@glib.Nullable[FileOutputStream], @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (@glib.Nullable[FileOutputStream], @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_create_async"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.create_async.html).
pub fn File::create_async(
  self : File,
  flags : FileCreateFlags,
  io_priority : Int,
  cancellable : &ICancellable?,
  callback : (Result[FileOutputStream, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_create_async(
    self,
    flags.to_int(),
    io_priority,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None =>
          match result.to_option() {
            Some(v) => callback(Ok(v))
            None => ()
          }
      }
    },
  )
}

///|
#borrow(self_, cancellable)
extern "c" fn g_file_create_readwrite_async(
  self_ : File,
  flags : Int,
  io_priority : Int,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      @glib.Nullable[FileIOStream],
      @glib.Nullable[@glib.Error_],
      (@glib.Nullable[FileIOStream], @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (@glib.Nullable[FileIOStream], @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_create_readwrite_async"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.create_readwrite_async.html).
pub fn File::create_readwrite_async(
  self : File,
  flags : FileCreateFlags,
  io_priority : Int,
  cancellable : &ICancellable?,
  callback : (Result[FileIOStream, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_create_readwrite_async(
    self,
    flags.to_int(),
    io_priority,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None =>
          match result.to_option() {
            Some(v) => callback(Ok(v))
            None => ()
          }
      }
    },
  )
}

///|
#borrow(self_, cancellable)
extern "c" fn g_file_delete_async(
  self_ : File,
  io_priority : Int,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      Bool,
      @glib.Nullable[@glib.Error_],
      (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_delete_async"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.delete_async.html).
pub fn File::delete_async(
  self : File,
  io_priority : Int,
  cancellable : &ICancellable?,
  callback : (Result[Bool, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_delete_async(
    self,
    io_priority,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None => callback(Ok(result))
      }
    },
  )
}

///|
#borrow(self_, mount_operation, cancellable)
extern "c" fn g_file_eject_mountable_with_operation(
  self_ : File,
  flags : Int,
  mount_operation : @glib.Nullable[MountOperation],
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      Bool,
      @glib.Nullable[@glib.Error_],
      (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_eject_mountable_with_operation"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.eject_mountable_with_operation.html).
pub fn File::eject_mountable_with_operation(
  self : File,
  flags : MountUnmountFlags,
  mount_operation : &IMountOperation?,
  cancellable : &ICancellable?,
  callback : (Result[Bool, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_eject_mountable_with_operation(
    self,
    flags.to_int(),
    match mount_operation {
      Some(v) => @glib.Nullable::some(v.as_mount_operation())
      None => @glib.Nullable::null()
    },
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None => callback(Ok(result))
      }
    },
  )
}

///|
#borrow(self_, attributes, cancellable)
extern "c" fn g_file_enumerate_children_async(
  self_ : File,
  attributes : Bytes,
  flags : Int,
  io_priority : Int,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      @glib.Nullable[FileEnumerator],
      @glib.Nullable[@glib.Error_],
      (@glib.Nullable[FileEnumerator], @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (@glib.Nullable[FileEnumerator], @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_enumerate_children_async"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.enumerate_children_async.html).
pub fn File::enumerate_children_async(
  self : File,
  attributes : String,
  flags : FileQueryInfoFlags,
  io_priority : Int,
  cancellable : &ICancellable?,
  callback : (Result[FileEnumerator, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_enumerate_children_async(
    self,
    @encoding/utf8.encode(attributes),
    flags.to_int(),
    io_priority,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None =>
          match result.to_option() {
            Some(v) => callback(Ok(v))
            None => ()
          }
      }
    },
  )
}

///|
#borrow(self_, cancellable)
extern "c" fn g_file_find_enclosing_mount_async(
  self_ : File,
  io_priority : Int,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      @glib.Nullable[Mount],
      @glib.Nullable[@glib.Error_],
      (@glib.Nullable[Mount], @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (@glib.Nullable[Mount], @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_find_enclosing_mount_async"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.find_enclosing_mount_async.html).
pub fn File::find_enclosing_mount_async(
  self : File,
  io_priority : Int,
  cancellable : &ICancellable?,
  callback : (Result[Mount, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_find_enclosing_mount_async(
    self,
    io_priority,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None =>
          match result.to_option() {
            Some(v) => callback(Ok(v))
            None => ()
          }
      }
    },
  )
}

///|
#borrow(self_, cancellable)
extern "c" fn g_file_make_directory_async(
  self_ : File,
  io_priority : Int,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      Bool,
      @glib.Nullable[@glib.Error_],
      (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_make_directory_async"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.make_directory_async.html).
pub fn File::make_directory_async(
  self : File,
  io_priority : Int,
  cancellable : &ICancellable?,
  callback : (Result[Bool, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_make_directory_async(
    self,
    io_priority,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None => callback(Ok(result))
      }
    },
  )
}

///|
#borrow(self_, symlink_value, cancellable)
extern "c" fn g_file_make_symbolic_link_async(
  self_ : File,
  symlink_value : Bytes,
  io_priority : Int,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      Bool,
      @glib.Nullable[@glib.Error_],
      (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_make_symbolic_link_async"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.make_symbolic_link_async.html).
pub fn File::make_symbolic_link_async(
  self : File,
  symlink_value : String,
  io_priority : Int,
  cancellable : &ICancellable?,
  callback : (Result[Bool, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_make_symbolic_link_async(
    self,
    @encoding/utf8.encode(symlink_value),
    io_priority,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None => callback(Ok(result))
      }
    },
  )
}

///|
#borrow(self_, mount_operation, cancellable)
extern "c" fn g_file_mount_enclosing_volume(
  self_ : File,
  flags : Int,
  mount_operation : @glib.Nullable[MountOperation],
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      Bool,
      @glib.Nullable[@glib.Error_],
      (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_mount_enclosing_volume"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.mount_enclosing_volume.html).
pub fn File::mount_enclosing_volume(
  self : File,
  flags : MountMountFlags,
  mount_operation : &IMountOperation?,
  cancellable : &ICancellable?,
  callback : (Result[Bool, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_mount_enclosing_volume(
    self,
    flags.to_int(),
    match mount_operation {
      Some(v) => @glib.Nullable::some(v.as_mount_operation())
      None => @glib.Nullable::null()
    },
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None => callback(Ok(result))
      }
    },
  )
}

///|
#borrow(self_, mount_operation, cancellable)
extern "c" fn g_file_mount_mountable(
  self_ : File,
  flags : Int,
  mount_operation : @glib.Nullable[MountOperation],
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      @glib.Nullable[File],
      @glib.Nullable[@glib.Error_],
      (@glib.Nullable[File], @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (@glib.Nullable[File], @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_mount_mountable"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.mount_mountable.html).
pub fn File::mount_mountable(
  self : File,
  flags : MountMountFlags,
  mount_operation : &IMountOperation?,
  cancellable : &ICancellable?,
  callback : (Result[File, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_mount_mountable(
    self,
    flags.to_int(),
    match mount_operation {
      Some(v) => @glib.Nullable::some(v.as_mount_operation())
      None => @glib.Nullable::null()
    },
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None =>
          match result.to_option() {
            Some(v) => callback(Ok(v))
            None => ()
          }
      }
    },
  )
}

///|
#borrow(self_, cancellable)
extern "c" fn g_file_open_readwrite_async(
  self_ : File,
  io_priority : Int,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      @glib.Nullable[FileIOStream],
      @glib.Nullable[@glib.Error_],
      (@glib.Nullable[FileIOStream], @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (@glib.Nullable[FileIOStream], @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_open_readwrite_async"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.open_readwrite_async.html).
pub fn File::open_readwrite_async(
  self : File,
  io_priority : Int,
  cancellable : &ICancellable?,
  callback : (Result[FileIOStream, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_open_readwrite_async(
    self,
    io_priority,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None =>
          match result.to_option() {
            Some(v) => callback(Ok(v))
            None => ()
          }
      }
    },
  )
}

///|
#borrow(self_, cancellable)
extern "c" fn g_file_poll_mountable(
  self_ : File,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      Bool,
      @glib.Nullable[@glib.Error_],
      (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_poll_mountable"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.poll_mountable.html).
pub fn File::poll_mountable(
  self : File,
  cancellable : &ICancellable?,
  callback : (Result[Bool, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_poll_mountable(
    self,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None => callback(Ok(result))
      }
    },
  )
}

///|
#borrow(self_, cancellable)
extern "c" fn g_file_query_default_handler_async(
  self_ : File,
  io_priority : Int,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      @glib.Nullable[AppInfo],
      @glib.Nullable[@glib.Error_],
      (@glib.Nullable[AppInfo], @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (@glib.Nullable[AppInfo], @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_query_default_handler_async"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.query_default_handler_async.html).
pub fn File::query_default_handler_async(
  self : File,
  io_priority : Int,
  cancellable : &ICancellable?,
  callback : (Result[AppInfo, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_query_default_handler_async(
    self,
    io_priority,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None =>
          match result.to_option() {
            Some(v) => callback(Ok(v))
            None => ()
          }
      }
    },
  )
}

///|
#borrow(self_, attributes, cancellable)
extern "c" fn g_file_query_filesystem_info_async(
  self_ : File,
  attributes : Bytes,
  io_priority : Int,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      @glib.Nullable[FileInfo],
      @glib.Nullable[@glib.Error_],
      (@glib.Nullable[FileInfo], @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (@glib.Nullable[FileInfo], @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_query_filesystem_info_async"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.query_filesystem_info_async.html).
pub fn File::query_filesystem_info_async(
  self : File,
  attributes : String,
  io_priority : Int,
  cancellable : &ICancellable?,
  callback : (Result[FileInfo, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_query_filesystem_info_async(
    self,
    @encoding/utf8.encode(attributes),
    io_priority,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None =>
          match result.to_option() {
            Some(v) => callback(Ok(v))
            None => ()
          }
      }
    },
  )
}

///|
#borrow(self_, attributes, cancellable)
extern "c" fn g_file_query_info_async(
  self_ : File,
  attributes : Bytes,
  flags : Int,
  io_priority : Int,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      @glib.Nullable[FileInfo],
      @glib.Nullable[@glib.Error_],
      (@glib.Nullable[FileInfo], @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (@glib.Nullable[FileInfo], @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_query_info_async"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.query_info_async.html).
pub fn File::query_info_async(
  self : File,
  attributes : String,
  flags : FileQueryInfoFlags,
  io_priority : Int,
  cancellable : &ICancellable?,
  callback : (Result[FileInfo, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_query_info_async(
    self,
    @encoding/utf8.encode(attributes),
    flags.to_int(),
    io_priority,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None =>
          match result.to_option() {
            Some(v) => callback(Ok(v))
            None => ()
          }
      }
    },
  )
}

///|
#borrow(self_, cancellable)
extern "c" fn g_file_read_async(
  self_ : File,
  io_priority : Int,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      @glib.Nullable[FileInputStream],
      @glib.Nullable[@glib.Error_],
      (@glib.Nullable[FileInputStream], @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (@glib.Nullable[FileInputStream], @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_read_async"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.read_async.html).
pub fn File::read_async(
  self : File,
  io_priority : Int,
  cancellable : &ICancellable?,
  callback : (Result[FileInputStream, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_read_async(
    self,
    io_priority,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None =>
          match result.to_option() {
            Some(v) => callback(Ok(v))
            None => ()
          }
      }
    },
  )
}

///|
#borrow(self_, etag, cancellable)
extern "c" fn g_file_replace_async(
  self_ : File,
  etag : @glib.Nullable[Bytes],
  make_backup : Bool,
  flags : Int,
  io_priority : Int,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      @glib.Nullable[FileOutputStream],
      @glib.Nullable[@glib.Error_],
      (@glib.Nullable[FileOutputStream], @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (@glib.Nullable[FileOutputStream], @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_replace_async"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.replace_async.html).
pub fn File::replace_async(
  self : File,
  etag : String?,
  make_backup : Bool,
  flags : FileCreateFlags,
  io_priority : Int,
  cancellable : &ICancellable?,
  callback : (Result[FileOutputStream, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_replace_async(
    self,
    match etag {
      Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
      None => @glib.Nullable::null()
    },
    make_backup,
    flags.to_int(),
    io_priority,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None =>
          match result.to_option() {
            Some(v) => callback(Ok(v))
            None => ()
          }
      }
    },
  )
}

///|
#borrow(self_, etag, cancellable)
extern "c" fn g_file_replace_readwrite_async(
  self_ : File,
  etag : @glib.Nullable[Bytes],
  make_backup : Bool,
  flags : Int,
  io_priority : Int,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      @glib.Nullable[FileIOStream],
      @glib.Nullable[@glib.Error_],
      (@glib.Nullable[FileIOStream], @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (@glib.Nullable[FileIOStream], @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_replace_readwrite_async"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.replace_readwrite_async.html).
pub fn File::replace_readwrite_async(
  self : File,
  etag : String?,
  make_backup : Bool,
  flags : FileCreateFlags,
  io_priority : Int,
  cancellable : &ICancellable?,
  callback : (Result[FileIOStream, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_replace_readwrite_async(
    self,
    match etag {
      Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
      None => @glib.Nullable::null()
    },
    make_backup,
    flags.to_int(),
    io_priority,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None =>
          match result.to_option() {
            Some(v) => callback(Ok(v))
            None => ()
          }
      }
    },
  )
}

///|
#borrow(self_, display_name, cancellable)
extern "c" fn g_file_set_display_name_async(
  self_ : File,
  display_name : Bytes,
  io_priority : Int,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      @glib.Nullable[File],
      @glib.Nullable[@glib.Error_],
      (@glib.Nullable[File], @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (@glib.Nullable[File], @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_set_display_name_async"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.set_display_name_async.html).
pub fn File::set_display_name_async(
  self : File,
  display_name : String,
  io_priority : Int,
  cancellable : &ICancellable?,
  callback : (Result[File, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_set_display_name_async(
    self,
    @encoding/utf8.encode(display_name),
    io_priority,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None =>
          match result.to_option() {
            Some(v) => callback(Ok(v))
            None => ()
          }
      }
    },
  )
}

///|
#borrow(self_, start_operation, cancellable)
extern "c" fn g_file_start_mountable(
  self_ : File,
  flags : Int,
  start_operation : @glib.Nullable[MountOperation],
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      Bool,
      @glib.Nullable[@glib.Error_],
      (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_start_mountable"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.start_mountable.html).
pub fn File::start_mountable(
  self : File,
  flags : DriveStartFlags,
  start_operation : &IMountOperation?,
  cancellable : &ICancellable?,
  callback : (Result[Bool, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_start_mountable(
    self,
    flags.to_int(),
    match start_operation {
      Some(v) => @glib.Nullable::some(v.as_mount_operation())
      None => @glib.Nullable::null()
    },
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None => callback(Ok(result))
      }
    },
  )
}

///|
#borrow(self_, mount_operation, cancellable)
extern "c" fn g_file_stop_mountable(
  self_ : File,
  flags : Int,
  mount_operation : @glib.Nullable[MountOperation],
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      Bool,
      @glib.Nullable[@glib.Error_],
      (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_stop_mountable"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.stop_mountable.html).
pub fn File::stop_mountable(
  self : File,
  flags : MountUnmountFlags,
  mount_operation : &IMountOperation?,
  cancellable : &ICancellable?,
  callback : (Result[Bool, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_stop_mountable(
    self,
    flags.to_int(),
    match mount_operation {
      Some(v) => @glib.Nullable::some(v.as_mount_operation())
      None => @glib.Nullable::null()
    },
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None => callback(Ok(result))
      }
    },
  )
}

///|
#borrow(self_, cancellable)
extern "c" fn g_file_trash_async(
  self_ : File,
  io_priority : Int,
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      Bool,
      @glib.Nullable[@glib.Error_],
      (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_trash_async"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.trash_async.html).
pub fn File::trash_async(
  self : File,
  io_priority : Int,
  cancellable : &ICancellable?,
  callback : (Result[Bool, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_trash_async(
    self,
    io_priority,
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None => callback(Ok(result))
      }
    },
  )
}

///|
#borrow(self_, mount_operation, cancellable)
extern "c" fn g_file_unmount_mountable_with_operation(
  self_ : File,
  flags : Int,
  mount_operation : @glib.Nullable[MountOperation],
  cancellable : @glib.Nullable[Cancellable],
  function : FuncRef[
    (
      Bool,
      @glib.Nullable[@glib.Error_],
      (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
    ) -> Unit,
  ],
  closure : (Bool, @glib.Nullable[@glib.Error_]) -> Unit,
) = "moonbit_g_file_unmount_mountable_with_operation"

///|
/// [Upstream documentation](https://docs.gtk.org/gio/method.File.unmount_mountable_with_operation.html).
pub fn File::unmount_mountable_with_operation(
  self : File,
  flags : MountUnmountFlags,
  mount_operation : &IMountOperation?,
  cancellable : &ICancellable?,
  callback : (Result[Bool, @glib.Error_]) -> Unit,
) -> Unit {
  g_file_unmount_mountable_with_operation(
    self,
    flags.to_int(),
    match mount_operation {
      Some(v) => @glib.Nullable::some(v.as_mount_operation())
      None => @glib.Nullable::null()
    },
    match cancellable {
      Some(v) => @glib.Nullable::some(v.as_cancellable())
      None => @glib.Nullable::null()
    },
    fn(result, error, f) { f(result, error) },
    fn(result, error) {
      match error.to_option() {
        Some(e) => callback(Err(e))
        None => callback(Ok(result))
      }
    },
  )
}

///|
impl IFile with fn append_to(self, flags, cancellable) -> FileOutputStream raise @glib.Error_ {
  self.as_file().append_to(flags, cancellable)
}

///|
impl IFile with fn build_attribute_list_for_copy(self, flags, cancellable) -> String raise @glib.Error_ {
  self.as_file().build_attribute_list_for_copy(flags, cancellable)
}

///|
impl IFile with fn copy_attributes(self, destination, flags, cancellable) -> Bool raise @glib.Error_ {
  self.as_file().copy_attributes(destination, flags, cancellable)
}

///|
impl IFile with fn copy_finish(self, res) -> Bool raise @glib.Error_ {
  self.as_file().copy_finish(res)
}

///|
impl IFile with fn create(self, flags, cancellable) -> FileOutputStream raise @glib.Error_ {
  self.as_file().create(flags, cancellable)
}

///|
impl IFile with fn create_readwrite(self, flags, cancellable) -> FileIOStream raise @glib.Error_ {
  self.as_file().create_readwrite(flags, cancellable)
}

///|
impl IFile with fn delete(self, cancellable) -> Bool raise @glib.Error_ {
  self.as_file().delete(cancellable)
}

///|
impl IFile with fn dup(self) -> File {
  self.as_file().dup()
}

///|
impl IFile with fn enumerate_children(self, attributes, flags, cancellable) -> FileEnumerator raise @glib.Error_ {
  self.as_file().enumerate_children(attributes, flags, cancellable)
}

///|
impl IFile with fn equal(self, file2) -> Bool {
  self.as_file().equal(file2)
}

///|
impl IFile with fn find_enclosing_mount(self, cancellable) -> Mount raise @glib.Error_ {
  self.as_file().find_enclosing_mount(cancellable)
}

///|
impl IFile with fn get_basename(self) -> String? {
  self.as_file().get_basename()
}

///|
impl IFile with fn get_child(self, name) -> File {
  self.as_file().get_child(name)
}

///|
impl IFile with fn get_child_for_display_name(self, display_name) -> File raise @glib.Error_ {
  self.as_file().get_child_for_display_name(display_name)
}

///|
impl IFile with fn get_parent(self) -> File? {
  self.as_file().get_parent()
}

///|
impl IFile with fn get_parse_name(self) -> String {
  self.as_file().get_parse_name()
}

///|
impl IFile with fn get_path(self) -> String? {
  self.as_file().get_path()
}

///|
impl IFile with fn get_relative_path(self, descendant) -> String? {
  self.as_file().get_relative_path(descendant)
}

///|
impl IFile with fn get_uri(self) -> String {
  self.as_file().get_uri()
}

///|
impl IFile with fn get_uri_scheme(self) -> String? {
  self.as_file().get_uri_scheme()
}

///|
impl IFile with fn has_parent(self, parent) -> Bool {
  self.as_file().has_parent(parent)
}

///|
impl IFile with fn has_prefix(self, prefix) -> Bool {
  self.as_file().has_prefix(prefix)
}

///|
impl IFile with fn has_uri_scheme(self, uri_scheme) -> Bool {
  self.as_file().has_uri_scheme(uri_scheme)
}

///|
impl IFile with fn hash(self) -> UInt {
  self.as_file().hash()
}

///|
impl IFile with fn is_native(self) -> Bool {
  self.as_file().is_native()
}

///|
impl IFile with fn load_bytes(self, cancellable) -> (Bytes, String?) raise @glib.Error_ {
  self.as_file().load_bytes(cancellable)
}

///|
impl IFile with fn load_bytes_finish(self, result) -> (Bytes, String?) raise @glib.Error_ {
  self.as_file().load_bytes_finish(result)
}

///|
impl IFile with fn make_directory(self, cancellable) -> Bool raise @glib.Error_ {
  self.as_file().make_directory(cancellable)
}

///|
impl IFile with fn make_directory_with_parents(self, cancellable) -> Bool raise @glib.Error_ {
  self.as_file().make_directory_with_parents(cancellable)
}

///|
impl IFile with fn make_symbolic_link(self, symlink_value, cancellable) -> Bool raise @glib.Error_ {
  self.as_file().make_symbolic_link(symlink_value, cancellable)
}

///|
impl IFile with fn measure_disk_usage_finish(self, result) -> (
  Bool,
  UInt64,
  UInt64,
  UInt64,
) raise @glib.Error_ {
  self.as_file().measure_disk_usage_finish(result)
}

///|
impl IFile with fn monitor(self, flags, cancellable) -> FileMonitor raise @glib.Error_ {
  self.as_file().monitor(flags, cancellable)
}

///|
impl IFile with fn monitor_directory(self, flags, cancellable) -> FileMonitor raise @glib.Error_ {
  self.as_file().monitor_directory(flags, cancellable)
}

///|
impl IFile with fn monitor_file(self, flags, cancellable) -> FileMonitor raise @glib.Error_ {
  self.as_file().monitor_file(flags, cancellable)
}

///|
impl IFile with fn move_finish(self, result) -> Bool raise @glib.Error_ {
  self.as_file().move_finish(result)
}

///|
impl IFile with fn open_readwrite(self, cancellable) -> FileIOStream raise @glib.Error_ {
  self.as_file().open_readwrite(cancellable)
}

///|
impl IFile with fn peek_path(self) -> String? {
  self.as_file().peek_path()
}

///|
impl IFile with fn query_default_handler(self, cancellable) -> AppInfo raise @glib.Error_ {
  self.as_file().query_default_handler(cancellable)
}

///|
impl IFile with fn query_exists(self, cancellable) -> Bool {
  self.as_file().query_exists(cancellable)
}

///|
impl IFile with fn query_file_type(self, flags, cancellable) -> FileType {
  self.as_file().query_file_type(flags, cancellable)
}

///|
impl IFile with fn query_filesystem_info(self, attributes, cancellable) -> FileInfo raise @glib.Error_ {
  self.as_file().query_filesystem_info(attributes, cancellable)
}

///|
impl IFile with fn query_info(self, attributes, flags, cancellable) -> FileInfo raise @glib.Error_ {
  self.as_file().query_info(attributes, flags, cancellable)
}

///|
impl IFile with fn read(self, cancellable) -> FileInputStream raise @glib.Error_ {
  self.as_file().read(cancellable)
}

///|
impl IFile with fn replace(self, etag, make_backup, flags, cancellable) -> FileOutputStream raise @glib.Error_ {
  self.as_file().replace(etag, make_backup, flags, cancellable)
}

///|
impl IFile with fn replace_contents_finish(self, res) -> (Bool, String?) raise @glib.Error_ {
  self.as_file().replace_contents_finish(res)
}

///|
impl IFile with fn replace_readwrite(
  self,
  etag,
  make_backup,
  flags,
  cancellable,
) -> FileIOStream raise @glib.Error_ {
  self.as_file().replace_readwrite(etag, make_backup, flags, cancellable)
}

///|
impl IFile with fn resolve_relative_path(self, relative_path) -> File {
  self.as_file().resolve_relative_path(relative_path)
}

///|
impl IFile with fn set_attribute_byte_string(
  self,
  attribute,
  value,
  flags,
  cancellable,
) -> Bool raise @glib.Error_ {
  self.as_file().set_attribute_byte_string(attribute, value, flags, cancellable)
}

///|
impl IFile with fn set_attribute_int32(
  self,
  attribute,
  value,
  flags,
  cancellable,
) -> Bool raise @glib.Error_ {
  self.as_file().set_attribute_int32(attribute, value, flags, cancellable)
}

///|
impl IFile with fn set_attribute_int64(
  self,
  attribute,
  value,
  flags,
  cancellable,
) -> Bool raise @glib.Error_ {
  self.as_file().set_attribute_int64(attribute, value, flags, cancellable)
}

///|
impl IFile with fn set_attribute_string(
  self,
  attribute,
  value,
  flags,
  cancellable,
) -> Bool raise @glib.Error_ {
  self.as_file().set_attribute_string(attribute, value, flags, cancellable)
}

///|
impl IFile with fn set_attribute_uint32(
  self,
  attribute,
  value,
  flags,
  cancellable,
) -> Bool raise @glib.Error_ {
  self.as_file().set_attribute_uint32(attribute, value, flags, cancellable)
}

///|
impl IFile with fn set_attribute_uint64(
  self,
  attribute,
  value,
  flags,
  cancellable,
) -> Bool raise @glib.Error_ {
  self.as_file().set_attribute_uint64(attribute, value, flags, cancellable)
}

///|
impl IFile with fn set_attributes_from_info(self, info, flags, cancellable) -> Bool raise @glib.Error_ {
  self.as_file().set_attributes_from_info(info, flags, cancellable)
}

///|
impl IFile with fn set_display_name(self, display_name, cancellable) -> File raise @glib.Error_ {
  self.as_file().set_display_name(display_name, cancellable)
}

///|
impl IFile with fn supports_thread_contexts(self) -> Bool {
  self.as_file().supports_thread_contexts()
}

///|
impl IFile with fn trash(self, cancellable) -> Bool raise @glib.Error_ {
  self.as_file().trash(cancellable)
}

///|
impl IFile with fn append_to_async(
  self,
  flags,
  io_priority,
  cancellable,
  callback,
) -> Unit {
  self.as_file().append_to_async(flags, io_priority, cancellable, callback)
}

///|
impl IFile with fn create_async(self, flags, io_priority, cancellable, callback) -> Unit {
  self.as_file().create_async(flags, io_priority, cancellable, callback)
}

///|
impl IFile with fn create_readwrite_async(
  self,
  flags,
  io_priority,
  cancellable,
  callback,
) -> Unit {
  self
  .as_file()
  .create_readwrite_async(flags, io_priority, cancellable, callback)
}

///|
impl IFile with fn delete_async(self, io_priority, cancellable, callback) -> Unit {
  self.as_file().delete_async(io_priority, cancellable, callback)
}

///|
impl IFile with fn eject_mountable_with_operation(
  self,
  flags,
  mount_operation,
  cancellable,
  callback,
) -> Unit {
  self
  .as_file()
  .eject_mountable_with_operation(flags, mount_operation, cancellable, callback)
}

///|
impl IFile with fn enumerate_children_async(
  self,
  attributes,
  flags,
  io_priority,
  cancellable,
  callback,
) -> Unit {
  self
  .as_file()
  .enumerate_children_async(
    attributes, flags, io_priority, cancellable, callback,
  )
}

///|
impl IFile with fn find_enclosing_mount_async(
  self,
  io_priority,
  cancellable,
  callback,
) -> Unit {
  self.as_file().find_enclosing_mount_async(io_priority, cancellable, callback)
}

///|
impl IFile with fn make_directory_async(
  self,
  io_priority,
  cancellable,
  callback,
) -> Unit {
  self.as_file().make_directory_async(io_priority, cancellable, callback)
}

///|
impl IFile with fn make_symbolic_link_async(
  self,
  symlink_value,
  io_priority,
  cancellable,
  callback,
) -> Unit {
  self
  .as_file()
  .make_symbolic_link_async(symlink_value, io_priority, cancellable, callback)
}

///|
impl IFile with fn mount_enclosing_volume(
  self,
  flags,
  mount_operation,
  cancellable,
  callback,
) -> Unit {
  self
  .as_file()
  .mount_enclosing_volume(flags, mount_operation, cancellable, callback)
}

///|
impl IFile with fn mount_mountable(
  self,
  flags,
  mount_operation,
  cancellable,
  callback,
) -> Unit {
  self.as_file().mount_mountable(flags, mount_operation, cancellable, callback)
}

///|
impl IFile with fn open_readwrite_async(
  self,
  io_priority,
  cancellable,
  callback,
) -> Unit {
  self.as_file().open_readwrite_async(io_priority, cancellable, callback)
}

///|
impl IFile with fn poll_mountable(self, cancellable, callback) -> Unit {
  self.as_file().poll_mountable(cancellable, callback)
}

///|
impl IFile with fn query_default_handler_async(
  self,
  io_priority,
  cancellable,
  callback,
) -> Unit {
  self.as_file().query_default_handler_async(io_priority, cancellable, callback)
}

///|
impl IFile with fn query_filesystem_info_async(
  self,
  attributes,
  io_priority,
  cancellable,
  callback,
) -> Unit {
  self
  .as_file()
  .query_filesystem_info_async(attributes, io_priority, cancellable, callback)
}

///|
impl IFile with fn query_info_async(
  self,
  attributes,
  flags,
  io_priority,
  cancellable,
  callback,
) -> Unit {
  self
  .as_file()
  .query_info_async(attributes, flags, io_priority, cancellable, callback)
}

///|
impl IFile with fn read_async(self, io_priority, cancellable, callback) -> Unit {
  self.as_file().read_async(io_priority, cancellable, callback)
}

///|
impl IFile with fn replace_async(
  self,
  etag,
  make_backup,
  flags,
  io_priority,
  cancellable,
  callback,
) -> Unit {
  self
  .as_file()
  .replace_async(etag, make_backup, flags, io_priority, cancellable, callback)
}

///|
impl IFile with fn replace_readwrite_async(
  self,
  etag,
  make_backup,
  flags,
  io_priority,
  cancellable,
  callback,
) -> Unit {
  self
  .as_file()
  .replace_readwrite_async(
    etag, make_backup, flags, io_priority, cancellable, callback,
  )
}

///|
impl IFile with fn set_display_name_async(
  self,
  display_name,
  io_priority,
  cancellable,
  callback,
) -> Unit {
  self
  .as_file()
  .set_display_name_async(display_name, io_priority, cancellable, callback)
}

///|
impl IFile with fn start_mountable(
  self,
  flags,
  start_operation,
  cancellable,
  callback,
) -> Unit {
  self.as_file().start_mountable(flags, start_operation, cancellable, callback)
}

///|
impl IFile with fn stop_mountable(
  self,
  flags,
  mount_operation,
  cancellable,
  callback,
) -> Unit {
  self.as_file().stop_mountable(flags, mount_operation, cancellable, callback)
}

///|
impl IFile with fn trash_async(self, io_priority, cancellable, callback) -> Unit {
  self.as_file().trash_async(io_priority, cancellable, callback)
}

///|
impl IFile with fn unmount_mountable_with_operation(
  self,
  flags,
  mount_operation,
  cancellable,
  callback,
) -> Unit {
  self
  .as_file()
  .unmount_mountable_with_operation(
    flags, mount_operation, cancellable, callback,
  )
}