// Autogenerated from Pigeon (v26.3.4), do not edit directly.
// See also: https://pub.dev/packages/pigeon
@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")

package app.alextran.immich.sync

import android.util.Log
import io.flutter.plugin.common.BasicMessageChannel
import io.flutter.plugin.common.BinaryMessenger
import io.flutter.plugin.common.EventChannel
import io.flutter.plugin.common.MessageCodec
import io.flutter.plugin.common.StandardMethodCodec
import io.flutter.plugin.common.StandardMessageCodec
import java.io.ByteArrayOutputStream
import java.nio.ByteBuffer
private object MessagesPigeonUtils {

  fun wrapResult(result: Any?): List<Any?> {
    return listOf(result)
  }

  fun wrapError(exception: Throwable): List<Any?> {
    return if (exception is FlutterError) {
      listOf(
        exception.code,
        exception.message,
        exception.details
      )
    } else {
      listOf(
        exception.javaClass.simpleName,
        exception.toString(),
        "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)
      )
    }
  }
  fun doubleEquals(a: Double, b: Double): Boolean {
    // Normalize -0.0 to 0.0 and handle NaN equality.
    return (if (a == 0.0) 0.0 else a) == (if (b == 0.0) 0.0 else b) || (a.isNaN() && b.isNaN())
  }

  fun floatEquals(a: Float, b: Float): Boolean {
    // Normalize -0.0 to 0.0 and handle NaN equality.
    return (if (a == 0.0f) 0.0f else a) == (if (b == 0.0f) 0.0f else b) || (a.isNaN() && b.isNaN())
  }

  fun doubleHash(d: Double): Int {
    // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes.
    val normalized = if (d == 0.0) 0.0 else d
    val bits = java.lang.Double.doubleToLongBits(normalized)
    return (bits xor (bits ushr 32)).toInt()
  }

  fun floatHash(f: Float): Int {
    // Normalize -0.0 to 0.0 and handle NaN to ensure consistent hash codes.
    val normalized = if (f == 0.0f) 0.0f else f
    return java.lang.Float.floatToIntBits(normalized)
  }

  fun deepEquals(a: Any?, b: Any?): Boolean {
    if (a === b) {
      return true
    }
    if (a == null || b == null) {
      return false
    }
    if (a is ByteArray && b is ByteArray) {
      return a.contentEquals(b)
    }
    if (a is IntArray && b is IntArray) {
      return a.contentEquals(b)
    }
    if (a is LongArray && b is LongArray) {
      return a.contentEquals(b)
    }
    if (a is DoubleArray && b is DoubleArray) {
      if (a.size != b.size) return false
      for (i in a.indices) {
        if (!doubleEquals(a[i], b[i])) return false
      }
      return true
    }
    if (a is FloatArray && b is FloatArray) {
      if (a.size != b.size) return false
      for (i in a.indices) {
        if (!floatEquals(a[i], b[i])) return false
      }
      return true
    }
    if (a is Array<*> && b is Array<*>) {
      if (a.size != b.size) return false
      for (i in a.indices) {
        if (!deepEquals(a[i], b[i])) return false
      }
      return true
    }
    if (a is List<*> && b is List<*>) {
      if (a.size != b.size) return false
      val iterA = a.iterator()
      val iterB = b.iterator()
      while (iterA.hasNext() && iterB.hasNext()) {
        if (!deepEquals(iterA.next(), iterB.next())) return false
      }
      return true
    }
    if (a is Map<*, *> && b is Map<*, *>) {
      if (a.size != b.size) return false
      for (entry in a) {
        val key = entry.key
        var found = false
        for (bEntry in b) {
          if (deepEquals(key, bEntry.key)) {
            if (deepEquals(entry.value, bEntry.value)) {
              found = true
              break
            } else {
              return false
            }
          }
        }
        if (!found) return false
      }
      return true
    }
    if (a is Double && b is Double) {
      return doubleEquals(a, b)
    }
    if (a is Float && b is Float) {
      return floatEquals(a, b)
    }
    return a == b
  }

