import { gracely } from "gracely" import { http } from "cloudly-http" import { Rule } from "../Rule" export class Rules { constructor(private readonly client: http.Client) {} async create(rule: Rule): Promise { return this.client.post(`/rule`, rule) } async list(): Promise { return this.client.get(`/rule`) } async replace(rule: Rule): Promise { return this.client.put(`/rule/${rule.code}`, rule) } async remove(code: string): Promise { return this.client.delete(`/rule/${code}`) } }