Class: Request

Abstract~Request(clientnullable) → {void}

Abstract request all api requests inherit from.

Constructor

new Request(clientnullable) → {void}

Request Constructor.

Request Constructor.

Parameters:
Name Type Attributes Default Description
client Client <nullable>
null
Source:
Returns:
Type
void

Members

(static, constant) REQUEST_SCOPE_DOMAIN

Constant REQUEST_SCOPE_DOMAIN

.

Constant REQUEST_SCOPE_DOMAIN

Source:

(static, constant) REQUEST_SCOPE_STORE

Constant REQUEST_SCOPE_STORE

.

Constant REQUEST_SCOPE_STORE

Source:

Methods

(abstract) createResponse(data) → {Response}

Override this method to create a response for this request.

Override this method to create a response for this request.

Parameters:
Name Type Description
data Object
Source:
Returns:
Type
Response

getClient() → (nullable) {Client}

Return the assigned client.

Return the assigned client.

Source:
Returns:
Type
Client

getFunction() → {string}

Get the function of the request.

Get the function of the request.

Source:
Returns:
Type
string

getScope() → {string}

Get the scope of request.

Get the scope of request.

Source:
Returns:
Type
string

getStoreCode() → {string}

Get the store code set for the request.

Get the store code set for the request.

Source:
Returns:
Type
string

promise() → {Promise}

Queue this request via the assigned client and get a Promise.

Queue this request via the assigned client and get a Promise.

Source:
Throws:
Error
Returns:
Type
Promise

send(callback) → {void}

Send this object via the assigned client.

Send this object via the assigned client.

Parameters:
Name Type Description
callback Request~sendCallback
Source:
Returns:
Type
void

setClient(clientnullable) → {Request}

Set the Client used for the request.

Set the Client used for the request.

Parameters:
Name Type Attributes Description
client Client <nullable>
Source:
Returns:
Type
Request

setStoreCode(storeCode) → {Request}

Set the store code for the request.

Set the store code for the request.

Parameters:
Name Type Description
storeCode string
Source:
Returns:
Type
Request

toObject() → {Object}

Reduce the request to a an object.

Reduce the request to a an object.

Source:
Returns:
Type
Object