  fun deepHash(value: Any?): Int {
    return when (value) {
      null -> 0
      is ByteArray -> value.contentHashCode()
      is IntArray -> value.contentHashCode()
      is LongArray -> value.contentHashCode()
      is DoubleArray -> {
        var result = 1
        for (item in value) {
          result = 31 * result + doubleHash(item)
        }
        result
      }
      is FloatArray -> {
        var result = 1
        for (item in value) {
          result = 31 * result + floatHash(item)
        }
        result
      }
      is Array<*> -> {
        var result = 1
        for (item in value) {
          result = 31 * result + deepHash(item)
        }
        result
      }
      is List<*> -> {
        var result = 1
        for (item in value) {
          result = 31 * result + deepHash(item)
        }
        result
      }
      is Map<*, *> -> {
        var result = 0
        for (entry in value) {
          result += ((deepHash(entry.key) * 31) xor deepHash(entry.value))
        }
        result
      }
      is Double -> doubleHash(value)
      is Float -> floatHash(value)
      else -> value.hashCode()
    }
  }

}

/**
 * Error class for passing custom error details to Flutter via a thrown PlatformException.
 * @property code The error code.
 * @property message The error message.
 * @property details The error details. Must be a datatype supported by the api codec.
 */
class FlutterError (
  val code: String,
  override val message: String? = null,
  val details: Any? = null
) : RuntimeException()

enum class PlatformAssetPlaybackStyle(val raw: Int) {
  UNKNOWN(0),
  IMAGE(1),
  VIDEO(2),
  IMAGE_ANIMATED(3),
  LIVE_PHOTO(4),
  VIDEO_LOOPING(5);

  companion object {
    fun ofRaw(raw: Int): PlatformAssetPlaybackStyle? {
      return values().firstOrNull { it.raw == raw }
    }
  }
}

/** Generated class from Pigeon that represents data sent in messages. */
data class PlatformAsset (
  val id: String,
  val name: String,
  val type: Long,
  val createdAt: Long? = null,
  val updatedAt: Long? = null,
  val width: Long? = null,
  val height: Long? = null,
  val durationInSeconds: Long,
  val orientation: Long,
  val isFavorite: Boolean,
  val adjustmentTime: Long? = null,
  val latitude: Double? = null,
  val longitude: Double? = null,
  val playbackStyle: PlatformAssetPlaybackStyle
)
 {
  companion object {
    fun fromList(pigeonVar_list: List<Any?>): PlatformAsset {
      val id = pigeonVar_list[0] as String
      val name = pigeonVar_list[1] as String
      val type = pigeonVar_list[2] as Long
      val createdAt = pigeonVar_list[3] as Long?
      val updatedAt = pigeonVar_list[4] as Long?
      val width = pigeonVar_list[5] as Long?
      val height = pigeonVar_list[6] as Long?
      val durationInSeconds = pigeonVar_list[7] as Long
      val orientation = pigeonVar_list[8] as Long
      val isFavorite = pigeonVar_list[9] as Boolean
      val adjustmentTime = pigeonVar_list[10] as Long?
      val latitude = pigeonVar_list[11] as Double?
      val longitude = pigeonVar_list[12] as Double?
      val playbackStyle = pigeonVar_list[13] as PlatformAssetPlaybackStyle
      return PlatformAsset(id, name, type, createdAt, updatedAt, width, height, durationInSeconds, orientation, isFavorite, adjustmentTime, latitude, longitude, playbackStyle)
    }
  }
  fun toList(): List<Any?> {
    return listOf(
      id,
      name,
      type,
      createdAt,
      updatedAt,
      width,
      height,
      durationInSeconds,
      orientation,
      isFavorite,
      adjustmentTime,
      latitude,
      longitude,
      playbackStyle,
    )
  }
  override fun equals(other: Any?): Boolean {
    if (other == null || other.javaClass != javaClass) {
      return false
    }
    if (this === other) {
      return true
    }
    val other = other as PlatformAsset
    return MessagesPigeonUtils.deepEquals(this.id, other.id) && MessagesPigeonUtils.deepEquals(this.name, other.name) && MessagesPigeonUtils.deepEquals(this.type, other.type) && MessagesPigeonUtils.deepEquals(this.createdAt, other.createdAt) && MessagesPigeonUtils.deepEquals(this.updatedAt, other.updatedAt) && MessagesPigeonUtils.deepEquals(this.width, other.width) && MessagesPigeonUtils.deepEquals(this.height, other.height) && MessagesPigeonUtils.deepEquals(this.durationInSeconds, other.durationInSeconds) && MessagesPigeonUtils.deepEquals(this.orientation, other.orientation) && MessagesPigeonUtils.deepEquals(this.isFavorite, other.isFavorite) && MessagesPigeonUtils.deepEquals(this.adjustmentTime, other.adjustmentTime) && MessagesPigeonUtils.deepEquals(this.latitude, other.latitude) && MessagesPigeonUtils.deepEquals(this.longitude, other.longitude) && MessagesPigeonUtils.deepEquals(this.playbackStyle, other.playbackStyle)
  }

  override fun hashCode(): Int {
    var result = javaClass.hashCode()
    result = 31 * result + MessagesPigeonUtils.deepHash(this.id)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.name)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.type)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.createdAt)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.updatedAt)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.width)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.height)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.durationInSeconds)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.orientation)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.isFavorite)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.adjustmentTime)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.latitude)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.longitude)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.playbackStyle)
    return result
  }
}

