diff --git a/src/main/scala/com.snowplowanalytics.snowplow.analytics.scalasdk/Event.scala b/src/main/scala/com.snowplowanalytics.snowplow.analytics.scalasdk/Event.scala index b43b567..a9f722e 100644 --- a/src/main/scala/com.snowplowanalytics.snowplow.analytics.scalasdk/Event.scala +++ b/src/main/scala/com.snowplowanalytics.snowplow.analytics.scalasdk/Event.scala @@ -256,4 +256,18 @@ object Event { */ def parse(line: String): DecodeResult[Event] = parser.parse(line) -} + + /** + * Creates an event with only required fields. + * All optional fields are set to [[None]]. + */ + def minimal(id: UUID, collectorTstamp: Instant, vCollector: String, vEtl: String): Event = + Event(None, None, None, collectorTstamp, None, None, id, None, None, None, vCollector, vEtl, None, None, None, + None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, + None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, + Contexts(Nil), None, None, None, None, None, UnstructEvent(None), None, None, None, None, None, None, None, None, + None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, + None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, + None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, + Contexts(Nil), None, None, None, None, None, None, None, None) +} \ No newline at end of file