// This file is automatically generated, so please do not edit it.
// @generated by `flutter_rust_bridge`@ 2.12.0.

#![allow(
    non_camel_case_types,
    unused,
    non_snake_case,
    clippy::needless_return,
    clippy::redundant_closure_call,
    clippy::redundant_closure,
    clippy::useless_conversion,
    clippy::unit_arg,
    clippy::unused_unit,
    clippy::double_parens,
    clippy::let_and_return,
    clippy::too_many_arguments,
    clippy::match_single_binding,
    clippy::clone_on_copy,
    clippy::let_unit_value,
    clippy::deref_addrof,
    clippy::explicit_auto_deref,
    clippy::borrow_deref_ref,
    clippy::uninlined_format_args,
    clippy::needless_borrow
)]

// Section: imports

use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt};
use flutter_rust_bridge::for_generated::{transform_result_dco, Lifetimeable, Lockable};
use flutter_rust_bridge::{Handler, IntoIntoDart};

// Section: boilerplate

flutter_rust_bridge::frb_generated_boilerplate!(
    default_stream_sink_codec = SseCodec,
    default_rust_opaque = RustOpaqueMoi,
    default_rust_auto_opaque = RustAutoOpaqueMoi,
);
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.12.0";
pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 264517153;

// Section: executor

flutter_rust_bridge::frb_generated_default_handler!();

// Section: wire_funcs

fn wire__crate__api__ffi__check_cloud_album_dirs_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "check_cloud_album_dirs",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            let api_base_uri = <String>::sse_decode(&mut deserializer);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok =
                            crate::api::ffi::check_cloud_album_dirs(api_base_uri).await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__create_cloud_album_dirs_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "create_cloud_album_dirs",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            let api_base_uri = <String>::sse_decode(&mut deserializer);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok =
                            crate::api::ffi::create_cloud_album_dirs(api_base_uri).await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__dispose_sync_engine_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "dispose_sync_engine",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::dispose_sync_engine().await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__force_sync_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "force_sync",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::force_sync().await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__get_active_tasks_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "get_active_tasks",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::get_active_tasks().await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__get_active_worker_count_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "get_active_worker_count",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::get_active_worker_count().await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__get_recent_tasks_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "get_recent_tasks",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            let api_limit = <u32>::sse_decode(&mut deserializer);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::get_recent_tasks(api_limit).await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__get_sync_config_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "get_sync_config",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::get_sync_config().await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__get_sync_status_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "get_sync_status",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::get_sync_status().await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__get_task_detail_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "get_task_detail",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            let api_task_id = <String>::sse_decode(&mut deserializer);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::get_task_detail(api_task_id).await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__hydrate_file_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "hydrate_file",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            let api_local_path = <String>::sse_decode(&mut deserializer);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::hydrate_file(api_local_path).await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__init_sync_engine_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "init_sync_engine",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            let api_config = <crate::api::ffi_types::SyncConfigFfi>::sse_decode(&mut deserializer);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::init_sync_engine(api_config).await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__pause_sync_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "pause_sync",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::pause_sync().await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__query_task_items_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "query_task_items",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            let api_filter =
                <crate::api::ffi_types::TaskItemFilterFfi>::sse_decode(&mut deserializer);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::query_task_items(api_filter).await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__register_sync_event_sink_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::SseCodec, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "register_sync_event_sink",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            let api_sink = <StreamSink<
                crate::api::ffi_types::SyncEventFfi,
                flutter_rust_bridge::for_generated::SseCodec,
            >>::sse_decode(&mut deserializer);
            deserializer.end();
            move |context| {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>((move || {
                    let output_ok = crate::api::ffi::register_sync_event_sink(api_sink)?;
                    Ok(output_ok)
                })())
            }
        },
    )
}
fn wire__crate__api__ffi__reset_sync_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "reset_sync",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::reset_sync().await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__resume_sync_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "resume_sync",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::resume_sync().await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__set_sync_log_level_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::SseCodec, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "set_sync_log_level",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            let api_level = <String>::sse_decode(&mut deserializer);
            deserializer.end();
            move |context| {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>((move || {
                    let output_ok = crate::api::ffi::set_sync_log_level(api_level)?;
                    Ok(output_ok)
                })())
            }
        },
    )
}
fn wire__crate__api__ffi__start_continuous_sync_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "start_continuous_sync",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::start_continuous_sync().await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__start_initial_sync_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "start_initial_sync",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::start_initial_sync().await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__stop_sync_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "stop_sync",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::stop_sync().await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__sync_album_to_cloud_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "sync_album_to_cloud",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            let api_album_paths = <Vec<String>>::sse_decode(&mut deserializer);
            let api_remote_dcim_uri = <String>::sse_decode(&mut deserializer);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::sync_album_to_cloud(
                            api_album_paths,
                            api_remote_dcim_uri,
                        )
                        .await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__sync_shutdown_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::<flutter_rust_bridge::for_generated::SseCodec, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "sync_shutdown",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            deserializer.end();
            move |context| {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>((move || {
                    let output_ok = crate::api::ffi::sync_shutdown()?;
                    Ok(output_ok)
                })())
            }
        },
    )
}
fn wire__crate__api__ffi__update_sync_config_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "update_sync_config",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            let api_config = <crate::api::ffi_types::SyncConfigFfi>::sse_decode(&mut deserializer);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::update_sync_config(api_config).await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}
fn wire__crate__api__ffi__update_tokens_impl(
    port_: flutter_rust_bridge::for_generated::MessagePort,
    ptr_: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len_: i32,
    data_len_: i32,
) {
    FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::<flutter_rust_bridge::for_generated::SseCodec, _, _, _>(
        flutter_rust_bridge::for_generated::TaskInfo {
            debug_name: "update_tokens",
            port: Some(port_),
            mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal,
        },
        move || {
            let message = unsafe {
                flutter_rust_bridge::for_generated::Dart2RustMessageSse::from_wire(
                    ptr_,
                    rust_vec_len_,
                    data_len_,
                )
            };
            let mut deserializer =
                flutter_rust_bridge::for_generated::SseDeserializer::new(message);
            let api_access_token = <String>::sse_decode(&mut deserializer);
            deserializer.end();
            move |context| async move {
                transform_result_sse::<_, crate::api::ffi_types::SyncErrorFfi>(
                    (move || async move {
                        let output_ok = crate::api::ffi::update_tokens(api_access_token).await?;
                        Ok(output_ok)
                    })()
                    .await,
                )
            }
        },
    )
}

// Section: dart2rust

impl SseDecode for flutter_rust_bridge::for_generated::anyhow::Error {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        let mut inner = <String>::sse_decode(deserializer);
        return flutter_rust_bridge::for_generated::anyhow::anyhow!("{}", inner);
    }
}