/** Generated class from Pigeon that represents data sent in messages. */
data class PlatformAlbum (
  val id: String,
  val name: String,
  val updatedAt: Long? = null,
  val isCloud: Boolean,
  val assetCount: Long
)
 {
  companion object {
    fun fromList(pigeonVar_list: List<Any?>): PlatformAlbum {
      val id = pigeonVar_list[0] as String
      val name = pigeonVar_list[1] as String
      val updatedAt = pigeonVar_list[2] as Long?
      val isCloud = pigeonVar_list[3] as Boolean
      val assetCount = pigeonVar_list[4] as Long
      return PlatformAlbum(id, name, updatedAt, isCloud, assetCount)
    }
  }
  fun toList(): List<Any?> {
    return listOf(
      id,
      name,
      updatedAt,
      isCloud,
      assetCount,
    )
  }
  override fun equals(other: Any?): Boolean {
    if (other == null || other.javaClass != javaClass) {
      return false
    }
    if (this === other) {
      return true
    }
    val other = other as PlatformAlbum
    return MessagesPigeonUtils.deepEquals(this.id, other.id) && MessagesPigeonUtils.deepEquals(this.name, other.name) && MessagesPigeonUtils.deepEquals(this.updatedAt, other.updatedAt) && MessagesPigeonUtils.deepEquals(this.isCloud, other.isCloud) && MessagesPigeonUtils.deepEquals(this.assetCount, other.assetCount)
  }

  override fun hashCode(): Int {
    var result = javaClass.hashCode()
    result = 31 * result + MessagesPigeonUtils.deepHash(this.id)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.name)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.updatedAt)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.isCloud)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.assetCount)
    return result
  }
}

/** Generated class from Pigeon that represents data sent in messages. */
data class SyncDelta (
  val hasChanges: Boolean,
  val updates: List<PlatformAsset>,
  val deletes: List<String>,
  val assetAlbums: Map<String, List<String>>
)
 {
  companion object {
    fun fromList(pigeonVar_list: List<Any?>): SyncDelta {
      val hasChanges = pigeonVar_list[0] as Boolean
      val updates = pigeonVar_list[1] as List<PlatformAsset>
      val deletes = pigeonVar_list[2] as List<String>
      val assetAlbums = pigeonVar_list[3] as Map<String, List<String>>
      return SyncDelta(hasChanges, updates, deletes, assetAlbums)
    }
  }
  fun toList(): List<Any?> {
    return listOf(
      hasChanges,
      updates,
      deletes,
      assetAlbums,
    )
  }
  override fun equals(other: Any?): Boolean {
    if (other == null || other.javaClass != javaClass) {
      return false
    }
    if (this === other) {
      return true
    }
    val other = other as SyncDelta
    return MessagesPigeonUtils.deepEquals(this.hasChanges, other.hasChanges) && MessagesPigeonUtils.deepEquals(this.updates, other.updates) && MessagesPigeonUtils.deepEquals(this.deletes, other.deletes) && MessagesPigeonUtils.deepEquals(this.assetAlbums, other.assetAlbums)
  }

  override fun hashCode(): Int {
    var result = javaClass.hashCode()
    result = 31 * result + MessagesPigeonUtils.deepHash(this.hasChanges)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.updates)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.deletes)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.assetAlbums)
    return result
  }
}

