<html><head><title></title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" >
</head>
<body class='pod'>
<!--
  generated by Pod::Simple::HTML v3.35,
  using Pod::Simple::PullParser v3.35,
  under Perl v5.030001 at Thu Jul 16 08:59:57 2020 GMT.

 If you want to change this HTML document, you probably shouldn't do that
   by changing it directly.  Instead, see about changing the calling options
   to Pod::Simple::HTML, and/or subclassing Pod::Simple::HTML,
   then reconverting this document from the Pod source.
   When in doubt, email the author of Pod::Simple::HTML for advice.
   See 'perldoc Pod::Simple::HTML' for more info.

-->

<!-- start doc -->
<a name='___top' class='dummyTopAnchor' ></a>

<h1><a class='u'
name="NAME"
>NAME</a></h1>

<p>WebService::Hexonet::Connector::ResponseTemplate - Library that provides basic functionality to access API response data.</p>

<h1><a class='u'
name="SYNOPSIS"
>SYNOPSIS</a></h1>

<p>This module is internally used by the WebService::Hexonet::Connector::Response module as described below.
To be used in the way:</p>

<pre>    # specify the API plain-text response (this is just an example that won&#39;t fit to the command above)
    $plain = &#34;[RESPONSE]\r\nCODE=200\r\nDESCRIPTION=Command completed successfully\r\nEOF\r\n&#34;;

    # create a new instance
    $r = WebService::Hexonet::Connector::ResponseTemplate-&#62;new($plain);</pre>

<p>The difference of this library and the Response library is simply that this library</p>

<ul>
<li>does not provide further data access possibilities based on Column and Record library</li>

<li>does not require an API command to be specified in constructor</li>
</ul>

<h1><a class='u'
name="DESCRIPTION"
>DESCRIPTION</a></h1>

<p>HEXONET Backend API always responds in plain-text format that needs to get parsed into a useful data structure. This module manages all this: parsing data into hash format. It provides different methods to access the data to fit your needs. It is used as base class for <a href="http://search.cpan.org/perldoc?WebService%3A%3AHexonet%3A%3AConnector%3A%3AResponse" class="podlinkpod"
>WebService::Hexonet::Connector::Response</a>. We internally use this module also in our automated tests to play with hardcoded API responses.</p>

<h2><a class='u'
name="Methods"
>Methods</a></h2>

<dl>
<dt><a name="new(_$plain_)"
><code>new( $plain )</code></a></dt>

<dd>
<p>Returns a new <a href="http://search.cpan.org/perldoc?WebService%3A%3AHexonet%3A%3AConnector%3A%3AResponseTemplate" class="podlinkpod"
>WebService::Hexonet::Connector::ResponseTemplate</a> instance. Specify the plain-text API response as $plain.</p>

<dt><a name="getCode"
><code>getCode</code></a></dt>

<dd>
<p>Returns the API response code as int.</p>

<dt><a name="getDescription"
><code>getDescription</code></a></dt>

<dd>
<p>Returns the API response description as string.</p>

<dt><a name="getPlain"
><code>getPlain</code></a></dt>

<dd>
<p>Returns the plain-text API response as string.</p>

<dt><a name="getQueuetime"
><code>getQueuetime</code></a></dt>

<dd>
<p>Returns the Queuetime of the API response as decimal.</p>

<dt><a name="getHash"
><code>getHash</code></a></dt>

<dd>
<p>Returns the API response as Hash.</p>

<dt><a name="getRuntime"
><code>getRuntime</code></a></dt>

<dd>
<p>Returns the Runtime of the API response code as decimal.</p>

<dt><a name="isError"
><code>isError</code></a></dt>

<dd>
<p>Checks if the API response code represents an error case. 500 &#60;= Code &#60;= 599 Returns boolean 0 or 1.</p>

<dt><a name="isSuccess"
><code>isSuccess</code></a></dt>

<dd>
<p>Checks if the API response code represents a success case. 200 &#60;= Code &#60;= 299 Returns boolean 0 or 1.</p>

<dt><a name="isTmpError"
><code>isTmpError</code></a></dt>

<dd>
<p>Checks if the API response code represents a temporary error case. 400 &#60;= Code &#60;= 499 Returns boolean 0 or 1.</p>

<dt><a name="isPending"
><code>isPending</code></a></dt>

<dd>
<p>Checks if current operation is returned as pending. Returns boolean 0 or 1.</p>
</dd>
</dl>

<h1><a class='u'
name="LICENSE_AND_COPYRIGHT"
>LICENSE AND COPYRIGHT</a></h1>

<p>This program is licensed under the <a href="https://raw.githubusercontent.com/hexonet/perl-sdk/master/LICENSE" class="podlinkurl"
>MIT License</a>.</p>

<h1><a class='u'
name="AUTHOR"
>AUTHOR</a></h1>

<p><a href="https://www.hexonet.net" class="podlinkurl"
>HEXONET GmbH</a></p>

<!-- end doc -->

</body></html>