# Copyright 2019 Google LLC
#
# 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.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpec do
  @moduledoc """
  This field specifies all conversational related parameters addition to traditional retail search.

  ## Attributes

  *   `conversationId` (*type:* `String.t`, *default:* `nil`) - This field specifies the conversation id, which maintains the state of the conversation between client side and server side. Use the value from the previous ConversationalSearchResult.conversation_id. For the initial request, this should be empty.
  *   `followupConversationRequested` (*type:* `boolean()`, *default:* `nil`) - This field specifies whether the customer would like to do conversational search. If this field is set to true, conversational related extra information will be returned from server side, including follow-up question, answer options, etc.
  *   `userAnswer` (*type:* `GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpecUserAnswer.t`, *default:* `nil`) - This field specifies the current user answer during the conversational search. This can be either user selected from suggested answers or user input plain text.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :conversationId => String.t() | nil,
          :followupConversationRequested => boolean() | nil,
          :userAnswer =>
            GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpecUserAnswer.t()
            | nil
        }

  field(:conversationId)
  field(:followupConversationRequested)

  field(:userAnswer,
    as:
      GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpecUserAnswer
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpec do
  def decode(value, options) do
    GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpec.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.Retail.V2.Model.GoogleCloudRetailV2SearchRequestConversationalSearchSpec do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
