class SignRequestClient::Document

Attributes

api_used[RW]

Indicates whether document was created using the API

attachments[RW]
auto_delete_after[RW]

Date and time calculated using `auto_delete_days` after which a finished document (signed/cancelled/declined) will be automatically deleted

auto_delete_days[RW]

Number of days after which a finished document (signed/cancelled/declined) will be automatically deleted

auto_expire_after[RW]

Date and time calculated using `auto_expire_days` after which a non finished document will be automatically expired

auto_expire_days[RW]

Number of days after which a non finished document will be automatically expired

events_callback_url[RW]

URL at which to receive [event callbacks](section/Events/Events-callback) for this document

external_id[RW]

ID used to reference document in external system

file[RW]

Temporary URL to original file, expires in five minutes

file_as_pdf[RW]

Temporary URL to original file as PDF, expires in five minutes

file_from_content[RW]

Base64 encoded document content

file_from_content_name[RW]

Filename, including extension. Required when using `file_from_content`.

file_from_sf[RW]
file_from_url[RW]

Publicly accessible URL of document to be downloaded by SignRequest

frontend_id[RW]

Shared secret used in conjunction with <a href="#section/Frontend-API/SignRequest-js-client-(beta)">SignRequest-js client</a> to grant user access to a document that's not a member of the document's team

integrations[RW]
name[RW]

Defaults to filename, including extension

pdf[RW]

Temporary URL to signed document as PDF, expires in five minutes

prefill_tags[RW]

Prefill signer input data, see [prefill tags](section/Preparing-a-document/Prefill-tags-templates)

processing[RW]

Indicates whether a change to the document is processing and the PDF may be out of date. It is recommended to wait until processing has finished before downloading the PDF. Webhooks are not sent until processing has been completed.

sandbox[RW]

Indicates whether document was created as part of a sandbox team

security_hash[RW]

SHA256 hash of PDF contents

signing_log[RW]
signrequest[RW]
status[RW]

`co`: converting, `ne`: new, `se`: sent, `vi`: viewed, `si`: signed, `do`: downloaded, `sd`: signed and downloaded, `ca`: cancelled, `de`: declined, `ec`: error converting, `es`: error sending, `xp`: expired

team[RW]
template[RW]
url[RW]
user[RW]
uuid[RW]

Public Class Methods

attribute_map() click to toggle source

Attribute mapping from ruby-style variable name to JSON key.

