package com.omixlab.lckcontrol.shared

import android.os.Parcel
import android.os.Parcelable

data class ConnectedClientInfo(
    val clientId: String,
    val clientName: String,
    val packageName: String,
    val activePlanId: String? = null,
) : Parcelable {

    constructor(parcel: Parcel) : this(
        clientId = parcel.readString()!!,
        clientName = parcel.readString()!!,
        packageName = parcel.readString()!!,
        activePlanId = parcel.readString(),
    )

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(clientId)
        parcel.writeString(clientName)
        parcel.writeString(packageName)
        parcel.writeString(activePlanId)
    }

    override fun describeContents(): Int = 0

    companion object CREATOR : Parcelable.Creator<ConnectedClientInfo> {
        override fun createFromParcel(parcel: Parcel) = ConnectedClientInfo(parcel)
        override fun newArray(size: Int) = arrayOfNulls<ConnectedClientInfo>(size)
    }
}
