# 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.CloudSearch.V1.Model.SuggestResult do
  @moduledoc """
  One suggestion result.

  ## Attributes

  *   `peopleSuggestion` (*type:* `GoogleApi.CloudSearch.V1.Model.PeopleSuggestion.t`, *default:* `nil`) - This is present when the suggestion indicates a person. It contains more information about the person - like their email ID, name etc.
  *   `querySuggestion` (*type:* `GoogleApi.CloudSearch.V1.Model.QuerySuggestion.t`, *default:* `nil`) - This field will be present if the suggested query is a word/phrase completion.
  *   `source` (*type:* `GoogleApi.CloudSearch.V1.Model.Source.t`, *default:* `nil`) - The source of the suggestion.
  *   `suggestedQuery` (*type:* `String.t`, *default:* `nil`) - The suggested query that will be used for search, when the user clicks on the suggestion
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :peopleSuggestion => GoogleApi.CloudSearch.V1.Model.PeopleSuggestion.t() | nil,
          :querySuggestion => GoogleApi.CloudSearch.V1.Model.QuerySuggestion.t() | nil,
          :source => GoogleApi.CloudSearch.V1.Model.Source.t() | nil,
          :suggestedQuery => String.t() | nil
        }

  field(:peopleSuggestion, as: GoogleApi.CloudSearch.V1.Model.PeopleSuggestion)
  field(:querySuggestion, as: GoogleApi.CloudSearch.V1.Model.QuerySuggestion)
  field(:source, as: GoogleApi.CloudSearch.V1.Model.Source)
  field(:suggestedQuery)
end

defimpl Poison.Decoder, for: GoogleApi.CloudSearch.V1.Model.SuggestResult do
  def decode(value, options) do
    GoogleApi.CloudSearch.V1.Model.SuggestResult.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudSearch.V1.Model.SuggestResult do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