# File lib/signrequest_client/models/document.rb, line 120
def self.attribute_map
  {
    :'url' => :'url',
    :'team' => :'team',
    :'uuid' => :'uuid',
    :'user' => :'user',
    :'file_as_pdf' => :'file_as_pdf',
    :'name' => :'name',
    :'external_id' => :'external_id',
    :'frontend_id' => :'frontend_id',
    :'file' => :'file',
    :'file_from_url' => :'file_from_url',
    :'events_callback_url' => :'events_callback_url',
    :'file_from_content' => :'file_from_content',
    :'file_from_content_name' => :'file_from_content_name',
    :'template' => :'template',
    :'prefill_tags' => :'prefill_tags',
    :'integrations' => :'integrations',
    :'file_from_sf' => :'file_from_sf',
    :'auto_delete_days' => :'auto_delete_days',
    :'auto_expire_days' => :'auto_expire_days',
    :'pdf' => :'pdf',
    :'status' => :'status',
    :'signrequest' => :'signrequest',
    :'api_used' => :'api_used',
    :'signing_log' => :'signing_log',
    :'security_hash' => :'security_hash',
    :'attachments' => :'attachments',
    :'auto_delete_after' => :'auto_delete_after',
    :'sandbox' => :'sandbox',
    :'auto_expire_after' => :'auto_expire_after',
    :'processing' => :'processing'
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/signrequest_client/models/document.rb, line 193
def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'url')
    self.url = attributes[:'url']
  end

  if attributes.has_key?(:'team')
    self.team = attributes[:'team']
  end

  if attributes.has_key?(:'uuid')
    self.uuid = attributes[:'uuid']
  end

  if attributes.has_key?(:'user')
    self.user = attributes[:'user']
  end

  if attributes.has_key?(:'file_as_pdf')
    self.file_as_pdf = attributes[:'file_as_pdf']
  end

  if attributes.has_key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.has_key?(:'external_id')
    self.external_id = attributes[:'external_id']
  end

  if attributes.has_key?(:'frontend_id')
    self.frontend_id = attributes[:'frontend_id']
  end

  if attributes.has_key?(:'file')
    self.file = attributes[:'file']
  end

  if attributes.has_key?(:'file_from_url')
    self.file_from_url = attributes[:'file_from_url']
  end

  if attributes.has_key?(:'events_callback_url')
    self.events_callback_url = attributes[:'events_callback_url']
  end

  if attributes.has_key?(:'file_from_content')
    self.file_from_content = attributes[:'file_from_content']
  end

  if attributes.has_key?(:'file_from_content_name')
    self.file_from_content_name = attributes[:'file_from_content_name']
  end

  if attributes.has_key?(:'template')
    self.template = attributes[:'template']
  end

  if attributes.has_key?(:'prefill_tags')
    if (value = attributes[:'prefill_tags']).is_a?(Array)
      self.prefill_tags = value
    end
  end

  if attributes.has_key?(:'integrations')
    if (value = attributes[:'integrations']).is_a?(Array)
      self.integrations = value
    end
  end

  if attributes.has_key?(:'file_from_sf')
    self.file_from_sf = attributes[:'file_from_sf']
  end

  if attributes.has_key?(:'auto_delete_days')
    self.auto_delete_days = attributes[:'auto_delete_days']
  end

  if attributes.has_key?(:'auto_expire_days')
    self.auto_expire_days = attributes[:'auto_expire_days']
  end

  if attributes.has_key?(:'pdf')
    self.pdf = attributes[:'pdf']
  end

  if attributes.has_key?(:'status')
    self.status = attributes[:'status']
  end

  if attributes.has_key?(:'signrequest')
    self.signrequest = attributes[:'signrequest']
  end

  if attributes.has_key?(:'api_used')
    self.api_used = attributes[:'api_used']
  end

  if attributes.has_key?(:'signing_log')
    self.signing_log = attributes[:'signing_log']
  end

  if attributes.has_key?(:'security_hash')
    self.security_hash = attributes[:'security_hash']
  end

  if attributes.has_key?(:'attachments')
    if (value = attributes[:'attachments']).is_a?(Array)
      self.attachments = value
    end
  end

  if attributes.has_key?(:'auto_delete_after')
    self.auto_delete_after = attributes[:'auto_delete_after']
  end

  if attributes.has_key?(:'sandbox')
    self.sandbox = attributes[:'sandbox']
  end

  if attributes.has_key?(:'auto_expire_after')
    self.auto_expire_after = attributes[:'auto_expire_after']
  end

  if attributes.has_key?(:'processing')
    self.processing = attributes[:'processing']
  end
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/signrequest_client/models/document.rb, line 156
def self.swagger_types
  {
    :'url' => :'String',
    :'team' => :'DocumentTeam',
    :'uuid' => :'String',
    :'user' => :'User',
    :'file_as_pdf' => :'String',
    :'name' => :'String',
    :'external_id' => :'String',
    :'frontend_id' => :'String',
    :'file' => :'String',
    :'file_from_url' => :'String',
    :'events_callback_url' => :'String',
    :'file_from_content' => :'String',
    :'file_from_content_name' => :'String',
    :'template' => :'String',
    :'prefill_tags' => :'Array<InlinePrefillTags>',
    :'integrations' => :'Array<InlineIntegrationData>',
    :'file_from_sf' => :'FileFromSf',
    :'auto_delete_days' => :'Integer',
    :'auto_expire_days' => :'Integer',
    :'pdf' => :'String',
    :'status' => :'String',
    :'signrequest' => :'DocumentSignrequest',
    :'api_used' => :'BOOLEAN',
    :'signing_log' => :'DocumentSigningLog',
    :'security_hash' => :'String',
    :'attachments' => :'Array<DocumentAttachment>',
    :'auto_delete_after' => :'DateTime',
    :'sandbox' => :'BOOLEAN',
    :'auto_expire_after' => :'DateTime',
    :'processing' => :'BOOLEAN'
  }
