Files
go-unifi/unifi/firewall_rule.go
Hendrik "T4cC0re" Meyer 4aed7d703d Generate UnmarshalJSON to handle emptyStringInt types
This commit changes the code generator to generate a `UnmarshalJSON` for each
struct, so that if unmarshalled it properly handles UniFis varying integer values
via the `emptyStringInt` type.

Structs not including a field of `int` type will still have the function generated,
but it will effectively do nothing.

Fixes #18
2021-01-03 13:21:53 -05:00

26 lines
757 B
Go

package unifi
import (
"context"
)
func (c *Client) ListFirewallRule(ctx context.Context, site string) ([]FirewallRule, error) {
return c.listFirewallRule(ctx, site)
}
func (c *Client) GetFirewallRule(ctx context.Context, site, id string) (*FirewallRule, error) {
return c.getFirewallRule(ctx, site, id)
}
func (c *Client) DeleteFirewallRule(ctx context.Context, site, id string) error {
return c.deleteFirewallRule(ctx, site, id)
}
func (c *Client) CreateFirewallRule(ctx context.Context, site string, d *FirewallRule) (*FirewallRule, error) {
return c.createFirewallRule(ctx, site, d)
}
func (c *Client) UpdateFirewallRule(ctx context.Context, site string, d *FirewallRule) (*FirewallRule, error) {
return c.updateFirewallRule(ctx, site, d)
}