public CreateTaskRequest withSchedule(TaskSchedule schedule) {
        setSchedule(schedule);
        return this;
    }
<p>
Specifies a schedule for when you want your task to run. For more information, see <a
href="https://docs.aws.amazon.com/datasync/latest/userguide/task-scheduling.html">Scheduling your task</a>.
</p>

@param schedule
       Specifies a schedule for when you want your task to run. For more information, see <a
       href="https://docs.aws.amazon.com/datasync/latest/userguide/task-scheduling.html">Scheduling your
       task</a>.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-datasync/src/main/java/com/amazonaws/services/datasync/model/CreateTaskRequest.java