@@ -585,6 +585,88 @@ public ScheduleListResult getScheduleList(int page)
585585 return _scheduleClient .getScheduleList (page );
586586 }
587587
588+ /**
589+ * Update the schedule name
590+ * @param scheduleId The schedule id.
591+ * @param name The new name.
592+ * @return The schedule information after updated.
593+ * @throws APIConnectionException
594+ * @throws APIRequestException
595+ */
596+ public ScheduleResult updateScheduleName (String scheduleId , String name )
597+ throws APIConnectionException , APIRequestException {
598+ SchedulePayload payload = SchedulePayload .newBuilder ()
599+ .setName (name )
600+ .build ();
601+
602+ return updateSchedule (scheduleId , payload );
603+ }
604+
605+ /**
606+ * Enable the schedule.
607+ * @param scheduleId The schedule id.
608+ * @return The schedule information after updated.
609+ * @throws APIConnectionException
610+ * @throws APIRequestException
611+ */
612+ public ScheduleResult enableSchedule (String scheduleId )
613+ throws APIConnectionException , APIRequestException {
614+ SchedulePayload payload = SchedulePayload .newBuilder ()
615+ .setEnabled (true )
616+ .build ();
617+
618+ return updateSchedule (scheduleId , payload );
619+ }
620+
621+ /**
622+ * Disable the schedule.
623+ * @param scheduleId The schedule id.
624+ * @return The schedule information after updated.
625+ * @throws APIConnectionException
626+ * @throws APIRequestException
627+ */
628+ public ScheduleResult disableSchedule (String scheduleId )
629+ throws APIConnectionException , APIRequestException {
630+ SchedulePayload payload = SchedulePayload .newBuilder ()
631+ .setEnabled (false )
632+ .build ();
633+ return updateSchedule (scheduleId , payload );
634+ }
635+
636+ /**
637+ * Update the trigger of the schedule.
638+ * @param scheduleId The schedule id.
639+ * @param trigger The new trigger.
640+ * @return The schedule information after updated.
641+ * @throws APIConnectionException
642+ * @throws APIRequestException
643+ */
644+ public ScheduleResult updateScheduleTrigger (String scheduleId , TriggerPayload trigger )
645+ throws APIConnectionException , APIRequestException {
646+ SchedulePayload payload = SchedulePayload .newBuilder ()
647+ .setTrigger (trigger )
648+ .build ();
649+
650+ return updateSchedule (scheduleId , payload );
651+ }
652+
653+ /**
654+ * Update the push content of the schedule.
655+ * @param scheduleId The schedule id.
656+ * @param push The new push payload.
657+ * @return The schedule information after updated.
658+ * @throws APIConnectionException
659+ * @throws APIRequestException
660+ */
661+ public ScheduleResult updateSchedulePush (String scheduleId , PushPayload push )
662+ throws APIConnectionException , APIRequestException {
663+ SchedulePayload payload = SchedulePayload .newBuilder ()
664+ .setPush (push )
665+ .build ();
666+
667+ return updateSchedule (scheduleId , payload );
668+ }
669+
588670 /**
589671 * Update a schedule by the id.
590672 * @param scheduleId The schedule id to update.
0 commit comments