# 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.Books.V1.Model.Annotation do
  @moduledoc """


  ## Attributes

  *   `afterSelectedText` (*type:* `String.t`, *default:* `nil`) - Anchor text after excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty.
  *   `beforeSelectedText` (*type:* `String.t`, *default:* `nil`) - Anchor text before excerpt. For requests, if the user bookmarked a screen that has no flowing text on it, then this field should be empty.
  *   `clientVersionRanges` (*type:* `GoogleApi.Books.V1.Model.AnnotationClientVersionRanges.t`, *default:* `nil`) - Selection ranges sent from the client.
  *   `created` (*type:* `String.t`, *default:* `nil`) - Timestamp for the created time of this annotation.
  *   `currentVersionRanges` (*type:* `GoogleApi.Books.V1.Model.AnnotationCurrentVersionRanges.t`, *default:* `nil`) - Selection ranges for the most recent content version.
  *   `data` (*type:* `String.t`, *default:* `nil`) - User-created data for this annotation.
  *   `deleted` (*type:* `boolean()`, *default:* `nil`) - Indicates that this annotation is deleted.
  *   `highlightStyle` (*type:* `String.t`, *default:* `nil`) - The highlight style for this annotation.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Id of this annotation, in the form of a GUID.
  *   `kind` (*type:* `String.t`, *default:* `nil`) - Resource type.
  *   `layerId` (*type:* `String.t`, *default:* `nil`) - The layer this annotation is for.
  *   `layerSummary` (*type:* `GoogleApi.Books.V1.Model.AnnotationLayerSummary.t`, *default:* `nil`) - 
  *   `pageIds` (*type:* `list(String.t)`, *default:* `nil`) - Pages that this annotation spans.
  *   `selectedText` (*type:* `String.t`, *default:* `nil`) - Excerpt from the volume.
  *   `selfLink` (*type:* `String.t`, *default:* `nil`) - URL to this resource.
  *   `updated` (*type:* `String.t`, *default:* `nil`) - Timestamp for the last time this annotation was modified.
  *   `volumeId` (*type:* `String.t`, *default:* `nil`) - The volume that this annotation belongs to.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :afterSelectedText => String.t() | nil,
          :beforeSelectedText => String.t() | nil,
          :clientVersionRanges =>
            GoogleApi.Books.V1.Model.AnnotationClientVersionRanges.t() | nil,
          :created => String.t() | nil,
          :currentVersionRanges =>
            GoogleApi.Books.V1.Model.AnnotationCurrentVersionRanges.t() | nil,
          :data => String.t() | nil,
          :deleted => boolean() | nil,
          :highlightStyle => String.t() | nil,
          :id => String.t() | nil,
          :kind => String.t() | nil,
          :layerId => String.t() | nil,
          :layerSummary => GoogleApi.Books.V1.Model.AnnotationLayerSummary.t() | nil,
          :pageIds => list(String.t()) | nil,
          :selectedText => String.t() | nil,
          :selfLink => String.t() | nil,
          :updated => String.t() | nil,
          :volumeId => String.t() | nil
        }

  field(:afterSelectedText)
  field(:beforeSelectedText)
  field(:clientVersionRanges, as: GoogleApi.Books.V1.Model.AnnotationClientVersionRanges)
  field(:created)
  field(:currentVersionRanges, as: GoogleApi.Books.V1.Model.AnnotationCurrentVersionRanges)
  field(:data)
  field(:deleted)
  field(:highlightStyle)
  field(:id)
  field(:kind)
  field(:layerId)
  field(:layerSummary, as: GoogleApi.Books.V1.Model.AnnotationLayerSummary)
  field(:pageIds, type: :list)
  field(:selectedText)
  field(:selfLink)
  field(:updated)
  field(:volumeId)
end

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

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