Skip to content

Commit

Permalink
refactor!: use int64 type in ID methods
Browse files Browse the repository at this point in the history
I missed updating these on my previous PR.
  • Loading branch information
raul-te committed Jul 14, 2022
1 parent 9402af1 commit 1da73f4
Show file tree
Hide file tree
Showing 32 changed files with 75 additions and 75 deletions.
2 changes: 1 addition & 1 deletion agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (c *Client) GetAgents() (*Agents, error) {
}

// GetAgent - Get agent
func (c *Client) GetAgent(id int) (*Agent, error) {
func (c *Client) GetAgent(id int64) (*Agent, error) {
resp, err := c.get(fmt.Sprintf("/agents/%d", id))
if err != nil {
return nil, err
Expand Down
6 changes: 3 additions & 3 deletions agent_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (t *AgentAgent) AddAlertRule(id int64) {
}

// GetAgentAgent - Get an agent to agent test
func (c *Client) GetAgentAgent(id int) (*AgentAgent, error) {
func (c *Client) GetAgentAgent(id int64) (*AgentAgent, error) {
resp, err := c.get(fmt.Sprintf("/tests/%d", id))
if err != nil {
return &AgentAgent{}, err
Expand Down Expand Up @@ -118,7 +118,7 @@ func (c Client) CreateAgentAgent(t AgentAgent) (*AgentAgent, error) {
}

//DeleteAgentAgent - delete agent to agent test
func (c *Client) DeleteAgentAgent(id int) error {
func (c *Client) DeleteAgentAgent(id int64) error {
resp, err := c.post(fmt.Sprintf("/tests/agent-to-agent/%d/delete", id), nil, nil)
if err != nil {
return err
Expand All @@ -130,7 +130,7 @@ func (c *Client) DeleteAgentAgent(id int) error {
}

// UpdateAgentAgent - update agent to agent test
func (c *Client) UpdateAgentAgent(id int, t AgentAgent) (*AgentAgent, error) {
func (c *Client) UpdateAgentAgent(id int64, t AgentAgent) (*AgentAgent, error) {
resp, err := c.post(fmt.Sprintf("/tests/agent-to-agent/%d/update", id), t, nil)
if err != nil {
return &t, err
Expand Down
2 changes: 1 addition & 1 deletion agent_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func TestClient_DeleteAgentAgent(t *testing.T) {
})

var client = &Client{APIEndpoint: server.URL, AuthToken: "foo"}
id := 1
id := int64(1)
err := client.DeleteAgentAgent(id)

if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions agent_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (t *AgentServer) AddAlertRule(id int64) {
}

// GetAgentServer - Get agent to server test
func (c *Client) GetAgentServer(id int) (*AgentServer, error) {
func (c *Client) GetAgentServer(id int64) (*AgentServer, error) {
resp, err := c.get(fmt.Sprintf("/tests/%d", id))
if err != nil {
return &AgentServer{}, err
Expand Down Expand Up @@ -145,7 +145,7 @@ func (c Client) CreateAgentServer(t AgentServer) (*AgentServer, error) {
}

// DeleteAgentServer - Delete agent to server test
func (c *Client) DeleteAgentServer(id int) error {
func (c *Client) DeleteAgentServer(id int64) error {
resp, err := c.post(fmt.Sprintf("/tests/agent-to-server/%d/delete", id), nil, nil)
if err != nil {
return err
Expand All @@ -157,7 +157,7 @@ func (c *Client) DeleteAgentServer(id int) error {
}

// UpdateAgentServer - Update agent to server test
func (c *Client) UpdateAgentServer(id int, t AgentServer) (*AgentServer, error) {
func (c *Client) UpdateAgentServer(id int64, t AgentServer) (*AgentServer, error) {
resp, err := c.post(fmt.Sprintf("/tests/agent-to-server/%d/update", id), t, nil)
if err != nil {
return &t, err
Expand Down
2 changes: 1 addition & 1 deletion agent_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func TestClient_DeleteAgentServer(t *testing.T) {
})

var client = &Client{APIEndpoint: server.URL, AuthToken: "foo"}
id := 1
id := int64(1)
err := client.DeleteAgentServer(id)

if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions alert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestClient_DeleteAlertRule(t *testing.T) {
})

var client = &Client{APIEndpoint: server.URL, AuthToken: "foo"}
id := 1
id := int64(1)
err := client.DeleteAlertRule(id)

if err != nil {
Expand All @@ -66,7 +66,7 @@ func TestClient_UpdateAlertRule(t *testing.T) {
})

var client = &Client{APIEndpoint: server.URL, AuthToken: "foo"}
id := 1
id := int64(1)
u := AlertRule{RoundsViolatingOutOf: Int(2)}
res, err := client.UpdateAlertRule(id, u)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (c Client) GetAlertRules() (*AlertRules, error) {
}

// GetAlertRule - Get single alert rule by ID
func (c *Client) GetAlertRule(id int) (*AlertRule, error) {
func (c *Client) GetAlertRule(id int64) (*AlertRule, error) {
log.Printf("[INFO] Getting Alert Rule %v", id)
resp, err := c.get(fmt.Sprintf("/alert-rules/%d", id))
if err != nil {
Expand All @@ -151,7 +151,7 @@ func (c *Client) GetAlertRule(id int) (*AlertRule, error) {
}

//DeleteAlertRule - delete alert rule
func (c Client) DeleteAlertRule(id int) error {
func (c Client) DeleteAlertRule(id int64) error {
resp, err := c.post(fmt.Sprintf("/alert-rules/%d/delete", id), nil, nil)
if err != nil {
return err
Expand All @@ -163,7 +163,7 @@ func (c Client) DeleteAlertRule(id int) error {
}

//UpdateAlertRule - update alert rule
func (c Client) UpdateAlertRule(id int, a AlertRule) (*AlertRule, error) {
func (c Client) UpdateAlertRule(id int64, a AlertRule) (*AlertRule, error) {
resp, err := c.post(fmt.Sprintf("/alert-rules/%d/update", id), a, nil)
if err != nil {
return nil, err
Expand Down
6 changes: 3 additions & 3 deletions bgp.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (t *BGP) AddAlertRule(id int64) {
}

// GetBGP - get bgp test
func (c *Client) GetBGP(id int) (*BGP, error) {
func (c *Client) GetBGP(id int64) (*BGP, error) {
resp, err := c.get(fmt.Sprintf("/tests/%d", id))
if err != nil {
return &BGP{}, err
Expand Down Expand Up @@ -97,7 +97,7 @@ func (c Client) CreateBGP(t BGP) (*BGP, error) {
}

//DeleteBGP - delete bgp test
func (c *Client) DeleteBGP(id int) error {
func (c *Client) DeleteBGP(id int64) error {
resp, err := c.post(fmt.Sprintf("/tests/bgp/%d/delete", id), nil, nil)
if err != nil {
return err
Expand All @@ -109,7 +109,7 @@ func (c *Client) DeleteBGP(id int) error {
}

//UpdateBGP - - Update bgp trace test
func (c *Client) UpdateBGP(id int, t BGP) (*BGP, error) {
func (c *Client) UpdateBGP(id int64, t BGP) (*BGP, error) {
resp, err := c.post(fmt.Sprintf("/tests/bgp/%d/update", id), t, nil)
if err != nil {
return &t, err
Expand Down
4 changes: 2 additions & 2 deletions bgp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func TestClient_DeleteBGP(t *testing.T) {
})

var client = &Client{APIEndpoint: server.URL, AuthToken: "foo"}
id := 1
id := int64(1)
err := client.DeleteBGP(id)

if err != nil {
Expand All @@ -172,7 +172,7 @@ func TestClient_UpdateBGP(t *testing.T) {
})

var client = &Client{APIEndpoint: server.URL, AuthToken: "foo"}
id := 1
id := int64(1)
dnsS := BGP{}
res, err := client.UpdateBGP(id, dnsS)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions dns_dnssec.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (t *DNSSec) AddAlertRule(id int64) {
}

// GetDNSSec - get DNSSec test
func (c *Client) GetDNSSec(id int) (*DNSSec, error) {
func (c *Client) GetDNSSec(id int64) (*DNSSec, error) {
resp, err := c.get(fmt.Sprintf("/tests/%d", id))
if err != nil {
return &DNSSec{}, err
Expand Down Expand Up @@ -102,7 +102,7 @@ func (c Client) CreateDNSSec(t DNSSec) (*DNSSec, error) {
}

// DeleteDNSSec - delete DNSSec test
func (c *Client) DeleteDNSSec(id int) error {
func (c *Client) DeleteDNSSec(id int64) error {
resp, err := c.post(fmt.Sprintf("/tests/dns-dnssec/%d/delete", id), nil, nil)
if err != nil {
return err
Expand All @@ -114,7 +114,7 @@ func (c *Client) DeleteDNSSec(id int) error {
}

// UpdateDNSSec - update DNSSec test
func (c *Client) UpdateDNSSec(id int, t DNSSec) (*DNSSec, error) {
func (c *Client) UpdateDNSSec(id int64, t DNSSec) (*DNSSec, error) {
resp, err := c.post(fmt.Sprintf("/tests/dns-dnssec/%d/update", id), t, nil)
if err != nil {
return &t, err
Expand Down
4 changes: 2 additions & 2 deletions dns_dnssec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func TestClient_DeleteDNSSec(t *testing.T) {
})

var client = &Client{APIEndpoint: server.URL, AuthToken: "foo"}
id := 1
id := int64(1)
err := client.DeleteDNSSec(id)

if err != nil {
Expand All @@ -196,7 +196,7 @@ func TestClient_UpdateDNSSec(t *testing.T) {
})

var client = &Client{APIEndpoint: server.URL, AuthToken: "foo"}
id := 1
id := int64(1)
dnsp := DNSSec{Domain: String("webex.com")}
res, err := client.UpdateDNSSec(id, dnsp)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions dns_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (t *DNSServer) AddAlertRule(id int64) {
}

//GetDNSServer - get dns server test
func (c *Client) GetDNSServer(id int) (*DNSServer, error) {
func (c *Client) GetDNSServer(id int64) (*DNSServer, error) {
resp, err := c.get(fmt.Sprintf("/tests/%d", id))
if err != nil {
return &DNSServer{}, err
Expand Down Expand Up @@ -121,7 +121,7 @@ func (c Client) CreateDNSServer(t DNSServer) (*DNSServer, error) {
}

//DeleteDNSServer - delete dns server test
func (c *Client) DeleteDNSServer(id int) error {
func (c *Client) DeleteDNSServer(id int64) error {
resp, err := c.post(fmt.Sprintf("/tests/dns-server/%d/delete", id), nil, nil)
if err != nil {
return err
Expand All @@ -133,7 +133,7 @@ func (c *Client) DeleteDNSServer(id int) error {
}

//UpdateDNSServer - - Update dns server test
func (c *Client) UpdateDNSServer(id int, t DNSServer) (*DNSServer, error) {
func (c *Client) UpdateDNSServer(id int64, t DNSServer) (*DNSServer, error) {
resp, err := c.post(fmt.Sprintf("/tests/dns-server/%d/update", id), t, nil)
if err != nil {
return &t, err
Expand Down
4 changes: 2 additions & 2 deletions dns_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func TestClient_DeleteDNSServer(t *testing.T) {
})

var client = &Client{APIEndpoint: server.URL, AuthToken: "foo"}
id := 1
id := int64(1)
err := client.DeleteDNSServer(id)

if err != nil {
Expand All @@ -253,7 +253,7 @@ func TestClient_UpdateDNSServer(t *testing.T) {
})

var client = &Client{APIEndpoint: server.URL, AuthToken: "foo"}
id := 1
id := int64(1)
dnsS := DNSServer{Domain: String("webex.com")}
res, err := client.UpdateDNSServer(id, dnsS)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions dns_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (t *DNSTrace) AddAlertRule(id int64) {
}

// GetDNSTrace - get dns trace test
func (c *Client) GetDNSTrace(id int) (*DNSTrace, error) {
func (c *Client) GetDNSTrace(id int64) (*DNSTrace, error) {
resp, err := c.get(fmt.Sprintf("/tests/%d", id))
if err != nil {
return &DNSTrace{}, err
Expand Down Expand Up @@ -103,7 +103,7 @@ func (c Client) CreateDNSTrace(t DNSTrace) (*DNSTrace, error) {
}

//DeleteDNSTrace - delete dns trace test
func (c *Client) DeleteDNSTrace(id int) error {
func (c *Client) DeleteDNSTrace(id int64) error {
resp, err := c.post(fmt.Sprintf("/tests/dns-trace/%d/delete", id), nil, nil)
if err != nil {
return err
Expand All @@ -115,7 +115,7 @@ func (c *Client) DeleteDNSTrace(id int) error {
}

//UpdateDNSTrace - update dns trace test
func (c *Client) UpdateDNSTrace(id int, t DNSTrace) (*DNSTrace, error) {
func (c *Client) UpdateDNSTrace(id int64, t DNSTrace) (*DNSTrace, error) {
resp, err := c.post(fmt.Sprintf("/tests/dns-trace/%d/update", id), t, nil)
if err != nil {
return &t, err
Expand Down
4 changes: 2 additions & 2 deletions dns_trace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func TestClient_DeleteDNSTrace(t *testing.T) {
})

var client = &Client{APIEndpoint: server.URL, AuthToken: "foo"}
id := 1
id := int64(1)
err := client.DeleteDNSTrace(id)

if err != nil {
Expand All @@ -203,7 +203,7 @@ func TestClient_UpdateDNSTrace(t *testing.T) {
})

var client = &Client{APIEndpoint: server.URL, AuthToken: "foo"}
id := 1
id := int64(1)
dnsS := DNSTrace{Domain: String("webex.com")}
res, err := client.UpdateDNSTrace(id, dnsS)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions ftp_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (t *FTPServer) AddAlertRule(id int64) {
}

// GetFTPServer - get ftp server test
func (c *Client) GetFTPServer(id int) (*FTPServer, error) {
func (c *Client) GetFTPServer(id int64) (*FTPServer, error) {
resp, err := c.get(fmt.Sprintf("/tests/%d", id))
if err != nil {
return &FTPServer{}, err
Expand Down Expand Up @@ -117,7 +117,7 @@ func (c Client) CreateFTPServer(t FTPServer) (*FTPServer, error) {
}

// DeleteFTPServer - delete ftp server test
func (c *Client) DeleteFTPServer(id int) error {
func (c *Client) DeleteFTPServer(id int64) error {
resp, err := c.post(fmt.Sprintf("/tests/ftp-server/%d/delete", id), nil, nil)
if err != nil {
return err
Expand All @@ -129,7 +129,7 @@ func (c *Client) DeleteFTPServer(id int) error {
}

// UpdateFTPServer - - Update ftp server test
func (c *Client) UpdateFTPServer(id int, t FTPServer) (*FTPServer, error) {
func (c *Client) UpdateFTPServer(id int64, t FTPServer) (*FTPServer, error) {
resp, err := c.post(fmt.Sprintf("/tests/ftp-server/%d/update", id), t, nil)
if err != nil {
return &t, err
Expand Down
4 changes: 2 additions & 2 deletions ftp_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func TestClient_DeleteFTPServer(t *testing.T) {
})

var client = &Client{APIEndpoint: server.URL, AuthToken: "foo"}
id := 1
id := int64(1)
err := client.DeleteFTPServer(id)

if err != nil {
Expand All @@ -203,7 +203,7 @@ func TestClient_UpdateFTPServer(t *testing.T) {
})

var client = &Client{APIEndpoint: server.URL, AuthToken: "foo"}
id := 1
id := int64(1)
ftpServer := FTPServer{URL: String("webex.com")}
res, err := client.UpdateFTPServer(id, ftpServer)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions group_label.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (c *Client) GetGroupLabelsByType(t string) (*GroupLabels, error) {
}

// GetGroupLabel - Get single group label by ID
func (c *Client) GetGroupLabel(id int) (*GroupLabel, error) {
func (c *Client) GetGroupLabel(id int64) (*GroupLabel, error) {
resp, err := c.get(fmt.Sprintf("/groups/%d", id))
if err != nil {
return &GroupLabel{}, err
Expand Down Expand Up @@ -114,7 +114,7 @@ func (c Client) CreateGroupLabel(a GroupLabel) (*GroupLabel, error) {
}

//DeleteGroupLabel - delete label
func (c Client) DeleteGroupLabel(id int) error {
func (c Client) DeleteGroupLabel(id int64) error {
resp, err := c.post(fmt.Sprintf("/groups/%d/delete", id), nil, nil)
if err != nil {
return err
Expand All @@ -126,7 +126,7 @@ func (c Client) DeleteGroupLabel(id int) error {
}

//UpdateGroupLabel - update label
func (c Client) UpdateGroupLabel(id int, a GroupLabel) (*GroupLabels, error) {
func (c Client) UpdateGroupLabel(id int64, a GroupLabel) (*GroupLabels, error) {
resp, err := c.post(fmt.Sprintf("/groups/%d/update", id), a, nil)
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions group_label_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func TestClient_DeleteGroupLabel(t *testing.T) {
})

var client = &Client{APIEndpoint: server.URL, AuthToken: "foo"}
id := 1
id := int64(1)
err := client.DeleteGroupLabel(id)

if err != nil {
Expand All @@ -152,7 +152,7 @@ func TestClient_UpdateGroupLabel(t *testing.T) {
})

var client = &Client{APIEndpoint: server.URL, AuthToken: "foo"}
id := 222
id := int64(222)
u := GroupLabel{Type: String("tests")}
res, err := client.UpdateGroupLabel(id, u)
if err != nil {
Expand Down
Loading

0 comments on commit 1da73f4

Please sign in to comment.