/** * Promotions service. * @module api/PromotionsApi */ export default class PromotionsApi { /** * Constructs a new PromotionsApi. * @alias PromotionsApi * @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 addPromotionTierToCampaign operation. * @callback addPromotionTierToCampaignCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {PromotionsTiersCreateResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Add Promotion Tier to Campaign * This method allows you to add a new promotion tier to an existing campaign. The tier hierarchy will be set as the next consequtive integer following the lowest ranking tier. * @param {String} campaignId Unique campaign ID assigned by Voucherify. * @param {PromotionsTiersCreateRequestBody} promotionsTiersCreateRequestBody Specify the promotion tier parameters. * @param {addPromotionTierToCampaignCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link PromotionsTiersCreateResponseBody} * @returns {Promise<(PromotionsTiersCreateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `PromotionsTiersCreateResponseBody` object or with `undefined`. */ addPromotionTierToCampaign(campaignId: string, promotionsTiersCreateRequestBody: PromotionsTiersCreateRequestBody, callback?: (error: Error | null, data?: PromotionsTiersCreateResponseBody, response?: any) => any): Promise<(PromotionsTiersCreateResponseBody | undefined)>; /** * Callback function to receive the result of the createPromotionStack operation. * @callback createPromotionStackCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {PromotionsStacksCreateResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Create Promotion Stack * This method creates one promotion stack. The sequence of promotion tier IDs will determine the promotion stacking order. * @param {String} campaignId Unique campaign ID. * @param {PromotionsStacksCreateRequestBody} promotionsStacksCreateRequestBody Specify the order of promotion tiers for the promotion stack. * @param {createPromotionStackCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link PromotionsStacksCreateResponseBody} * @returns {Promise<(PromotionsStacksCreateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `PromotionsStacksCreateResponseBody` object or with `undefined`. */ createPromotionStack(campaignId: string, promotionsStacksCreateRequestBody: PromotionsStacksCreateRequestBody, callback?: (error: Error | null, data?: PromotionsStacksCreateResponseBody, response?: any) => any): Promise<(PromotionsStacksCreateResponseBody | undefined)>; /** * Callback function to receive the result of the deletePromotionStack operation. * @callback deletePromotionStackCallback * @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 Promotion Stack * This method deletes a promotion stack. * @param {String} campaignId ID of the promotion campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty Campaign. * @param {String} stackId Promotion stack ID. * @param {deletePromotionStackCallback} [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`. */ deletePromotionStack(campaignId: string, stackId: string, callback?: (error: Error | null, data: any, response?: any) => any): Promise<(undefined)>; /** * Callback function to receive the result of the deletePromotionTier operation. * @callback deletePromotionTierCallback * @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 Promotion Tier * This method deletes a promotion tier. * @param {String} promotionTierId Unique promotion tier ID. * @param {deletePromotionTierCallback} [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`. */ deletePromotionTier(promotionTierId: string, callback?: (error: Error | null, data: any, response?: any) => any): Promise<(undefined)>; /** * Callback function to receive the result of the disablePromotionTier operation. * @callback disablePromotionTierCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {PromotionsTiersDisableResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Disable Promotion Tier * This method disables a promotion tier, i.e. makes the active parameter false. * @param {String} promotionTierId Unique promotion tier ID. * @param {disablePromotionTierCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link PromotionsTiersDisableResponseBody} * @returns {Promise<(PromotionsTiersDisableResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `PromotionsTiersDisableResponseBody` object or with `undefined`. */ disablePromotionTier(promotionTierId: string, callback?: (error: Error | null, data?: PromotionsTiersDisableResponseBody, response?: any) => any): Promise<(PromotionsTiersDisableResponseBody | undefined)>; /** * Callback function to receive the result of the enablePromotionTier operation. * @callback enablePromotionTierCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {PromotionsTiersEnableResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Enable Promotion Tier * This method enables a promotion tier, i.e. makes the active parameter true. * @param {String} promotionTierId Unique promotion tier ID. * @param {enablePromotionTierCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link PromotionsTiersEnableResponseBody} * @returns {Promise<(PromotionsTiersEnableResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `PromotionsTiersEnableResponseBody` object or with `undefined`. */ enablePromotionTier(promotionTierId: string, callback?: (error: Error | null, data?: PromotionsTiersEnableResponseBody, response?: any) => any): Promise<(PromotionsTiersEnableResponseBody | undefined)>; /** * Callback function to receive the result of the getPromotionStack operation. * @callback getPromotionStackCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {PromotionsStacksGetResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Get Promotion Stack * This method returns the details of a promotion stack, including the promotion tiers grouped within the stack. * @param {String} campaignId ID of the promotion campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty Campaign. * @param {String} stackId Promotion stack ID. * @param {getPromotionStackCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link PromotionsStacksGetResponseBody} * @returns {Promise<(PromotionsStacksGetResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `PromotionsStacksGetResponseBody` object or with `undefined`. */ getPromotionStack(campaignId: string, stackId: string, callback?: (error: Error | null, data?: PromotionsStacksGetResponseBody, response?: any) => any): Promise<(PromotionsStacksGetResponseBody | undefined)>; /** * Callback function to receive the result of the getPromotionTier operation. * @callback getPromotionTierCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {PromotionsTiersGetResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Get Promotion Tier * This method enables you to retrieve a specific promotion tier. * @param {String} promotionTierId Unique promotion tier ID. * @param {getPromotionTierCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link PromotionsTiersGetResponseBody} * @returns {Promise<(PromotionsTiersGetResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `PromotionsTiersGetResponseBody` object or with `undefined`. */ getPromotionTier(promotionTierId: string, callback?: (error: Error | null, data?: PromotionsTiersGetResponseBody, response?: any) => any): Promise<(PromotionsTiersGetResponseBody | undefined)>; /** * Callback function to receive the result of the listAllPromotionStacks operation. * @callback listAllPromotionStacksCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {PromotionsStacksListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List Promotion Stacks * This method enables you to list promotion stacks irrespective of the campaign they are associated with. You can use filters in the query parameters to specify the stacks to be returned in the response. # Advanced filters for fetching promotion stacks * @param {{ limit?: Number, page?: Number, order?: Exclude, createdAt?: ParameterCreatedBeforeAfter, updatedAt?: ParameterUpdatedBeforeAfter, }} [opts] Optional parameters * @param {listAllPromotionStacksCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link PromotionsStacksListResponseBody} * @returns {Promise<(PromotionsStacksListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `PromotionsStacksListResponseBody` object or with `undefined`. */ listAllPromotionStacks(opts?: { limit?: number; page?: number; order?: Exclude; createdAt?: ParameterCreatedBeforeAfter; updatedAt?: ParameterUpdatedBeforeAfter; }, callback?: (error: Error | null, data?: PromotionsStacksListResponseBody, response?: any) => any): Promise<(PromotionsStacksListResponseBody | undefined)>; /** * Callback function to receive the result of the listPromotionStacksInCampaign operation. * @callback listPromotionStacksInCampaignCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {PromotionsStacksListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List Promotion Stacks in Campaign * This method enables you to list promotion stacks from a specified campaign. * @param {String} campaignId Unique campaign ID. * @param {listPromotionStacksInCampaignCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link PromotionsStacksListResponseBody} * @returns {Promise<(PromotionsStacksListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `PromotionsStacksListResponseBody` object or with `undefined`. */ listPromotionStacksInCampaign(campaignId: string, callback?: (error: Error | null, data?: PromotionsStacksListResponseBody, response?: any) => any): Promise<(PromotionsStacksListResponseBody | undefined)>; /** * Callback function to receive the result of the listPromotionTiers operation. * @callback listPromotionTiersCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {PromotionsTiersListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List Promotion Tiers * This method enables you to list promotion tiers. * @param {{ isAvailable?: Boolean, limit?: Number, page?: Number, order?: Exclude, }} [opts] Optional parameters * @param {listPromotionTiersCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link PromotionsTiersListResponseBody} * @returns {Promise<(PromotionsTiersListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `PromotionsTiersListResponseBody` object or with `undefined`. */ listPromotionTiers(opts?: { isAvailable?: boolean; limit?: number; page?: number; order?: Exclude; }, callback?: (error: Error | null, data?: PromotionsTiersListResponseBody, response?: any) => any): Promise<(PromotionsTiersListResponseBody | undefined)>; /** * Callback function to receive the result of the listPromotionTiersFromCampaign operation. * @callback listPromotionTiersFromCampaignCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {PromotionsTiersListResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * List Promotion Tiers from Campaign * This method enables you to list promotion tiers from a specified campaign. * @param {String} campaignId Unique campaign ID assigned by Voucherify. * @param {listPromotionTiersFromCampaignCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link PromotionsTiersListResponseBody} * @returns {Promise<(PromotionsTiersListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `PromotionsTiersListResponseBody` object or with `undefined`. */ listPromotionTiersFromCampaign(campaignId: string, callback?: (error: Error | null, data?: PromotionsTiersListResponseBody, response?: any) => any): Promise<(PromotionsTiersListResponseBody | undefined)>; /** * Callback function to receive the result of the updatePromotionStack operation. * @callback updatePromotionStackCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {PromotionsStacksUpdateResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Update Promotion Stack * This methods allows for editing an existing stack. * @param {String} campaignId ID of the promotion campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value, e.g., Loyalty Campaign. * @param {String} stackId Promotion stack ID. * @param {PromotionsStacksUpdateRequestBody} promotionsStacksUpdateRequestBody Specify the promotion stack parameters that you would like to update. * @param {updatePromotionStackCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link PromotionsStacksUpdateResponseBody} * @returns {Promise<(PromotionsStacksUpdateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `PromotionsStacksUpdateResponseBody` object or with `undefined`. */ updatePromotionStack(campaignId: string, stackId: string, promotionsStacksUpdateRequestBody: PromotionsStacksUpdateRequestBody, callback?: (error: Error | null, data?: PromotionsStacksUpdateResponseBody, response?: any) => any): Promise<(PromotionsStacksUpdateResponseBody | undefined)>; /** * Callback function to receive the result of the updatePromotionTier operation. * @callback updatePromotionTierCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {PromotionsTiersUpdateResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Update Promotion Tier * This method updates a promotion tier. * @param {String} promotionTierId Unique promotion tier ID. * @param {PromotionsTiersUpdateRequestBody} promotionsTiersUpdateRequestBody Specify the promotion tier parameters that you would like to update. * @param {updatePromotionTierCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link PromotionsTiersUpdateResponseBody} * @returns {Promise<(PromotionsTiersUpdateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `PromotionsTiersUpdateResponseBody` object or with `undefined`. */ updatePromotionTier(promotionTierId: string, promotionsTiersUpdateRequestBody: PromotionsTiersUpdateRequestBody, callback?: (error: Error | null, data?: PromotionsTiersUpdateResponseBody, response?: any) => any): Promise<(PromotionsTiersUpdateResponseBody | undefined)>; } import PromotionsTiersCreateRequestBody from '../model/PromotionsTiersCreateRequestBody'; import PromotionsTiersCreateResponseBody from '../model/PromotionsTiersCreateResponseBody'; import PromotionsStacksCreateRequestBody from '../model/PromotionsStacksCreateRequestBody'; import PromotionsStacksCreateResponseBody from '../model/PromotionsStacksCreateResponseBody'; import PromotionsTiersDisableResponseBody from '../model/PromotionsTiersDisableResponseBody'; import PromotionsTiersEnableResponseBody from '../model/PromotionsTiersEnableResponseBody'; import PromotionsStacksGetResponseBody from '../model/PromotionsStacksGetResponseBody'; import PromotionsTiersGetResponseBody from '../model/PromotionsTiersGetResponseBody'; import ParameterOrderListAllPromotionStacks from '../model/ParameterOrderListAllPromotionStacks'; import ParameterCreatedBeforeAfter from '../model/ParameterCreatedBeforeAfter'; import ParameterUpdatedBeforeAfter from '../model/ParameterUpdatedBeforeAfter'; import PromotionsStacksListResponseBody from '../model/PromotionsStacksListResponseBody'; import ParameterOrderListPromotionTiers from '../model/ParameterOrderListPromotionTiers'; import PromotionsTiersListResponseBody from '../model/PromotionsTiersListResponseBody'; import PromotionsStacksUpdateRequestBody from '../model/PromotionsStacksUpdateRequestBody'; import PromotionsStacksUpdateResponseBody from '../model/PromotionsStacksUpdateResponseBody'; import PromotionsTiersUpdateRequestBody from '../model/PromotionsTiersUpdateRequestBody'; import PromotionsTiersUpdateResponseBody from '../model/PromotionsTiersUpdateResponseBody';