impl SseDecode
    for StreamSink<
        crate::api::ffi_types::SyncEventFfi,
        flutter_rust_bridge::for_generated::SseCodec,
    >
{
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        let mut inner = <String>::sse_decode(deserializer);
        return StreamSink::deserialize(inner);
    }
}

impl SseDecode for String {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        let mut inner = <Vec<u8>>::sse_decode(deserializer);
        return String::from_utf8(inner).unwrap();
    }
}

impl SseDecode for bool {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        deserializer.cursor.read_u8().unwrap() != 0
    }
}

impl SseDecode for crate::api::ffi_types::CloudAlbumCheckResultFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        let mut var_dcimExists = <bool>::sse_decode(deserializer);
        let mut var_picturesExists = <bool>::sse_decode(deserializer);
        let mut var_dcimUri = <Option<String>>::sse_decode(deserializer);
        let mut var_picturesUri = <Option<String>>::sse_decode(deserializer);
        return crate::api::ffi_types::CloudAlbumCheckResultFfi {
            dcim_exists: var_dcimExists,
            pictures_exists: var_picturesExists,
            dcim_uri: var_dcimUri,
            pictures_uri: var_picturesUri,
        };
    }
}

impl SseDecode for i64 {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        deserializer.cursor.read_i64::<NativeEndian>().unwrap()
    }
}

impl SseDecode for Vec<String> {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        let mut len_ = <i32>::sse_decode(deserializer);
        let mut ans_ = Vec::with_capacity(len_ as usize);
        for idx_ in 0..len_ {
            ans_.push(<String>::sse_decode(deserializer));
        }
        return ans_;
    }
}

impl SseDecode for Vec<u8> {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        let mut len_ = <i32>::sse_decode(deserializer);
        let mut ans_ = Vec::with_capacity(len_ as usize);
        for idx_ in 0..len_ {
            ans_.push(<u8>::sse_decode(deserializer));
        }
        return ans_;
    }
}

impl SseDecode for Vec<crate::api::ffi_types::SyncTaskFfi> {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        let mut len_ = <i32>::sse_decode(deserializer);
        let mut ans_ = Vec::with_capacity(len_ as usize);
        for idx_ in 0..len_ {
            ans_.push(<crate::api::ffi_types::SyncTaskFfi>::sse_decode(
                deserializer,
            ));
        }
        return ans_;
    }
}

impl SseDecode for Vec<crate::api::ffi_types::SyncTaskItemFfi> {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        let mut len_ = <i32>::sse_decode(deserializer);
        let mut ans_ = Vec::with_capacity(len_ as usize);
        for idx_ in 0..len_ {
            ans_.push(<crate::api::ffi_types::SyncTaskItemFfi>::sse_decode(
                deserializer,
            ));
        }
        return ans_;
    }
}

impl SseDecode for Option<String> {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        if (<bool>::sse_decode(deserializer)) {
            return Some(<String>::sse_decode(deserializer));
        } else {
            return None;
        }
    }
}

impl SseDecode for crate::api::ffi_types::SyncConfigFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        let mut var_baseUrl = <String>::sse_decode(deserializer);
        let mut var_accessToken = <String>::sse_decode(deserializer);
        let mut var_refreshToken = <String>::sse_decode(deserializer);
        let mut var_localRoot = <String>::sse_decode(deserializer);
        let mut var_remoteRoot = <String>::sse_decode(deserializer);
        let mut var_syncMode = <String>::sse_decode(deserializer);
        let mut var_conflictStrategy = <String>::sse_decode(deserializer);
        let mut var_wcfDeleteMode = <String>::sse_decode(deserializer);
        let mut var_maxConcurrentTransfers = <u32>::sse_decode(deserializer);
        let mut var_bandwidthLimitKbps = <u64>::sse_decode(deserializer);
        let mut var_excludedPaths = <Vec<String>>::sse_decode(deserializer);
        let mut var_maxWorkers = <u32>::sse_decode(deserializer);
        let mut var_dataDir = <String>::sse_decode(deserializer);
        let mut var_clientId = <String>::sse_decode(deserializer);
        let mut var_logLevel = <String>::sse_decode(deserializer);
        return crate::api::ffi_types::SyncConfigFfi {
            base_url: var_baseUrl,
            access_token: var_accessToken,
            refresh_token: var_refreshToken,
            local_root: var_localRoot,
            remote_root: var_remoteRoot,
            sync_mode: var_syncMode,
            conflict_strategy: var_conflictStrategy,
            wcf_delete_mode: var_wcfDeleteMode,
            max_concurrent_transfers: var_maxConcurrentTransfers,
            bandwidth_limit_kbps: var_bandwidthLimitKbps,
            excluded_paths: var_excludedPaths,
            max_workers: var_maxWorkers,
            data_dir: var_dataDir,
            client_id: var_clientId,
            log_level: var_logLevel,
        };
    }
}

impl SseDecode for crate::api::ffi_types::SyncErrorFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        let mut tag_ = <i32>::sse_decode(deserializer);
        match tag_ {
            0 => {
                return crate::api::ffi_types::SyncErrorFfi::NotInitialized;
            }
            1 => {
                let mut var_message = <String>::sse_decode(deserializer);
                return crate::api::ffi_types::SyncErrorFfi::NetworkError {
                    message: var_message,
                };
            }
            2 => {
                let mut var_needed = <u64>::sse_decode(deserializer);
                let mut var_available = <u64>::sse_decode(deserializer);
                return crate::api::ffi_types::SyncErrorFfi::DiskFull {
                    needed: var_needed,
                    available: var_available,
                };
            }
            3 => {
                let mut var_message = <String>::sse_decode(deserializer);
                return crate::api::ffi_types::SyncErrorFfi::AuthError {
                    message: var_message,
                };
            }
            4 => {
                let mut var_count = <u32>::sse_decode(deserializer);
                return crate::api::ffi_types::SyncErrorFfi::ConflictError { count: var_count };
            }
            5 => {
                let mut var_message = <String>::sse_decode(deserializer);
                return crate::api::ffi_types::SyncErrorFfi::InternalError {
                    message: var_message,
                };
            }
            _ => {
                unimplemented!("");
            }
        }
    }
}

