diff --git a/api.go b/api.go index ba4a311..c438b85 100644 --- a/api.go +++ b/api.go @@ -2223,6 +2223,8 @@ func getResponseSiteRuleBody(response []byte) (ResponseSiteRuleBody, error) { // GetAllSiteRules Lists the Site Rules func (sc *Client) GetAllSiteRules(corpName, siteName string) (ResponseSiteRuleBodyList, error) { resp, err := sc.doRequest("GET", fmt.Sprintf("/v0/corps/%s/sites/%s/rules", corpName, siteName), "") +func (sc *Client) GetAllSiteRules(corpName, siteName string, limit, page int) (ResponseSiteRuleBodyList, error) { + resp, err := sc.doRequest("GET", fmt.Sprintf("/v0/corps/%s/sites/%s/rules?limit=%d&page=%d", corpName, siteName, limit, page), "") if err != nil { return ResponseSiteRuleBodyList{}, err diff --git a/api_test.go b/api_test.go index ebe06b3..5353e1a 100644 --- a/api_test.go +++ b/api_test.go @@ -261,7 +261,7 @@ func TestCreateReadUpdateDeleteSiteRules(t *testing.T) { t.Errorf("CreateSiteRules got: %v expected %v", updateResp, updateSiteRuleBody) } - readall, err := sc.GetAllSiteRules(corp, site) + readall, err := sc.GetAllSiteRules(corp, site, 20, 1) if err != nil { t.Fatal(err) } @@ -336,14 +336,14 @@ func TestDeleteAllSiteRules(t *testing.T) { sc := NewTokenClient(testcreds.email, testcreds.token) corp := testcreds.corp site := testcreds.site - respList, err := sc.GetAllSiteRules(corp, site) + respList, err := sc.GetAllSiteRules(corp, site, 20, 1) if err != nil { t.Fatal(err) } for _, rule := range respList.Data { sc.DeleteSiteRuleByID(corp, site, rule.ID) } - respList, err = sc.GetAllSiteRules(corp, site) + respList, err = sc.GetAllSiteRules(corp, site, 20, 1) if err != nil { t.Fatal(err) }