/** * Rewards service. * @module api/RewardsApi */ export default class RewardsApi { /** * Constructs a new RewardsApi. * @alias RewardsApi * @class * @param {module:ApiClient} [apiClient] Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ constructor(apiClient?: any); apiClient: any; /** * Callback function to receive the result of the createReward operation. * @callback createRewardCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {RewardsCreateResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Create Reward * Create a new reward. * @param {RewardsCreateRequestBody} rewardsCreateRequestBody Define parameters of the new reward. * @param {createRewardCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link RewardsCreateResponseBody} * @returns {Promise<(RewardsCreateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `RewardsCreateResponseBody` object or with `undefined`. */ createReward(rewardsCreateRequestBody: RewardsCreateRequestBody, callback?: (error: Error | null, data?: RewardsCreateResponseBody, response?: any) => any): Promise<(RewardsCreateResponseBody | undefined)>; /** * Callback function to receive the result of the createRewardAssignment operation. * @callback createRewardAssignmentCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {RewardsAssignmentsCreateResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Create Reward Assignment * Assigns a reward to a specified loyalty campaign. * @param {String} rewardId A unique reward ID. * @param {RewardsAssignmentsCreateRequestBody} rewardsAssignmentsCreateRequestBody Provide the campaign ID of the campaign to which the reward is to be assigned and define the cost of the reward in terms of loyalty points. * @param {createRewardAssignmentCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link RewardsAssignmentsCreateResponseBody} * @returns {Promise<(RewardsAssignmentsCreateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `RewardsAssignmentsCreateResponseBody` object or with `undefined`. */ createRewardAssignment(rewardId: string, rewardsAssignmentsCreateRequestBody: RewardsAssignmentsCreateRequestBody, callback?: (error: Error | null, data?: RewardsAssignmentsCreateResponseBody, response?: any) => any): Promise<(RewardsAssignmentsCreateResponseBody | undefined)>; /** * Callback function to receive the result of the deleteReward operation. * @callback deleteRewardCallback * @param {Error|null} error Error object if failed, null otherwise. * @param data This operation does not return a value. * @param {Object} [response] Full response object if successful. */ /** * Delete Reward * Delete a reward. * @param {String} rewardId A unique reward ID. * @param {deleteRewardCallback} [callback] The callback function, accepting three arguments: error, data, response * @returns {Promise<( | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `` object or with `undefined`. */ deleteReward(rewardId: string, callback?: (error: Error | null, data: any, response?: any) => any): Promise<(undefined)>; /** * Callback function to receive the result of the deleteRewardAssignment operation. * @callback deleteRewardAssignmentCallback * @param {Error|null} error Error object if failed, null otherwise. * @param data This operation does not return a value. * @param {Object} [response] Full response object if successful. */ /** * Delete Reward Assignment * This method deletes a reward assignment for a particular reward. * @param {String} rewardId A unique reward ID. * @param {String} assignmentId A unique reward assignment ID. * @param {deleteRewardAssignmentCallback} [callback] The callback function, accepting three arguments: error, data, response * @returns {Promise<( | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `` object or with `undefined`. */ deleteRewardAssignment(rewardId: string, assignmentId: string, callback?: (error: Error | null, data: any, response?: any) => any): Promise<(undefined)>; /** * Callback function to receive the result of the getReward operation. * @callback getRewardCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {Reward} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Get Reward * Retrieve a reward by the reward ID. * @param {String} rewardId A unique reward ID. * @param {getRewardCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link Reward} * @returns {Promise<(Reward | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `Reward` object or with `undefined`. */ getReward(rewardId: string, callback?: (error: Error | null, data?: Reward, response?: any) => any): Promise<(Reward | undefined)>; /** * Callback function to receive the result of the getRewardAssignment operation. * @callback getRewardAssignmentCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {RewardsAssignmentsGetResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Get Reward Assignment * Retrieve a reward assignment. * @param {String} rewardId A unique reward ID. * @param {String} assignmentId A unique reward assignment ID. * @param {getRewardAssignmentCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link RewardsAssignmentsGetResponseBody} * @returns {Promise<(RewardsAssignmentsGetResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `RewardsAssignmentsGetResponseBody` object or with `undefined`. */ getRewardAssignment(rewardId: string, assignmentId: string, callback?: (error: Error | null, data?: RewardsAssignmentsGetResponseBody, response?: any) => any): Promise<(RewardsAssignmentsGetResponseBody | undefined)>; /** * Callback function to receive the result of the listRewardAssignments operation. * @callback listRewardAssignmentsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {RewardsAssignmentsListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List Reward Assignments * Retrieve reward assignments by the reward ID. * @param {String} rewardId A unique reward ID. * @param {{ limit?: Number, page?: Number, }} [opts] Optional parameters * @param {listRewardAssignmentsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link RewardsAssignmentsListResponseBody} * @returns {Promise<(RewardsAssignmentsListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `RewardsAssignmentsListResponseBody` object or with `undefined`. */ listRewardAssignments(rewardId: string, opts?: { limit?: number; page?: number; }, callback?: (error: Error | null, data?: RewardsAssignmentsListResponseBody, response?: any) => any): Promise<(RewardsAssignmentsListResponseBody | undefined)>; /** * Callback function to receive the result of the listRewards operation. * @callback listRewardsCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {RewardsListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List Rewards * Retrieve rewards. * @param {{ limit?: Number, page?: Number, assignmentId?: String, }} [opts] Optional parameters * @param {listRewardsCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link RewardsListResponseBody} * @returns {Promise<(RewardsListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `RewardsListResponseBody` object or with `undefined`. */ listRewards(opts?: { limit?: number; page?: number; assignmentId?: string; }, callback?: (error: Error | null, data?: RewardsListResponseBody, response?: any) => any): Promise<(RewardsListResponseBody | undefined)>; /** * Callback function to receive the result of the updateReward operation. * @callback updateRewardCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {RewardsUpdateResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Update Reward * Update the details of a reward. * @param {String} rewardId A unique reward ID. * @param {RewardsUpdateRequestBody} rewardsUpdateRequestBody Define the parameters to be updated for the reward. * @param {updateRewardCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link RewardsUpdateResponseBody} * @returns {Promise<(RewardsUpdateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `RewardsUpdateResponseBody` object or with `undefined`. */ updateReward(rewardId: string, rewardsUpdateRequestBody: RewardsUpdateRequestBody, callback?: (error: Error | null, data?: RewardsUpdateResponseBody, response?: any) => any): Promise<(RewardsUpdateResponseBody | undefined)>; /** * Callback function to receive the result of the updateRewardAssignment operation. * @callback updateRewardAssignmentCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {RewardsAssignmentsUpdateResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Update Reward Assignment * Update the number of points needed to successfully redeem the reward. * @param {String} rewardId A unique reward ID. * @param {String} assignmentId A unique reward assignment ID. * @param {RewardsAssignmentsUpdateRequestBody} rewardsAssignmentsUpdateRequestBody Define the number of points required to exchange for the reward. * @param {updateRewardAssignmentCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link RewardsAssignmentsUpdateResponseBody} * @returns {Promise<(RewardsAssignmentsUpdateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `RewardsAssignmentsUpdateResponseBody` object or with `undefined`. */ updateRewardAssignment(rewardId: string, assignmentId: string, rewardsAssignmentsUpdateRequestBody: RewardsAssignmentsUpdateRequestBody, callback?: (error: Error | null, data?: RewardsAssignmentsUpdateResponseBody, response?: any) => any): Promise<(RewardsAssignmentsUpdateResponseBody | undefined)>; } import RewardsCreateRequestBody from '../model/RewardsCreateRequestBody'; import RewardsCreateResponseBody from '../model/RewardsCreateResponseBody'; import RewardsAssignmentsCreateRequestBody from '../model/RewardsAssignmentsCreateRequestBody'; import RewardsAssignmentsCreateResponseBody from '../model/RewardsAssignmentsCreateResponseBody'; import Reward from '../model/Reward'; import RewardsAssignmentsGetResponseBody from '../model/RewardsAssignmentsGetResponseBody'; import RewardsAssignmentsListResponseBody from '../model/RewardsAssignmentsListResponseBody'; import RewardsListResponseBody from '../model/RewardsListResponseBody'; import RewardsUpdateRequestBody from '../model/RewardsUpdateRequestBody'; import RewardsUpdateResponseBody from '../model/RewardsUpdateResponseBody'; import RewardsAssignmentsUpdateRequestBody from '../model/RewardsAssignmentsUpdateRequestBody'; import RewardsAssignmentsUpdateResponseBody from '../model/RewardsAssignmentsUpdateResponseBody';