impl SseDecode for crate::api::ffi_types::SyncEventFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        let mut tag_ = <i32>::sse_decode(deserializer);
        match tag_ {
            0 => {
                let mut var_newState = <String>::sse_decode(deserializer);
                return crate::api::ffi_types::SyncEventFfi::StateChanged {
                    new_state: var_newState,
                };
            }
            1 => {
                let mut var_synced = <u64>::sse_decode(deserializer);
                let mut var_total = <u64>::sse_decode(deserializer);
                let mut var_currentFile = <String>::sse_decode(deserializer);
                return crate::api::ffi_types::SyncEventFfi::Progress {
                    synced: var_synced,
                    total: var_total,
                    current_file: var_currentFile,
                };
            }
            2 => {
                let mut var_localPath = <String>::sse_decode(deserializer);
                let mut var_remoteUri = <String>::sse_decode(deserializer);
                return crate::api::ffi_types::SyncEventFfi::FileUploaded {
                    local_path: var_localPath,
                    remote_uri: var_remoteUri,
                };
            }
            3 => {
                let mut var_localPath = <String>::sse_decode(deserializer);
                let mut var_remoteUri = <String>::sse_decode(deserializer);
                return crate::api::ffi_types::SyncEventFfi::FileDownloaded {
                    local_path: var_localPath,
                    remote_uri: var_remoteUri,
                };
            }
            4 => {
                let mut var_localPath = <String>::sse_decode(deserializer);
                let mut var_conflictType = <String>::sse_decode(deserializer);
                return crate::api::ffi_types::SyncEventFfi::ConflictDetected {
                    local_path: var_localPath,
                    conflict_type: var_conflictType,
                };
            }
            5 => {
                let mut var_message = <String>::sse_decode(deserializer);
                let mut var_recoverable = <bool>::sse_decode(deserializer);
                return crate::api::ffi_types::SyncEventFfi::Error {
                    message: var_message,
                    recoverable: var_recoverable,
                };
            }
            6 => {
                return crate::api::ffi_types::SyncEventFfi::TokenExpired;
            }
            7 => {
                let mut var_availableMb = <u64>::sse_decode(deserializer);
                return crate::api::ffi_types::SyncEventFfi::DiskSpaceWarning {
                    available_mb: var_availableMb,
                };
            }
            8 => {
                let mut var_summary =
                    <crate::api::ffi_types::SyncSummaryFfi>::sse_decode(deserializer);
                return crate::api::ffi_types::SyncEventFfi::InitialSyncComplete {
                    summary: var_summary,
                };
            }
            9 => {
                let mut var_taskId = <String>::sse_decode(deserializer);
                let mut var_trigger = <String>::sse_decode(deserializer);
                let mut var_uploadCount = <u32>::sse_decode(deserializer);
                let mut var_downloadCount = <u32>::sse_decode(deserializer);
                return crate::api::ffi_types::SyncEventFfi::WorkerStarted {
                    task_id: var_taskId,
                    trigger: var_trigger,
                    upload_count: var_uploadCount,
                    download_count: var_downloadCount,
                };
            }
            10 => {
                let mut var_taskId = <String>::sse_decode(deserializer);
                let mut var_uploaded = <u32>::sse_decode(deserializer);
                let mut var_downloaded = <u32>::sse_decode(deserializer);
                let mut var_renamed = <u32>::sse_decode(deserializer);
                let mut var_moved = <u32>::sse_decode(deserializer);
                let mut var_failed = <u32>::sse_decode(deserializer);
                let mut var_durationMs = <u64>::sse_decode(deserializer);
                return crate::api::ffi_types::SyncEventFfi::WorkerCompleted {
                    task_id: var_taskId,
                    uploaded: var_uploaded,
                    downloaded: var_downloaded,
                    renamed: var_renamed,
                    moved: var_moved,
                    failed: var_failed,
                    duration_ms: var_durationMs,
                };
            }
            11 => {
                let mut var_taskId = <String>::sse_decode(deserializer);
                let mut var_message = <String>::sse_decode(deserializer);
                return crate::api::ffi_types::SyncEventFfi::WorkerFailed {
                    task_id: var_taskId,
                    message: var_message,
                };
            }
            12 => {
                let mut var_taskId = <String>::sse_decode(deserializer);
                let mut var_relativePath = <String>::sse_decode(deserializer);
                let mut var_action = <String>::sse_decode(deserializer);
                let mut var_status = <String>::sse_decode(deserializer);
                return crate::api::ffi_types::SyncEventFfi::TaskItemUpdated {
                    task_id: var_taskId,
                    relative_path: var_relativePath,
                    action: var_action,
                    status: var_status,
                };
            }
            _ => {
                unimplemented!("");
            }
        }
    }
}

impl SseDecode for crate::api::ffi_types::SyncStatusFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        let mut var_state = <String>::sse_decode(deserializer);
        let mut var_syncedFiles = <u64>::sse_decode(deserializer);
        let mut var_totalFiles = <u64>::sse_decode(deserializer);
        let mut var_uploadingCount = <u32>::sse_decode(deserializer);
        let mut var_downloadingCount = <u32>::sse_decode(deserializer);
        let mut var_conflictCount = <u32>::sse_decode(deserializer);
        let mut var_errorCount = <u32>::sse_decode(deserializer);
        let mut var_lastSyncTime = <Option<String>>::sse_decode(deserializer);
        let mut var_errorMessage = <Option<String>>::sse_decode(deserializer);
        return crate::api::ffi_types::SyncStatusFfi {
            state: var_state,
            synced_files: var_syncedFiles,
            total_files: var_totalFiles,
            uploading_count: var_uploadingCount,
            downloading_count: var_downloadingCount,
            conflict_count: var_conflictCount,
            error_count: var_errorCount,
            last_sync_time: var_lastSyncTime,
            error_message: var_errorMessage,
        };
    }
}

impl SseDecode for crate::api::ffi_types::SyncSummaryFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        let mut var_uploaded = <u32>::sse_decode(deserializer);
        let mut var_downloaded = <u32>::sse_decode(deserializer);
        let mut var_renamed = <u32>::sse_decode(deserializer);
        let mut var_moved = <u32>::sse_decode(deserializer);
        let mut var_conflicts = <u32>::sse_decode(deserializer);
        let mut var_failed = <u32>::sse_decode(deserializer);
        let mut var_skipped = <u32>::sse_decode(deserializer);
        let mut var_deletedLocal = <u32>::sse_decode(deserializer);
        let mut var_deletedRemote = <u32>::sse_decode(deserializer);
        let mut var_durationMs = <u64>::sse_decode(deserializer);
        return crate::api::ffi_types::SyncSummaryFfi {
            uploaded: var_uploaded,
            downloaded: var_downloaded,
            renamed: var_renamed,
            moved: var_moved,
            conflicts: var_conflicts,
            failed: var_failed,
            skipped: var_skipped,
            deleted_local: var_deletedLocal,
            deleted_remote: var_deletedRemote,
            duration_ms: var_durationMs,
        };
    }
}

