/*
 * 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;

/**
 * For a more detailed presentation on what's a fetching operation, see go/datetime-meaning-schemas.
 * Examples to illustrate how the proto is used: I. Fetching day-of-weeks: a) query: "1st 2 Mondays
 * of April" proto: ordinal: 1 target {weekday: MONDAY} count: 2 range: {begin {year: RESOLVED_YEAR
 * month: APRIL day: 1} {end {year: RESOLVED_YEAR month: APRIL day: 30} b) query: "1st and last
 * Monday of April" proto: ordinal: 1 ordinal: -1 target {weekday: MONDAY} range: {begin {year:
 * RESOLVED_YEAR month: APRIL day: 1} {end {year: RESOLVED_YEAR month: APRIL day: 30} c) query:
 * "next Monday" proto: ordinal: 1 target {weekday: MONDAY} d) query: "last 2 Mondays" proto:
 * ordinal: -1 count: 2 target {weekday: MONDAY} e) query: "this Monday" proto: ordinal: 0 target
 * {weekday: MONDAY} f) query: "the monday after next" proto: ordinal: 2 target {weekday: MONDAY} g)
 * query: "third Monday in April" proto: ordinal: 3 target {weekday: MONDAY} range: {begin {year:
 * RESOLVED_YEAR month: APRIL day: 1} {end {year: RESOLVED_YEAR month: APRIL day: 30} h) query: "the
 * monday before last" proto: ordinal: -2 target {weekday: MONDAY} i) query: "the second to the last
 * monday in April" proto: ordinal: -2 target {weekday: MONDAY} range: {begin {year: RESOLVED_YEAR
 * month: APRIL day: 1} {end {year: RESOLVED_YEAR month: APRIL day: 30} II. Fetching date/time unit:
 * a) query: "1st 2 weeks of April" proto: ordinal: 1 target {unit: WEEK} count: 2 range: {begin
 * {year: RESOLVED_YEAR month: APRIL day: 1} {end {year: RESOLVED_YEAR month: APRIL day: 30} b)
 * query: "1st and last week of April" proto: ordinal: 1 ordinal: -1 target {unit: WEEK} range:
 * {begin {year: RESOLVED_YEAR month: APRIL day: 1} {end {year: RESOLVED_YEAR month: APRIL day: 30}
 * c) query: "next year" proto: ordinal: 1 target {unit: YEAR} d) query: "last 2 weeks" proto:
 * ordinal: -1 count: 2 target {unit: WEEK} e) query: "this month" proto: ordinal: 0 target {unit:
 * MONTH} f) query: "the week after next" proto: ordinal: 2 target {unit: WEEK} g) query: "third
 * week in April" proto: ordinal: 3 target {unit: WEEK} range: {begin {year: RESOLVED_YEAR month:
 * APRIL day: 1} {end {year: RESOLVED_YEAR month: APRIL day: 30} h) query: "the week before last"
 * proto: ordinal: -2 target {unit: WEEK} i) query: "the second to the last week in April" proto:
 * ordinal: -2 target {unit: WEEK} range: {begin {year: RESOLVED_YEAR month: APRIL day: 1} {end
 * {year: RESOLVED_YEAR month: APRIL day: 30} Next field: 9
 *
 * <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 NlpSemanticParsingDatetimeFetchedRelativeDateTime extends com.google.api.client.json.GenericJson {

  /**
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String baseType;

  /**
   * How many to fetch (e.g. [next weekend] vs. [next two weeks])
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Long count;

  /**
   * Can be used to tag relative datetime expressions with metadata information in the grammar.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String metadata;

  /**
   * Encodes expressions like next (+1), last (-1), after next (+2), this (0).
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.List<java.lang.Integer> ordinal;

  /**
   * The restriction range on which fetching is operated, e.g., "April" in "first Tuesday in/of
   * April." If this field is missing, the operation is done relative to the base_type (or if not
   * given, to the query's reference datetime). When the fetching operation is performed relative to
   * a reference time point, positive ordinal values represent upcoming instances from the reference
   * point, negative ordinal values represent previous instances from the reference point.
   * Similarly, ordinal=0 represents a reference to the "current instance", which may vary depending
   * on the target. E.g. "this week" is simply defined as the week range that contains the current
   * reference time point, but "this " can be ambiguous and its resolution will depend on
   * language/locale conventions ("this monday" in some languages refers to the closest upcoming
   * instance of Monday, while in other languages it represents the Monday instance within the
   * current week).
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private NlpSemanticParsingDatetimeRange range;

  /**
   * Modifier that return the appropriate subrange. For more information, see the description of
   * RangeOfDateTimeModifier. Example: * *early* next week * *late* next Monday
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String rangeModifier;

  /**
   * If the underlying range comes from a relative datetime expression, encode the expression here
   * instead.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private NlpSemanticParsingDatetimeResolutionProperties relativeRange;

  /**
   * The target to be fetched. This could be a named day-of-week or month (e.g., "Monday", "April"),
   * or a date/time unit (e.g., "day", "week", "month").
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private NlpSemanticParsingDatetimeTargetToFetch target;

  /**
   * @return value or {@code null} for none
   */
  public java.lang.String getBaseType() {
    return baseType;
  }

  /**
   * @param baseType baseType or {@code null} for none
   */
  public NlpSemanticParsingDatetimeFetchedRelativeDateTime setBaseType(java.lang.String baseType) {
    this.baseType = baseType;
    return this;
  }

  /**
   * How many to fetch (e.g. [next weekend] vs. [next two weeks])
   * @return value or {@code null} for none
   */
  public java.lang.Long getCount() {
    return count;
  }

  /**
   * How many to fetch (e.g. [next weekend] vs. [next two weeks])
   * @param count count or {@code null} for none
   */
  public NlpSemanticParsingDatetimeFetchedRelativeDateTime setCount(java.lang.Long count) {
    this.count = count;
    return this;
  }

  /**
   * Can be used to tag relative datetime expressions with metadata information in the grammar.
   * @return value or {@code null} for none
   */
  public java.lang.String getMetadata() {
    return metadata;
  }

  /**
   * Can be used to tag relative datetime expressions with metadata information in the grammar.
   * @param metadata metadata or {@code null} for none
   */
  public NlpSemanticParsingDatetimeFetchedRelativeDateTime setMetadata(java.lang.String metadata) {
    this.metadata = metadata;
    return this;
  }

  /**
   * Encodes expressions like next (+1), last (-1), after next (+2), this (0).
   * @return value or {@code null} for none
   */
  public java.util.List<java.lang.Integer> getOrdinal() {
    return ordinal;
  }

  /**
   * Encodes expressions like next (+1), last (-1), after next (+2), this (0).
   * @param ordinal ordinal or {@code null} for none
   */
  public NlpSemanticParsingDatetimeFetchedRelativeDateTime setOrdinal(java.util.List<java.lang.Integer> ordinal) {
    this.ordinal = ordinal;
    return this;
  }

  /**
   * The restriction range on which fetching is operated, e.g., "April" in "first Tuesday in/of
   * April." If this field is missing, the operation is done relative to the base_type (or if not
   * given, to the query's reference datetime). When the fetching operation is performed relative to
   * a reference time point, positive ordinal values represent upcoming instances from the reference
   * point, negative ordinal values represent previous instances from the reference point.
   * Similarly, ordinal=0 represents a reference to the "current instance", which may vary depending
   * on the target. E.g. "this week" is simply defined as the week range that contains the current
   * reference time point, but "this " can be ambiguous and its resolution will depend on
   * language/locale conventions ("this monday" in some languages refers to the closest upcoming
   * instance of Monday, while in other languages it represents the Monday instance within the
   * current week).
   * @return value or {@code null} for none
   */
  public NlpSemanticParsingDatetimeRange getRange() {
    return range;
  }

  /**
   * The restriction range on which fetching is operated, e.g., "April" in "first Tuesday in/of
   * April." If this field is missing, the operation is done relative to the base_type (or if not
   * given, to the query's reference datetime). When the fetching operation is performed relative to
   * a reference time point, positive ordinal values represent upcoming instances from the reference
   * point, negative ordinal values represent previous instances from the reference point.
   * Similarly, ordinal=0 represents a reference to the "current instance", which may vary depending
   * on the target. E.g. "this week" is simply defined as the week range that contains the current
   * reference time point, but "this " can be ambiguous and its resolution will depend on
   * language/locale conventions ("this monday" in some languages refers to the closest upcoming
   * instance of Monday, while in other languages it represents the Monday instance within the
   * current week).
   * @param range range or {@code null} for none
   */
  public NlpSemanticParsingDatetimeFetchedRelativeDateTime setRange(NlpSemanticParsingDatetimeRange range) {
    this.range = range;
    return this;
  }

  /**
   * Modifier that return the appropriate subrange. For more information, see the description of
   * RangeOfDateTimeModifier. Example: * *early* next week * *late* next Monday
   * @return value or {@code null} for none
   */
  public java.lang.String getRangeModifier() {
    return rangeModifier;
  }

  /**
   * Modifier that return the appropriate subrange. For more information, see the description of
   * RangeOfDateTimeModifier. Example: * *early* next week * *late* next Monday
   * @param rangeModifier rangeModifier or {@code null} for none
   */
  public NlpSemanticParsingDatetimeFetchedRelativeDateTime setRangeModifier(java.lang.String rangeModifier) {
    this.rangeModifier = rangeModifier;
    return this;
  }

  /**
   * If the underlying range comes from a relative datetime expression, encode the expression here
   * instead.
   * @return value or {@code null} for none
   */
  public NlpSemanticParsingDatetimeResolutionProperties getRelativeRange() {
    return relativeRange;
  }

  /**
   * If the underlying range comes from a relative datetime expression, encode the expression here
   * instead.
   * @param relativeRange relativeRange or {@code null} for none
   */
  public NlpSemanticParsingDatetimeFetchedRelativeDateTime setRelativeRange(NlpSemanticParsingDatetimeResolutionProperties relativeRange) {
    this.relativeRange = relativeRange;
    return this;
  }

  /**
   * The target to be fetched. This could be a named day-of-week or month (e.g., "Monday", "April"),
   * or a date/time unit (e.g., "day", "week", "month").
   * @return value or {@code null} for none
   */
  public NlpSemanticParsingDatetimeTargetToFetch getTarget() {
    return target;
  }

  /**
   * The target to be fetched. This could be a named day-of-week or month (e.g., "Monday", "April"),
   * or a date/time unit (e.g., "day", "week", "month").
   * @param target target or {@code null} for none
   */
  public NlpSemanticParsingDatetimeFetchedRelativeDateTime setTarget(NlpSemanticParsingDatetimeTargetToFetch target) {
    this.target = target;
    return this;
  }

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

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

}
