feat: expose all available actions on all resources through Client (#27)

This commit is contained in:
Mateusz Filipowicz
2025-02-18 10:23:18 +01:00
committed by GitHub
parent 87d0c6e28d
commit 7432260d3e
17 changed files with 660 additions and 12 deletions

View File

@@ -2,19 +2,7 @@
customizations: customizations:
client: client:
excludeResources: excludeResources:
- "BroadcastGroup"
- "ChannelPlan"
- "Dashboard"
- "DHCPOption"
- "Dpi*" - "Dpi*"
- "HeatMap*"
- "Hotspot*"
- "Map"
- "MediaFile"
- "ScheduleTask"
- "SpatialRecord"
- "Tag"
- "VirtualDevice"
functions: functions:
- name: "Login" - name: "Login"
comment: "Login logs in to the controller. Useful only for user/password authentication." comment: "Login logs in to the controller. Useful only for user/password authentication."

25
unifi/broadcast_group.go Normal file
View File

@@ -0,0 +1,25 @@
package unifi
import (
"context"
)
func (c *client) ListBroadcastGroup(ctx context.Context, site string) ([]BroadcastGroup, error) {
return c.listBroadcastGroup(ctx, site)
}
func (c *client) CreateBroadcastGroup(ctx context.Context, site string, d *BroadcastGroup) (*BroadcastGroup, error) {
return c.createBroadcastGroup(ctx, site, d)
}
func (c *client) GetBroadcastGroup(ctx context.Context, site, id string) (*BroadcastGroup, error) {
return c.getBroadcastGroup(ctx, site, id)
}
func (c *client) DeleteBroadcastGroup(ctx context.Context, site, id string) error {
return c.deleteBroadcastGroup(ctx, site, id)
}
func (c *client) UpdateBroadcastGroup(ctx context.Context, site string, d *BroadcastGroup) (*BroadcastGroup, error) {
return c.updateBroadcastGroup(ctx, site, d)
}

25
unifi/channel_plan.go Normal file
View File

@@ -0,0 +1,25 @@
package unifi
import (
"context"
)
func (c *client) ListChannelPlan(ctx context.Context, site string) ([]ChannelPlan, error) {
return c.listChannelPlan(ctx, site)
}
func (c *client) GetChannelPlan(ctx context.Context, site, id string) (*ChannelPlan, error) {
return c.getChannelPlan(ctx, site, id)
}
func (c *client) DeleteChannelPlan(ctx context.Context, site, id string) error {
return c.deleteChannelPlan(ctx, site, id)
}
func (c *client) CreateChannelPlan(ctx context.Context, site string, d *ChannelPlan) (*ChannelPlan, error) {
return c.createChannelPlan(ctx, site, d)
}
func (c *client) UpdateChannelPlan(ctx context.Context, site string, d *ChannelPlan) (*ChannelPlan, error) {
return c.updateChannelPlan(ctx, site, d)
}

View File

@@ -71,6 +71,63 @@ type Client interface {
// ==== end of client methods for Account resource ==== // ==== end of client methods for Account resource ====
// ==== client methods for BroadcastGroup resource ====
// CreateBroadcastGroup creates a resource
CreateBroadcastGroup(ctx context.Context, site string, b *BroadcastGroup) (*BroadcastGroup, error)
// DeleteBroadcastGroup deletes a resource
DeleteBroadcastGroup(ctx context.Context, site string, id string) error
// GetBroadcastGroup retrieves a resource
GetBroadcastGroup(ctx context.Context, site string, id string) (*BroadcastGroup, error)
// ListBroadcastGroup lists the resources
ListBroadcastGroup(ctx context.Context, site string) ([]BroadcastGroup, error)
// UpdateBroadcastGroup updates a resource
UpdateBroadcastGroup(ctx context.Context, site string, b *BroadcastGroup) (*BroadcastGroup, error)
// ==== end of client methods for BroadcastGroup resource ====
// ==== client methods for ChannelPlan resource ====
// CreateChannelPlan creates a resource
CreateChannelPlan(ctx context.Context, site string, c *ChannelPlan) (*ChannelPlan, error)
// DeleteChannelPlan deletes a resource
DeleteChannelPlan(ctx context.Context, site string, id string) error
// GetChannelPlan retrieves a resource
GetChannelPlan(ctx context.Context, site string, id string) (*ChannelPlan, error)
// ListChannelPlan lists the resources
ListChannelPlan(ctx context.Context, site string) ([]ChannelPlan, error)
// UpdateChannelPlan updates a resource
UpdateChannelPlan(ctx context.Context, site string, c *ChannelPlan) (*ChannelPlan, error)
// ==== end of client methods for ChannelPlan resource ====
// ==== client methods for DHCPOption resource ====
// CreateDHCPOption creates a resource
CreateDHCPOption(ctx context.Context, site string, d *DHCPOption) (*DHCPOption, error)
// DeleteDHCPOption deletes a resource
DeleteDHCPOption(ctx context.Context, site string, id string) error
// GetDHCPOption retrieves a resource
GetDHCPOption(ctx context.Context, site string, id string) (*DHCPOption, error)
// ListDHCPOption lists the resources
ListDHCPOption(ctx context.Context, site string) ([]DHCPOption, error)
// UpdateDHCPOption updates a resource
UpdateDHCPOption(ctx context.Context, site string, d *DHCPOption) (*DHCPOption, error)
// ==== end of client methods for DHCPOption resource ====
// ==== client methods for DNSRecord resource ==== // ==== client methods for DNSRecord resource ====
// CreateDNSRecord creates a resource // CreateDNSRecord creates a resource
@@ -90,6 +147,25 @@ type Client interface {
// ==== end of client methods for DNSRecord resource ==== // ==== end of client methods for DNSRecord resource ====
// ==== client methods for Dashboard resource ====
// CreateDashboard creates a resource
CreateDashboard(ctx context.Context, site string, d *Dashboard) (*Dashboard, error)
// DeleteDashboard deletes a resource
DeleteDashboard(ctx context.Context, site string, id string) error
// GetDashboard retrieves a resource
GetDashboard(ctx context.Context, site string, id string) (*Dashboard, error)
// ListDashboard lists the resources
ListDashboard(ctx context.Context, site string) ([]Dashboard, error)
// UpdateDashboard updates a resource
UpdateDashboard(ctx context.Context, site string, d *Dashboard) (*Dashboard, error)
// ==== end of client methods for Dashboard resource ====
// ==== client methods for Device resource ==== // ==== client methods for Device resource ====
// AdoptDevice adopts a device by MAC address. // AdoptDevice adopts a device by MAC address.
@@ -176,6 +252,139 @@ type Client interface {
// ==== end of client methods for FirewallRule resource ==== // ==== end of client methods for FirewallRule resource ====
// ==== client methods for HeatMap resource ====
// CreateHeatMap creates a resource
CreateHeatMap(ctx context.Context, site string, h *HeatMap) (*HeatMap, error)
// DeleteHeatMap deletes a resource
DeleteHeatMap(ctx context.Context, site string, id string) error
// GetHeatMap retrieves a resource
GetHeatMap(ctx context.Context, site string, id string) (*HeatMap, error)
// ListHeatMap lists the resources
ListHeatMap(ctx context.Context, site string) ([]HeatMap, error)
// UpdateHeatMap updates a resource
UpdateHeatMap(ctx context.Context, site string, h *HeatMap) (*HeatMap, error)
// ==== client methods for HeatMapPoint resource ====
// CreateHeatMapPoint creates a resource
CreateHeatMapPoint(ctx context.Context, site string, h *HeatMapPoint) (*HeatMapPoint, error)
// DeleteHeatMapPoint deletes a resource
DeleteHeatMapPoint(ctx context.Context, site string, id string) error
// GetHeatMapPoint retrieves a resource
GetHeatMapPoint(ctx context.Context, site string, id string) (*HeatMapPoint, error)
// ListHeatMapPoint lists the resources
ListHeatMapPoint(ctx context.Context, site string) ([]HeatMapPoint, error)
// UpdateHeatMapPoint updates a resource
UpdateHeatMapPoint(ctx context.Context, site string, h *HeatMapPoint) (*HeatMapPoint, error)
// ==== end of client methods for HeatMapPoint resource ====
// ==== end of client methods for HeatMap resource ====
// ==== client methods for Hotspot2Conf resource ====
// CreateHotspot2Conf creates a resource
CreateHotspot2Conf(ctx context.Context, site string, h *Hotspot2Conf) (*Hotspot2Conf, error)
// DeleteHotspot2Conf deletes a resource
DeleteHotspot2Conf(ctx context.Context, site string, id string) error
// GetHotspot2Conf retrieves a resource
GetHotspot2Conf(ctx context.Context, site string, id string) (*Hotspot2Conf, error)
// ListHotspot2Conf lists the resources
ListHotspot2Conf(ctx context.Context, site string) ([]Hotspot2Conf, error)
// UpdateHotspot2Conf updates a resource
UpdateHotspot2Conf(ctx context.Context, site string, h *Hotspot2Conf) (*Hotspot2Conf, error)
// ==== end of client methods for Hotspot2Conf resource ====
// ==== client methods for HotspotOp resource ====
// CreateHotspotOp creates a resource
CreateHotspotOp(ctx context.Context, site string, h *HotspotOp) (*HotspotOp, error)
// DeleteHotspotOp deletes a resource
DeleteHotspotOp(ctx context.Context, site string, id string) error
// GetHotspotOp retrieves a resource
GetHotspotOp(ctx context.Context, site string, id string) (*HotspotOp, error)
// ListHotspotOp lists the resources
ListHotspotOp(ctx context.Context, site string) ([]HotspotOp, error)
// UpdateHotspotOp updates a resource
UpdateHotspotOp(ctx context.Context, site string, h *HotspotOp) (*HotspotOp, error)
// ==== end of client methods for HotspotOp resource ====
// ==== client methods for HotspotPackage resource ====
// CreateHotspotPackage creates a resource
CreateHotspotPackage(ctx context.Context, site string, h *HotspotPackage) (*HotspotPackage, error)
// DeleteHotspotPackage deletes a resource
DeleteHotspotPackage(ctx context.Context, site string, id string) error
// GetHotspotPackage retrieves a resource
GetHotspotPackage(ctx context.Context, site string, id string) (*HotspotPackage, error)
// ListHotspotPackage lists the resources
ListHotspotPackage(ctx context.Context, site string) ([]HotspotPackage, error)
// UpdateHotspotPackage updates a resource
UpdateHotspotPackage(ctx context.Context, site string, h *HotspotPackage) (*HotspotPackage, error)
// ==== end of client methods for HotspotPackage resource ====
// ==== client methods for Map resource ====
// CreateMap creates a resource
CreateMap(ctx context.Context, site string, m *Map) (*Map, error)
// DeleteMap deletes a resource
DeleteMap(ctx context.Context, site string, id string) error
// GetMap retrieves a resource
GetMap(ctx context.Context, site string, id string) (*Map, error)
// ListMap lists the resources
ListMap(ctx context.Context, site string) ([]Map, error)
// UpdateMap updates a resource
UpdateMap(ctx context.Context, site string, m *Map) (*Map, error)
// ==== end of client methods for Map resource ====
// ==== client methods for MediaFile resource ====
// CreateMediaFile creates a resource
CreateMediaFile(ctx context.Context, site string, m *MediaFile) (*MediaFile, error)
// DeleteMediaFile deletes a resource
DeleteMediaFile(ctx context.Context, site string, id string) error
// GetMediaFile retrieves a resource
GetMediaFile(ctx context.Context, site string, id string) (*MediaFile, error)
// ListMediaFile lists the resources
ListMediaFile(ctx context.Context, site string) ([]MediaFile, error)
// UpdateMediaFile updates a resource
UpdateMediaFile(ctx context.Context, site string, m *MediaFile) (*MediaFile, error)
// ==== end of client methods for MediaFile resource ====
// ==== client methods for Network resource ==== // ==== client methods for Network resource ====
// CreateNetwork creates a resource // CreateNetwork creates a resource
@@ -271,6 +480,25 @@ type Client interface {
// ==== end of client methods for Routing resource ==== // ==== end of client methods for Routing resource ====
// ==== client methods for ScheduleTask resource ====
// CreateScheduleTask creates a resource
CreateScheduleTask(ctx context.Context, site string, s *ScheduleTask) (*ScheduleTask, error)
// DeleteScheduleTask deletes a resource
DeleteScheduleTask(ctx context.Context, site string, id string) error
// GetScheduleTask retrieves a resource
GetScheduleTask(ctx context.Context, site string, id string) (*ScheduleTask, error)
// ListScheduleTask lists the resources
ListScheduleTask(ctx context.Context, site string) ([]ScheduleTask, error)
// UpdateScheduleTask updates a resource
UpdateScheduleTask(ctx context.Context, site string, s *ScheduleTask) (*ScheduleTask, error)
// ==== end of client methods for ScheduleTask resource ====
GetSetting(ctx context.Context, site string, key string) (*Setting, interface{}, error) GetSetting(ctx context.Context, site string, key string) (*Setting, interface{}, error)
// ==== client methods for SettingAutoSpeedtest resource ==== // ==== client methods for SettingAutoSpeedtest resource ====
@@ -603,10 +831,48 @@ type Client interface {
UpdateSite(ctx context.Context, name string, description string) ([]Site, error) UpdateSite(ctx context.Context, name string, description string) ([]Site, error)
// ==== client methods for SpatialRecord resource ====
// CreateSpatialRecord creates a resource
CreateSpatialRecord(ctx context.Context, site string, s *SpatialRecord) (*SpatialRecord, error)
// DeleteSpatialRecord deletes a resource
DeleteSpatialRecord(ctx context.Context, site string, id string) error
// GetSpatialRecord retrieves a resource
GetSpatialRecord(ctx context.Context, site string, id string) (*SpatialRecord, error)
// ListSpatialRecord lists the resources
ListSpatialRecord(ctx context.Context, site string) ([]SpatialRecord, error)
// UpdateSpatialRecord updates a resource
UpdateSpatialRecord(ctx context.Context, site string, s *SpatialRecord) (*SpatialRecord, error)
// ==== end of client methods for SpatialRecord resource ====
GetSystemInfo(ctx context.Context, id string) (*SysInfo, error) GetSystemInfo(ctx context.Context, id string) (*SysInfo, error)
GetSystemInformation() (*SysInfo, error) GetSystemInformation() (*SysInfo, error)
// ==== client methods for Tag resource ====
// CreateTag creates a resource
CreateTag(ctx context.Context, site string, t *Tag) (*Tag, error)
// DeleteTag deletes a resource
DeleteTag(ctx context.Context, site string, id string) error
// GetTag retrieves a resource
GetTag(ctx context.Context, site string, id string) (*Tag, error)
// ListTag lists the resources
ListTag(ctx context.Context, site string) ([]Tag, error)
// UpdateTag updates a resource
UpdateTag(ctx context.Context, site string, t *Tag) (*Tag, error)
// ==== end of client methods for Tag resource ====
// ==== client methods for User resource ==== // ==== client methods for User resource ====
BlockUserByMAC(ctx context.Context, site string, mac string) error BlockUserByMAC(ctx context.Context, site string, mac string) error
@@ -657,6 +923,25 @@ type Client interface {
// ==== end of client methods for User resource ==== // ==== end of client methods for User resource ====
// ==== client methods for VirtualDevice resource ====
// CreateVirtualDevice creates a resource
CreateVirtualDevice(ctx context.Context, site string, v *VirtualDevice) (*VirtualDevice, error)
// DeleteVirtualDevice deletes a resource
DeleteVirtualDevice(ctx context.Context, site string, id string) error
// GetVirtualDevice retrieves a resource
GetVirtualDevice(ctx context.Context, site string, id string) (*VirtualDevice, error)
// ListVirtualDevice lists the resources
ListVirtualDevice(ctx context.Context, site string) ([]VirtualDevice, error)
// UpdateVirtualDevice updates a resource
UpdateVirtualDevice(ctx context.Context, site string, v *VirtualDevice) (*VirtualDevice, error)
// ==== end of client methods for VirtualDevice resource ====
// ==== client methods for WLAN resource ==== // ==== client methods for WLAN resource ====
// CreateWLAN creates a resource // CreateWLAN creates a resource

27
unifi/dashboard.go Normal file
View File

@@ -0,0 +1,27 @@
package unifi
// client for dashboard.generated.go
import (
"context"
)
func (c *client) ListDashboard(ctx context.Context, site string) ([]Dashboard, error) {
return c.listDashboard(ctx, site)
}
func (c *client) GetDashboard(ctx context.Context, site, id string) (*Dashboard, error) {
return c.getDashboard(ctx, site, id)
}
func (c *client) DeleteDashboard(ctx context.Context, site, id string) error {
return c.deleteDashboard(ctx, site, id)
}
func (c *client) CreateDashboard(ctx context.Context, site string, d *Dashboard) (*Dashboard, error) {
return c.createDashboard(ctx, site, d)
}
func (c *client) UpdateDashboard(ctx context.Context, site string, d *Dashboard) (*Dashboard, error) {
return c.updateDashboard(ctx, site, d)
}

23
unifi/dhcp_option.go Normal file
View File

@@ -0,0 +1,23 @@
package unifi
import "context"
func (c *client) ListDHCPOption(ctx context.Context, site string) ([]DHCPOption, error) {
return c.listDHCPOption(ctx, site)
}
func (c *client) CreateDHCPOption(ctx context.Context, site string, d *DHCPOption) (*DHCPOption, error) {
return c.createDHCPOption(ctx, site, d)
}
func (c *client) GetDHCPOption(ctx context.Context, site, id string) (*DHCPOption, error) {
return c.getDHCPOption(ctx, site, id)
}
func (c *client) DeleteDHCPOption(ctx context.Context, site, id string) error {
return c.deleteDHCPOption(ctx, site, id)
}
func (c *client) UpdateDHCPOption(ctx context.Context, site string, d *DHCPOption) (*DHCPOption, error) {
return c.updateDHCPOption(ctx, site, d)
}

25
unifi/heat_map.go Normal file
View File

@@ -0,0 +1,25 @@
package unifi
import (
"context"
)
func (c *client) ListHeatMap(ctx context.Context, site string) ([]HeatMap, error) {
return c.listHeatMap(ctx, site)
}
func (c *client) GetHeatMap(ctx context.Context, site, id string) (*HeatMap, error) {
return c.getHeatMap(ctx, site, id)
}
func (c *client) DeleteHeatMap(ctx context.Context, site, id string) error {
return c.deleteHeatMap(ctx, site, id)
}
func (c *client) CreateHeatMap(ctx context.Context, site string, d *HeatMap) (*HeatMap, error) {
return c.createHeatMap(ctx, site, d)
}
func (c *client) UpdateHeatMap(ctx context.Context, site string, d *HeatMap) (*HeatMap, error) {
return c.updateHeatMap(ctx, site, d)
}

25
unifi/heat_map_point.go Normal file
View File

@@ -0,0 +1,25 @@
package unifi
import (
"context"
)
func (c *client) ListHeatMapPoint(ctx context.Context, site string) ([]HeatMapPoint, error) {
return c.listHeatMapPoint(ctx, site)
}
func (c *client) GetHeatMapPoint(ctx context.Context, site, id string) (*HeatMapPoint, error) {
return c.getHeatMapPoint(ctx, site, id)
}
func (c *client) DeleteHeatMapPoint(ctx context.Context, site, id string) error {
return c.deleteHeatMapPoint(ctx, site, id)
}
func (c *client) CreateHeatMapPoint(ctx context.Context, site string, d *HeatMapPoint) (*HeatMapPoint, error) {
return c.createHeatMapPoint(ctx, site, d)
}
func (c *client) UpdateHeatMapPoint(ctx context.Context, site string, d *HeatMapPoint) (*HeatMapPoint, error) {
return c.updateHeatMapPoint(ctx, site, d)
}

25
unifi/hotspot_2_conf.go Normal file
View File

@@ -0,0 +1,25 @@
package unifi
import (
"context"
)
func (c *client) ListHotspot2Conf(ctx context.Context, site string) ([]Hotspot2Conf, error) {
return c.listHotspot2Conf(ctx, site)
}
func (c *client) GetHotspot2Conf(ctx context.Context, site, id string) (*Hotspot2Conf, error) {
return c.getHotspot2Conf(ctx, site, id)
}
func (c *client) DeleteHotspot2Conf(ctx context.Context, site, id string) error {
return c.deleteHotspot2Conf(ctx, site, id)
}
func (c *client) CreateHotspot2Conf(ctx context.Context, site string, d *Hotspot2Conf) (*Hotspot2Conf, error) {
return c.createHotspot2Conf(ctx, site, d)
}
func (c *client) UpdateHotspot2Conf(ctx context.Context, site string, d *Hotspot2Conf) (*Hotspot2Conf, error) {
return c.updateHotspot2Conf(ctx, site, d)
}

25
unifi/hotspot_op.go Normal file
View File

@@ -0,0 +1,25 @@
package unifi
import (
"context"
)
func (c *client) ListHotspotOp(ctx context.Context, site string) ([]HotspotOp, error) {
return c.listHotspotOp(ctx, site)
}
func (c *client) GetHotspotOp(ctx context.Context, site, id string) (*HotspotOp, error) {
return c.getHotspotOp(ctx, site, id)
}
func (c *client) DeleteHotspotOp(ctx context.Context, site, id string) error {
return c.deleteHotspotOp(ctx, site, id)
}
func (c *client) CreateHotspotOp(ctx context.Context, site string, d *HotspotOp) (*HotspotOp, error) {
return c.createHotspotOp(ctx, site, d)
}
func (c *client) UpdateHotspotOp(ctx context.Context, site string, d *HotspotOp) (*HotspotOp, error) {
return c.updateHotspotOp(ctx, site, d)
}

25
unifi/hotspot_package.go Normal file
View File

@@ -0,0 +1,25 @@
package unifi
import (
"context"
)
func (c *client) ListHotspotPackage(ctx context.Context, site string) ([]HotspotPackage, error) {
return c.listHotspotPackage(ctx, site)
}
func (c *client) GetHotspotPackage(ctx context.Context, site, id string) (*HotspotPackage, error) {
return c.getHotspotPackage(ctx, site, id)
}
func (c *client) DeleteHotspotPackage(ctx context.Context, site, id string) error {
return c.deleteHotspotPackage(ctx, site, id)
}
func (c *client) CreateHotspotPackage(ctx context.Context, site string, d *HotspotPackage) (*HotspotPackage, error) {
return c.createHotspotPackage(ctx, site, d)
}
func (c *client) UpdateHotspotPackage(ctx context.Context, site string, d *HotspotPackage) (*HotspotPackage, error) {
return c.updateHotspotPackage(ctx, site, d)
}

25
unifi/map.go Normal file
View File

@@ -0,0 +1,25 @@
package unifi
import (
"context"
)
func (c *client) ListMap(ctx context.Context, site string) ([]Map, error) {
return c.listMap(ctx, site)
}
func (c *client) GetMap(ctx context.Context, site, id string) (*Map, error) {
return c.getMap(ctx, site, id)
}
func (c *client) DeleteMap(ctx context.Context, site, id string) error {
return c.deleteMap(ctx, site, id)
}
func (c *client) CreateMap(ctx context.Context, site string, d *Map) (*Map, error) {
return c.createMap(ctx, site, d)
}
func (c *client) UpdateMap(ctx context.Context, site string, d *Map) (*Map, error) {
return c.updateMap(ctx, site, d)
}

25
unifi/media_file.go Normal file
View File

@@ -0,0 +1,25 @@
package unifi
import (
"context"
)
func (c *client) ListMediaFile(ctx context.Context, site string) ([]MediaFile, error) {
return c.listMediaFile(ctx, site)
}
func (c *client) CreateMediaFile(ctx context.Context, site string, m *MediaFile) (*MediaFile, error) {
return c.createMediaFile(ctx, site, m)
}
func (c *client) GetMediaFile(ctx context.Context, site, id string) (*MediaFile, error) {
return c.getMediaFile(ctx, site, id)
}
func (c *client) DeleteMediaFile(ctx context.Context, site, id string) error {
return c.deleteMediaFile(ctx, site, id)
}
func (c *client) UpdateMediaFile(ctx context.Context, site string, d *MediaFile) (*MediaFile, error) {
return c.updateMediaFile(ctx, site, d)
}

25
unifi/schedule_task.go Normal file
View File

@@ -0,0 +1,25 @@
package unifi
import (
"context"
)
func (c *client) ListScheduleTask(ctx context.Context, site string) ([]ScheduleTask, error) {
return c.listScheduleTask(ctx, site)
}
func (c *client) GetScheduleTask(ctx context.Context, site, id string) (*ScheduleTask, error) {
return c.getScheduleTask(ctx, site, id)
}
func (c *client) CreateScheduleTask(ctx context.Context, site string, d *ScheduleTask) (*ScheduleTask, error) {
return c.createScheduleTask(ctx, site, d)
}
func (c *client) UpdateScheduleTask(ctx context.Context, site string, d *ScheduleTask) (*ScheduleTask, error) {
return c.updateScheduleTask(ctx, site, d)
}
func (c *client) DeleteScheduleTask(ctx context.Context, site, id string) error {
return c.deleteScheduleTask(ctx, site, id)
}

25
unifi/spatial_record.go Normal file
View File

@@ -0,0 +1,25 @@
package unifi
import (
"context"
)
func (c *client) ListSpatialRecord(ctx context.Context, site string) ([]SpatialRecord, error) {
return c.listSpatialRecord(ctx, site)
}
func (c *client) GetSpatialRecord(ctx context.Context, site, id string) (*SpatialRecord, error) {
return c.getSpatialRecord(ctx, site, id)
}
func (c *client) DeleteSpatialRecord(ctx context.Context, site, id string) error {
return c.deleteSpatialRecord(ctx, site, id)
}
func (c *client) CreateSpatialRecord(ctx context.Context, site string, d *SpatialRecord) (*SpatialRecord, error) {
return c.createSpatialRecord(ctx, site, d)
}
func (c *client) UpdateSpatialRecord(ctx context.Context, site string, d *SpatialRecord) (*SpatialRecord, error) {
return c.updateSpatialRecord(ctx, site, d)
}

25
unifi/tag.go Normal file
View File

@@ -0,0 +1,25 @@
package unifi
import (
"context"
)
func (c *client) ListTag(ctx context.Context, site string) ([]Tag, error) {
return c.listTag(ctx, site)
}
func (c *client) CreateTag(ctx context.Context, site string, d *Tag) (*Tag, error) {
return c.createTag(ctx, site, d)
}
func (c *client) GetTag(ctx context.Context, site, id string) (*Tag, error) {
return c.getTag(ctx, site, id)
}
func (c *client) DeleteTag(ctx context.Context, site, id string) error {
return c.deleteTag(ctx, site, id)
}
func (c *client) UpdateTag(ctx context.Context, site string, d *Tag) (*Tag, error) {
return c.updateTag(ctx, site, d)
}

25
unifi/virtual_device.go Normal file
View File

@@ -0,0 +1,25 @@
package unifi
import (
"context"
)
func (c *client) ListVirtualDevice(ctx context.Context, site string) ([]VirtualDevice, error) {
return c.listVirtualDevice(ctx, site)
}
func (c *client) GetVirtualDevice(ctx context.Context, site, id string) (*VirtualDevice, error) {
return c.getVirtualDevice(ctx, site, id)
}
func (c *client) DeleteVirtualDevice(ctx context.Context, site, id string) error {
return c.deleteVirtualDevice(ctx, site, id)
}
func (c *client) CreateVirtualDevice(ctx context.Context, site string, d *VirtualDevice) (*VirtualDevice, error) {
return c.createVirtualDevice(ctx, site, d)
}
func (c *client) UpdateVirtualDevice(ctx context.Context, site string, d *VirtualDevice) (*VirtualDevice, error) {
return c.updateVirtualDevice(ctx, site, d)
}