impl SseDecode for crate::api::ffi_types::SyncTaskFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        let mut var_id = <String>::sse_decode(deserializer);
        let mut var_trigger = <String>::sse_decode(deserializer);
        let mut var_totalCount = <u32>::sse_decode(deserializer);
        let mut var_completedCount = <u32>::sse_decode(deserializer);
        let mut var_failedCount = <u32>::sse_decode(deserializer);
        let mut var_status = <String>::sse_decode(deserializer);
        let mut var_createdAt = <String>::sse_decode(deserializer);
        let mut var_updatedAt = <String>::sse_decode(deserializer);
        let mut var_finishedAt = <Option<String>>::sse_decode(deserializer);
        return crate::api::ffi_types::SyncTaskFfi {
            id: var_id,
            trigger: var_trigger,
            total_count: var_totalCount,
            completed_count: var_completedCount,
            failed_count: var_failedCount,
            status: var_status,
            created_at: var_createdAt,
            updated_at: var_updatedAt,
            finished_at: var_finishedAt,
        };
    }
}

impl SseDecode for crate::api::ffi_types::SyncTaskItemFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        let mut var_id = <i64>::sse_decode(deserializer);
        let mut var_taskId = <String>::sse_decode(deserializer);
        let mut var_relativePath = <String>::sse_decode(deserializer);
        let mut var_actionType = <String>::sse_decode(deserializer);
        let mut var_status = <String>::sse_decode(deserializer);
        let mut var_fileSize = <u64>::sse_decode(deserializer);
        let mut var_errorMessage = <Option<String>>::sse_decode(deserializer);
        let mut var_createdAt = <String>::sse_decode(deserializer);
        let mut var_updatedAt = <String>::sse_decode(deserializer);
        return crate::api::ffi_types::SyncTaskItemFfi {
            id: var_id,
            task_id: var_taskId,
            relative_path: var_relativePath,
            action_type: var_actionType,
            status: var_status,
            file_size: var_fileSize,
            error_message: var_errorMessage,
            created_at: var_createdAt,
            updated_at: var_updatedAt,
        };
    }
}

impl SseDecode for crate::api::ffi_types::TaskItemFilterFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        let mut var_taskId = <Option<String>>::sse_decode(deserializer);
        let mut var_relativePathContains = <Option<String>>::sse_decode(deserializer);
        let mut var_actionType = <Option<String>>::sse_decode(deserializer);
        let mut var_status = <Option<String>>::sse_decode(deserializer);
        let mut var_limit = <u32>::sse_decode(deserializer);
        let mut var_offset = <u32>::sse_decode(deserializer);
        return crate::api::ffi_types::TaskItemFilterFfi {
            task_id: var_taskId,
            relative_path_contains: var_relativePathContains,
            action_type: var_actionType,
            status: var_status,
            limit: var_limit,
            offset: var_offset,
        };
    }
}

impl SseDecode for u32 {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        deserializer.cursor.read_u32::<NativeEndian>().unwrap()
    }
}

impl SseDecode for u64 {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        deserializer.cursor.read_u64::<NativeEndian>().unwrap()
    }
}

impl SseDecode for u8 {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        deserializer.cursor.read_u8().unwrap()
    }
}

impl SseDecode for () {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {}
}

impl SseDecode for i32 {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self {
        deserializer.cursor.read_i32::<NativeEndian>().unwrap()
    }
}

fn pde_ffi_dispatcher_primary_impl(
    func_id: i32,
    port: flutter_rust_bridge::for_generated::MessagePort,
    ptr: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len: i32,
    data_len: i32,
) {
    // Codec=Pde (Serialization + dispatch), see doc to use other codecs
    match func_id {
        1 => wire__crate__api__ffi__check_cloud_album_dirs_impl(port, ptr, rust_vec_len, data_len),
        2 => wire__crate__api__ffi__create_cloud_album_dirs_impl(port, ptr, rust_vec_len, data_len),
        3 => wire__crate__api__ffi__dispose_sync_engine_impl(port, ptr, rust_vec_len, data_len),
        4 => wire__crate__api__ffi__force_sync_impl(port, ptr, rust_vec_len, data_len),
        5 => wire__crate__api__ffi__get_active_tasks_impl(port, ptr, rust_vec_len, data_len),
        6 => wire__crate__api__ffi__get_active_worker_count_impl(port, ptr, rust_vec_len, data_len),
        7 => wire__crate__api__ffi__get_recent_tasks_impl(port, ptr, rust_vec_len, data_len),
        8 => wire__crate__api__ffi__get_sync_config_impl(port, ptr, rust_vec_len, data_len),
        9 => wire__crate__api__ffi__get_sync_status_impl(port, ptr, rust_vec_len, data_len),
        10 => wire__crate__api__ffi__get_task_detail_impl(port, ptr, rust_vec_len, data_len),
        11 => wire__crate__api__ffi__hydrate_file_impl(port, ptr, rust_vec_len, data_len),
        12 => wire__crate__api__ffi__init_sync_engine_impl(port, ptr, rust_vec_len, data_len),
        13 => wire__crate__api__ffi__pause_sync_impl(port, ptr, rust_vec_len, data_len),
        14 => wire__crate__api__ffi__query_task_items_impl(port, ptr, rust_vec_len, data_len),
        15 => {
            wire__crate__api__ffi__register_sync_event_sink_impl(port, ptr, rust_vec_len, data_len)
        }
        16 => wire__crate__api__ffi__reset_sync_impl(port, ptr, rust_vec_len, data_len),
        17 => wire__crate__api__ffi__resume_sync_impl(port, ptr, rust_vec_len, data_len),
        18 => wire__crate__api__ffi__set_sync_log_level_impl(port, ptr, rust_vec_len, data_len),
        19 => wire__crate__api__ffi__start_continuous_sync_impl(port, ptr, rust_vec_len, data_len),
        20 => wire__crate__api__ffi__start_initial_sync_impl(port, ptr, rust_vec_len, data_len),
        21 => wire__crate__api__ffi__stop_sync_impl(port, ptr, rust_vec_len, data_len),
        22 => wire__crate__api__ffi__sync_album_to_cloud_impl(port, ptr, rust_vec_len, data_len),
        23 => wire__crate__api__ffi__sync_shutdown_impl(port, ptr, rust_vec_len, data_len),
        24 => wire__crate__api__ffi__update_sync_config_impl(port, ptr, rust_vec_len, data_len),
        25 => wire__crate__api__ffi__update_tokens_impl(port, ptr, rust_vec_len, data_len),
        _ => unreachable!(),
    }
}

