Skip to content

Commit

Permalink
Renaming PortConf to PortProfile; cleanup Device API func names
Browse files Browse the repository at this point in the history
  • Loading branch information
james-stephenson authored and paultyng committed Oct 9, 2020
1 parent 4b8ec1e commit 6203ee9
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 42 deletions.
2 changes: 2 additions & 0 deletions fields/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ var fieldReps = []replacement{
{"Networkgroup", "NetworkGroup"},
{"Pd", "PD"},
{"Pmf", "PMF"},
{"Portconf", "PortProfile"},
{"Qos", "QOS"},
{"Radiusprofile", "RADIUSProfile"},
{"Radius", "RADIUS"},
Expand All @@ -80,6 +81,7 @@ var fileReps = []replacement{
{"Dhcp", "DHCP"},
{"Wlan", "WLAN"},
{"NetworkConf", "Network"},
{"PortConf", "PortProfile"},
{"RadiusProfile", "RADIUSProfile"},
}

Expand Down
2 changes: 1 addition & 1 deletion unifi/device.generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions unifi/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ func (c *Client) ListDevice(ctx context.Context, site string) ([]Device, error)
return c.listDevice(ctx, site)
}

func (c *Client) GetDevice(ctx context.Context, site, mac string) (*Device, error) {
func (c *Client) GetDeviceByMAC(ctx context.Context, site, mac string) (*Device, error) {
return c.getDevice(ctx, site, mac)
}

Expand All @@ -24,7 +24,7 @@ func (c *Client) UpdateDevice(ctx context.Context, site string, d *Device) (*Dev
return c.updateDevice(ctx, site, d)
}

func (c *Client) GetDeviceById(ctx context.Context, site, id string) (*Device, error) {
func (c *Client) GetDevice(ctx context.Context, site, id string) (*Device, error) {
devices, err := c.ListDevice(ctx, site)

if err != nil {
Expand Down
25 changes: 0 additions & 25 deletions unifi/port_conf.go

This file was deleted.

28 changes: 14 additions & 14 deletions unifi/port_conf.generated.go → unifi/port_profile.generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions unifi/port_profile.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package unifi

import (
"context"
)

func (c *Client) ListPortProfile(ctx context.Context, site string) ([]PortProfile, error) {
return c.listPortProfile(ctx, site)
}

func (c *Client) GetPortProfile(ctx context.Context, site, id string) (*PortProfile, error) {
return c.getPortProfile(ctx, site, id)
}

func (c *Client) DeletePortProfile(ctx context.Context, site, id string) error {
return c.deletePortProfile(ctx, site, id)
}

func (c *Client) CreatePortProfile(ctx context.Context, site string, d *PortProfile) (*PortProfile, error) {
return c.createPortProfile(ctx, site, d)
}

func (c *Client) UpdatePortProfile(ctx context.Context, site string, d *PortProfile) (*PortProfile, error) {
return c.updatePortProfile(ctx, site, d)
}

0 comments on commit 6203ee9

Please sign in to comment.