/*
 * 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.contentwarehouse.v1.model;

/**
 * A rate which applies based on the precise times of utilization. Defines a rate, as well as
 * restrictions on the start and end times which must be satisfied in order to be eligible for the
 * rate. See go/rate-schema for more details.
 *
 * <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 Document AI Warehouse 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 GeostoreTimeBasedRateProto extends com.google.api.client.json.GenericJson {

  /**
   * The rates for this rule. Each duration_based_rate defines the costs associated with a
   * particular duration of a stay. There must be at least one rate with range_start_seconds set to
   * 0 and there cannot be gaps between durations (i.e. there should be no interval uncovered
   * between 0 and the largest range_end_seconds of any duration-based rate).
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<GeostoreDurationBasedRateProto> durationBasedRate;

  static {
    // hack to force ProGuard to consider GeostoreDurationBasedRateProto used, since otherwise it would be stripped out
    // see https://github.com/google/google-api-java-client/issues/543
    com.google.api.client.util.Data.nullOf(GeostoreDurationBasedRateProto.class);
  }

  /**
   * If true, tax is included in the prices in this rate. If false, additional taxes may apply.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean taxIncluded;

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GeostoreTimeScheduleProto validEndWithin;

  /**
   * Time period during which utilization of this rate must start in order to be eligible for the
   * rate. If not set, there is no restriction on the time when the utilization starts.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GeostoreTimeScheduleProto validStartWithin;

  /**
   * The rates for this rule. Each duration_based_rate defines the costs associated with a
   * particular duration of a stay. There must be at least one rate with range_start_seconds set to
   * 0 and there cannot be gaps between durations (i.e. there should be no interval uncovered
   * between 0 and the largest range_end_seconds of any duration-based rate).
   * @return value or {@code null} for none
   */
  public java.util.List<GeostoreDurationBasedRateProto> getDurationBasedRate() {
    return durationBasedRate;
  }

  /**
   * The rates for this rule. Each duration_based_rate defines the costs associated with a
   * particular duration of a stay. There must be at least one rate with range_start_seconds set to
   * 0 and there cannot be gaps between durations (i.e. there should be no interval uncovered
   * between 0 and the largest range_end_seconds of any duration-based rate).
   * @param durationBasedRate durationBasedRate or {@code null} for none
   */
  public GeostoreTimeBasedRateProto setDurationBasedRate(java.util.List<GeostoreDurationBasedRateProto> durationBasedRate) {
    this.durationBasedRate = durationBasedRate;
    return this;
  }

  /**
   * If true, tax is included in the prices in this rate. If false, additional taxes may apply.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getTaxIncluded() {
    return taxIncluded;
  }

  /**
   * If true, tax is included in the prices in this rate. If false, additional taxes may apply.
   * @param taxIncluded taxIncluded or {@code null} for none
   */
  public GeostoreTimeBasedRateProto setTaxIncluded(java.lang.Boolean taxIncluded) {
    this.taxIncluded = taxIncluded;
    return this;
  }

  /**
   * @return value or {@code null} for none
   */
  public GeostoreTimeScheduleProto getValidEndWithin() {
    return validEndWithin;
  }

  /**
   * @param validEndWithin validEndWithin or {@code null} for none
   */
  public GeostoreTimeBasedRateProto setValidEndWithin(GeostoreTimeScheduleProto validEndWithin) {
    this.validEndWithin = validEndWithin;
    return this;
  }

  /**
   * Time period during which utilization of this rate must start in order to be eligible for the
   * rate. If not set, there is no restriction on the time when the utilization starts.
   * @return value or {@code null} for none
   */
  public GeostoreTimeScheduleProto getValidStartWithin() {
    return validStartWithin;
  }

  /**
   * Time period during which utilization of this rate must start in order to be eligible for the
   * rate. If not set, there is no restriction on the time when the utilization starts.
   * @param validStartWithin validStartWithin or {@code null} for none
   */
  public GeostoreTimeBasedRateProto setValidStartWithin(GeostoreTimeScheduleProto validStartWithin) {
    this.validStartWithin = validStartWithin;
    return this;
  }

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

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

}