fn pde_ffi_dispatcher_sync_impl(
    func_id: i32,
    ptr: flutter_rust_bridge::for_generated::PlatformGeneralizedUint8ListPtr,
    rust_vec_len: i32,
    data_len: i32,
) -> flutter_rust_bridge::for_generated::WireSyncRust2DartSse {
    // Codec=Pde (Serialization + dispatch), see doc to use other codecs
    match func_id {
        _ => unreachable!(),
    }
}

// Section: rust2dart

// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::api::ffi_types::CloudAlbumCheckResultFfi {
    fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
        [
            self.dcim_exists.into_into_dart().into_dart(),
            self.pictures_exists.into_into_dart().into_dart(),
            self.dcim_uri.into_into_dart().into_dart(),
            self.pictures_uri.into_into_dart().into_dart(),
        ]
        .into_dart()
    }
}
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
    for crate::api::ffi_types::CloudAlbumCheckResultFfi
{
}
impl flutter_rust_bridge::IntoIntoDart<crate::api::ffi_types::CloudAlbumCheckResultFfi>
    for crate::api::ffi_types::CloudAlbumCheckResultFfi
{
    fn into_into_dart(self) -> crate::api::ffi_types::CloudAlbumCheckResultFfi {
        self
    }
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::api::ffi_types::SyncConfigFfi {
    fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
        [
            self.base_url.into_into_dart().into_dart(),
            self.access_token.into_into_dart().into_dart(),
            self.refresh_token.into_into_dart().into_dart(),
            self.local_root.into_into_dart().into_dart(),
            self.remote_root.into_into_dart().into_dart(),
            self.sync_mode.into_into_dart().into_dart(),
            self.conflict_strategy.into_into_dart().into_dart(),
            self.wcf_delete_mode.into_into_dart().into_dart(),
            self.max_concurrent_transfers.into_into_dart().into_dart(),
            self.bandwidth_limit_kbps.into_into_dart().into_dart(),
            self.excluded_paths.into_into_dart().into_dart(),
            self.max_workers.into_into_dart().into_dart(),
            self.data_dir.into_into_dart().into_dart(),
            self.client_id.into_into_dart().into_dart(),
            self.log_level.into_into_dart().into_dart(),
        ]
        .into_dart()
    }
}
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
    for crate::api::ffi_types::SyncConfigFfi
{
}
impl flutter_rust_bridge::IntoIntoDart<crate::api::ffi_types::SyncConfigFfi>
    for crate::api::ffi_types::SyncConfigFfi
{
    fn into_into_dart(self) -> crate::api::ffi_types::SyncConfigFfi {
        self
    }
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::api::ffi_types::SyncErrorFfi {
    fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
        match self {
            crate::api::ffi_types::SyncErrorFfi::NotInitialized => [0.into_dart()].into_dart(),
            crate::api::ffi_types::SyncErrorFfi::NetworkError { message } => {
                [1.into_dart(), message.into_into_dart().into_dart()].into_dart()
            }
            crate::api::ffi_types::SyncErrorFfi::DiskFull { needed, available } => [
                2.into_dart(),
                needed.into_into_dart().into_dart(),
                available.into_into_dart().into_dart(),
            ]
            .into_dart(),
            crate::api::ffi_types::SyncErrorFfi::AuthError { message } => {
                [3.into_dart(), message.into_into_dart().into_dart()].into_dart()
            }
            crate::api::ffi_types::SyncErrorFfi::ConflictError { count } => {
                [4.into_dart(), count.into_into_dart().into_dart()].into_dart()
            }
            crate::api::ffi_types::SyncErrorFfi::InternalError { message } => {
                [5.into_dart(), message.into_into_dart().into_dart()].into_dart()
            }
            _ => {
                unimplemented!("");
            }
        }
    }
}
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
    for crate::api::ffi_types::SyncErrorFfi
{
}
impl flutter_rust_bridge::IntoIntoDart<crate::api::ffi_types::SyncErrorFfi>
    for crate::api::ffi_types::SyncErrorFfi
{
    fn into_into_dart(self) -> crate::api::ffi_types::SyncErrorFfi {
        self
    }
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::api::ffi_types::SyncEventFfi {
    fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
        match self {
            crate::api::ffi_types::SyncEventFfi::StateChanged { new_state } => {
                [0.into_dart(), new_state.into_into_dart().into_dart()].into_dart()
            }
            crate::api::ffi_types::SyncEventFfi::Progress {
                synced,
                total,
                current_file,
            } => [
                1.into_dart(),
                synced.into_into_dart().into_dart(),
                total.into_into_dart().into_dart(),
                current_file.into_into_dart().into_dart(),
            ]
            .into_dart(),
            crate::api::ffi_types::SyncEventFfi::FileUploaded {
                local_path,
                remote_uri,
            } => [
                2.into_dart(),
                local_path.into_into_dart().into_dart(),
                remote_uri.into_into_dart().into_dart(),
            ]
            .into_dart(),
            crate::api::ffi_types::SyncEventFfi::FileDownloaded {
                local_path,
                remote_uri,
            } => [
                3.into_dart(),
                local_path.into_into_dart().into_dart(),
                remote_uri.into_into_dart().into_dart(),
            ]
            .into_dart(),
            crate::api::ffi_types::SyncEventFfi::ConflictDetected {
                local_path,
                conflict_type,
            } => [
                4.into_dart(),
                local_path.into_into_dart().into_dart(),
                conflict_type.into_into_dart().into_dart(),
            ]
            .into_dart(),
            crate::api::ffi_types::SyncEventFfi::Error {
                message,
                recoverable,
            } => [
                5.into_dart(),
                message.into_into_dart().into_dart(),
                recoverable.into_into_dart().into_dart(),
            ]
            .into_dart(),
            crate::api::ffi_types::SyncEventFfi::TokenExpired => [6.into_dart()].into_dart(),
            crate::api::ffi_types::SyncEventFfi::DiskSpaceWarning { available_mb } => {
                [7.into_dart(), available_mb.into_into_dart().into_dart()].into_dart()
            }
            crate::api::ffi_types::SyncEventFfi::InitialSyncComplete { summary } => {
                [8.into_dart(), summary.into_into_dart().into_dart()].into_dart()
            }
            crate::api::ffi_types::SyncEventFfi::WorkerStarted {
                task_id,
                trigger,
                upload_count,
                download_count,
            } => [
                9.into_dart(),
                task_id.into_into_dart().into_dart(),
                trigger.into_into_dart().into_dart(),
                upload_count.into_into_dart().into_dart(),
                download_count.into_into_dart().into_dart(),
            ]
            .into_dart(),
            crate::api::ffi_types::SyncEventFfi::WorkerCompleted {
                task_id,
                uploaded,
                downloaded,
                renamed,
                moved,
                failed,
                duration_ms,
            } => [
                10.into_dart(),
                task_id.into_into_dart().into_dart(),
                uploaded.into_into_dart().into_dart(),
                downloaded.into_into_dart().into_dart(),
                renamed.into_into_dart().into_dart(),
                moved.into_into_dart().into_dart(),
                failed.into_into_dart().into_dart(),
                duration_ms.into_into_dart().into_dart(),
            ]
            .into_dart(),
            crate::api::ffi_types::SyncEventFfi::WorkerFailed { task_id, message } => [
                11.into_dart(),
                task_id.into_into_dart().into_dart(),
                message.into_into_dart().into_dart(),
            ]
            .into_dart(),
            crate::api::ffi_types::SyncEventFfi::TaskItemUpdated {
                task_id,
                relative_path,
                action,
                status,
            } => [
                12.into_dart(),
                task_id.into_into_dart().into_dart(),
                relative_path.into_into_dart().into_dart(),
                action.into_into_dart().into_dart(),
                status.into_into_dart().into_dart(),
            ]
            .into_dart(),
            _ => {
                unimplemented!("");
            }
        }
    }
}
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
    for crate::api::ffi_types::SyncEventFfi
{
}
impl flutter_rust_bridge::IntoIntoDart<crate::api::ffi_types::SyncEventFfi>
    for crate::api::ffi_types::SyncEventFfi
{
    fn into_into_dart(self) -> crate::api::ffi_types::SyncEventFfi {
        self
    }
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::api::ffi_types::SyncStatusFfi {
    fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
        [
            self.state.into_into_dart().into_dart(),
            self.synced_files.into_into_dart().into_dart(),
            self.total_files.into_into_dart().into_dart(),
            self.uploading_count.into_into_dart().into_dart(),
            self.downloading_count.into_into_dart().into_dart(),
            self.conflict_count.into_into_dart().into_dart(),
            self.error_count.into_into_dart().into_dart(),
            self.last_sync_time.into_into_dart().into_dart(),
            self.error_message.into_into_dart().into_dart(),
        ]
        .into_dart()
    }
}
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
    for crate::api::ffi_types::SyncStatusFfi
{
}
impl flutter_rust_bridge::IntoIntoDart<crate::api::ffi_types::SyncStatusFfi>
    for crate::api::ffi_types::SyncStatusFfi
{
    fn into_into_dart(self) -> crate::api::ffi_types::SyncStatusFfi {
        self
    }
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::api::ffi_types::SyncSummaryFfi {
    fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
        [
            self.uploaded.into_into_dart().into_dart(),
            self.downloaded.into_into_dart().into_dart(),
            self.renamed.into_into_dart().into_dart(),
            self.moved.into_into_dart().into_dart(),
            self.conflicts.into_into_dart().into_dart(),
            self.failed.into_into_dart().into_dart(),
            self.skipped.into_into_dart().into_dart(),
            self.deleted_local.into_into_dart().into_dart(),
            self.deleted_remote.into_into_dart().into_dart(),
            self.duration_ms.into_into_dart().into_dart(),
        ]
        .into_dart()
    }
}
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
    for crate::api::ffi_types::SyncSummaryFfi
{
}
impl flutter_rust_bridge::IntoIntoDart<crate::api::ffi_types::SyncSummaryFfi>
    for crate::api::ffi_types::SyncSummaryFfi
{
    fn into_into_dart(self) -> crate::api::ffi_types::SyncSummaryFfi {
        self
    }
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::api::ffi_types::SyncTaskFfi {
    fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
        [
            self.id.into_into_dart().into_dart(),
            self.trigger.into_into_dart().into_dart(),
            self.total_count.into_into_dart().into_dart(),
            self.completed_count.into_into_dart().into_dart(),
            self.failed_count.into_into_dart().into_dart(),
            self.status.into_into_dart().into_dart(),
            self.created_at.into_into_dart().into_dart(),
            self.updated_at.into_into_dart().into_dart(),
            self.finished_at.into_into_dart().into_dart(),
        ]
        .into_dart()
    }
}
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
    for crate::api::ffi_types::SyncTaskFfi
{
}
impl flutter_rust_bridge::IntoIntoDart<crate::api::ffi_types::SyncTaskFfi>
    for crate::api::ffi_types::SyncTaskFfi
{
    fn into_into_dart(self) -> crate::api::ffi_types::SyncTaskFfi {
        self
    }
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::api::ffi_types::SyncTaskItemFfi {
    fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
        [
            self.id.into_into_dart().into_dart(),
            self.task_id.into_into_dart().into_dart(),
            self.relative_path.into_into_dart().into_dart(),
            self.action_type.into_into_dart().into_dart(),
            self.status.into_into_dart().into_dart(),
            self.file_size.into_into_dart().into_dart(),
            self.error_message.into_into_dart().into_dart(),
            self.created_at.into_into_dart().into_dart(),
            self.updated_at.into_into_dart().into_dart(),
        ]
        .into_dart()
    }
}
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
    for crate::api::ffi_types::SyncTaskItemFfi
{
}
impl flutter_rust_bridge::IntoIntoDart<crate::api::ffi_types::SyncTaskItemFfi>
    for crate::api::ffi_types::SyncTaskItemFfi
{
    fn into_into_dart(self) -> crate::api::ffi_types::SyncTaskItemFfi {
        self
    }
}
// Codec=Dco (DartCObject based), see doc to use other codecs
impl flutter_rust_bridge::IntoDart for crate::api::ffi_types::TaskItemFilterFfi {
    fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi {
        [
            self.task_id.into_into_dart().into_dart(),
            self.relative_path_contains.into_into_dart().into_dart(),
            self.action_type.into_into_dart().into_dart(),
            self.status.into_into_dart().into_dart(),
            self.limit.into_into_dart().into_dart(),
            self.offset.into_into_dart().into_dart(),
        ]
        .into_dart()
    }
}
impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive
    for crate::api::ffi_types::TaskItemFilterFfi
{
}
impl flutter_rust_bridge::IntoIntoDart<crate::api::ffi_types::TaskItemFilterFfi>
    for crate::api::ffi_types::TaskItemFilterFfi
{
    fn into_into_dart(self) -> crate::api::ffi_types::TaskItemFilterFfi {
        self
    }
}

