lib/voucherify/service/validation_rules.rb in voucherify-1.6.1 vs lib/voucherify/service/validation_rules.rb in voucherify-2.0.0

- old
+ new

@@ -11,10 +11,14 @@ def create(validation_rules) @client.post('/validation-rules', validation_rules.to_json) end + def list(query) + @client.get('/validation-rules', query) + end + def get(id) @client.get("/validation-rules/#{URI.encode(id)}") end def update(validation_rules) @@ -22,8 +26,20 @@ end def delete(id) @client.delete("/validation-rules/#{URI.encode(id)}") end + + def createAssignment(id, assignment) + @client.post("/validation-rules/#{URI.encode(id)}/assignments", assignment.to_json) + end + + def deleteAssignment(rule_id, assignment_id) + @client.delete("/validation-rules/#{URI.encode(rule_id)}/assignments/#{URI.encode(assignment_id)}") + end + + def listAssignments(id, query) + @client.get("/validation-rules/#{URI.encode(id)}/assignments", query) + end end end -end \ No newline at end of file +end