/**
* Templates service.
* @module api/TemplatesApi
*/
export default class TemplatesApi {
/**
* Constructs a new TemplatesApi.
* @alias TemplatesApi
* @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 addTierFromTemplate operation.
* @callback addTierFromTemplateCallback
* @param {Error|null} error Error object if failed, null otherwise.
* @param {TemplatesCampaignsTierSetupCreateResponseBody} [data] The data returned by the service call.
* @param {Object} [response] Full response object if successful.
*/
/**
* Add Promotion Tier From Template
* Creates a promotion tier out of a discount campaign template and adds it to an existing promotion campaign. To add a promotion tier to a campaign, you need to provide the name in the request and the campaign ID. Other fields are optional. If no other fields are sent, the configuration from the template will be used. You can send new values of the fields listed below to replace the settings saved in the template. However, you cannot assign an action or an existing validation rule or create a new one in the request. If the template has a validation rule, a new validation rule is always created for the promotion tier. When the promotion tier has been created, then you can: - [Update the validation rule](/api-reference/validation-rules/update-validation-rule), - [Unassign the validation rule](/api-reference/validation-rules/delete-validation-rule-assignment), - [Assign an existing validation rule](/api-reference/validation-rules/create-validation-rule-assignment). Promotion Tiers and Campaign Templates You can create a campaign template out of a promotion tier. Promotion tiers are converted to a discount campaign with the DISCOUNT_COUPON type. You can use this template to create: - [Discount campaign](/api-reference/templates/create-campaign-from-template) - [Promotion tier](/api-reference/templates/add-promotion-tier-from-template) Campaign Templates – Documentation Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.
* @param {String} campaignTemplateId Pass the campaign template ID that was assigned by Voucherify.
* @param {TemplatesCampaignsTierSetupCreateRequestBody} templatesCampaignsTierSetupCreateRequestBody Only name and campaign_id are required. The rest of the fields will overwrite the template configuration.
* @param {addTierFromTemplateCallback} [callback] The callback function, accepting three arguments: error, data, response
* data is of type: {@link TemplatesCampaignsTierSetupCreateResponseBody}
* @returns {Promise<(TemplatesCampaignsTierSetupCreateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `TemplatesCampaignsTierSetupCreateResponseBody` object or with `undefined`.
*/
addTierFromTemplate(campaignTemplateId: string, templatesCampaignsTierSetupCreateRequestBody: TemplatesCampaignsTierSetupCreateRequestBody, callback?: (error: Error | null, data?: TemplatesCampaignsTierSetupCreateResponseBody, response?: any) => any): Promise<(TemplatesCampaignsTierSetupCreateResponseBody | undefined)>;
/**
* Callback function to receive the result of the createCampaignFromTemplate operation.
* @callback createCampaignFromTemplateCallback
* @param {Error|null} error Error object if failed, null otherwise.
* @param {TemplatesCampaignsCampaignSetupCreateResponseBody} [data] The data returned by the service call.
* @param {Object} [response] Full response object if successful.
*/
/**
* Create Campaign From Template
* Creates a campaign out of a campaign template. To create a campaign, you need to provide the name in the request, while other fields are optional. If no other fields are sent, the configuration from the template will be used. You can send new values of the fields listed below to replace the settings saved in the template. However, you cannot assign an existing validation rule or create a new one in the request. If the template has a validation rule, a new validation rule is always created for the campaign. When the campaign has been created, then you can: - [Update the validation rule](/api-reference/validation-rules/update-validation-rule), - [Unassign the validation rule](/api-reference/validation-rules/delete-validation-rule-assignment), - [Assign an existing validation rule](/api-reference/validation-rules/create-validation-rules-assignments). Promotion Tiers and Campaign Templates You can create a campaign template out of a promotion tier. Promotion tiers are converted to a discount campaign with the DISCOUNT_COUPON type. You can use this template to create: - [Discount campaign](/api-reference/templates/create-campaign-from-template) - [Promotion tier](/api-reference/templates/add-promotion-tier-from-template) Campaign Templates – Documentation Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.
* @param {String} campaignTemplateId Pass the campaign template ID that was assigned by Voucherify.
* @param {TemplatesCampaignsCampaignSetupCreateRequestBody} templatesCampaignsCampaignSetupCreateRequestBody Only name is required. The rest of the fields will overwrite the template configuration.
* @param {createCampaignFromTemplateCallback} [callback] The callback function, accepting three arguments: error, data, response
* data is of type: {@link TemplatesCampaignsCampaignSetupCreateResponseBody}
* @returns {Promise<(TemplatesCampaignsCampaignSetupCreateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `TemplatesCampaignsCampaignSetupCreateResponseBody` object or with `undefined`.
*/
createCampaignFromTemplate(campaignTemplateId: string, templatesCampaignsCampaignSetupCreateRequestBody: TemplatesCampaignsCampaignSetupCreateRequestBody, callback?: (error: Error | null, data?: TemplatesCampaignsCampaignSetupCreateResponseBody, response?: any) => any): Promise<(TemplatesCampaignsCampaignSetupCreateResponseBody | undefined)>;
/**
* Callback function to receive the result of the createCampaignTemplate operation.
* @callback createCampaignTemplateCallback
* @param {Error|null} error Error object if failed, null otherwise.
* @param {TemplatesCampaignsCreateTemplateResponseBody} [data] The data returned by the service call.
* @param {Object} [response] Full response object if successful.
*/
/**
* Create Campaign Template
* Creates a template for a discount or gift campaign, or a promotion tier. A template stores campaign configuration **without** the following details: - Campaign name - Category - Code count The following elements are not supported by campaign templates: - Redeeming API keys - Redeeming users - Customer loyalty tier - Static segments Promotion Tiers and Campaign Templates You can create a campaign template out of a promotion tier. Promotion tiers are converted to a discount campaign with the DISCOUNT_COUPON type. You can use this template to create: - [Discount campaign](/api-reference/templates/create-campaign-from-template), - [Promotion tier](/api-reference/templates/add-promotion-tier-from-template). Campaign Templates – Documentation Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.
* @param {TemplatesCampaignsCreateRequestBody} templatesCampaignsCreateRequestBody Provide details for a campaign template
* @param {createCampaignTemplateCallback} [callback] The callback function, accepting three arguments: error, data, response
* data is of type: {@link TemplatesCampaignsCreateTemplateResponseBody}
* @returns {Promise<(TemplatesCampaignsCreateTemplateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `TemplatesCampaignsCreateTemplateResponseBody` object or with `undefined`.
*/
createCampaignTemplate(templatesCampaignsCreateRequestBody: TemplatesCampaignsCreateRequestBody, callback?: (error: Error | null, data?: TemplatesCampaignsCreateTemplateResponseBody, response?: any) => any): Promise<(TemplatesCampaignsCreateTemplateResponseBody | undefined)>;
/**
* Callback function to receive the result of the deleteCampaignTemplate operation.
* @callback deleteCampaignTemplateCallback
* @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 Campaign Template
* Deletes the campaign template permanently. Campaign Templates – Documentation Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.
* @param {String} campaignTemplateId Pass the campaign template ID that was assigned by Voucherify.
* @param {deleteCampaignTemplateCallback} [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`.
*/
deleteCampaignTemplate(campaignTemplateId: string, callback?: (error: Error | null, data: any, response?: any) => any): Promise<(undefined)>;
/**
* Callback function to receive the result of the getCampaignTemplate operation.
* @callback getCampaignTemplateCallback
* @param {Error|null} error Error object if failed, null otherwise.
* @param {TemplatesCampaignsGetResponseBody} [data] The data returned by the service call.
* @param {Object} [response] Full response object if successful.
*/
/**
* Get Campaign Template
* Retrieves a campaign template available in the project. Campaign Templates – Documentation Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.
* @param {String} campaignTemplateId Pass the campaign template ID that was assigned by Voucherify.
* @param {getCampaignTemplateCallback} [callback] The callback function, accepting three arguments: error, data, response
* data is of type: {@link TemplatesCampaignsGetResponseBody}
* @returns {Promise<(TemplatesCampaignsGetResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `TemplatesCampaignsGetResponseBody` object or with `undefined`.
*/
getCampaignTemplate(campaignTemplateId: string, callback?: (error: Error | null, data?: TemplatesCampaignsGetResponseBody, response?: any) => any): Promise<(TemplatesCampaignsGetResponseBody | undefined)>;
/**
* Callback function to receive the result of the listCampaignTemplates operation.
* @callback listCampaignTemplatesCallback
* @param {Error|null} error Error object if failed, null otherwise.
* @param {TemplatesCampaignsListResponseBody} [data] The data returned by the service call.
* @param {Object} [response] Full response object if successful.
*/
/**
* List Campaign Templates
* Lists all campaign templates available in the project. Campaign Templates – Documentation Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.
* @param {{
limit?: Number,
startingAfterId?: String,
order?: Exclude,
includeTotal?: Boolean,
filters?: ParameterFiltersListTemplates,
}} [opts] Optional parameters
* @param {listCampaignTemplatesCallback} [callback] The callback function, accepting three arguments: error, data, response
* data is of type: {@link TemplatesCampaignsListResponseBody}
* @returns {Promise<(TemplatesCampaignsListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `TemplatesCampaignsListResponseBody` object or with `undefined`.
*/
listCampaignTemplates(opts?: {
limit?: number;
startingAfterId?: string;
order?: Exclude;
includeTotal?: boolean;
filters?: ParameterFiltersListTemplates;
}, callback?: (error: Error | null, data?: TemplatesCampaignsListResponseBody, response?: any) => any): Promise<(TemplatesCampaignsListResponseBody | undefined)>;
/**
* Callback function to receive the result of the updateCampaignTemplate operation.
* @callback updateCampaignTemplateCallback
* @param {Error|null} error Error object if failed, null otherwise.
* @param {TemplatesCampaignsUpdateResponseBody} [data] The data returned by the service call.
* @param {Object} [response] Full response object if successful.
*/
/**
* Update Campaign Template
* Updates the name or description of the campaign template. Campaign Templates – Documentation Read the [Campaign Templates documentation](/build/campaign-templates) to learn more about this feature.
* @param {String} campaignTemplateId Pass the campaign template ID that was assigned by Voucherify.
* @param {TemplatesCampaignsUpdateRequestBody} templatesCampaignsUpdateRequestBody Provide the new name or description for the campaign template
* @param {updateCampaignTemplateCallback} [callback] The callback function, accepting three arguments: error, data, response
* data is of type: {@link TemplatesCampaignsUpdateResponseBody}
* @returns {Promise<(TemplatesCampaignsUpdateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `TemplatesCampaignsUpdateResponseBody` object or with `undefined`.
*/
updateCampaignTemplate(campaignTemplateId: string, templatesCampaignsUpdateRequestBody: TemplatesCampaignsUpdateRequestBody, callback?: (error: Error | null, data?: TemplatesCampaignsUpdateResponseBody, response?: any) => any): Promise<(TemplatesCampaignsUpdateResponseBody | undefined)>;
}
import TemplatesCampaignsTierSetupCreateRequestBody from '../model/TemplatesCampaignsTierSetupCreateRequestBody';
import TemplatesCampaignsTierSetupCreateResponseBody from '../model/TemplatesCampaignsTierSetupCreateResponseBody';
import TemplatesCampaignsCampaignSetupCreateRequestBody from '../model/TemplatesCampaignsCampaignSetupCreateRequestBody';
import TemplatesCampaignsCampaignSetupCreateResponseBody from '../model/TemplatesCampaignsCampaignSetupCreateResponseBody';
import TemplatesCampaignsCreateRequestBody from '../model/TemplatesCampaignsCreateRequestBody';
import TemplatesCampaignsCreateTemplateResponseBody from '../model/TemplatesCampaignsCreateTemplateResponseBody';
import TemplatesCampaignsGetResponseBody from '../model/TemplatesCampaignsGetResponseBody';
import ParameterTemplatesList from '../model/ParameterTemplatesList';
import ParameterFiltersListTemplates from '../model/ParameterFiltersListTemplates';
import TemplatesCampaignsListResponseBody from '../model/TemplatesCampaignsListResponseBody';
import TemplatesCampaignsUpdateRequestBody from '../model/TemplatesCampaignsUpdateRequestBody';
import TemplatesCampaignsUpdateResponseBody from '../model/TemplatesCampaignsUpdateResponseBody';