impl SseEncode for flutter_rust_bridge::for_generated::anyhow::Error {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        <String>::sse_encode(format!("{:?}", self), serializer);
    }
}

impl SseEncode
    for StreamSink<
        crate::api::ffi_types::SyncEventFfi,
        flutter_rust_bridge::for_generated::SseCodec,
    >
{
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        unimplemented!("")
    }
}

impl SseEncode for String {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        <Vec<u8>>::sse_encode(self.into_bytes(), serializer);
    }
}

impl SseEncode for bool {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        serializer.cursor.write_u8(self as _).unwrap();
    }
}

impl SseEncode for crate::api::ffi_types::CloudAlbumCheckResultFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        <bool>::sse_encode(self.dcim_exists, serializer);
        <bool>::sse_encode(self.pictures_exists, serializer);
        <Option<String>>::sse_encode(self.dcim_uri, serializer);
        <Option<String>>::sse_encode(self.pictures_uri, serializer);
    }
}

impl SseEncode for i64 {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        serializer.cursor.write_i64::<NativeEndian>(self).unwrap();
    }
}

impl SseEncode for Vec<String> {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        <i32>::sse_encode(self.len() as _, serializer);
        for item in self {
            <String>::sse_encode(item, serializer);
        }
    }
}

impl SseEncode for Vec<u8> {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        <i32>::sse_encode(self.len() as _, serializer);
        for item in self {
            <u8>::sse_encode(item, serializer);
        }
    }
}

