aboutsummaryrefslogtreecommitdiff
path: root/schedule.go
diff options
context:
space:
mode:
Diffstat (limited to 'schedule.go')
-rw-r--r--schedule.go21
1 files changed, 19 insertions, 2 deletions
diff --git a/schedule.go b/schedule.go
index f35802d..ce139e8 100644
--- a/schedule.go
+++ b/schedule.go
@@ -74,10 +74,27 @@ func (bridge *Bridge) GetSchedule(id string) (Schedule, error) {
return schedule, nil
}
-// func (bridge *Bridge) CreateSchedule(schedule interface{}) error {
-// return nil
+func (bridge *Bridge) CreateSchedule(schedule Schedule) error {
+ uri := fmt.Sprintf("/api/%s/schedules", bridge.Username)
+ body, _, err := bridge.Post(uri, schedule)
+ if err != nil {
+ return err
+ }
+
+ fmt.Println("CREATE SCHEDULE BODY: ", string(body))
+ // TODO: Not tested or fully implemented
+ return nil
+}
+
+// func (self *Schedule) Disable() {
+//
+// }
+//
+// func (self *Schedule) Enable() {
+//
// }
//
+//
// func (bridge *Bridge) GetSchedule(index int) (interface{}, error) {
// return []interface{}, nil
// }