WebService::Hexonet::Connector::Response

# NAME

WebService::Hexonet::Connector::Response - package to provide functionality to deal with Backend API reponses.

# DESCRIPTION

This package provides any functionality that you need to deal with Backend API responses.

The Response object itself can be instantiated by bytes array (basically the plaintext response from the Backend API), or by a hash format (an already parsed response). But the latter case is more for internal use.

# METHODS WebService::Hexonet::Connector::Response

`new(response)`

  Create an new Response object using the given Backend API response data. This can be a bytes array (basically the plaintext response from the Backend API), or by a hash format (an already parsed response returned by method as_list_hash). The latter case is more for internal use.

`as_string()`

  Returns the response as a string

`as_hash()`

  Returns the response as a hash

`as_list_hash()`

  Returns the response as a list hash

`as_list()`

  Returns the response as a list

`code()`

  Returns the response code

`description()`

  Returns the response description

`properties()`

  Returns the response properties

`runtime()`

  Returns the response runtime

`queuetime()`

  Returns the response queutime

`property(index)`

  Returns the property for a given index If no index given, the complete property list is returned

`is_success()`

  Returns true if the results is a success Success = response code starting with 2

`is_tmp_error()`

  Returns true if the results is a tmp error tmp error = response code starting with 4

`columns()`

  Returns the columns

`first()`

  Returns the index of the first element

`last()`

  Returns the index of the last element

`count()`

  Returns the number of list elements returned (= last - first + 1)

`limit()`

  Returns the limit of the response

`total()`

  Returns the total number of elements found (!= count)

`pages()`

  Returns the number of pages

`page()`

  Returns the number of the current page (starts with 1)

`prevpage()`

  Returns the number of the previous page

`prevpagefirst()`

  Returns the first index for the previous page

`nextpage()`

  Returns the number of the next page

`nextpagefirst()`

  Returns the first index for the next page

`lastpagefirst()`

  Returns the first index for the last page

# AUTHOR

Hexonet GmbH

https://www.hexonet.net

# LICENSE

MIT