end

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File lib/signrequest_client/models/document.rb, line 521
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      url == o.url &&
      team == o.team &&
      uuid == o.uuid &&
      user == o.user &&
      file_as_pdf == o.file_as_pdf &&
      name == o.name &&
      external_id == o.external_id &&
      frontend_id == o.frontend_id &&
      file == o.file &&
      file_from_url == o.file_from_url &&
      events_callback_url == o.events_callback_url &&
      file_from_content == o.file_from_content &&
      file_from_content_name == o.file_from_content_name &&
      template == o.template &&
      prefill_tags == o.prefill_tags &&
      integrations == o.integrations &&
      file_from_sf == o.file_from_sf &&
      auto_delete_days == o.auto_delete_days &&
      auto_expire_days == o.auto_expire_days &&
      pdf == o.pdf &&
      status == o.status &&
      signrequest == o.signrequest &&
      api_used == o.api_used &&
      signing_log == o.signing_log &&
      security_hash == o.security_hash &&
      attachments == o.attachments &&
      auto_delete_after == o.auto_delete_after &&
      sandbox == o.sandbox &&
      auto_expire_after == o.auto_expire_after &&
      processing == o.processing
end
_deserialize(type, value) click to toggle source

Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data

# File lib/signrequest_client/models/document.rb, line 592
def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = SignRequestClient.const_get(type).new
    temp_model.build_from_hash(value)
  end
end
_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/signrequest_client/models/document.rb, line 658
def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end
auto_delete_days=(auto_delete_days) click to toggle source

Custom attribute writer method with validation @param [Object] auto_delete_days Value to be assigned

# File lib/signrequest_client/models/document.rb, line 473
def auto_delete_days=(auto_delete_days)
  if !auto_delete_days.nil? && auto_delete_days > 730
    fail ArgumentError, 'invalid value for "auto_delete_days", must be smaller than or equal to 730.'
  end

  if !auto_delete_days.nil? && auto_delete_days < 1
    fail ArgumentError, 'invalid value for "auto_delete_days", must be greater than or equal to 1.'
  end

  @auto_delete_days = auto_delete_days
end
auto_expire_days=(auto_expire_days) click to toggle source

Custom attribute writer method with validation @param [Object] auto_expire_days Value to be assigned

# File lib/signrequest_client/models/document.rb, line 487
def auto_expire_days=(auto_expire_days)
  if !auto_expire_days.nil? && auto_expire_days > 730
    fail ArgumentError, 'invalid value for "auto_expire_days", must be smaller than or equal to 730.'
  end

  if !auto_expire_days.nil? && auto_expire_days < 1
    fail ArgumentError, 'invalid value for "auto_expire_days", must be greater than or equal to 1.'
  end

  @auto_expire_days = auto_expire_days
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/signrequest_client/models/document.rb, line 571
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end
eql?(o) click to toggle source

@see the `==` method @param [Object] Object to be compared

# File lib/signrequest_client/models/document.rb, line 558
def eql?(o)
  self == o
end
events_callback_url=(events_callback_url) click to toggle source

Custom attribute writer method with validation @param [Object] events_callback_url Value to be assigned

