class SignRequestClient::SignRequest

Attributes

disable_attachments[RW]

Disable uploading/adding of attachments

disable_blockchain_proof[RW]

Disables storing timestamp proof hashes in blockchain integrations.

disable_date[RW]

Disable adding of dates

disable_emails[RW]

Disable all SignRequest status emails as well as the email that contains the signed documents

disable_text[RW]

Disable adding of text

disable_text_signatures[RW]

Disable usage of signatures generated by typing (text)

disable_upload_signatures[RW]

Disable usage of uploaded signatures (images)

document[RW]
from_email[RW]

Email of user sending the SignRequest (must be a validated email)

from_email_name[RW]

Name to be used in the `From` email header, e.g. `{from_email_name} <no-reply@signrequest.com>`

integration[RW]
integration_data[RW]
is_being_prepared[RW]

Have the sender of a SignRequest prepare the document before sending the request out, see: [prepare using the web interface](section/Preparing-a-document/Prepare-using-the-web-interface)

message[RW]

Message to include in SignRequest email, may contain the following html tags: `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and `strong`

prepare_url[RW]
redirect_url[RW]

URL at which SignRequest will redirect to when a document is signed

redirect_url_declined[RW]

URL at which SignRequest will redirect to when a document is declined

required_attachments[RW]

Attachments that signers are required to upload

send_reminders[RW]

Automatically remind signers to sign a document, see: [automatic reminders](section/Working-with-a-SignRequest/Automatic-reminders)

signers[RW]
subject[RW]

Subject of SignRequest email

text_message_verification_locked[RW]

When true a text message verification is needed before the signer can see the document

url[RW]
uuid[RW]
who[RW]

`m`: only me, `mo`: me and others, `o`: only others

Public Class Methods

attribute_map() click to toggle source

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

# File lib/signrequest_client/models/sign_request.rb, line 108
def self.attribute_map
  {
    :'from_email' => :'from_email',
    :'from_email_name' => :'from_email_name',
    :'is_being_prepared' => :'is_being_prepared',
    :'prepare_url' => :'prepare_url',
    :'redirect_url' => :'redirect_url',
    :'redirect_url_declined' => :'redirect_url_declined',
    :'required_attachments' => :'required_attachments',
    :'disable_attachments' => :'disable_attachments',
    :'disable_text_signatures' => :'disable_text_signatures',
    :'disable_text' => :'disable_text',
    :'disable_date' => :'disable_date',
    :'disable_emails' => :'disable_emails',
    :'disable_upload_signatures' => :'disable_upload_signatures',
    :'disable_blockchain_proof' => :'disable_blockchain_proof',
    :'text_message_verification_locked' => :'text_message_verification_locked',
    :'subject' => :'subject',
    :'message' => :'message',
    :'who' => :'who',
    :'send_reminders' => :'send_reminders',
    :'signers' => :'signers',
    :'uuid' => :'uuid',
    :'url' => :'url',
    :'document' => :'document',
    :'integration' => :'integration',
    :'integration_data' => :'integration_data'
  }
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/sign_request.rb, line 171
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?(:'from_email')
    self.from_email = attributes[:'from_email']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  if attributes.has_key?(:'who')
    self.who = attributes[:'who']
  else
    self.who = 'o'
  end

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

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

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

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

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

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

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

Attribute type mapping.

# File lib/signrequest_client/models/sign_request.rb, line 139
def self.swagger_types
  {
    :'from_email' => :'String',
    :'from_email_name' => :'String',
    :'is_being_prepared' => :'BOOLEAN',
    :'prepare_url' => :'String',
    :'redirect_url' => :'String',
    :'redirect_url_declined' => :'String',
    :'required_attachments' => :'Array<RequiredAttachment>',
    :'disable_attachments' => :'BOOLEAN',
    :'disable_text_signatures' => :'BOOLEAN',
    :'disable_text' => :'BOOLEAN',
    :'disable_date' => :'BOOLEAN',
    :'disable_emails' => :'BOOLEAN',
    :'disable_upload_signatures' => :'BOOLEAN',
    :'disable_blockchain_proof' => :'BOOLEAN',
    :'text_message_verification_locked' => :'BOOLEAN',
    :'subject' => :'String',
    :'message' => :'String',
    :'who' => :'String',
    :'send_reminders' => :'BOOLEAN',
    :'signers' => :'Array<Signer>',
    :'uuid' => :'String',
    :'url' => :'String',
    :'document' => :'String',
    :'integration' => :'String',
    :'integration_data' => :'Object'
  }
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/sign_request.rb, line 447
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      from_email == o.from_email &&
      from_email_name == o.from_email_name &&
      is_being_prepared == o.is_being_prepared &&
      prepare_url == o.prepare_url &&
      redirect_url == o.redirect_url &&
      redirect_url_declined == o.redirect_url_declined &&
      required_attachments == o.required_attachments &&
      disable_attachments == o.disable_attachments &&
      disable_text_signatures == o.disable_text_signatures &&
      disable_text == o.disable_text &&
      disable_date == o.disable_date &&
      disable_emails == o.disable_emails &&
      disable_upload_signatures == o.disable_upload_signatures &&
      disable_blockchain_proof == o.disable_blockchain_proof &&
      text_message_verification_locked == o.text_message_verification_locked &&
      subject == o.subject &&
      message == o.message &&
      who == o.who &&
      send_reminders == o.send_reminders &&
      signers == o.signers &&
      uuid == o.uuid &&
      url == o.url &&
      document == o.document &&
      integration == o.integration &&
      integration_data == o.integration_data
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/sign_request.rb, line 513
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/sign_request.rb, line 579
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
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/sign_request.rb, line 492
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/sign_request.rb, line 479
def eql?(o)
  self == o
end
from_email=(from_email) click to toggle source

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

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

  if !from_email.nil? && from_email.to_s.length < 1
    fail ArgumentError, 'invalid value for "from_email", the character length must be great than or equal to 1.'
  end

  @from_email = from_email
end
from_email_name=(from_email_name) click to toggle source

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

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

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

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

# File lib/signrequest_client/models/sign_request.rb, line 485
def hash
  [from_email, from_email_name, is_being_prepared, prepare_url, redirect_url, redirect_url_declined, required_attachments, disable_attachments, disable_text_signatures, disable_text, disable_date, disable_emails, disable_upload_signatures, disable_blockchain_proof, text_message_verification_locked, subject, message, who, send_reminders, signers, uuid, url, document, integration, integration_data].hash
end
integration=(integration) click to toggle source

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

# File lib/signrequest_client/models/sign_request.rb, line 437
def integration=(integration)
  validator = EnumAttributeValidator.new('String', ['mfiles', 'salesforce', 'formdesk', 'zapier'])
  unless validator.valid?(integration)
    fail ArgumentError, 'invalid value for "integration", must be one of #{validator.allowable_values}.'
  end
  @integration = integration
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/sign_request.rb, line 286
def list_invalid_properties
  invalid_properties = Array.new
  if !@from_email.nil? && @from_email.to_s.length > 255
    invalid_properties.push('invalid value for "from_email", the character length must be smaller than or equal to 255.')
  end

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

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

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

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

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

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

  if @signers.nil?
    invalid_properties.push('invalid value for "signers", signers cannot be nil.')
  end

  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 @document.nil?
    invalid_properties.push('invalid value for "document", document cannot be nil.')
  end

  invalid_properties
end
prepare_url=(prepare_url) click to toggle source

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

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

  @prepare_url = prepare_url
end
redirect_url=(redirect_url) click to toggle source

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

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

  @redirect_url = redirect_url
end
redirect_url_declined=(redirect_url_declined) click to toggle source

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

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

  @redirect_url_declined = redirect_url_declined
end
subject=(subject) click to toggle source

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

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

  @subject = subject
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/sign_request.rb, line 559
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/sign_request.rb, line 565
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/sign_request.rb, line 553
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/sign_request.rb, line 427
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/sign_request.rb, line 333
def valid?
  return false if !@from_email.nil? && @from_email.to_s.length > 255
  return false if !@from_email.nil? && @from_email.to_s.length < 1
  return false if !@from_email_name.nil? && @from_email_name.to_s.length > 255
  return false if !@prepare_url.nil? && @prepare_url.to_s.length < 1
  return false if !@redirect_url.nil? && @redirect_url.to_s.length > 2100
  return false if !@redirect_url_declined.nil? && @redirect_url_declined.to_s.length > 2100
  return false if !@subject.nil? && @subject.to_s.length > 512
  who_validator = EnumAttributeValidator.new('String', ['m', 'mo', 'o'])
  return false unless who_validator.valid?(@who)
  return false if @signers.nil?
  return false if !@uuid.nil? && @uuid.to_s.length < 1
  return false if @document.nil?
  integration_validator = EnumAttributeValidator.new('String', ['mfiles', 'salesforce', 'formdesk', 'zapier'])
  return false unless integration_validator.valid?(@integration)
  true
end
who=(who) click to toggle source

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

# File lib/signrequest_client/models/sign_request.rb, line 417
def who=(who)
  validator = EnumAttributeValidator.new('String', ['m', 'mo', 'o'])
  unless validator.valid?(who)
    fail ArgumentError, 'invalid value for "who", must be one of #{validator.allowable_values}.'
  end
  @who = who
end