Items resources
- Copyright:
- 2015–2020 RewardOps Inc.
- Source:
- Copyright:
- 2015–2024 RewardOps Inc.
- Source:
Methods
(protected, inner) getAllProgramItems(programId) → {module:resources/items~GetAllFunc}
Higher order function for creating a getAll program items function.
Parameters:
| Name | Type | Description |
|---|---|---|
programId |
number | The ID of the item's parent program |
- Source:
- See:
-
module:resources/items~GetAllFuncfor examples.
Returns:
Returns getAll program items function.
(protected, inner) getAllProgramItems(programId) → {module:resources/items~GetAllFunc}
Higher order function for creating a getAll program items function.
Parameters:
| Name | Type | Description |
|---|---|---|
programId |
number | The ID of the item's parent program |
- Source:
- See:
-
module:resources/items~GetAllFuncfor examples.
Returns:
Returns getAll program items function.
(protected, inner) getProgramItem(programId) → {module:resources/items~GetFunc}
Higher order function for creating a get program item function.
Parameters:
| Name | Type | Description |
|---|---|---|
programId |
number | The ID of the item's parent program |
- Source:
- See:
-
module:resources/items~GetFuncfor examples.
Returns:
Returns get program item function.
(protected, inner) getProgramItemParameters(programId) → {module:resources/items~GetParametersFunc}
Higher order function for creating a getParameters program item function.
Parameters:
| Name | Type | Description |
|---|---|---|
programId |
number | The ID of the item's parent program |
- Source:
- See:
-
module:resources/items~GetParametersFuncfor examples.
Returns:
Returns getParameters program item function.
(inner) getSavedItemsSummary(programCode)
Parameters:
| Name | Type | Description |
|---|---|---|
programCode |
string | string that contains the programCode |
- Source:
Returns:
api caller
(inner) items(programId) → {module:resources/items~ProgramItems}
Factory for items objects.
Parameters:
| Name | Type | Description |
|---|---|---|
programId |
number | The ID of the item's parent program |
- Source:
Returns:
Program items object.
Example
// Returns a items object for the program with ID 55
const items = ro.program(756).items;
(inner) memberSavedItems(programId, code) → {module:resources/member_saved_items~ProgramItems}
Factory for items objects.
Parameters:
| Name | Type | Description |
|---|---|---|
programId |
number | The ID of the item's parent program |
code |
- Source:
Returns:
Program items object.
- Type
- module:resources/member_saved_items~ProgramItems
Example
// Returns a items object for the program with ID 55
const items = ro.program(756).items;
Type Definitions
GetAllFunc
Function for getting an array of item JSON objects.
Properties:
| Name | Type | Description |
|---|---|---|
params |
object | Request params to pass to the API call |
callback |
module:api~requestCallback | Callback that handles the response |
- Source:
Example
// Gets an array of item detail objects the program with id 12
ro.program(12).items.getAll((error, responseBody, response) => {
// ...
});
GetFunc
Function for getting a item JSON object.
Properties:
| Name | Type | Description |
|---|---|---|
itemId |
string | Program item ID |
params |
object | Request params to pass to the API call |
callback |
module:api~requestCallback | Callback that handles the response |
- Source:
Example
// Get JSON for the item with ID 938
ro.program(12).items.get(938, (error, responseBody, response) => {
if (error) {
console.log(error);
} else {
console.log(result);
}
});
GetParametersFunc
Function for getting an array of filter parameter JSON objects that are relevant to the program.
Properties:
| Name | Type | Description |
|---|---|---|
params |
object | Request params to pass to the API call |
callback |
module:api~requestCallback | Callback that handles the response |
- Source:
Example
// Gets an array of filter parameter objects for the program with id 12
ro.program(12).items.getParameters((error, responseBody, response) => {
// ...
});
ProgramItems
Program items object.
Properties:
| Name | Type | Description |
|---|---|---|
programId |
number | The ID of the item's parent program |
get |
module:resources/items~GetFunc |
|
getAll |
module:resources/items~GetAllFunc |
|
getParameters |
function | Get parameters function |
- Source:
ProgramItems
Program items object.
Properties:
| Name | Type | Description |
|---|---|---|
programId |
number | The ID of the item's parent program |
getAll |
module:resources/msmber_saved_items~GetAllFunc |
|
summary |
module:resources/member_saved_items_summary~GetAllSummaryFunc |
- Source: