writefreely-swift/docs/WFUser/index.html

220 lines
7.7 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WriteFreely - WFUser</title>
<link rel="stylesheet" type="text/css" href="/all.css" media="all" />
</head>
<body>
<header>
<a href="/">
<strong>
WriteFreely
</strong>
<span>Documentation</span>
</a>
<sup>Beta</sup>
</header>
<!--
<form class="search">
<input type="search" placeholder="Search" />
</form>
-->
<nav>
<div class="wrapper">
<h2>On This Page</h2>
<ol><li><a href="#relationships">Relationships</a><ul><li><a href="#relationships">Conforms To</a></li></ul></li><li><a href="#initializers">Initializers</a><ul><li class="initializer"><a href="#wfuser.init(token:username:)">init(token:username:)</a></li><li class="initializer"><a href="#wfuser.init(from:)">init(from:)</a></li></ul></li><li><a href="#properties">Properties</a><ul><li class="variable"><a href="#wfuser.token">token</a></li><li class="variable"><a href="#wfuser.username">username</a></li><li class="variable"><a href="#wfuser.email">email</a></li><li class="variable"><a href="#wfuser.createddate">createdDate</a></li></ul></li></ol>
</div>
</nav>
<main>
<article>
<h1>
<small>Structure</small>
<code class="name">WFUser</code>
</h1>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">struct</span> <span class="type">WFUser</span> </code></pre>
</div>
<section id="relationships">
<h2 hidden>Relationships</h2>
<figure>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.47.1 (20210417.1919)
-->
<!-- Pages: 1 -->
<svg width="872pt" height="116pt"
viewBox="0.00 0.00 872.00 116.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 112)">
<polygon fill="white" stroke="transparent" points="-4,4 -4,-112 868,-112 868,4 -4,4"/>
<!-- WFUser -->
<g id="node1" class="node structure current">
<title>WFUser</title>
<g id="a_node1"><a xlink:href="/WFUser" xlink:title="WFUser">
<path fill="none" stroke="black" stroke-width="3" d="M528,-108C528,-108 336,-108 336,-108 330,-108 324,-102 324,-96 324,-96 324,-84 324,-84 324,-78 330,-72 336,-72 336,-72 528,-72 528,-72 534,-72 540,-78 540,-84 540,-84 540,-96 540,-96 540,-102 534,-108 528,-108"/>
<text text-anchor="middle" x="432" y="-86.3" font-family="Menlo" font-size="14.00">WFUser</text>
</a>
</g>
</g>
<!-- Decodable -->
<g id="node2" class="node unknown">
<title>Decodable</title>
<path fill="none" stroke="black" d="M528,-36C528,-36 336,-36 336,-36 330,-36 324,-30 324,-24 324,-24 324,-12 324,-12 324,-6 330,0 336,0 336,0 528,0 528,0 534,0 540,-6 540,-12 540,-12 540,-24 540,-24 540,-30 534,-36 528,-36"/>
<text text-anchor="middle" x="432" y="-14.3" font-family="Menlo" font-size="14.00">Decodable</text>
</g>
<!-- WFUser&#45;&gt;Decodable -->
<g id="edge1" class="edge conformsTo">
<title>WFUser&#45;&gt;Decodable</title>
<path fill="none" stroke="black" d="M432,-71.7C432,-63.98 432,-54.71 432,-46.11"/>
<polygon fill="black" stroke="black" points="435.5,-46.1 432,-36.1 428.5,-46.1 435.5,-46.1"/>
</g>
</g>
</svg>
<figcaption hidden>Inheritance graph for WFUser.</figcaption>
</figure>
<h3>Conforms To</h3>
<dl>
<dt class="unknown"><code>Decodable</code></dt>
</dl>
</section>
<section id="initializers">
<h2>Initializers</h2>
<div role="article" class="initializer" id="wfuser.init(token:username:)">
<h3>
<code>init(token:username:)</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">init</span>(<span class="variable">token</span>: <span class="type">String</span>, <span class="variable">username</span>: <span class="type">String</span>?) </code></pre>
</div>
<div class="summary" role="doc-abstract">
<p>Creates a minimum <code>WFUser</code> object from a stored token.</p>
</div>
<div class="discussion">
<p>Use this when the client has already logged in a user and only needs to reconstruct the type from saved properties.</p>
</div>
<h4>Parameters</h4>
<table class="parameters">
<thead hidden>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<th>token</th>
<td><code class="type">String</code></td>
<td><p>The user's access token</p>
</td>
</tr>
<tr>
<th>username</th>
<td><code class="type">String?</code></td>
<td><p>The user's username (optional)</p>
</td>
</tr>
</tbody>
</table>
</div>
<div role="article" class="initializer" id="wfuser.init(from:)">
<h3>
<code>init(from:)</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">init</span>(<span class="variable">from</span> <span class="variable">decoder</span>: <span class="type">Decoder</span>) <span class="keyword">throws</span> </code></pre>
</div>
<div class="summary" role="doc-abstract">
<p>Creates a <code>WFUser</code> object from the server response.</p>
</div>
<div class="discussion">
<p>Primarily used by the <code>WFClient</code> to create a <code>WFUser</code> object from the JSON returned by the server.</p>
</div>
<h4>Parameters</h4>
<table class="parameters">
<thead hidden>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<th>decoder</th>
<td><code class="type">Decoder</code></td>
<td><p>The decoder to use for translating the server response to a Swift object.</p>
</td>
</tr>
</tbody>
</table>
<h4>Throws</h4>
<p>Error thrown by the <code>try</code> attempt when decoding any given property.</p>
</div>
</section>
<section id="properties">
<h2>Properties</h2>
<div role="article" class="variable" id="wfuser.token">
<h3>
<code>token</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">token</span>: <span class="type">String</span></code></pre>
</div>
</div>
<div role="article" class="variable" id="wfuser.username">
<h3>
<code>username</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">username</span>: <span class="type">String</span>?</code></pre>
</div>
</div>
<div role="article" class="variable" id="wfuser.email">
<h3>
<code>email</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">email</span>: <span class="type">String</span>?</code></pre>
</div>
</div>
<div role="article" class="variable" id="wfuser.createddate">
<h3>
<code>createdDate</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">createdDate</span>: <span class="type">Date</span>?</code></pre>
</div>
</div>
</section>
</article>
</main>
<footer>
<p>
Generated on <time datetime="2021-05-27T16:04:29-0400">May 27, 2021</time> using <a href="https://github.com/SwiftDocOrg/swift-doc">swift-doc</a> <span class="version">1.0.0-beta.6</span>.
</p>
</footer>
</body>
</html>