Cumulocity API Services / com.softwareag.jc.cumulocity.services.models / Event

Event

data class Event : JsonSerializable

Represents an event, non measurable activity triggered by or for a device

Formal definition is given in Cumulocity REST API Guide

Types

AnyEventValue

class AnyEventValue : HashMap<String, Any>, JsonSerializable

JSonEventValue

class JSonEventValue : HashMap<String, Any>, JsonSerializable

Source

data class Source : JsonSerializable

Constructors

<init>

Event(o: JSONObject)

Alternative constructor used internally to parse JSON response returned by Cumulocity

Event(source: Event.Source, type: String, text: String)

Create a new Event to be posted to Cumulocity

Properties

properties

val properties: Map<String, Any>

Allows supplementary adhoc information to be included in event details

source

val source: Event.Source

identifies associated device/object

text

val text: String

arbritary text describing event

time

val time: Date

type

val type: String

label to allow events to be grouped/typed

Functions

addPosition

fun addPosition(position: Position): Unit

Includes GPS formatted position 'c8y_LocationUpdate' to be included in event details

addValue

fun addValue(label: String, event: Any): Unit

Allows arbitrary values to be included in event details

toJSONString

fun toJSONString(): String

Allows this object type to converted to a JSON String This method is used internally, you do not need to use it