# 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.SearchApplication do
  @moduledoc """
  SearchApplication

  ## Attributes

  *   `dataSourceRestrictions` (*type:* `list(GoogleApi.CloudSearch.V1.Model.DataSourceRestriction.t)`, *default:* `nil`) - Retrictions applied to the configurations. The maximum number of elements is 10.
  *   `defaultFacetOptions` (*type:* `list(GoogleApi.CloudSearch.V1.Model.FacetOptions.t)`, *default:* `nil`) - The default fields for returning facet results. The sources specified here also have been included in data_source_restrictions above.
  *   `defaultSortOptions` (*type:* `GoogleApi.CloudSearch.V1.Model.SortOptions.t`, *default:* `nil`) - The default options for sorting the search results
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Display name of the Search Application. The maximum length is 300 characters.
  *   `enableAuditLog` (*type:* `boolean()`, *default:* `nil`) - Indicates whether audit logging is on/off for requests made for the search application in query APIs.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The name of the Search Application. Format: searchapplications/{application_id}.
  *   `operationIds` (*type:* `list(String.t)`, *default:* `nil`) - Output only. IDs of the Long Running Operations (LROs) currently running for this schema. Output only field.
  *   `queryInterpretationConfig` (*type:* `GoogleApi.CloudSearch.V1.Model.QueryInterpretationConfig.t`, *default:* `nil`) - The default options for query interpretation
  *   `returnResultThumbnailUrls` (*type:* `boolean()`, *default:* `nil`) - With each result we should return the URI for its thumbnail (when applicable)
  *   `scoringConfig` (*type:* `GoogleApi.CloudSearch.V1.Model.ScoringConfig.t`, *default:* `nil`) - Configuration for ranking results.
  *   `sourceConfig` (*type:* `list(GoogleApi.CloudSearch.V1.Model.SourceConfig.t)`, *default:* `nil`) - Configuration for a sources specified in data_source_restrictions.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dataSourceRestrictions =>
            list(GoogleApi.CloudSearch.V1.Model.DataSourceRestriction.t()) | nil,
          :defaultFacetOptions => list(GoogleApi.CloudSearch.V1.Model.FacetOptions.t()) | nil,
          :defaultSortOptions => GoogleApi.CloudSearch.V1.Model.SortOptions.t() | nil,
          :displayName => String.t() | nil,
          :enableAuditLog => boolean() | nil,
          :name => String.t() | nil,
          :operationIds => list(String.t()) | nil,
          :queryInterpretationConfig =>
            GoogleApi.CloudSearch.V1.Model.QueryInterpretationConfig.t() | nil,
          :returnResultThumbnailUrls => boolean() | nil,
          :scoringConfig => GoogleApi.CloudSearch.V1.Model.ScoringConfig.t() | nil,
          :sourceConfig => list(GoogleApi.CloudSearch.V1.Model.SourceConfig.t()) | nil
        }

  field(:dataSourceRestrictions,
    as: GoogleApi.CloudSearch.V1.Model.DataSourceRestriction,
    type: :list
  )

  field(:defaultFacetOptions, as: GoogleApi.CloudSearch.V1.Model.FacetOptions, type: :list)
  field(:defaultSortOptions, as: GoogleApi.CloudSearch.V1.Model.SortOptions)
  field(:displayName)
  field(:enableAuditLog)
  field(:name)
  field(:operationIds, type: :list)
  field(:queryInterpretationConfig, as: GoogleApi.CloudSearch.V1.Model.QueryInterpretationConfig)
  field(:returnResultThumbnailUrls)
  field(:scoringConfig, as: GoogleApi.CloudSearch.V1.Model.ScoringConfig)
  field(:sourceConfig, as: GoogleApi.CloudSearch.V1.Model.SourceConfig, type: :list)
end

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

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