All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.pubnub.api.models.consumer.objects.uuid.PNUUIDMetadata.kt Maven / Gradle / Ivy

package com.pubnub.api.models.consumer.objects.uuid

import com.pubnub.api.utils.PatchValue

// TODO add a test that checks sending patch values to server and reading them back when we have the "sending" part
data class PNUUIDMetadata(
    val id: String,
    val name: PatchValue? = null,
    val externalId: PatchValue? = null,
    val profileUrl: PatchValue? = null,
    val email: PatchValue? = null,
    val custom: PatchValue?>? = null,
    val updated: PatchValue? = null,
    val eTag: PatchValue? = null,
    val type: PatchValue? = null,
    val status: PatchValue? = null,
) {
    /**
     * Merge information from this `PNUUIDMetadata` with new data from `update`, returning a new `PNUUIDMetadata` instance.
     */
    operator fun plus(update: PNUUIDMetadata): PNUUIDMetadata {
        return copy(
            name = update.name ?: name,
            externalId = update.externalId ?: externalId,
            profileUrl = update.profileUrl ?: profileUrl,
            email = update.email ?: email,
            custom = update.custom ?: custom,
            updated = update.updated ?: updated,
            eTag = update.eTag ?: eTag,
            type = update.type ?: type,
            status = update.status ?: status,
        )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy