sdk-javascript/docs/CloudEvent.html

2559 lines
32 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
CloudEvent - Documentation
</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
<link type="text/css" rel="stylesheet" href="styles/collapse.css">
</head>
<body>
<svg style="display: none;">
<defs>
<symbol id="linkIcon" fill="#706d77" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/>
</symbol>
</defs>
</svg>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<div class="top-nav-wrapper">
<ul>
<li >
<a href="index.html">
<svg fill="#6D6D6D" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
<path d="M0 0h24v24H0z" fill="none"/>
</svg>
</a>
</li>
</ul>
</div>
<nav>
<h3 class="reference-title">
cloudevents-sdk
</h3>
<h3>
Resources
</h3>
<a href="concepts.html">Concepts</a>
<h3>Classes</h3><ul><li id="CloudEvent-nav"><a href="CloudEvent.html">CloudEvent</a><ul class='methods'><li data-type="method" id="CloudEvent-addExtension-nav"><a href="CloudEvent.html#addExtension">addExtension</a></li><li data-type="method" id="CloudEvent-data-nav"><a href="CloudEvent.html#data">data</a></li><li data-type="method" id="CloudEvent-dataContenttype-nav"><a href="CloudEvent.html#dataContenttype">dataContenttype</a></li><li data-type="method" id="CloudEvent-format-nav"><a href="CloudEvent.html#format">format</a></li><li data-type="method" id="CloudEvent-getData-nav"><a href="CloudEvent.html#getData">getData</a></li><li data-type="method" id="CloudEvent-getDataContenttype-nav"><a href="CloudEvent.html#getDataContenttype">getDataContenttype</a></li><li data-type="method" id="CloudEvent-getExtensions-nav"><a href="CloudEvent.html#getExtensions">getExtensions</a></li><li data-type="method" id="CloudEvent-getFormats-nav"><a href="CloudEvent.html#getFormats">getFormats</a></li><li data-type="method" id="CloudEvent-getId-nav"><a href="CloudEvent.html#getId">getId</a></li><li data-type="method" id="CloudEvent-getSource-nav"><a href="CloudEvent.html#getSource">getSource</a></li><li data-type="method" id="CloudEvent-getSpecversion-nav"><a href="CloudEvent.html#getSpecversion">getSpecversion</a></li><li data-type="method" id="CloudEvent-getTime-nav"><a href="CloudEvent.html#getTime">getTime</a></li><li data-type="method" id="CloudEvent-getType-nav"><a href="CloudEvent.html#getType">getType</a></li><li data-type="method" id="CloudEvent-id-nav"><a href="CloudEvent.html#id">id</a></li><li data-type="method" id="CloudEvent-source-nav"><a href="CloudEvent.html#source">source</a></li><li data-type="method" id="CloudEvent-time-nav"><a href="CloudEvent.html#time">time</a></li><li data-type="method" id="CloudEvent-toString-nav"><a href="CloudEvent.html#toString">toString</a></li><li data-type="method" id="CloudEvent-type-nav"><a href="CloudEvent.html#type">type</a></li></ul></li><li id="HTTPReceiver-nav"><a href="HTTPReceiver.html">HTTPReceiver</a><ul class='methods'><li data-type="method" id="HTTPReceiver-accept-nav"><a href="HTTPReceiver.html#accept">accept</a></li></ul></li></ul>
</nav>
<div id="main">
<h1 class="page-title">
CloudEvent
</h1>
<section>
<header>
<h2>
CloudEvent
</h2>
<div class="class-description">
<p>An instance of a CloudEvent.</p>
</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<span class='name-container'>
<a class="link-icon" href="#CloudEvent">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="CloudEvent">
<span class="type-signature"></span>new CloudEvent<span class="signature">(UserSpec<span class="signature-attributes">opt</span>, UserFormatter<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span>
</h4>
</span>
<div class="description">
<p>Creates a new CloudEvent instance</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>UserSpec</code></td>
<td class="type">
<span class="param-type">
Spec
</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>A CloudEvent version specification</p>
</td>
</tr>
<tr>
<td class="name"><code>UserFormatter</code></td>
<td class="type">
<span class="param-type">
Formatter
</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">
<p>Converts the event into a readable string</p>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line13">line 13</a>
</li>
</ul>
</dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<span class='name-container'>
<a class="link-icon" href="#addExtension">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="addExtension">
<span class="type-signature"></span>addExtension<span class="signature">(key, value)</span><span class="type-signature"> &rarr; {<a href="CloudEvent.html">CloudEvent</a>}</span>
</h4>
</span>
<div class="description">
<p>Adds an extension attribute to this CloudEvent</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>key</code></td>
<td class="type">
<span class="param-type">
*
</span>
</td>
<td class="description last">
<p>the name of the exteneion attribute</p>
</td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">
*
</span>
</td>
<td class="description last">
<p>the value of the extension attribute</p>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line214">line 214</a>
</li>
</ul>
</dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>
<a href="https://github.com/cloudevents/spec/blob/master/spec.md#extension-context-attributes">https://github.com/cloudevents/spec/blob/master/spec.md#extension-context-attributes</a>
</li>
</ul>
</dd>
</dl>
<span class='name-container'>
<a class="link-icon" href="#data">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="data">
<span class="type-signature"></span>data<span class="signature">(data)</span><span class="type-signature"> &rarr; {<a href="CloudEvent.html">CloudEvent</a>}</span>
</h4>
</span>
<div class="description">
<p>Sets the data for this event</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">
*
</span>
</td>
<td class="description last">
<p>any data associated with this event</p>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line193">line 193</a>
</li>
</ul>
</dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>
<a href="https://github.com/cloudevents/spec/blob/master/spec.md#event-data">https://github.com/cloudevents/spec/blob/master/spec.md#event-data</a>
</li>
</ul>
</dd>
</dl>
<span class='name-container'>
<a class="link-icon" href="#dataContenttype">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="dataContenttype">
<span class="type-signature"></span>dataContenttype<span class="signature">(contenttype)</span><span class="type-signature"> &rarr; {<a href="CloudEvent.html">CloudEvent</a>}</span>
</h4>
</span>
<div class="description">
<p>Sets the content type of the data value for this event</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>contenttype</code></td>
<td class="type">
<span class="param-type">
string
</span>
</td>
<td class="description last">
<p>per https://tools.ietf.org/html/rfc2046</p>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line173">line 173</a>
</li>
</ul>
</dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>
<a href="https://github.com/cloudevents/spec/blob/master/spec.md#datacontenttype">https://github.com/cloudevents/spec/blob/master/spec.md#datacontenttype</a>
</li>
</ul>
</dd>
</dl>
<span class='name-container'>
<a class="link-icon" href="#format">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="format">
<span class="type-signature"></span>format<span class="signature">()</span><span class="type-signature"> &rarr; {JSON}</span>
</h4>
</span>
<div class="description">
<p>Format the CloudEvent as JSON. Validates the event according
to the CloudEvent specification and throws an exception if
it's invalid.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line35">line 35</a>
</li>
</ul>
</dd>
</dl>
<span class='name-container'>
<a class="link-icon" href="#getData">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="getData">
<span class="type-signature"></span>getData<span class="signature">()</span><span class="type-signature"> &rarr; {*}</span>
</h4>
</span>
<div class="description">
<p>Gets any data that has been set for this event</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line203">line 203</a>
</li>
</ul>
</dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>
<a href="https://github.com/cloudevents/spec/blob/master/spec.md#event-data">https://github.com/cloudevents/spec/blob/master/spec.md#event-data</a>
</li>
</ul>
</dd>
</dl>
<span class='name-container'>
<a class="link-icon" href="#getDataContenttype">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="getDataContenttype">
<span class="type-signature"></span>getDataContenttype<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span>
</h4>
</span>
<div class="description">
<p>Gets the content type of the data value for this event</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line183">line 183</a>
</li>
</ul>
</dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>
<a href="https://github.com/cloudevents/spec/blob/master/spec.md#datacontenttype">https://github.com/cloudevents/spec/blob/master/spec.md#datacontenttype</a>
</li>
</ul>
</dd>
</dl>
<span class='name-container'>
<a class="link-icon" href="#getExtensions">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="getExtensions">
<span class="type-signature"></span>getExtensions<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span>
</h4>
</span>
<div class="description">
<p>Gets the extension attributes, if any, associated with this event</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line229">line 229</a>
</li>
</ul>
</dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>
<a href="https://github.com/cloudevents/spec/blob/master/spec.md#extension-context-attributes">https://github.com/cloudevents/spec/blob/master/spec.md#extension-context-attributes</a>
</li>
</ul>
</dd>
</dl>
<span class='name-container'>
<a class="link-icon" href="#getFormats">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="getFormats">
<span class="type-signature"></span>getFormats<span class="signature">()</span><span class="type-signature"> &rarr; {Object}</span>
</h4>
</span>
<div class="description">
<p>Get the formatters available to this CloudEvent</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line25">line 25</a>
</li>
</ul>
</dd>
</dl>
<span class='name-container'>
<a class="link-icon" href="#getId">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="getId">
<span class="type-signature"></span>getId<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span>
</h4>
</span>
<div class="description">
<p>Gets the event id.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line128">line 128</a>
</li>
</ul>
</dd>
</dl>
<span class='name-container'>
<a class="link-icon" href="#getSource">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="getSource">
<span class="type-signature"></span>getSource<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span>
</h4>
</span>
<div class="description">
<p>Gets the origination source of this event.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line109">line 109</a>
</li>
</ul>
</dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>
<a href="https://github.com/cloudevents/spec/blob/master/spec.md#source-1">https://github.com/cloudevents/spec/blob/master/spec.md#source-1</a>
</li>
</ul>
</dd>
</dl>
<span class='name-container'>
<a class="link-icon" href="#getSpecversion">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="getSpecversion">
<span class="type-signature"></span>getSpecversion<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span>
</h4>
</span>
<div class="description">
<p>Gets the CloudEvent specification version</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line89">line 89</a>
</li>
</ul>
</dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>
<a href="https://github.com/cloudevents/spec/blob/master/spec.md#specversion">https://github.com/cloudevents/spec/blob/master/spec.md#specversion</a>
</li>
</ul>
</dd>
</dl>
<span class='name-container'>
<a class="link-icon" href="#getTime">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="getTime">
<span class="type-signature"></span>getTime<span class="signature">()</span><span class="type-signature"> &rarr; {Date}</span>
</h4>
</span>
<div class="description">
<p>Gets the timestamp for this event</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line150">line 150</a>
</li>
</ul>
</dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>
<a href="https://github.com/cloudevents/spec/blob/master/spec.md#time">https://github.com/cloudevents/spec/blob/master/spec.md#time</a>
</li>
</ul>
</dd>
</dl>
<span class='name-container'>
<a class="link-icon" href="#getType">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="getType">
<span class="type-signature"></span>getType<span class="signature">()</span><span class="type-signature"> &rarr; {String}</span>
</h4>
</span>
<div class="description">
<p>Gets the event type</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line71">line 71</a>
</li>
</ul>
</dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>
<a href="https://github.com/cloudevents/spec/blob/master/spec.md#type">https://github.com/cloudevents/spec/blob/master/spec.md#type</a>
</li>
</ul>
</dd>
</dl>
<span class='name-container'>
<a class="link-icon" href="#id">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="id">
<span class="type-signature"></span>id<span class="signature">(id)</span><span class="type-signature"> &rarr; {<a href="CloudEvent.html">CloudEvent</a>}</span>
</h4>
</span>
<div class="description">
<p>Sets the event id. Source + id must be unique for each distinct event.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">
string
</span>
</td>
<td class="description last">
<p>source+id must be unique for each distinct event</p>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line119">line 119</a>
</li>
</ul>
</dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>
<a href="https://github.com/cloudevents/spec/blob/master/spec.md#id">https://github.com/cloudevents/spec/blob/master/spec.md#id</a>
</li>
</ul>
</dd>
</dl>
<span class='name-container'>
<a class="link-icon" href="#source">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="source">
<span class="type-signature"></span>source<span class="signature">(source)</span><span class="type-signature"> &rarr; {<a href="CloudEvent.html">CloudEvent</a>}</span>
</h4>
</span>
<div class="description">
<p>Sets the origination source of this event.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>source</code></td>
<td class="type">
<span class="param-type">
URI
</span>
</td>
<td class="description last">
<p>the context in which the event happened</p>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line99">line 99</a>
</li>
</ul>
</dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>
<a href="https://github.com/cloudevents/spec/blob/master/spec.md#source-1">https://github.com/cloudevents/spec/blob/master/spec.md#source-1</a>
</li>
</ul>
</dd>
</dl>
<span class='name-container'>
<a class="link-icon" href="#time">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="time">
<span class="type-signature"></span>time<span class="signature">(time)</span><span class="type-signature"> &rarr; {<a href="CloudEvent.html">CloudEvent</a>}</span>
</h4>
</span>
<div class="description">
<p>Sets the timestamp for this event</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>time</code></td>
<td class="type">
<span class="param-type">
Date
</span>
</td>
<td class="description last">
<p>timestamp when the event occurred</p>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line138">line 138</a>
</li>
</ul>
</dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>
<a href="https://github.com/cloudevents/spec/blob/master/spec.md#time">https://github.com/cloudevents/spec/blob/master/spec.md#time</a>
</li>
</ul>
</dd>
</dl>
<span class='name-container'>
<a class="link-icon" href="#toString">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="toString">
<span class="type-signature"></span>toString<span class="signature">()</span><span class="type-signature"> &rarr; {JSON}</span>
</h4>
</span>
<div class="description">
<p>Formats the CLoudEvent as JSON. No specification validation
is performed.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line51">line 51</a>
</li>
</ul>
</dd>
</dl>
<span class='name-container'>
<a class="link-icon" href="#type">
<svg height="20" width="20" style="fill: black;">
<use xlink:href="#linkIcon"></use>
</svg>
</a>
<h4 class="name" id="type">
<span class="type-signature"></span>type<span class="signature">(type)</span><span class="type-signature"> &rarr; {<a href="CloudEvent.html">CloudEvent</a>}</span>
</h4>
</span>
<div class="description">
<p>Sets the event type</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">
string
</span>
</td>
<td class="description last">
<p>the type of event related to the originating source</p>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source">
<ul class="dummy">
<li>
<a href="cloudevent.js.html">cloudevent.js</a>, <a href="cloudevent.js.html#line61">line 61</a>
</li>
</ul>
</dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>
<a href="https://github.com/cloudevents/spec/blob/master/spec.md#type">https://github.com/cloudevents/spec/blob/master/spec.md#type</a>
</li>
</ul>
</dd>
</dl>
</article>
</section>
</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a>
</footer>
<script src="scripts/linenumber.js"></script>
<script src="scripts/pagelocation.js"></script>
</body>
</html>