Class: VoucherifySdk::ValidationRulesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/VoucherifySdk/api/validation_rules_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ValidationRulesApi

Returns a new instance of ValidationRulesApi.



19
20
21
# File 'lib/VoucherifySdk/api/validation_rules_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/VoucherifySdk/api/validation_rules_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_validation_rule_assignment(validation_rule_id, opts = {}) ⇒ ValidationRulesAssignmentsCreateResponseBody

Create Validation Rules Assignments Assign validation rule to either one of the following objects: voucher, campaign, promotion tier, earning rule, reward, distribution.

Parameters:

  • validation_rule_id (String)

    Unique validation rule ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :force (Boolean)

    If this flag is set to true, the previous assignment with the same data will be deleted and a new one will be added.

  • :validation_rules_assignments_create_request_body (ValidationRulesAssignmentsCreateRequestBody)

    Specify the resource that you would like to assign the validation rule to.

Returns:



29
30
31
32
# File 'lib/VoucherifySdk/api/validation_rules_api.rb', line 29

def create_validation_rule_assignment(validation_rule_id, opts = {})
  data, _status_code, _headers = create_validation_rule_assignment_with_http_info(validation_rule_id, opts)
  data
end

#create_validation_rules(opts = {}) ⇒ ValidationRulesCreateResponseBody

Create Validation Rules Create validation rules.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



96
97
98
99
# File 'lib/VoucherifySdk/api/validation_rules_api.rb', line 96

def create_validation_rules(opts = {})
  data, _status_code, _headers = create_validation_rules_with_http_info(opts)
  data
end

#delete_validation_rule_assignment(validation_rule_id, assignment_id, opts = {}) ⇒ nil

Delete Validation Rule Assignment This method deletes a validation rule assignment.

Parameters:

  • validation_rule_id (String)

    A unique validation rule ID.

  • assignment_id (String)

    A unique validation rule assignment ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


161
162
163
164
# File 'lib/VoucherifySdk/api/validation_rules_api.rb', line 161

def delete_validation_rule_assignment(validation_rule_id, assignment_id, opts = {})
  delete_validation_rule_assignment_with_http_info(validation_rule_id, assignment_id, opts)
  nil
end

#delete_validation_rules(validation_rule_id, opts = {}) ⇒ nil

Delete Validation Rule This method deletes a validation rule.

Parameters:

  • validation_rule_id (String)

    A unique validation rule ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


219
220
221
222
# File 'lib/VoucherifySdk/api/validation_rules_api.rb', line 219

def delete_validation_rules(validation_rule_id, opts = {})
  delete_validation_rules_with_http_info(validation_rule_id, opts)
  nil
end

#get_validation_rule(validation_rule_id, opts = {}) ⇒ ValidationRulesGetResponseBody

Get Validation Rule Retrieve the details of a validation rule.

Parameters:

  • validation_rule_id (String)

    A unique validation rule ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



276
277
278
279
# File 'lib/VoucherifySdk/api/validation_rules_api.rb', line 276

def get_validation_rule(validation_rule_id, opts = {})
  data, _status_code, _headers = get_validation_rule_with_http_info(validation_rule_id, opts)
  data
end

#list_validation_rule_assignments(validation_rule_id, opts = {}) ⇒ ValidationRulesAssignmentsListResponseBody

List Validation Rule Assignments Retrieve validation rule assignments for a specific validation rule.

Parameters:

  • validation_rule_id (String)

    Unique validation rule ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.

  • :page (Integer)

    Which page of results to return. The lowest value is 1.

  • :order (ParameterOrderListValidationRuleAssignments)

    This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.

Returns:



338
339
340
341
# File 'lib/VoucherifySdk/api/validation_rules_api.rb', line 338

def list_validation_rule_assignments(validation_rule_id, opts = {})
  data, _status_code, _headers = list_validation_rule_assignments_with_http_info(validation_rule_id, opts)
  data
end

#list_validation_rules(opts = {}) ⇒ ValidationRulesListResponseBody

List Validation Rules Retrieve validation rules.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.

  • :page (Integer)

    Which page of results to return. The lowest value is 1.

  • :order (ParameterOrderListValidationRules)

    This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.

  • :start_date (Time)

    Timestamp representing the date and time which results must start on. Represented in ISO 8601 format.

  • :end_date (Time)

    Timestamp representing the date and time which results must end on. Represented in ISO 8601 format.

Returns:



407
408
409
410
# File 'lib/VoucherifySdk/api/validation_rules_api.rb', line 407

def list_validation_rules(opts = {})
  data, _status_code, _headers = list_validation_rules_with_http_info(opts)
  data
end

#list_validation_rules_assignments(opts = {}) ⇒ ValidationRulesAssignmentsListResponseBody

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. # How to retrieve specific validation rule assignments(s) ## Related object ID To find an assignment for a particular resource, you can use the ID of the object to which the validation rule was assigned. This could be, for example, an ID of a: voucher, campaign, distribution, reward assignment, earning rule, promotion tier. ## Validation rule ID You can use the validation rule ID to find assignment(s) for a specific validation rule.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :related_object_id (String)

    The resource ID to which the validation rule was assigned; this could be, for example, a resource ID of a voucher, campaign, earning rule, reward assignment, promotion tier, or distribution.

  • :rule (String)

    Validation rule ID.

  • :page (Integer)

    Which page of results to return. The lowest value is 1.

  • :limit (Integer)

    Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.

  • :order (String)

    Sorts the results using one of the filtering options: -created_at, created_at, where the dash - preceding a sorting option means sorting in a descending order.

Returns:



479
480
481
482
# File 'lib/VoucherifySdk/api/validation_rules_api.rb', line 479

def list_validation_rules_assignments(opts = {})
  data, _status_code, _headers = list_validation_rules_assignments_with_http_info(opts)
  data
end

#update_validation_rule(validation_rule_id, opts = {}) ⇒ ValidationRulesUpdateResponseBody

Update Validation Rule Update validation rule parameters.

Parameters:

  • validation_rule_id (String)

    A unique validation rule ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



548
549
550
551
# File 'lib/VoucherifySdk/api/validation_rules_api.rb', line 548

def update_validation_rule(validation_rule_id, opts = {})
  data, _status_code, _headers = update_validation_rule_with_http_info(validation_rule_id, opts)
  data
end