Skip to content

Commit

Permalink
Fix order of optional parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
djfarrelly committed Jul 23, 2024
1 parent 69e3657 commit c8b6a70
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions inngest/src/main/kotlin/com/inngest/Event.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.inngest

import com.beust.klaxon.Json

/**
* An internal class used for parsing events sent to Inngest functions
*/
Expand All @@ -15,14 +17,20 @@ internal data class Event(
/**
* Create an event to send to Inngest
*/
data class InngestEvent(
val id: String?,
val name: String,
val data: Any,
val user: Any?,
val ts: Long?,
val v: String? = null,
)
data class InngestEvent
@JvmOverloads
constructor(
val name: String,
val data: Any,
@Json(serializeNull = false)
val user: Any? = null,
@Json(serializeNull = false)
val id: String? = null,
@Json(serializeNull = false)
val ts: Long? = null,
@Json(serializeNull = false)
val v: String? = null,
)

/**
* Construct a new Inngest Event via builder
Expand Down Expand Up @@ -68,10 +76,10 @@ class InngestEventBuilder(
throw IllegalArgumentException("data is required")
}
return InngestEvent(
id,
name!!,
data!!,
user,
id,
ts,
v,
)
Expand Down

0 comments on commit c8b6a70

Please sign in to comment.