impl SseEncode for Vec<crate::api::ffi_types::SyncTaskFfi> {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        <i32>::sse_encode(self.len() as _, serializer);
        for item in self {
            <crate::api::ffi_types::SyncTaskFfi>::sse_encode(item, serializer);
        }
    }
}

impl SseEncode for Vec<crate::api::ffi_types::SyncTaskItemFfi> {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        <i32>::sse_encode(self.len() as _, serializer);
        for item in self {
            <crate::api::ffi_types::SyncTaskItemFfi>::sse_encode(item, serializer);
        }
    }
}

impl SseEncode for Option<String> {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        <bool>::sse_encode(self.is_some(), serializer);
        if let Some(value) = self {
            <String>::sse_encode(value, serializer);
        }
    }
}

impl SseEncode for crate::api::ffi_types::SyncConfigFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        <String>::sse_encode(self.base_url, serializer);
        <String>::sse_encode(self.access_token, serializer);
        <String>::sse_encode(self.refresh_token, serializer);
        <String>::sse_encode(self.local_root, serializer);
        <String>::sse_encode(self.remote_root, serializer);
        <String>::sse_encode(self.sync_mode, serializer);
        <String>::sse_encode(self.conflict_strategy, serializer);
        <String>::sse_encode(self.wcf_delete_mode, serializer);
        <u32>::sse_encode(self.max_concurrent_transfers, serializer);
        <u64>::sse_encode(self.bandwidth_limit_kbps, serializer);
        <Vec<String>>::sse_encode(self.excluded_paths, serializer);
        <u32>::sse_encode(self.max_workers, serializer);
        <String>::sse_encode(self.data_dir, serializer);
        <String>::sse_encode(self.client_id, serializer);
        <String>::sse_encode(self.log_level, serializer);
    }
}

impl SseEncode for crate::api::ffi_types::SyncErrorFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        match self {
            crate::api::ffi_types::SyncErrorFfi::NotInitialized => {
                <i32>::sse_encode(0, serializer);
            }
            crate::api::ffi_types::SyncErrorFfi::NetworkError { message } => {
                <i32>::sse_encode(1, serializer);
                <String>::sse_encode(message, serializer);
            }
            crate::api::ffi_types::SyncErrorFfi::DiskFull { needed, available } => {
                <i32>::sse_encode(2, serializer);
                <u64>::sse_encode(needed, serializer);
                <u64>::sse_encode(available, serializer);
            }
            crate::api::ffi_types::SyncErrorFfi::AuthError { message } => {
                <i32>::sse_encode(3, serializer);
                <String>::sse_encode(message, serializer);
            }
            crate::api::ffi_types::SyncErrorFfi::ConflictError { count } => {
                <i32>::sse_encode(4, serializer);
                <u32>::sse_encode(count, serializer);
            }
            crate::api::ffi_types::SyncErrorFfi::InternalError { message } => {
                <i32>::sse_encode(5, serializer);
                <String>::sse_encode(message, serializer);
            }
            _ => {
                unimplemented!("");
            }
        }
    }
}

impl SseEncode for crate::api::ffi_types::SyncEventFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        match self {
            crate::api::ffi_types::SyncEventFfi::StateChanged { new_state } => {
                <i32>::sse_encode(0, serializer);
                <String>::sse_encode(new_state, serializer);
            }
            crate::api::ffi_types::SyncEventFfi::Progress {
                synced,
                total,
                current_file,
            } => {
                <i32>::sse_encode(1, serializer);
                <u64>::sse_encode(synced, serializer);
                <u64>::sse_encode(total, serializer);
                <String>::sse_encode(current_file, serializer);
            }
            crate::api::ffi_types::SyncEventFfi::FileUploaded {
                local_path,
                remote_uri,
            } => {
                <i32>::sse_encode(2, serializer);
                <String>::sse_encode(local_path, serializer);
                <String>::sse_encode(remote_uri, serializer);
            }
            crate::api::ffi_types::SyncEventFfi::FileDownloaded {
                local_path,
                remote_uri,
            } => {
                <i32>::sse_encode(3, serializer);
                <String>::sse_encode(local_path, serializer);
                <String>::sse_encode(remote_uri, serializer);
            }
            crate::api::ffi_types::SyncEventFfi::ConflictDetected {
                local_path,
                conflict_type,
            } => {
                <i32>::sse_encode(4, serializer);
                <String>::sse_encode(local_path, serializer);
                <String>::sse_encode(conflict_type, serializer);
            }
            crate::api::ffi_types::SyncEventFfi::Error {
                message,
                recoverable,
            } => {
                <i32>::sse_encode(5, serializer);
                <String>::sse_encode(message, serializer);
                <bool>::sse_encode(recoverable, serializer);
            }
            crate::api::ffi_types::SyncEventFfi::TokenExpired => {
                <i32>::sse_encode(6, serializer);
            }
            crate::api::ffi_types::SyncEventFfi::DiskSpaceWarning { available_mb } => {
                <i32>::sse_encode(7, serializer);
                <u64>::sse_encode(available_mb, serializer);
            }
            crate::api::ffi_types::SyncEventFfi::InitialSyncComplete { summary } => {
                <i32>::sse_encode(8, serializer);
                <crate::api::ffi_types::SyncSummaryFfi>::sse_encode(summary, serializer);
            }
            crate::api::ffi_types::SyncEventFfi::WorkerStarted {
                task_id,
                trigger,
                upload_count,
                download_count,
            } => {
                <i32>::sse_encode(9, serializer);
                <String>::sse_encode(task_id, serializer);
                <String>::sse_encode(trigger, serializer);
                <u32>::sse_encode(upload_count, serializer);
                <u32>::sse_encode(download_count, serializer);
            }
            crate::api::ffi_types::SyncEventFfi::WorkerCompleted {
                task_id,
                uploaded,
                downloaded,
                renamed,
                moved,
                failed,
                duration_ms,
            } => {
                <i32>::sse_encode(10, serializer);
                <String>::sse_encode(task_id, serializer);
                <u32>::sse_encode(uploaded, serializer);
                <u32>::sse_encode(downloaded, serializer);
                <u32>::sse_encode(renamed, serializer);
                <u32>::sse_encode(moved, serializer);
                <u32>::sse_encode(failed, serializer);
                <u64>::sse_encode(duration_ms, serializer);
            }
            crate::api::ffi_types::SyncEventFfi::WorkerFailed { task_id, message } => {
                <i32>::sse_encode(11, serializer);
                <String>::sse_encode(task_id, serializer);
                <String>::sse_encode(message, serializer);
            }
            crate::api::ffi_types::SyncEventFfi::TaskItemUpdated {
                task_id,
                relative_path,
                action,
                status,
            } => {
                <i32>::sse_encode(12, serializer);
                <String>::sse_encode(task_id, serializer);
                <String>::sse_encode(relative_path, serializer);
                <String>::sse_encode(action, serializer);
                <String>::sse_encode(status, serializer);
            }
            _ => {
                unimplemented!("");
            }
        }
    }
}