/** Generated class from Pigeon that represents data sent in messages. */
data class HashResult (
  val assetId: String,
  val error: String? = null,
  val hash: String? = null
)
 {
  companion object {
    fun fromList(pigeonVar_list: List<Any?>): HashResult {
      val assetId = pigeonVar_list[0] as String
      val error = pigeonVar_list[1] as String?
      val hash = pigeonVar_list[2] as String?
      return HashResult(assetId, error, hash)
    }
  }
  fun toList(): List<Any?> {
    return listOf(
      assetId,
      error,
      hash,
    )
  }
  override fun equals(other: Any?): Boolean {
    if (other == null || other.javaClass != javaClass) {
      return false
    }
    if (this === other) {
      return true
    }
    val other = other as HashResult
    return MessagesPigeonUtils.deepEquals(this.assetId, other.assetId) && MessagesPigeonUtils.deepEquals(this.error, other.error) && MessagesPigeonUtils.deepEquals(this.hash, other.hash)
  }

  override fun hashCode(): Int {
    var result = javaClass.hashCode()
    result = 31 * result + MessagesPigeonUtils.deepHash(this.assetId)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.error)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.hash)
    return result
  }
}

/** Generated class from Pigeon that represents data sent in messages. */
data class CloudIdResult (
  val assetId: String,
  val error: String? = null,
  val cloudId: String? = null
)
 {
  companion object {
    fun fromList(pigeonVar_list: List<Any?>): CloudIdResult {
      val assetId = pigeonVar_list[0] as String
      val error = pigeonVar_list[1] as String?
      val cloudId = pigeonVar_list[2] as String?
      return CloudIdResult(assetId, error, cloudId)
    }
  }
  fun toList(): List<Any?> {
    return listOf(
      assetId,
      error,
      cloudId,
    )
  }
  override fun equals(other: Any?): Boolean {
    if (other == null || other.javaClass != javaClass) {
      return false
    }
    if (this === other) {
      return true
    }
    val other = other as CloudIdResult
    return MessagesPigeonUtils.deepEquals(this.assetId, other.assetId) && MessagesPigeonUtils.deepEquals(this.error, other.error) && MessagesPigeonUtils.deepEquals(this.cloudId, other.cloudId)
  }

  override fun hashCode(): Int {
    var result = javaClass.hashCode()
    result = 31 * result + MessagesPigeonUtils.deepHash(this.assetId)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.error)
    result = 31 * result + MessagesPigeonUtils.deepHash(this.cloudId)
    return result
  }
}
private open class MessagesPigeonCodec : StandardMessageCodec() {
  override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? {
    return when (type) {
      129.toByte() -> {
        return (readValue(buffer) as Long?)?.let {
          PlatformAssetPlaybackStyle.ofRaw(it.toInt())
        }
      }
      130.toByte() -> {
        return (readValue(buffer) as? List<Any?>)?.let {
          PlatformAsset.fromList(it)
        }
      }
      131.toByte() -> {
        return (readValue(buffer) as? List<Any?>)?.let {
          PlatformAlbum.fromList(it)
        }
      }
      132.toByte() -> {
        return (readValue(buffer) as? List<Any?>)?.let {
          SyncDelta.fromList(it)
        }
      }
      133.toByte() -> {
        return (readValue(buffer) as? List<Any?>)?.let {
          HashResult.fromList(it)
        }
      }
      134.toByte() -> {
        return (readValue(buffer) as? List<Any?>)?.let {
          CloudIdResult.fromList(it)
        }
      }
      else -> super.readValueOfType(type, buffer)
    }
  }
  override fun writeValue(stream: ByteArrayOutputStream, value: Any?)   {
    when (value) {
      is PlatformAssetPlaybackStyle -> {
        stream.write(129)
        writeValue(stream, value.raw.toLong())
      }
      is PlatformAsset -> {
        stream.write(130)
        writeValue(stream, value.toList())
      }
      is PlatformAlbum -> {
        stream.write(131)
        writeValue(stream, value.toList())
      }
      is SyncDelta -> {
        stream.write(132)
        writeValue(stream, value.toList())
      }
      is HashResult -> {
        stream.write(133)
        writeValue(stream, value.toList())
      }
      is CloudIdResult -> {
        stream.write(134)
        writeValue(stream, value.toList())
      }
      else -> super.writeValue(stream, value)
    }
  }
}


