| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <title>Event Struct Reference</title> |
| <link rel="stylesheet" type="text/css" href="../css/jazzy.css" /> |
| <link rel="stylesheet" type="text/css" href="../css/highlight.css" /> |
| <meta charset='utf-8'> |
| <script type="text/javascript"> |
| window.jazzy = {'docset': false} |
| if (typeof window.dash != 'undefined') { |
| document.documentElement.className += ' dash' |
| window.jazzy.docset = true |
| } |
| if (navigator.userAgent.match(/xcode/i)) { |
| document.documentElement.className += ' xcode' |
| window.jazzy.docset = true |
| } |
| </script> |
| <script src="../js/jquery.min.js" defer></script> |
| <script src="../js/jazzy.js" defer></script> |
| </head> |
| <body id="reference" class="Swift"> |
| <a name="//apple_ref/swift/Struct/Event" class="dashAnchor"></a> |
| <a title="Event Struct Reference"></a> |
| <header> |
| <div class="content-wrapper"> |
| <p class="header-text"><a href="../index.html">PredictionIO Swift SDK Docs</a> (96% documented)</p> |
| <p id="header-links"><a href="https://github.com/minhtule/PredictionIO-iOS-SDK"><img id="header-icon" src="../img/gh.png" height="16px" width="16px" />View on GitHub</a></p> |
| </div> |
| </header> |
| <section id="valence"> |
| <div class="content-wrapper"> |
| <p id="hierarchial_navigation"> |
| <a href="../index.html" id="design_resources_link">PredictionIO Swift SDK Reference</a> |
| <img id="carat" src="../img/carat.png" height="10px" width="6px" /> |
| Event Struct Reference |
| </p> |
| </div> |
| </section> |
| <div class="content-wrapper"> |
| <nav class="book-parts"> |
| <ul class="nav-parts"> |
| <li class="part-name tasks"> |
| <a href="../Classes.html">Classes</a> |
| <ul class="nav-chapters"> |
| <li class="nav-chapter"> |
| <a href="../Classes/BaseClient.html">BaseClient</a> |
| </li> |
| <li class="nav-chapter"> |
| <a href="../Classes/EngineClient.html">EngineClient</a> |
| </li> |
| <li class="nav-chapter"> |
| <a href="../Classes/EventClient.html">EventClient</a> |
| </li> |
| <li class="nav-chapter"> |
| <a href="../Classes.html#/s:C15PredictionIOSDK7Manager">Manager</a> |
| </li> |
| </ul> |
| </li> |
| <li class="part-name tasks"> |
| <a href="../Extensions.html">Extensions</a> |
| <ul class="nav-chapters"> |
| <li class="nav-chapter"> |
| <a href="../Extensions/EventClient.html">EventClient</a> |
| </li> |
| </li> |
| </ul> |
| </li> |
| <li class="part-name tasks"> |
| <a href="../Structs.html">Structs</a> |
| <ul class="nav-chapters"> |
| <li class="nav-chapter"> |
| <a href="../Structs/Event.html">Event</a> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </nav> |
| <div class="pixel-line"></div> |
| <div class="rubber-band-gap"></div> |
| <article class="chapter"> |
| <a name="/"></a> |
| <h1 class="chapter-name">Event</h1> |
| <section> |
| <section class="section"> |
| <p class="para">An <code>Event</code> class that represents a PredictionIO’s event JSON dictionary in its REST API.</p> |
| </section> |
| <section class="section task-group-section"> |
| <div class="task-group"> |
| <div class="task-name-container"> |
| |
| <a name="/Constants"></a> |
| <a name="//apple_ref/swift/Section/Constants" class="dashAnchor"></a> |
| <a href="#/Constants"> |
| <h3 class="section-name">Constants</h3> |
| </a> |
| |
| </div> |
| <ul class="task-group-list"> |
| <li class="item symbol"> |
| <div class="task-group-term"> |
| <code> |
| <a name="/s:vV15PredictionIOSDK5Event8SetEventSS"> |
| <a name="//apple_ref/swift/Property/SetEvent" class="dashAnchor"></a> |
| <a class="x-instance-method Swift" href="#/s:vV15PredictionIOSDK5Event8SetEventSS">SetEvent</a> |
| </code> |
| </div> |
| <div class="height-container"> |
| <div class="pointy-thing-container"></div> |
| <section class="section instance-method"> |
| <div class="pointy-thing"></div> |
| <div class="abstract"> |
| <p class="para">Reversed set event name.</p> |
| </div> |
| <div class="declaration"> |
| <h4>Declaration</h4> |
| |
| <div class="Swift"> |
| <p class="aside-title">Swift</p> |
| <pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">SetEvent</span> <span class="o">=</span> <span class="s">"$set"</span></code></pre> |
| |
| </div> |
| </div> |
| </section> |
| </div> |
| </li> |
| <li class="item symbol"> |
| <div class="task-group-term"> |
| <code> |
| <a name="/s:vV15PredictionIOSDK5Event10UnsetEventSS"> |
| <a name="//apple_ref/swift/Property/UnsetEvent" class="dashAnchor"></a> |
| <a class="x-instance-method Swift" href="#/s:vV15PredictionIOSDK5Event10UnsetEventSS">UnsetEvent</a> |
| </code> |
| </div> |
| <div class="height-container"> |
| <div class="pointy-thing-container"></div> |
| <section class="section instance-method"> |
| <div class="pointy-thing"></div> |
| <div class="abstract"> |
| <p class="para">Reversed unset event name.</p> |
| </div> |
| <div class="declaration"> |
| <h4>Declaration</h4> |
| |
| <div class="Swift"> |
| <p class="aside-title">Swift</p> |
| <pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">UnsetEvent</span> <span class="o">=</span> <span class="s">"$unset"</span></code></pre> |
| |
| </div> |
| </div> |
| </section> |
| </div> |
| </li> |
| <li class="item symbol"> |
| <div class="task-group-term"> |
| <code> |
| <a name="/s:vV15PredictionIOSDK5Event11DeleteEventSS"> |
| <a name="//apple_ref/swift/Property/DeleteEvent" class="dashAnchor"></a> |
| <a class="x-instance-method Swift" href="#/s:vV15PredictionIOSDK5Event11DeleteEventSS">DeleteEvent</a> |
| </code> |
| </div> |
| <div class="height-container"> |
| <div class="pointy-thing-container"></div> |
| <section class="section instance-method"> |
| <div class="pointy-thing"></div> |
| <div class="abstract"> |
| <p class="para">Reversed delete event name.</p> |
| </div> |
| <div class="declaration"> |
| <h4>Declaration</h4> |
| |
| <div class="Swift"> |
| <p class="aside-title">Swift</p> |
| <pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">DeleteEvent</span> <span class="o">=</span> <span class="s">"$delete"</span></code></pre> |
| |
| </div> |
| </div> |
| </section> |
| </div> |
| </li> |
| <li class="item symbol"> |
| <div class="task-group-term"> |
| <code> |
| <a name="/s:vV15PredictionIOSDK5Event14UserEntityTypeSS"> |
| <a name="//apple_ref/swift/Property/UserEntityType" class="dashAnchor"></a> |
| <a class="x-instance-method Swift" href="#/s:vV15PredictionIOSDK5Event14UserEntityTypeSS">UserEntityType</a> |
| </code> |
| </div> |
| <div class="height-container"> |
| <div class="pointy-thing-container"></div> |
| <section class="section instance-method"> |
| <div class="pointy-thing"></div> |
| <div class="abstract"> |
| <p class="para">Predefined user entity type.</p> |
| </div> |
| <div class="declaration"> |
| <h4>Declaration</h4> |
| |
| <div class="Swift"> |
| <p class="aside-title">Swift</p> |
| <pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">UserEntityType</span> <span class="o">=</span> <span class="s">"user"</span></code></pre> |
| |
| </div> |
| </div> |
| </section> |
| </div> |
| </li> |
| <li class="item symbol"> |
| <div class="task-group-term"> |
| <code> |
| <a name="/s:vV15PredictionIOSDK5Event14ItemEntityTypeSS"> |
| <a name="//apple_ref/swift/Property/ItemEntityType" class="dashAnchor"></a> |
| <a class="x-instance-method Swift" href="#/s:vV15PredictionIOSDK5Event14ItemEntityTypeSS">ItemEntityType</a> |
| </code> |
| </div> |
| <div class="height-container"> |
| <div class="pointy-thing-container"></div> |
| <section class="section instance-method"> |
| <div class="pointy-thing"></div> |
| <div class="abstract"> |
| <p class="para">Predefined item entity type.</p> |
| </div> |
| <div class="declaration"> |
| <h4>Declaration</h4> |
| |
| <div class="Swift"> |
| <p class="aside-title">Swift</p> |
| <pre class="highlight"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">let</span> <span class="nv">ItemEntityType</span> <span class="o">=</span> <span class="s">"item"</span></code></pre> |
| |
| </div> |
| </div> |
| </section> |
| </div> |
| </li> |
| </ul> |
| </div> |
| <div class="task-group"> |
| <div class="task-name-container"> |
| |
| <a name="/Properties"></a> |
| <a name="//apple_ref/swift/Section/Properties" class="dashAnchor"></a> |
| <a href="#/Properties"> |
| <h3 class="section-name">Properties</h3> |
| </a> |
| |
| </div> |
| <ul class="task-group-list"> |
| <li class="item symbol"> |
| <div class="task-group-term"> |
| <code> |
| <a name="/s:vV15PredictionIOSDK5Event5eventSS"> |
| <a name="//apple_ref/swift/Property/event" class="dashAnchor"></a> |
| <a class="x-instance-method Swift" href="#/s:vV15PredictionIOSDK5Event5eventSS">event</a> |
| </code> |
| </div> |
| <div class="height-container"> |
| <div class="pointy-thing-container"></div> |
| <section class="section instance-method"> |
| <div class="pointy-thing"></div> |
| <div class="abstract"> |
| <p class="para">The event name e.g. <q>sign-up</q>, <q>rate</q>, <q>view</q>.<strong>Note:</strong> All event names starting with <q>$</q> and <q>pio_</q> are reversed and shouldn’t be used as your custom event (e.g. <q>$set</q>).</p> |
| </div> |
| <div class="declaration"> |
| <h4>Declaration</h4> |
| |
| <div class="Swift"> |
| <p class="aside-title">Swift</p> |
| <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">event</span><span class="p">:</span> <span class="kt">String</span></code></pre> |
| |
| </div> |
| </div> |
| </section> |
| </div> |
| </li> |
| <li class="item symbol"> |
| <div class="task-group-term"> |
| <code> |
| <a name="/s:vV15PredictionIOSDK5Event10entityTypeSS"> |
| <a name="//apple_ref/swift/Property/entityType" class="dashAnchor"></a> |
| <a class="x-instance-method Swift" href="#/s:vV15PredictionIOSDK5Event10entityTypeSS">entityType</a> |
| </code> |
| </div> |
| <div class="height-container"> |
| <div class="pointy-thing-container"></div> |
| <section class="section instance-method"> |
| <div class="pointy-thing"></div> |
| <div class="abstract"> |
| <p class="para">The entity type. It is the namespace of the <code>entityID</code> and analogous to the table name of a relational database. The <code>entityID</code> must be unique within the same <code>entityType</code>.<strong>Note:</strong> All entityType names starting with <q>$</q> and <q>pio_</q> are reversed and shouldn’t be used.</p> |
| </div> |
| <div class="declaration"> |
| <h4>Declaration</h4> |
| |
| <div class="Swift"> |
| <p class="aside-title">Swift</p> |
| <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">entityType</span><span class="p">:</span> <span class="kt">String</span></code></pre> |
| |
| </div> |
| </div> |
| </section> |
| </div> |
| </li> |
| <li class="item symbol"> |
| <div class="task-group-term"> |
| <code> |
| <a name="/s:vV15PredictionIOSDK5Event8entityIDSS"> |
| <a name="//apple_ref/swift/Property/entityID" class="dashAnchor"></a> |
| <a class="x-instance-method Swift" href="#/s:vV15PredictionIOSDK5Event8entityIDSS">entityID</a> |
| </code> |
| </div> |
| <div class="height-container"> |
| <div class="pointy-thing-container"></div> |
| <section class="section instance-method"> |
| <div class="pointy-thing"></div> |
| <div class="abstract"> |
| <p class="para">The entity ID. <code>entityType-entityID</code> becomes the unique identifier of the entity.</p> |
| </div> |
| <div class="declaration"> |
| <h4>Declaration</h4> |
| |
| <div class="Swift"> |
| <p class="aside-title">Swift</p> |
| <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">entityID</span><span class="p">:</span> <span class="kt">String</span></code></pre> |
| |
| </div> |
| </div> |
| </section> |
| </div> |
| </li> |
| <li class="item symbol"> |
| <div class="task-group-term"> |
| <code> |
| <a name="/s:vV15PredictionIOSDK5Event16targetEntityTypeGSqSS_"> |
| <a name="//apple_ref/swift/Property/targetEntityType" class="dashAnchor"></a> |
| <a class="x-instance-method Swift" href="#/s:vV15PredictionIOSDK5Event16targetEntityTypeGSqSS_">targetEntityType</a> |
| </code> |
| </div> |
| <div class="height-container"> |
| <div class="pointy-thing-container"></div> |
| <section class="section instance-method"> |
| <div class="pointy-thing"></div> |
| <div class="abstract"> |
| <p class="para">The target entity type.<strong>Note:</strong> All targetEntityType names starting with <q>$</q> and <q>pio_</q> are reversed and shouldn’t be used.</p> |
| </div> |
| <div class="declaration"> |
| <h4>Declaration</h4> |
| |
| <div class="Swift"> |
| <p class="aside-title">Swift</p> |
| <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">targetEntityType</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span></code></pre> |
| |
| </div> |
| </div> |
| </section> |
| </div> |
| </li> |
| <li class="item symbol"> |
| <div class="task-group-term"> |
| <code> |
| <a name="/s:vV15PredictionIOSDK5Event14targetEntityIDGSqSS_"> |
| <a name="//apple_ref/swift/Property/targetEntityID" class="dashAnchor"></a> |
| <a class="x-instance-method Swift" href="#/s:vV15PredictionIOSDK5Event14targetEntityIDGSqSS_">targetEntityID</a> |
| </code> |
| </div> |
| <div class="height-container"> |
| <div class="pointy-thing-container"></div> |
| <section class="section instance-method"> |
| <div class="pointy-thing"></div> |
| <div class="abstract"> |
| <p class="para">The target entity ID.</p> |
| </div> |
| <div class="declaration"> |
| <h4>Declaration</h4> |
| |
| <div class="Swift"> |
| <p class="aside-title">Swift</p> |
| <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">targetEntityID</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span></code></pre> |
| |
| </div> |
| </div> |
| </section> |
| </div> |
| </li> |
| <li class="item symbol"> |
| <div class="task-group-term"> |
| <code> |
| <a name="/s:vV15PredictionIOSDK5Event10propertiesGSqGVSs10DictionarySSPSs9AnyObject___"> |
| <a name="//apple_ref/swift/Property/properties" class="dashAnchor"></a> |
| <a class="x-instance-method Swift" href="#/s:vV15PredictionIOSDK5Event10propertiesGSqGVSs10DictionarySSPSs9AnyObject___">properties</a> |
| </code> |
| </div> |
| <div class="height-container"> |
| <div class="pointy-thing-container"></div> |
| <section class="section instance-method"> |
| <div class="pointy-thing"></div> |
| <div class="abstract"> |
| <p class="para">The event properties.<strong>Note:</strong> All properties names starting with <q>$</q> and <q>pio_</q> are reversed and shouldn’t be used.</p> |
| </div> |
| <div class="declaration"> |
| <h4>Declaration</h4> |
| |
| <div class="Swift"> |
| <p class="aside-title">Swift</p> |
| <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">properties</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">:</span> <span class="kt">AnyObject</span><span class="p">]?</span></code></pre> |
| |
| </div> |
| </div> |
| </section> |
| </div> |
| </li> |
| <li class="item symbol"> |
| <div class="task-group-term"> |
| <code> |
| <a name="/s:vV15PredictionIOSDK5Event9eventTimeCSo6NSDate"> |
| <a name="//apple_ref/swift/Property/eventTime" class="dashAnchor"></a> |
| <a class="x-instance-method Swift" href="#/s:vV15PredictionIOSDK5Event9eventTimeCSo6NSDate">eventTime</a> |
| </code> |
| </div> |
| <div class="height-container"> |
| <div class="pointy-thing-container"></div> |
| <section class="section instance-method"> |
| <div class="pointy-thing"></div> |
| <div class="abstract"> |
| <p class="para">The time of the event.</p> |
| </div> |
| <div class="declaration"> |
| <h4>Declaration</h4> |
| |
| <div class="Swift"> |
| <p class="aside-title">Swift</p> |
| <pre class="highlight"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">eventTime</span><span class="p">:</span> <span class="kt">NSDate</span></code></pre> |
| |
| </div> |
| </div> |
| </section> |
| </div> |
| </li> |
| </ul> |
| </div> |
| <div class="task-group"> |
| <div class="task-name-container"> |
| |
| <a name="/Constructors"></a> |
| <a name="//apple_ref/swift/Section/Constructors" class="dashAnchor"></a> |
| <a href="#/Constructors"> |
| <h3 class="section-name">Constructors</h3> |
| </a> |
| |
| </div> |
| <ul class="task-group-list"> |
| <li class="item symbol"> |
| <div class="task-group-term"> |
| <code> |
| <a name="/s:FV15PredictionIOSDK5EventcFMS0_FT5eventSS10entityTypeSS8entityIDSS16targetEntityTypeGSqSS_14targetEntityIDGSqSS_10propertiesGSqGVSs10DictionarySSPSs9AnyObject___9eventTimeCSo6NSDate_S0_"> |
| <a name="//apple_ref/swift/Method/init(event:entityType:entityID:targetEntityType:targetEntityID:properties:eventTime:)" class="dashAnchor"></a> |
| <a class="x-instance-method Swift" href="#/s:FV15PredictionIOSDK5EventcFMS0_FT5eventSS10entityTypeSS8entityIDSS16targetEntityTypeGSqSS_14targetEntityIDGSqSS_10propertiesGSqGVSs10DictionarySSPSs9AnyObject___9eventTimeCSo6NSDate_S0_">init(event:entityType:entityID:targetEntityType:targetEntityID:properties:eventTime:)</a> |
| </code> |
| </div> |
| <div class="height-container"> |
| <div class="pointy-thing-container"></div> |
| <section class="section instance-method"> |
| <div class="pointy-thing"></div> |
| <div class="abstract"> |
| |
| </div> |
| <div class="declaration"> |
| <h4>Declaration</h4> |
| |
| <div class="Swift"> |
| <p class="aside-title">Swift</p> |
| <pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">event</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">entityType</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">entityID</span><span class="p">:</span> <span class="kt">String</span><span class="p">,</span> <span class="nv">targetEntityType</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="nv">targetEntityID</span><span class="p">:</span> <span class="kt">String</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="nv">properties</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">:</span> <span class="kt">AnyObject</span><span class="p">]?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="nv">eventTime</span><span class="p">:</span> <span class="kt">NSDate</span> <span class="o">=</span> <span class="kt">NSDate</span><span class="p">())</span></code></pre> |
| |
| </div> |
| </div> |
| <div class="parameters"> |
| <h4>Parameters</h4> |
| <table class="graybox" border="0" cellspacing="0" cellpadding="5"> |
| <tbody> |
| <tr> |
| <td scope="row"> |
| <code> |
| <em class="term">event</em> |
| </code> |
| </td> |
| <td> |
| <div class="definition"> |
| <p class="para">The event name</p> |
| </div> |
| </td> |
| </tr> |
| <tr> |
| <td scope="row"> |
| <code> |
| <em class="term">entityType</em> |
| </code> |
| </td> |
| <td> |
| <div class="definition"> |
| <p class="para">The entity type</p> |
| </div> |
| </td> |
| </tr> |
| <tr> |
| <td scope="row"> |
| <code> |
| <em class="term">entityID</em> |
| </code> |
| </td> |
| <td> |
| <div class="definition"> |
| <p class="para">The entity ID</p> |
| </div> |
| </td> |
| </tr> |
| <tr> |
| <td scope="row"> |
| <code> |
| <em class="term">targetEntityType</em> |
| </code> |
| </td> |
| <td> |
| <div class="definition"> |
| <p class="para">The target entity type</p> |
| </div> |
| </td> |
| </tr> |
| <tr> |
| <td scope="row"> |
| <code> |
| <em class="term">targetEntityID</em> |
| </code> |
| </td> |
| <td> |
| <div class="definition"> |
| <p class="para">The target entity ID</p> |
| </div> |
| </td> |
| </tr> |
| <tr> |
| <td scope="row"> |
| <code> |
| <em class="term">properties</em> |
| </code> |
| </td> |
| <td> |
| <div class="definition"> |
| <p class="para">The event properties</p> |
| </div> |
| </td> |
| </tr> |
| <tr> |
| <td scope="row"> |
| <code> |
| <em class="term">eventTime</em> |
| </code> |
| </td> |
| <td> |
| <div class="definition"> |
| <p class="para">The event time</p> |
| </div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </section> |
| </div> |
| </li> |
| </ul> |
| </div> |
| </section> |
| </section> |
| <section id="footer"> |
| <p class="copyright">© 2015 <a class="link" href="https://github.com/minhtule" target="_blank" rel="external">Minh-Tu Le</a>. All rights reserved. (Last updated: 2015-03-03)</p> |
| <p class="copyright">Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.1.2</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p> |
| </section> |
| </article> |
| </div> |
| </body> |
| </div> |
| </html> |