# File lib/signrequest_client/models/document.rb, line 463
def events_callback_url=(events_callback_url)
  if !events_callback_url.nil? && events_callback_url.to_s.length > 2100
    fail ArgumentError, 'invalid value for "events_callback_url", the character length must be smaller than or equal to 2100.'
  end

  @events_callback_url = events_callback_url
end
external_id=(external_id) click to toggle source

Custom attribute writer method with validation @param [Object] external_id Value to be assigned

# File lib/signrequest_client/models/document.rb, line 433
def external_id=(external_id)
  if !external_id.nil? && external_id.to_s.length > 255
    fail ArgumentError, 'invalid value for "external_id", the character length must be smaller than or equal to 255.'
  end

  @external_id = external_id
end
file_as_pdf=(file_as_pdf) click to toggle source

Custom attribute writer method with validation @param [Object] file_as_pdf Value to be assigned

# File lib/signrequest_client/models/document.rb, line 413
def file_as_pdf=(file_as_pdf)
  if !file_as_pdf.nil? && file_as_pdf.to_s.length < 1
    fail ArgumentError, 'invalid value for "file_as_pdf", the character length must be great than or equal to 1.'
  end

  @file_as_pdf = file_as_pdf
end
file_from_url=(file_from_url) click to toggle source

Custom attribute writer method with validation @param [Object] file_from_url Value to be assigned

# File lib/signrequest_client/models/document.rb, line 453
def file_from_url=(file_from_url)
  if !file_from_url.nil? && file_from_url.to_s.length > 2100
    fail ArgumentError, 'invalid value for "file_from_url", the character length must be smaller than or equal to 2100.'
  end

  @file_from_url = file_from_url
end
frontend_id=(frontend_id) click to toggle source

Custom attribute writer method with validation @param [Object] frontend_id Value to be assigned

# File lib/signrequest_client/models/document.rb, line 443
def frontend_id=(frontend_id)
  if !frontend_id.nil? && frontend_id.to_s.length > 255
    fail ArgumentError, 'invalid value for "frontend_id", the character length must be smaller than or equal to 255.'
  end

  @frontend_id = frontend_id
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/signrequest_client/models/document.rb, line 564
def hash
  [url, team, uuid, user, file_as_pdf, name, external_id, frontend_id, file, file_from_url, events_callback_url, file_from_content, file_from_content_name, template, prefill_tags, integrations, file_from_sf, auto_delete_days, auto_expire_days, pdf, status, signrequest, api_used, signing_log, security_hash, attachments, auto_delete_after, sandbox, auto_expire_after, processing].hash
end
list_invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/signrequest_client/models/document.rb, line 328
def list_invalid_properties
  invalid_properties = Array.new
  if !@uuid.nil? && @uuid.to_s.length < 1
    invalid_properties.push('invalid value for "uuid", the character length must be great than or equal to 1.')
  end

  if !@file_as_pdf.nil? && @file_as_pdf.to_s.length < 1
    invalid_properties.push('invalid value for "file_as_pdf", the character length must be great than or equal to 1.')
  end

  if !@name.nil? && @name.to_s.length > 255
    invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
  end

  if !@external_id.nil? && @external_id.to_s.length > 255
    invalid_properties.push('invalid value for "external_id", the character length must be smaller than or equal to 255.')
  end

  if !@frontend_id.nil? && @frontend_id.to_s.length > 255
    invalid_properties.push('invalid value for "frontend_id", the character length must be smaller than or equal to 255.')
  end

  if !@file_from_url.nil? && @file_from_url.to_s.length > 2100
    invalid_properties.push('invalid value for "file_from_url", the character length must be smaller than or equal to 2100.')
  end

  if !@events_callback_url.nil? && @events_callback_url.to_s.length > 2100
    invalid_properties.push('invalid value for "events_callback_url", the character length must be smaller than or equal to 2100.')
  end

  if !@auto_delete_days.nil? && @auto_delete_days > 730
    invalid_properties.push('invalid value for "auto_delete_days", must be smaller than or equal to 730.')
  end

  if !@auto_delete_days.nil? && @auto_delete_days < 1
    invalid_properties.push('invalid value for "auto_delete_days", must be greater than or equal to 1.')
  end

  if !@auto_expire_days.nil? && @auto_expire_days > 730
    invalid_properties.push('invalid value for "auto_expire_days", must be smaller than or equal to 730.')
  end

  if !@auto_expire_days.nil? && @auto_expire_days < 1
    invalid_properties.push('invalid value for "auto_expire_days", must be greater than or equal to 1.')
  end

  if !@security_hash.nil? && @security_hash.to_s.length < 1
    invalid_properties.push('invalid value for "security_hash", the character length must be great than or equal to 1.')
  end

  invalid_properties