/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
interface NativeSyncApi {
  fun shouldFullSync(): Boolean
  fun getMediaChanges(): SyncDelta
  fun checkpointSync()
  fun clearSyncCheckpoint()
  fun getAssetIdsForAlbum(albumId: String): List<String>
  fun getAlbums(): List<PlatformAlbum>
  fun getAssetsCountSince(albumId: String, timestamp: Long): Long
  fun getAssetsForAlbum(albumId: String, updatedTimeCond: Long?): List<PlatformAsset>
  fun hashAssets(assetIds: List<String>, allowNetworkAccess: Boolean, callback: (Result<List<HashResult>>) -> Unit)
  fun cancelHashing()
  fun getTrashedAssets(): Map<String, List<PlatformAsset>>
  fun getCloudIdForAssetIds(assetIds: List<String>): List<CloudIdResult>

  companion object {
    /** The codec used by NativeSyncApi. */
    val codec: MessageCodec<Any?> by lazy {
      MessagesPigeonCodec()
    }
    /** Sets up an instance of `NativeSyncApi` to handle messages through the `binaryMessenger`. */
    @JvmOverloads
    fun setUp(binaryMessenger: BinaryMessenger, api: NativeSyncApi?, messageChannelSuffix: String = "") {
      val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else ""
      val taskQueue = binaryMessenger.makeBackgroundTaskQueue()
      run {
        val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.immich_mobile.NativeSyncApi.shouldFullSync$separatedMessageChannelSuffix", codec)
        if (api != null) {
          channel.setMessageHandler { _, reply ->
            val wrapped: List<Any?> = try {
              listOf(api.shouldFullSync())
            } catch (exception: Throwable) {
              MessagesPigeonUtils.wrapError(exception)
            }
            reply.reply(wrapped)
          }
        } else {
          channel.setMessageHandler(null)
        }
      }
      run {
        val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.immich_mobile.NativeSyncApi.getMediaChanges$separatedMessageChannelSuffix", codec, taskQueue)
        if (api != null) {
          channel.setMessageHandler { _, reply ->
            val wrapped: List<Any?> = try {
              listOf(api.getMediaChanges())
            } catch (exception: Throwable) {
              MessagesPigeonUtils.wrapError(exception)
            }
            reply.reply(wrapped)
          }
        } else {
          channel.setMessageHandler(null)
        }
      }
      run {
        val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.immich_mobile.NativeSyncApi.checkpointSync$separatedMessageChannelSuffix", codec)
        if (api != null) {
          channel.setMessageHandler { _, reply ->
            val wrapped: List<Any?> = try {
              api.checkpointSync()
              listOf(null)
            } catch (exception: Throwable) {
              MessagesPigeonUtils.wrapError(exception)
            }
            reply.reply(wrapped)
          }
        } else {
          channel.setMessageHandler(null)
        }
      }
      run {
        val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.immich_mobile.NativeSyncApi.clearSyncCheckpoint$separatedMessageChannelSuffix", codec)
        if (api != null) {
          channel.setMessageHandler { _, reply ->
            val wrapped: List<Any?> = try {
              api.clearSyncCheckpoint()
              listOf(null)
            } catch (exception: Throwable) {
              MessagesPigeonUtils.wrapError(exception)
            }
            reply.reply(wrapped)
          }
        } else {
          channel.setMessageHandler(null)
        }
      }
      run {
        val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.immich_mobile.NativeSyncApi.getAssetIdsForAlbum$separatedMessageChannelSuffix", codec, taskQueue)
        if (api != null) {
          channel.setMessageHandler { message, reply ->
            val args = message as List<Any?>
            val albumIdArg = args[0] as String
            val wrapped: List<Any?> = try {
              listOf(api.getAssetIdsForAlbum(albumIdArg))
            } catch (exception: Throwable) {
              MessagesPigeonUtils.wrapError(exception)
            }
            reply.reply(wrapped)
          }
        } else {
          channel.setMessageHandler(null)
        }
      }
      run {
        val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.immich_mobile.NativeSyncApi.getAlbums$separatedMessageChannelSuffix", codec, taskQueue)
        if (api != null) {
          channel.setMessageHandler { _, reply ->
            val wrapped: List<Any?> = try {
              listOf(api.getAlbums())
            } catch (exception: Throwable) {
              MessagesPigeonUtils.wrapError(exception)
            }
            reply.reply(wrapped)
          }
        } else {
          channel.setMessageHandler(null)
        }
      }
      run {
        val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.immich_mobile.NativeSyncApi.getAssetsCountSince$separatedMessageChannelSuffix", codec, taskQueue)
        if (api != null) {
          channel.setMessageHandler { message, reply ->
            val args = message as List<Any?>
            val albumIdArg = args[0] as String
            val timestampArg = args[1] as Long
            val wrapped: List<Any?> = try {
              listOf(api.getAssetsCountSince(albumIdArg, timestampArg))
            } catch (exception: Throwable) {
              MessagesPigeonUtils.wrapError(exception)
            }
            reply.reply(wrapped)
          }
        } else {
          channel.setMessageHandler(null)
        }
      }
      run {
        val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.immich_mobile.NativeSyncApi.getAssetsForAlbum$separatedMessageChannelSuffix", codec, taskQueue)
        if (api != null) {
          channel.setMessageHandler { message, reply ->
            val args = message as List<Any?>
            val albumIdArg = args[0] as String
            val updatedTimeCondArg = args[1] as Long?
            val wrapped: List<Any?> = try {
              listOf(api.getAssetsForAlbum(albumIdArg, updatedTimeCondArg))
            } catch (exception: Throwable) {
              MessagesPigeonUtils.wrapError(exception)
            }
            reply.reply(wrapped)
          }
        } else {
          channel.setMessageHandler(null)
        }
      }
      run {
        val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.immich_mobile.NativeSyncApi.hashAssets$separatedMessageChannelSuffix", codec, taskQueue)
        if (api != null) {
          channel.setMessageHandler { message, reply ->
            val args = message as List<Any?>
            val assetIdsArg = args[0] as List<String>
            val allowNetworkAccessArg = args[1] as Boolean
            api.hashAssets(assetIdsArg, allowNetworkAccessArg) { result: Result<List<HashResult>> ->
              val error = result.exceptionOrNull()
              if (error != null) {
                reply.reply(MessagesPigeonUtils.wrapError(error))
              } else {
                val data = result.getOrNull()
                reply.reply(MessagesPigeonUtils.wrapResult(data))
              }
            }
          }
        } else {
          channel.setMessageHandler(null)
        }
      }
      run {
        val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.immich_mobile.NativeSyncApi.cancelHashing$separatedMessageChannelSuffix", codec)
        if (api != null) {
          channel.setMessageHandler { _, reply ->
            val wrapped: List<Any?> = try {
              api.cancelHashing()
              listOf(null)
            } catch (exception: Throwable) {
              MessagesPigeonUtils.wrapError(exception)
            }
            reply.reply(wrapped)
          }
        } else {
          channel.setMessageHandler(null)
        }
      }
      run {
        val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.immich_mobile.NativeSyncApi.getTrashedAssets$separatedMessageChannelSuffix", codec, taskQueue)
        if (api != null) {
          channel.setMessageHandler { _, reply ->
            val wrapped: List<Any?> = try {
              listOf(api.getTrashedAssets())
            } catch (exception: Throwable) {
              MessagesPigeonUtils.wrapError(exception)
            }
            reply.reply(wrapped)
          }
        } else {
          channel.setMessageHandler(null)
        }
      }
      run {
        val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.immich_mobile.NativeSyncApi.getCloudIdForAssetIds$separatedMessageChannelSuffix", codec, taskQueue)
        if (api != null) {
          channel.setMessageHandler { message, reply ->
            val args = message as List<Any?>
            val assetIdsArg = args[0] as List<String>
            val wrapped: List<Any?> = try {
              listOf(api.getCloudIdForAssetIds(assetIdsArg))
            } catch (exception: Throwable) {
              MessagesPigeonUtils.wrapError(exception)
            }
            reply.reply(wrapped)
          }
        } else {
          channel.setMessageHandler(null)
        }
      }
    }
  }
}
