Regenerated types so that sub-types are not embedded.

This allows callers to create complex payloads; for example, to create a
Device type for a Unifi Switch with PortOverrides, the caller needs to
create these sub-types, which is not possible when it's purely embedded.
This commit is contained in:
James Stephenson
2020-09-02 17:35:14 -04:00
committed by Paul Tyng
parent 35eda4f67b
commit bee58f48d4
8 changed files with 420 additions and 349 deletions

View File

@@ -23,18 +23,20 @@ type ScheduleTask struct {
NoDelete bool `json:"attr_no_delete,omitempty"`
NoEdit bool `json:"attr_no_edit,omitempty"`
Action string `json:"action,omitempty"` // stream|upgrade
AdditionalSoundsEnabled bool `json:"additional_sounds_enabled"`
BroadcastgroupID string `json:"broadcastgroup_id"`
CronExpr string `json:"cron_expr,omitempty"`
ExecuteOnlyOnce bool `json:"execute_only_once"`
MediafileID string `json:"mediafile_id"`
Name string `json:"name,omitempty"`
SampleFilename string `json:"sample_filename,omitempty"`
StreamType string `json:"stream_type,omitempty"` // media|sample
UpgradeTargets []struct {
MAC string `json:"mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$
} `json:"upgrade_targets,omitempty"`
Action string `json:"action,omitempty"` // stream|upgrade
AdditionalSoundsEnabled bool `json:"additional_sounds_enabled"`
BroadcastgroupID string `json:"broadcastgroup_id"`
CronExpr string `json:"cron_expr,omitempty"`
ExecuteOnlyOnce bool `json:"execute_only_once"`
MediafileID string `json:"mediafile_id"`
Name string `json:"name,omitempty"`
SampleFilename string `json:"sample_filename,omitempty"`
StreamType string `json:"stream_type,omitempty"` // media|sample
UpgradeTargets []ScheduleTask_UpgradeTargets `json:"upgrade_targets,omitempty"`
}
type ScheduleTask_UpgradeTargets struct {
MAC string `json:"mac,omitempty"` // ^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$
}
func (c *Client) listScheduleTask(ctx context.Context, site string) ([]ScheduleTask, error) {