# 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.Places.V1.Model.GoogleMapsPlacesV1SearchTextResponse do
  @moduledoc """
  Response proto for SearchText. 

  ## Attributes

  *   `contextualContents` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1ContextualContent.t)`, *default:* `nil`) - Experimental: See https://developers.google.com/maps/documentation/places/web-service/experimental/places-generative for more details. A list of contextual contents where each entry associates to the corresponding place in the same index in the places field. The contents that are relevant to the `text_query` in the request are preferred. If the contextual content is not available for one of the places, it will return non-contextual content. It will be empty only when the content is unavailable for this place. This list will have as many entries as the list of places if requested.
  *   `nextPageToken` (*type:* `String.t`, *default:* `nil`) - A token that can be sent as `page_token` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages.
  *   `places` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place.t)`, *default:* `nil`) - A list of places that meet the user's text search criteria.
  *   `routingSummaries` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummary.t)`, *default:* `nil`) - A list of routing summaries where each entry associates to the corresponding place in the same index in the `places` field. If the routing summary is not available for one of the places, it will contain an empty entry. This list will have as many entries as the list of places if requested.
  *   `searchUri` (*type:* `String.t`, *default:* `nil`) - A link allows the user to search with the same text query as specified in the request on Google Maps.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :contextualContents =>
            list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1ContextualContent.t()) | nil,
          :nextPageToken => String.t() | nil,
          :places => list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place.t()) | nil,
          :routingSummaries =>
            list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummary.t()) | nil,
          :searchUri => String.t() | nil
        }

  field(:contextualContents,
    as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1ContextualContent,
    type: :list
  )

  field(:nextPageToken)
  field(:places, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place, type: :list)

  field(:routingSummaries,
    as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummary,
    type: :list
  )

  field(:searchUri)
end

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

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