Merge pull request #4 from vegardengen/2-create-firewall-zone-api

fixes
This commit is contained in:
2025-04-13 12:50:24 +02:00
committed by GitHub

View File

@@ -21,7 +21,7 @@ type FirewallZone struct {
// Role string `json:"role"` // Role string `json:"role"`
} }
func (c *Client) ListFirewallZones(ctx context.Context) ([]FirewallZone, error) { func (c *Client) ListFirewallZones(ctx context.Context, site string) ([]FirewallZone, error) {
var respBody struct { var respBody struct {
Meta meta `json:"meta"` Meta meta `json:"meta"`
Data []FirewallZone `json:"data"` Data []FirewallZone `json:"data"`
@@ -35,7 +35,7 @@ func (c *Client) ListFirewallZones(ctx context.Context) ([]FirewallZone, error)
return respBody.Data, nil return respBody.Data, nil
} }
func (c *Client) GetFirewallZone(ctx context.Context, id string) (*Site, error) { func (c *Client) GetFirewallZone(ctx context.Context, site, id string) (*Site, error) {
firewallzones, err := c.ListFirewallZones(ctx) firewallzones, err := c.ListFirewallZones(ctx)
if err != nil { if err != nil {
return nil, err return nil, err