/*
 * 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.dialogflow.v2beta1.model;

/**
 * Represents a context.
 *
 * <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 Dialogflow 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 GoogleCloudDialogflowV2beta1Context extends com.google.api.client.json.GenericJson {

  /**
   * Optional. The number of conversational query requests after which the context expires. If set
   * to `0` (the default) the context expires immediately. Contexts expire automatically after 20
   * minutes if there are no matching queries.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Integer lifespanCount;

  /**
   * Required. The unique identifier of the context. Format: `projects//agent/sessions//contexts/`,
   * or `projects//agent/environments//users//sessions//contexts/`.
   *
   * The `Context ID` is always converted to lowercase, may only contain characters in a-zA-Z0-9_-%
   * and may be at most 250 bytes long.
   *
   * If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is
   * not specified, we assume default '-' user.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String name;

  /**
   * Optional. The collection of parameters associated with this context. Refer to [this
   * doc](https://cloud.google.com/dialogflow-enterprise/docs/intents-actions-parameters) for
   * syntax.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.util.Map<String, java.lang.Object> parameters;

  /**
   * Optional. The number of conversational query requests after which the context expires. If set
   * to `0` (the default) the context expires immediately. Contexts expire automatically after 20
   * minutes if there are no matching queries.
   * @return value or {@code null} for none
   */
  public java.lang.Integer getLifespanCount() {
    return lifespanCount;
  }

  /**
   * Optional. The number of conversational query requests after which the context expires. If set
   * to `0` (the default) the context expires immediately. Contexts expire automatically after 20
   * minutes if there are no matching queries.
   * @param lifespanCount lifespanCount or {@code null} for none
   */
  public GoogleCloudDialogflowV2beta1Context setLifespanCount(java.lang.Integer lifespanCount) {
    this.lifespanCount = lifespanCount;
    return this;
  }

  /**
   * Required. The unique identifier of the context. Format: `projects//agent/sessions//contexts/`,
   * or `projects//agent/environments//users//sessions//contexts/`.
   *
   * The `Context ID` is always converted to lowercase, may only contain characters in a-zA-Z0-9_-%
   * and may be at most 250 bytes long.
   *
   * If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is
   * not specified, we assume default '-' user.
   * @return value or {@code null} for none
   */
  public java.lang.String getName() {
    return name;
  }

  /**
   * Required. The unique identifier of the context. Format: `projects//agent/sessions//contexts/`,
   * or `projects//agent/environments//users//sessions//contexts/`.
   *
   * The `Context ID` is always converted to lowercase, may only contain characters in a-zA-Z0-9_-%
   * and may be at most 250 bytes long.
   *
   * If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is
   * not specified, we assume default '-' user.
   * @param name name or {@code null} for none
   */
  public GoogleCloudDialogflowV2beta1Context setName(java.lang.String name) {
    this.name = name;
    return this;
  }

  /**
   * Optional. The collection of parameters associated with this context. Refer to [this
   * doc](https://cloud.google.com/dialogflow-enterprise/docs/intents-actions-parameters) for
   * syntax.
   * @return value or {@code null} for none
   */
  public java.util.Map<String, java.lang.Object> getParameters() {
    return parameters;
  }

  /**
   * Optional. The collection of parameters associated with this context. Refer to [this
   * doc](https://cloud.google.com/dialogflow-enterprise/docs/intents-actions-parameters) for
   * syntax.
   * @param parameters parameters or {@code null} for none
   */
  public GoogleCloudDialogflowV2beta1Context setParameters(java.util.Map<String, java.lang.Object> parameters) {
    this.parameters = parameters;
    return this;
  }

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

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

}
