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

/**
 * The request to detect user's intent.
 *
 * <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 GoogleCloudDialogflowV2DetectIntentRequest extends com.google.api.client.json.GenericJson {

  /**
   * Optional. The natural language speech audio to be processed. This field should be populated iff
   * `query_input` is set to an input audio config. A single request can contain up to 1 minute of
   * speech audio data.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String inputAudio;

  /**
   * Optional. Instructs the speech synthesizer how to generate the output audio. If this field is
   * not set and agent-level speech synthesizer is not configured, no output audio is generated.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudDialogflowV2OutputAudioConfig outputAudioConfig;

  /**
   * Required. The input specification. It can be set to:
   *
   * 1.  an audio config     which instructs the speech recognizer how to process the speech audio,
   *
   * 2.  a conversational query in the form of text, or
   *
   * 3.  an event that specifies which intent to trigger.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudDialogflowV2QueryInput queryInput;

  /**
   * Optional. The parameters of this query.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private GoogleCloudDialogflowV2QueryParameters queryParams;

  /**
   * Optional. The natural language speech audio to be processed. This field should be populated iff
   * `query_input` is set to an input audio config. A single request can contain up to 1 minute of
   * speech audio data.
   * @see #decodeInputAudio()
   * @return value or {@code null} for none
   */
  public java.lang.String getInputAudio() {
    return inputAudio;
  }

  /**
   * Optional. The natural language speech audio to be processed. This field should be populated iff
   * `query_input` is set to an input audio config. A single request can contain up to 1 minute of
   * speech audio data.
   * @see #getInputAudio()
   * @return Base64 decoded value or {@code null} for none
   *
   * @since 1.14
   */
  public byte[] decodeInputAudio() {
    return com.google.api.client.util.Base64.decodeBase64(inputAudio);
  }

  /**
   * Optional. The natural language speech audio to be processed. This field should be populated iff
   * `query_input` is set to an input audio config. A single request can contain up to 1 minute of
   * speech audio data.
   * @see #encodeInputAudio()
   * @param inputAudio inputAudio or {@code null} for none
   */
  public GoogleCloudDialogflowV2DetectIntentRequest setInputAudio(java.lang.String inputAudio) {
    this.inputAudio = inputAudio;
    return this;
  }

  /**
   * Optional. The natural language speech audio to be processed. This field should be populated iff
   * `query_input` is set to an input audio config. A single request can contain up to 1 minute of
   * speech audio data.
   * @see #setInputAudio()
   *
   * <p>
   * The value is encoded Base64 or {@code null} for none.
   * </p>
   *
   * @since 1.14
   */
  public GoogleCloudDialogflowV2DetectIntentRequest encodeInputAudio(byte[] inputAudio) {
    this.inputAudio = com.google.api.client.util.Base64.encodeBase64URLSafeString(inputAudio);
    return this;
  }

  /**
   * Optional. Instructs the speech synthesizer how to generate the output audio. If this field is
   * not set and agent-level speech synthesizer is not configured, no output audio is generated.
   * @return value or {@code null} for none
   */
  public GoogleCloudDialogflowV2OutputAudioConfig getOutputAudioConfig() {
    return outputAudioConfig;
  }

  /**
   * Optional. Instructs the speech synthesizer how to generate the output audio. If this field is
   * not set and agent-level speech synthesizer is not configured, no output audio is generated.
   * @param outputAudioConfig outputAudioConfig or {@code null} for none
   */
  public GoogleCloudDialogflowV2DetectIntentRequest setOutputAudioConfig(GoogleCloudDialogflowV2OutputAudioConfig outputAudioConfig) {
    this.outputAudioConfig = outputAudioConfig;
    return this;
  }

  /**
   * Required. The input specification. It can be set to:
   *
   * 1.  an audio config     which instructs the speech recognizer how to process the speech audio,
   *
   * 2.  a conversational query in the form of text, or
   *
   * 3.  an event that specifies which intent to trigger.
   * @return value or {@code null} for none
   */
  public GoogleCloudDialogflowV2QueryInput getQueryInput() {
    return queryInput;
  }

  /**
   * Required. The input specification. It can be set to:
   *
   * 1.  an audio config     which instructs the speech recognizer how to process the speech audio,
   *
   * 2.  a conversational query in the form of text, or
   *
   * 3.  an event that specifies which intent to trigger.
   * @param queryInput queryInput or {@code null} for none
   */
  public GoogleCloudDialogflowV2DetectIntentRequest setQueryInput(GoogleCloudDialogflowV2QueryInput queryInput) {
    this.queryInput = queryInput;
    return this;
  }

  /**
   * Optional. The parameters of this query.
   * @return value or {@code null} for none
   */
  public GoogleCloudDialogflowV2QueryParameters getQueryParams() {
    return queryParams;
  }

  /**
   * Optional. The parameters of this query.
   * @param queryParams queryParams or {@code null} for none
   */
  public GoogleCloudDialogflowV2DetectIntentRequest setQueryParams(GoogleCloudDialogflowV2QueryParameters queryParams) {
    this.queryParams = queryParams;
    return this;
  }

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

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

}
