Skip to main content

lib/docusign/model/document.ex

# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.

defmodule DocuSign.Model.Document do
  @moduledoc """
  A document object.
  """

  @derive [Poison.Encoder]
  defstruct [
    :applyAnchorTabs,
    :authoritativeCopy,
    :display,
    :documentBase64,
    :documentFields,
    :documentGroup,
    :documentId,
    :encryptedWithKeyManager,
    :fileExtension,
    :fileFormatHint,
    :includeInDownload,
    :matchBoxes,
    :name,
    :order,
    :pages,
    :password,
    :remoteUrl,
    :signerMustAcknowledge,
    :templateLocked,
    :templateRequired,
    :transformPdfFields,
    :uri
  ]

  @type t :: %__MODULE__{
          :applyAnchorTabs => String.t(),
          :authoritativeCopy => boolean(),
          :display => String.t(),
          :documentBase64 => String.t(),
          :documentFields => [NameValue],
          :documentGroup => String.t(),
          :documentId => String.t(),
          :encryptedWithKeyManager => String.t(),
          :fileExtension => String.t(),
          :fileFormatHint => String.t(),
          :includeInDownload => String.t(),
          :matchBoxes => [MatchBox],
          :name => String.t(),
          :order => String.t(),
          :pages => String.t(),
          :password => String.t(),
          :remoteUrl => String.t(),
          :signerMustAcknowledge => String.t(),
          :templateLocked => String.t(),
          :templateRequired => String.t(),
          :transformPdfFields => String.t(),
          :uri => String.t()
        }
end

defimpl Poison.Decoder, for: DocuSign.Model.Document do
  import DocuSign.Deserializer

  def decode(value, options) do
    value
    |> deserialize(:documentFields, :list, DocuSign.Model.NameValue, options)
    |> deserialize(:matchBoxes, :list, DocuSign.Model.MatchBox, options)
  end
end