end
name=(name) click to toggle source

Custom attribute writer method with validation @param [Object] name Value to be assigned

# File lib/signrequest_client/models/document.rb, line 423
def name=(name)
  if !name.nil? && name.to_s.length > 255
    fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
  end

  @name = name
end
security_hash=(security_hash) click to toggle source

Custom attribute writer method with validation @param [Object] security_hash Value to be assigned

# File lib/signrequest_client/models/document.rb, line 511
def security_hash=(security_hash)
  if !security_hash.nil? && security_hash.to_s.length < 1
    fail ArgumentError, 'invalid value for "security_hash", the character length must be great than or equal to 1.'
  end

  @security_hash = security_hash
end
status=(status) click to toggle source

Custom attribute writer method checking allowed values (enum). @param [Object] status Object to be assigned

# File lib/signrequest_client/models/document.rb, line 501
def status=(status)
  validator = EnumAttributeValidator.new('String', ['co', 'ne', 'se', 'vi', 'si', 'do', 'sd', 'ca', 'de', 'ec', 'es', 'xp'])
  unless validator.valid?(status)
    fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.'
  end
  @status = status
end
to_body() click to toggle source

to_body is an alias to to_hash (backward compatibility) @return [Hash] Returns the object in the form of hash

# File lib/signrequest_client/models/document.rb, line 638
def to_body
  to_hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/signrequest_client/models/document.rb, line 644
def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end
to_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/signrequest_client/models/document.rb, line 632
def to_s
  to_hash.to_s
end
uuid=(uuid) click to toggle source

Custom attribute writer method with validation @param [Object] uuid Value to be assigned

# File lib/signrequest_client/models/document.rb, line 403
def uuid=(uuid)
  if !uuid.nil? && uuid.to_s.length < 1
    fail ArgumentError, 'invalid value for "uuid", the character length must be great than or equal to 1.'
  end

  @uuid = uuid
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/signrequest_client/models/document.rb, line 383
def valid?
  return false if !@uuid.nil? && @uuid.to_s.length < 1
  return false if !@file_as_pdf.nil? && @file_as_pdf.to_s.length < 1
  return false if !@name.nil? && @name.to_s.length > 255
  return false if !@external_id.nil? && @external_id.to_s.length > 255
  return false if !@frontend_id.nil? && @frontend_id.to_s.length > 255
  return false if !@file_from_url.nil? && @file_from_url.to_s.length > 2100
  return false if !@events_callback_url.nil? && @events_callback_url.to_s.length > 2100
  return false if !@auto_delete_days.nil? && @auto_delete_days > 730
  return false if !@auto_delete_days.nil? && @auto_delete_days < 1
  return false if !@auto_expire_days.nil? && @auto_expire_days > 730
  return false if !@auto_expire_days.nil? && @auto_expire_days < 1
  status_validator = EnumAttributeValidator.new('String', ['co', 'ne', 'se', 'vi', 'si', 'do', 'sd', 'ca', 'de', 'ec', 'es', 'xp'])
  return false unless status_validator.valid?(@status)
  return false if !@security_hash.nil? && @security_hash.to_s.length < 1
  true
end