| Qore ServiceNowRestDataProvider Module Reference 2.0

Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ServiceNowRestDataProvider::ServiceNowRestRecordIterator Class Reference

Defines the record iterator class for Table-based iterators. More...

`#include <ServiceNowRestRecordIterator.qc.dox.h>`

## Public Member Functions
| constructor (ServiceNowRestClient::ServiceNowRestClient rest, string name, hash< ServiceNowRestRecordInfo > record_info, *hash< auto > where_cond, *hash< auto > search_options)
| creates the iterator
*hash< string, DataProvider::AbstractDataField > | getRecordType ()
| Returns the record description, if available.
hash< auto > | getValue ()
| Returns a single record if the iterator is valid.
*string | makeQuery (*hash< DataProviderExpression > where_cond, *hash< auto > search_options)
| Returns the filter for a request.
auto | memberGate (string key)
| Returns the value of the given field in the current row, if the iterator is valid.
bool | next ()
| Increments the row pointer when retrieving rows from a select statement; returns True if there is a row to retrieve, False if not.
bool | valid ()
| Returns True if the iterator is valid.

## Private Attributes
Qore::ListHashIterator | i
| record iterator
string | name
| current object name
hash< ServiceNowRestRecordInfo > | record_info
| Record info for the entity.
ServiceNowRestClient::ServiceNowRestClient | rest
| The REST client object for API calls.

## Detailed Description

Defines the record iterator class for Table-based iterators.

## Member Function Documentation

## ◆ constructor()

ServiceNowRestDataProvider::ServiceNowRestRecordIterator::constructor | ( | ServiceNowRestClient::ServiceNowRestClient | rest,
|  | string | name,
|  | hash< ServiceNowRestRecordInfo > | record_info,
|  | *hash< auto > | where_cond,
|  | *hash< auto > | search_options )

creates the iterator

Parameters

  rest | the REST client connection
  name | the name of the entity
  record_info | record information describing the entity
  where_cond | the where clause for the query, if any
  search_options | search options; assumed to have already been processed for validity before this call

## ◆ getRecordType()

*hash< string, DataProvider::AbstractDataField > ServiceNowRestDataProvider::ServiceNowRestRecordIterator::getRecordType | ( |  | ) |

Returns the record description, if available.

Returns
  the record type of the iterator

## ◆ getValue()

hash< auto > ServiceNowRestDataProvider::ServiceNowRestRecordIterator::getValue | ( |  | ) |

Returns a single record if the iterator is valid.

Exceptions

  INVALID-ITERATOR | the iterator is not pointing at a valid element

## ◆ memberGate()

auto ServiceNowRestDataProvider::ServiceNowRestRecordIterator::memberGate | ( | string | key | ) |

Returns the value of the given field in the current row, if the iterator is valid.

Parameters

  key | the name of the field

Returns
  the value of the given field in the current row, if the iterator is valid

Exceptions

  FIELD-ERROR | invalid or unknown field name

## ◆ next()

bool ServiceNowRestDataProvider::ServiceNowRestRecordIterator::next | ( |  | ) |

Increments the row pointer when retrieving rows from a select statement; returns True if there is a row to retrieve, False if not.

Returns
  True if there is a row to retrieve, False if not (no more rows to be retrieved)

Note
  Exceptions could be thrown by the DBI driver when the statement is executed; see the relevant DBI driver docs for more information

## ◆ valid()

bool ServiceNowRestDataProvider::ServiceNowRestRecordIterator::valid | ( |  | ) |

Returns True if the iterator is valid.

Returns
  True if the iterator is valid