(abstract) new MediaEvent(nameopt, valueopt, propertiesopt, transactionIdopt)
MediaEvent abstract class with a predefined and known properties. Must be used via it's subclasses. This class is not accessible directly.
Properties:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
properties |
Object
|
||||||||||||||||||||||
Name | Type | Description |
---|---|---|
category |
String
|
e.g. "entertainment" |
identifier |
String
|
e.g. "12322" |
description |
String
|
e.g. "Watching latest entertainment news." |
type |
String
|
e.g. "video" |
author |
String
|
e.g. "UA Enterprises" |
feature |
Boolean
|
e.g. true |
published_date |
String
|
ISO date string: e.g. "2017-06-23", "2017-06-23T21:30:00" |
- See:
-
CustomEvent.templates.media
for usable subclasses.CustomEvent
for all properties and constructor details.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name |
String
|
<optional> |
||
value |
Number
|
<optional> |
||
properties |
Object
|
<optional> |
{} | |
transactionId |
String
|
<optional> |
Extends
Methods
(async) track() → {Promise}
Validates and tracks the custom event.
- Inherited From:
Returns:
- Type:
-
Promise
Resolves to {ok: true, operation_id}
on success.
Rejects any error found in CustomEvent#validate
.
validate()
Should never have to be called manually.
Validates the event and throws any errors found. Is used by
CustomEvent#track
to reject any errors.
- Inherited From:
Throws:
-
-
A value with a required type is the wrong type.
- Type
-
TypeError
-
-
-
All strings have 255 character limits.
- Type
-
RangeError
-
-
-
Any properties that are arrays may only contain strings.
- Type
-
TypeError
-
-
-
Any properties that are arrays have a max length of 20.
- Type
-
RangeError
-