impl SseEncode for crate::api::ffi_types::SyncStatusFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        <String>::sse_encode(self.state, serializer);
        <u64>::sse_encode(self.synced_files, serializer);
        <u64>::sse_encode(self.total_files, serializer);
        <u32>::sse_encode(self.uploading_count, serializer);
        <u32>::sse_encode(self.downloading_count, serializer);
        <u32>::sse_encode(self.conflict_count, serializer);
        <u32>::sse_encode(self.error_count, serializer);
        <Option<String>>::sse_encode(self.last_sync_time, serializer);
        <Option<String>>::sse_encode(self.error_message, serializer);
    }
}

impl SseEncode for crate::api::ffi_types::SyncSummaryFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        <u32>::sse_encode(self.uploaded, serializer);
        <u32>::sse_encode(self.downloaded, serializer);
        <u32>::sse_encode(self.renamed, serializer);
        <u32>::sse_encode(self.moved, serializer);
        <u32>::sse_encode(self.conflicts, serializer);
        <u32>::sse_encode(self.failed, serializer);
        <u32>::sse_encode(self.skipped, serializer);
        <u32>::sse_encode(self.deleted_local, serializer);
        <u32>::sse_encode(self.deleted_remote, serializer);
        <u64>::sse_encode(self.duration_ms, serializer);
    }
}

impl SseEncode for crate::api::ffi_types::SyncTaskFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        <String>::sse_encode(self.id, serializer);
        <String>::sse_encode(self.trigger, serializer);
        <u32>::sse_encode(self.total_count, serializer);
        <u32>::sse_encode(self.completed_count, serializer);
        <u32>::sse_encode(self.failed_count, serializer);
        <String>::sse_encode(self.status, serializer);
        <String>::sse_encode(self.created_at, serializer);
        <String>::sse_encode(self.updated_at, serializer);
        <Option<String>>::sse_encode(self.finished_at, serializer);
    }
}

impl SseEncode for crate::api::ffi_types::SyncTaskItemFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        <i64>::sse_encode(self.id, serializer);
        <String>::sse_encode(self.task_id, serializer);
        <String>::sse_encode(self.relative_path, serializer);
        <String>::sse_encode(self.action_type, serializer);
        <String>::sse_encode(self.status, serializer);
        <u64>::sse_encode(self.file_size, serializer);
        <Option<String>>::sse_encode(self.error_message, serializer);
        <String>::sse_encode(self.created_at, serializer);
        <String>::sse_encode(self.updated_at, serializer);
    }
}

impl SseEncode for crate::api::ffi_types::TaskItemFilterFfi {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        <Option<String>>::sse_encode(self.task_id, serializer);
        <Option<String>>::sse_encode(self.relative_path_contains, serializer);
        <Option<String>>::sse_encode(self.action_type, serializer);
        <Option<String>>::sse_encode(self.status, serializer);
        <u32>::sse_encode(self.limit, serializer);
        <u32>::sse_encode(self.offset, serializer);
    }
}

impl SseEncode for u32 {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        serializer.cursor.write_u32::<NativeEndian>(self).unwrap();
    }
}

impl SseEncode for u64 {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        serializer.cursor.write_u64::<NativeEndian>(self).unwrap();
    }
}

impl SseEncode for u8 {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        serializer.cursor.write_u8(self).unwrap();
    }
}

impl SseEncode for () {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {}
}

impl SseEncode for i32 {
    // Codec=Sse (Serialization based), see doc to use other codecs
    fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) {
        serializer.cursor.write_i32::<NativeEndian>(self).unwrap();
    }
}

#[cfg(not(target_family = "wasm"))]
mod io {
    // This file is automatically generated, so please do not edit it.
    // @generated by `flutter_rust_bridge`@ 2.12.0.

    // Section: imports

    use super::*;
    use flutter_rust_bridge::for_generated::byteorder::{
        NativeEndian, ReadBytesExt, WriteBytesExt,
    };
    use flutter_rust_bridge::for_generated::{transform_result_dco, Lifetimeable, Lockable};
    use flutter_rust_bridge::{Handler, IntoIntoDart};

    // Section: boilerplate

    flutter_rust_bridge::frb_generated_boilerplate_io!();
}
#[cfg(not(target_family = "wasm"))]
pub use io::*;

/// cbindgen:ignore
#[cfg(target_family = "wasm")]
mod web {
    // This file is automatically generated, so please do not edit it.
    // @generated by `flutter_rust_bridge`@ 2.12.0.

    // Section: imports

    use super::*;
    use flutter_rust_bridge::for_generated::byteorder::{
        NativeEndian, ReadBytesExt, WriteBytesExt,
    };
    use flutter_rust_bridge::for_generated::wasm_bindgen;
    use flutter_rust_bridge::for_generated::wasm_bindgen::prelude::*;
    use flutter_rust_bridge::for_generated::{transform_result_dco, Lifetimeable, Lockable};
    use flutter_rust_bridge::{Handler, IntoIntoDart};

    // Section: boilerplate

    flutter_rust_bridge::frb_generated_boilerplate_web!();
}
#[cfg(target_family = "wasm")]
pub use web::*;
