/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.storagetransfer.v1.model;

/**
 * Transfers can be scheduled to recur or to run just once.
 *
 * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Storage Transfer API. For a detailed explanation see:
 * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
 * </p>
 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class Schedule extends com.google.api.client.json.GenericJson {

  /**
   * The last day the recurring transfer will be run. If `scheduleEndDate` is the same as
   * `scheduleStartDate`, the transfer will be executed only once.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Date scheduleEndDate;

  /**
   * Required. The first day the recurring transfer is scheduled to run. If `scheduleStartDate` is
   * in the past, the transfer will run for the first time on the following day.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private Date scheduleStartDate;

  /**
   * The time in UTC at which the transfer will be scheduled to start in a day. Transfers may start
   * later than this time. If not specified, recurring and one-time transfers that are scheduled to
   * run today will run immediately; recurring transfers that are scheduled to run on a future date
   * will start at approximately midnight UTC on that date. Note that when configuring a transfer
   * with the Cloud Platform Console, the transfer's start time in a day is specified in your local
   * timezone.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private TimeOfDay startTimeOfDay;

  /**
   * The last day the recurring transfer will be run. If `scheduleEndDate` is the same as
   * `scheduleStartDate`, the transfer will be executed only once.
   * @return value or {@code null} for none
   */
  public Date getScheduleEndDate() {
    return scheduleEndDate;
  }

  /**
   * The last day the recurring transfer will be run. If `scheduleEndDate` is the same as
   * `scheduleStartDate`, the transfer will be executed only once.
   * @param scheduleEndDate scheduleEndDate or {@code null} for none
   */
  public Schedule setScheduleEndDate(Date scheduleEndDate) {
    this.scheduleEndDate = scheduleEndDate;
    return this;
  }

  /**
   * Required. The first day the recurring transfer is scheduled to run. If `scheduleStartDate` is
   * in the past, the transfer will run for the first time on the following day.
   * @return value or {@code null} for none
   */
  public Date getScheduleStartDate() {
    return scheduleStartDate;
  }

  /**
   * Required. The first day the recurring transfer is scheduled to run. If `scheduleStartDate` is
   * in the past, the transfer will run for the first time on the following day.
   * @param scheduleStartDate scheduleStartDate or {@code null} for none
   */
  public Schedule setScheduleStartDate(Date scheduleStartDate) {
    this.scheduleStartDate = scheduleStartDate;
    return this;
  }

  /**
   * The time in UTC at which the transfer will be scheduled to start in a day. Transfers may start
   * later than this time. If not specified, recurring and one-time transfers that are scheduled to
   * run today will run immediately; recurring transfers that are scheduled to run on a future date
   * will start at approximately midnight UTC on that date. Note that when configuring a transfer
   * with the Cloud Platform Console, the transfer's start time in a day is specified in your local
   * timezone.
   * @return value or {@code null} for none
   */
  public TimeOfDay getStartTimeOfDay() {
    return startTimeOfDay;
  }

  /**
   * The time in UTC at which the transfer will be scheduled to start in a day. Transfers may start
   * later than this time. If not specified, recurring and one-time transfers that are scheduled to
   * run today will run immediately; recurring transfers that are scheduled to run on a future date
   * will start at approximately midnight UTC on that date. Note that when configuring a transfer
   * with the Cloud Platform Console, the transfer's start time in a day is specified in your local
   * timezone.
   * @param startTimeOfDay startTimeOfDay or {@code null} for none
   */
  public Schedule setStartTimeOfDay(TimeOfDay startTimeOfDay) {
    this.startTimeOfDay = startTimeOfDay;
    return this;
  }

  @Override
  public Schedule set(String fieldName, Object value) {
    return (Schedule) super.set(fieldName, value);
  }

  @Override
  public Schedule clone() {
    return (Schedule) super.clone();
  }

}
