writefreely-swift/docs/WFPost/index.html

319 lines
12 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 - WFPost</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="#wfpost.init(body:title:appearance:language:rtl:createddate:)">init(body:title:appearance:language:rtl:createdDate:)</a></li><li class="initializer"><a href="#wfpost.init(from:)">init(from:)</a></li></ul></li><li><a href="#properties">Properties</a><ul><li class="variable"><a href="#wfpost.postid">postId</a></li><li class="variable"><a href="#wfpost.slug">slug</a></li><li class="variable"><a href="#wfpost.appearance">appearance</a></li><li class="variable"><a href="#wfpost.language">language</a></li><li class="variable"><a href="#wfpost.rtl">rtl</a></li><li class="variable"><a href="#wfpost.createddate">createdDate</a></li><li class="variable"><a href="#wfpost.updateddate">updatedDate</a></li><li class="variable"><a href="#wfpost.title">title</a></li><li class="variable"><a href="#wfpost.body">body</a></li><li class="variable"><a href="#wfpost.tags">tags</a></li><li class="variable"><a href="#wfpost.views">views</a></li><li class="variable"><a href="#wfpost.collectionalias">collectionAlias</a></li></ul></li></ol>
</div>
</nav>
<main>
<article>
<h1>
<small>Structure</small>
<code class="name">WFPost</code>
</h1>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">struct</span> <span class="type">WFPost</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"/>
<!-- WFPost -->
<g id="node1" class="node structure current">
<title>WFPost</title>
<g id="a_node1"><a xlink:href="/WFPost" xlink:title="WFPost">
<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">WFPost</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>
<!-- WFPost&#45;&gt;Decodable -->
<g id="edge1" class="edge conformsTo">
<title>WFPost&#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 WFPost.</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="wfpost.init(body:title:appearance:language:rtl:createddate:)">
<h3>
<code>init(body:title:appearance:language:rtl:createdDate:)</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">init</span>(
<span class="variable">body</span>: <span class="type">String</span>,
<span class="variable">title</span>: <span class="type">String</span>? = <span class="keyword">nil</span>,
<span class="variable">appearance</span>: <span class="type">String</span>? = <span class="keyword">nil</span>,
<span class="variable">language</span>: <span class="type">String</span>? = <span class="keyword">nil</span>,
<span class="variable">rtl</span>: <span class="type">Bool</span>? = <span class="keyword">nil</span>,
<span class="variable">createdDate</span>: <span class="type">Date</span>? = <span class="keyword">nil</span>
) </code></pre>
</div>
<div class="summary" role="doc-abstract">
<p>Creates a basic <code>WFPost</code> object.</p>
</div>
<div class="discussion">
<p>This initializer creates a bare-minimum <code>WFPost</code> object for sending to the server; use the decoder-based
initializer to populate its other properties from the server response.</p>
<p>Only the <code>body</code> parameter is required. If other properties are not provided, they will be generated 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>body</th>
<td><code class="type">String</code></td>
<td><p>The body text for the post.</p>
</td>
</tr>
<tr>
<th>title</th>
<td><code class="type">String?</code></td>
<td><p>The title for the post.</p>
</td>
</tr>
<tr>
<th>appearance</th>
<td><code class="type">String?</code></td>
<td><p>The appearance for the post; one of <code>sans</code>, <code>serif</code>/<code>norm</code>, <code>wrap</code>, <code>mono</code>, or <code>code</code>. Defaults to <code>serif</code>.</p>
</td>
</tr>
<tr>
<th>language</th>
<td><code class="type">String?</code></td>
<td><p>An ISO 639-1 language code.</p>
</td>
</tr>
<tr>
<th>rtl</th>
<td><code class="type">Bool?</code></td>
<td><p>Set to <code>true</code> to show content right-to-left.</p>
</td>
</tr>
<tr>
<th>createdDate</th>
<td><code class="type">Date?</code></td>
<td><p>The published date for the post.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div role="article" class="initializer" id="wfpost.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>WFPost</code> object from the server response.</p>
</div>
<div class="discussion">
<p>Primarily used by the <code>WFClient</code> to create a <code>WFPost</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="wfpost.postid">
<h3>
<code>postId</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">postId</span>: <span class="type">String</span>?</code></pre>
</div>
</div>
<div role="article" class="variable" id="wfpost.slug">
<h3>
<code>slug</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">slug</span>: <span class="type">String</span>?</code></pre>
</div>
</div>
<div role="article" class="variable" id="wfpost.appearance">
<h3>
<code>appearance</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">appearance</span>: <span class="type">String</span>?</code></pre>
</div>
</div>
<div role="article" class="variable" id="wfpost.language">
<h3>
<code>language</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">language</span>: <span class="type">String</span>?</code></pre>
</div>
</div>
<div role="article" class="variable" id="wfpost.rtl">
<h3>
<code>rtl</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">rtl</span>: <span class="type">Bool</span>?</code></pre>
</div>
</div>
<div role="article" class="variable" id="wfpost.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>
<div role="article" class="variable" id="wfpost.updateddate">
<h3>
<code>updatedDate</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">updatedDate</span>: <span class="type">Date</span>?</code></pre>
</div>
</div>
<div role="article" class="variable" id="wfpost.title">
<h3>
<code>title</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">title</span>: <span class="type">String</span>?</code></pre>
</div>
</div>
<div role="article" class="variable" id="wfpost.body">
<h3>
<code>body</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">body</span>: <span class="type">String</span></code></pre>
</div>
</div>
<div role="article" class="variable" id="wfpost.tags">
<h3>
<code>tags</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">tags</span>: [<span class="type">String</span>]?</code></pre>
</div>
</div>
<div role="article" class="variable" id="wfpost.views">
<h3>
<code>views</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">views</span>: <span class="type">Int</span>?</code></pre>
</div>
</div>
<div role="article" class="variable" id="wfpost.collectionalias">
<h3>
<code>collectionAlias</code>
</h3>
<div class="declaration">
<pre class="highlight"><code><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">collectionAlias</span>: <span class="type">String</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>