/**
* ValidationRules service.
* @module api/ValidationRulesApi
*/
export default class ValidationRulesApi {
/**
* Constructs a new ValidationRulesApi.
* @alias ValidationRulesApi
* @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 createValidationRuleAssignment operation.
* @callback createValidationRuleAssignmentCallback
* @param {Error|null} error Error object if failed, null otherwise.
* @param {ValidationRulesAssignmentsCreateResponseBody} [data] The data returned by the service call.
* @param {Object} [response] Full response object if successful.
*/
/**
* Create Validation Rules Assignments
* Assign validation rule to either one of the following objects: voucher, campaign, promotion tier, earning rule, reward, distribution.
* @param {String} validationRuleId Unique validation rule ID.
* @param {ValidationRulesAssignmentsCreateRequestBody} validationRulesAssignmentsCreateRequestBody Specify the resource that you would like to assign the validation rule to.
* @param {{
force?: Boolean,
}} [opts] Optional parameters
* @param {createValidationRuleAssignmentCallback} [callback] The callback function, accepting three arguments: error, data, response
* data is of type: {@link ValidationRulesAssignmentsCreateResponseBody}
* @returns {Promise<(ValidationRulesAssignmentsCreateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `ValidationRulesAssignmentsCreateResponseBody` object or with `undefined`.
*/
createValidationRuleAssignment(validationRuleId: string, validationRulesAssignmentsCreateRequestBody: ValidationRulesAssignmentsCreateRequestBody, opts?: {
force?: boolean;
}, callback?: (error: Error | null, data?: ValidationRulesAssignmentsCreateResponseBody, response?: any) => any): Promise<(ValidationRulesAssignmentsCreateResponseBody | undefined)>;
/**
* Callback function to receive the result of the createValidationRules operation.
* @callback createValidationRulesCallback
* @param {Error|null} error Error object if failed, null otherwise.
* @param {ValidationRulesCreateResponseBody} [data] The data returned by the service call.
* @param {Object} [response] Full response object if successful.
*/
/**
* Create Validation Rules
* Create a validation rule. Managing validation rules It is recommended to [create or update validation rules](/personalize/create-validation-rules) in the Voucherify dashboard. The rule builder in the dashboard helps configuring the desired conditions in a convenient way. The API should not be used as a preferable way to create and manage validation rules.
* @param {ValidationRulesCreateRequestBody} validationRulesCreateRequestBody Specify the validation rules parameters.
* @param {createValidationRulesCallback} [callback] The callback function, accepting three arguments: error, data, response
* data is of type: {@link ValidationRulesCreateResponseBody}
* @returns {Promise<(ValidationRulesCreateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `ValidationRulesCreateResponseBody` object or with `undefined`.
*/
createValidationRules(validationRulesCreateRequestBody: ValidationRulesCreateRequestBody, callback?: (error: Error | null, data?: ValidationRulesCreateResponseBody, response?: any) => any): Promise<(ValidationRulesCreateResponseBody | undefined)>;
/**
* Callback function to receive the result of the deleteValidationRuleAssignment operation.
* @callback deleteValidationRuleAssignmentCallback
* @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 Validation Rule Assignment
* This method deletes a validation rule assignment.
* @param {String} validationRuleId A unique validation rule ID.
* @param {String} assignmentId A unique validation rule assignment ID.
* @param {deleteValidationRuleAssignmentCallback} [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`.
*/
deleteValidationRuleAssignment(validationRuleId: string, assignmentId: string, callback?: (error: Error | null, data: any, response?: any) => any): Promise<(undefined)>;
/**
* Callback function to receive the result of the deleteValidationRules operation.
* @callback deleteValidationRulesCallback
* @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 Validation Rule
* This method deletes a validation rule.
* @param {String} validationRuleId A unique validation rule ID.
* @param {deleteValidationRulesCallback} [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`.
*/
deleteValidationRules(validationRuleId: string, callback?: (error: Error | null, data: any, response?: any) => any): Promise<(undefined)>;
/**
* Callback function to receive the result of the getValidationRule operation.
* @callback getValidationRuleCallback
* @param {Error|null} error Error object if failed, null otherwise.
* @param {ValidationRulesGetResponseBody} [data] The data returned by the service call.
* @param {Object} [response] Full response object if successful.
*/
/**
* Get Validation Rule
* Retrieve the details of a validation rule.
* @param {String} validationRuleId A unique validation rule ID.
* @param {getValidationRuleCallback} [callback] The callback function, accepting three arguments: error, data, response
* data is of type: {@link ValidationRulesGetResponseBody}
* @returns {Promise<(ValidationRulesGetResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `ValidationRulesGetResponseBody` object or with `undefined`.
*/
getValidationRule(validationRuleId: string, callback?: (error: Error | null, data?: ValidationRulesGetResponseBody, response?: any) => any): Promise<(ValidationRulesGetResponseBody | undefined)>;
/**
* Callback function to receive the result of the listValidationRuleAssignments operation.
* @callback listValidationRuleAssignmentsCallback
* @param {Error|null} error Error object if failed, null otherwise.
* @param {ValidationRulesAssignmentsListResponseBody} [data] The data returned by the service call.
* @param {Object} [response] Full response object if successful.
*/
/**
* List Validation Rule Assignments
* Retrieve validation rule assignments for a specific validation rule.
* @param {String} validationRuleId Unique validation rule ID.
* @param {{
limit?: Number,
page?: Number,
order?: Exclude,
}} [opts] Optional parameters
* @param {listValidationRuleAssignmentsCallback} [callback] The callback function, accepting three arguments: error, data, response
* data is of type: {@link ValidationRulesAssignmentsListResponseBody}
* @returns {Promise<(ValidationRulesAssignmentsListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `ValidationRulesAssignmentsListResponseBody` object or with `undefined`.
*/
listValidationRuleAssignments(validationRuleId: string, opts?: {
limit?: number;
page?: number;
order?: Exclude;
}, callback?: (error: Error | null, data?: ValidationRulesAssignmentsListResponseBody, response?: any) => any): Promise<(ValidationRulesAssignmentsListResponseBody | undefined)>;
/**
* Callback function to receive the result of the listValidationRules operation.
* @callback listValidationRulesCallback
* @param {Error|null} error Error object if failed, null otherwise.
* @param {ValidationRulesListResponseBody} [data] The data returned by the service call.
* @param {Object} [response] Full response object if successful.
*/
/**
* List Validation Rules
* Retrieve validation rules.
* @param {{
limit?: Number,
page?: Number,
order?: Exclude,
startDate?: Date,
endDate?: Date,
}} [opts] Optional parameters
* @param {listValidationRulesCallback} [callback] The callback function, accepting three arguments: error, data, response
* data is of type: {@link ValidationRulesListResponseBody}
* @returns {Promise<(ValidationRulesListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `ValidationRulesListResponseBody` object or with `undefined`.
*/
listValidationRules(opts?: {
limit?: number;
page?: number;
order?: Exclude;
startDate?: Date;
endDate?: Date;
}, callback?: (error: Error | null, data?: ValidationRulesListResponseBody, response?: any) => any): Promise<(ValidationRulesListResponseBody | undefined)>;
/**
* Callback function to receive the result of the listValidationRulesAssignments operation.
* @callback listValidationRulesAssignmentsCallback
* @param {Error|null} error Error object if failed, null otherwise.
* @param {ValidationRulesAssignmentsListResponseBody} [data] The data returned by the service call.
* @param {Object} [response] Full response object if successful.
*/
/**
* List Validation Rules' Assignment(s)
* List all validation rules assignments or filter the results using the related object ID or the validation rule ID query parameters.
* @param {{
relatedObjectId?: String,
rule?: String,
page?: Number,
limit?: Number,
order?: String,
}} [opts] Optional parameters
* @param {listValidationRulesAssignmentsCallback} [callback] The callback function, accepting three arguments: error, data, response
* data is of type: {@link ValidationRulesAssignmentsListResponseBody}
* @returns {Promise<(ValidationRulesAssignmentsListResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `ValidationRulesAssignmentsListResponseBody` object or with `undefined`.
*/
listValidationRulesAssignments(opts?: {
relatedObjectId?: string;
rule?: string;
page?: number;
limit?: number;
order?: string;
}, callback?: (error: Error | null, data?: ValidationRulesAssignmentsListResponseBody, response?: any) => any): Promise<(ValidationRulesAssignmentsListResponseBody | undefined)>;
/**
* Callback function to receive the result of the updateValidationRule operation.
* @callback updateValidationRuleCallback
* @param {Error|null} error Error object if failed, null otherwise.
* @param {ValidationRulesUpdateResponseBody} [data] The data returned by the service call.
* @param {Object} [response] Full response object if successful.
*/
/**
* Update Validation Rule
* Update validation rule parameters. Managing validation rules It is recommended to [create or update validation rules](/personalize/create-validation-rules) in the Voucherify dashboard. The rule builder in the dashboard helps configuring the desired conditions in a convenient way. The API should not be used as a preferable way to create and manage validation rules.
* @param {String} validationRuleId A unique validation rule ID.
* @param {ValidationRulesUpdateRequestBody} validationRulesUpdateRequestBody Specify the parameters to be updated.
* @param {updateValidationRuleCallback} [callback] The callback function, accepting three arguments: error, data, response
* data is of type: {@link ValidationRulesUpdateResponseBody}
* @returns {Promise<(ValidationRulesUpdateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `ValidationRulesUpdateResponseBody` object or with `undefined`.
*/
updateValidationRule(validationRuleId: string, validationRulesUpdateRequestBody: ValidationRulesUpdateRequestBody, callback?: (error: Error | null, data?: ValidationRulesUpdateResponseBody, response?: any) => any): Promise<(ValidationRulesUpdateResponseBody | undefined)>;
}
import ValidationRulesAssignmentsCreateRequestBody from '../model/ValidationRulesAssignmentsCreateRequestBody';
import ValidationRulesAssignmentsCreateResponseBody from '../model/ValidationRulesAssignmentsCreateResponseBody';
import ValidationRulesCreateRequestBody from '../model/ValidationRulesCreateRequestBody';
import ValidationRulesCreateResponseBody from '../model/ValidationRulesCreateResponseBody';
import ValidationRulesGetResponseBody from '../model/ValidationRulesGetResponseBody';
import ParameterOrderListValidationRuleAssignments from '../model/ParameterOrderListValidationRuleAssignments';
import ValidationRulesAssignmentsListResponseBody from '../model/ValidationRulesAssignmentsListResponseBody';
import ParameterOrderListValidationRules from '../model/ParameterOrderListValidationRules';
import ValidationRulesListResponseBody from '../model/ValidationRulesListResponseBody';
import ValidationRulesUpdateRequestBody from '../model/ValidationRulesUpdateRequestBody';
import ValidationRulesUpdateResponseBody from '../model/ValidationRulesUpdateResponseBody';