# 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.EnterpriseTopazSidekickCommonDocument do
  @moduledoc """
  Representation of a document. NEXT_TAG: 15

  ## Attributes

  *   `accessType` (*type:* `String.t`, *default:* `nil`) - Access type, i.e., whether the user has access to the document or not.
  *   `debugInfo` (*type:* `GoogleApi.CloudSearch.V1.Model.EnterpriseTopazSidekickCommonDebugInfo.t`, *default:* `nil`) - Information for debugging.
  *   `documentId` (*type:* `String.t`, *default:* `nil`) - Document id.
  *   `driveDocumentMetadata` (*type:* `GoogleApi.CloudSearch.V1.Model.EnterpriseTopazSidekickCommonDocumentDriveDocumentMetadata.t`, *default:* `nil`) - Drive document metadata.
  *   `genericUrl` (*type:* `String.t`, *default:* `nil`) - Generic Drive-based url in the format of drive.google.com/open to be used for deeplink
  *   `justification` (*type:* `GoogleApi.CloudSearch.V1.Model.EnterpriseTopazSidekickCommonDocumentJustification.t`, *default:* `nil`) - Justification on why the document is selected.
  *   `mimeType` (*type:* `String.t`, *default:* `nil`) - MIME type
  *   `provenance` (*type:* `String.t`, *default:* `nil`) - Document provenance.
  *   `reason` (*type:* `String.t`, *default:* `nil`) - Justification of why this document is being returned.
  *   `snippet` (*type:* `String.t`, *default:* `nil`) - A sampling of the text from the document.
  *   `thumbnailUrl` (*type:* `String.t`, *default:* `nil`) - Thumbnail URL.
  *   `title` (*type:* `String.t`, *default:* `nil`) - Title of the document.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Type of the document.
  *   `url` (*type:* `String.t`, *default:* `nil`) - Absolute URL of the document.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accessType => String.t() | nil,
          :debugInfo =>
            GoogleApi.CloudSearch.V1.Model.EnterpriseTopazSidekickCommonDebugInfo.t() | nil,
          :documentId => String.t() | nil,
          :driveDocumentMetadata =>
            GoogleApi.CloudSearch.V1.Model.EnterpriseTopazSidekickCommonDocumentDriveDocumentMetadata.t()
            | nil,
          :genericUrl => String.t() | nil,
          :justification =>
            GoogleApi.CloudSearch.V1.Model.EnterpriseTopazSidekickCommonDocumentJustification.t()
            | nil,
          :mimeType => String.t() | nil,
          :provenance => String.t() | nil,
          :reason => String.t() | nil,
          :snippet => String.t() | nil,
          :thumbnailUrl => String.t() | nil,
          :title => String.t() | nil,
          :type => String.t() | nil,
          :url => String.t() | nil
        }

  field(:accessType)
  field(:debugInfo, as: GoogleApi.CloudSearch.V1.Model.EnterpriseTopazSidekickCommonDebugInfo)
  field(:documentId)

  field(:driveDocumentMetadata,
    as: GoogleApi.CloudSearch.V1.Model.EnterpriseTopazSidekickCommonDocumentDriveDocumentMetadata
  )

  field(:genericUrl)

  field(:justification,
    as: GoogleApi.CloudSearch.V1.Model.EnterpriseTopazSidekickCommonDocumentJustification
  )

  field(:mimeType)
  field(:provenance)
  field(:reason)
  field(:snippet)
  field(:thumbnailUrl)
  field(:title)
  field(:type)
  field(:url)
end

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

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