Class: SignRequestClient::SignRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/signrequest_client/models/sign_request.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SignRequest

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# 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

Instance Attribute Details

#disable_attachmentsObject

Disable uploading/adding of attachments



38
39
40
# File 'lib/signrequest_client/models/sign_request.rb', line 38

def disable_attachments
  @disable_attachments
end

#disable_blockchain_proofObject

Disables storing timestamp proof hashes in blockchain integrations.



56
57
58
# File 'lib/signrequest_client/models/sign_request.rb', line 56

def disable_blockchain_proof
  @disable_blockchain_proof
end

#disable_dateObject

Disable adding of dates



47
48
49
# File 'lib/signrequest_client/models/sign_request.rb', line 47

def disable_date
  @disable_date
end

#disable_emailsObject

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



50
51
52
# File 'lib/signrequest_client/models/sign_request.rb', line 50

def disable_emails
  @disable_emails
end

#disable_textObject

Disable adding of text



44
45
46
# File 'lib/signrequest_client/models/sign_request.rb', line 44

def disable_text
  @disable_text
end

#disable_text_signaturesObject

Disable usage of signatures generated by typing (text)



41
42
43
# File 'lib/signrequest_client/models/sign_request.rb', line 41

def disable_text_signatures
  @disable_text_signatures
end

#disable_upload_signaturesObject

Disable usage of uploaded signatures (images)



53
54
55
# File 'lib/signrequest_client/models/sign_request.rb', line 53

def disable_upload_signatures
  @disable_upload_signatures
end

#documentObject

Returns the value of attribute document.



79
80
81
# File 'lib/signrequest_client/models/sign_request.rb', line 79

def document
  @document
end

#from_emailObject

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



18
19
20
# File 'lib/signrequest_client/models/sign_request.rb', line 18

def from_email
  @from_email
end

#from_email_nameObject

Name to be used in the From email header, e.g. ‘#from_email_name <[email protected]>`



21
22
23
# File 'lib/signrequest_client/models/sign_request.rb', line 21

def from_email_name
  @from_email_name
end

#integrationObject

Returns the value of attribute integration.



81
82
83
# File 'lib/signrequest_client/models/sign_request.rb', line 81

def integration
  @integration
end

#integration_dataObject

Returns the value of attribute integration_data.



83
84
85
# File 'lib/signrequest_client/models/sign_request.rb', line 83

def integration_data
  @integration_data
end

#is_being_preparedObject

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)



24
25
26
# File 'lib/signrequest_client/models/sign_request.rb', line 24

def is_being_prepared
  @is_being_prepared
end

#messageObject

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



65
66
67
# File 'lib/signrequest_client/models/sign_request.rb', line 65

def message
  @message
end

#prepare_urlObject

Returns the value of attribute prepare_url.



26
27
28
# File 'lib/signrequest_client/models/sign_request.rb', line 26

def prepare_url
  @prepare_url
end

#redirect_urlObject

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



29
30
31
# File 'lib/signrequest_client/models/sign_request.rb', line 29

def redirect_url
  @redirect_url
end

#redirect_url_declinedObject

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



32
33
34
# File 'lib/signrequest_client/models/sign_request.rb', line 32

def redirect_url_declined
  @redirect_url_declined
end

#required_attachmentsObject

Attachments that signers are required to upload



35
36
37
# File 'lib/signrequest_client/models/sign_request.rb', line 35

def required_attachments
  @required_attachments
end

#send_remindersObject

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



71
72
73
# File 'lib/signrequest_client/models/sign_request.rb', line 71

def send_reminders
  @send_reminders
end

#signersObject

Returns the value of attribute signers.



73
74
75
# File 'lib/signrequest_client/models/sign_request.rb', line 73

def signers
  @signers
end

#subjectObject

Subject of SignRequest email



62
63
64
# File 'lib/signrequest_client/models/sign_request.rb', line 62

def subject
  @subject
end

#text_message_verification_lockedObject

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



59
60
61
# File 'lib/signrequest_client/models/sign_request.rb', line 59

def text_message_verification_locked
  @text_message_verification_locked
end

#urlObject

Returns the value of attribute url.



77
78
79
# File 'lib/signrequest_client/models/sign_request.rb', line 77

def url
  @url
end

#uuidObject

Returns the value of attribute uuid.



75
76
77
# File 'lib/signrequest_client/models/sign_request.rb', line 75

def uuid
  @uuid
end

#whoObject

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



68
69
70
# File 'lib/signrequest_client/models/sign_request.rb', line 68

def who
  @who
end

Class Method Details

.attribute_mapObject

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



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# 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

.swagger_typesObject

Attribute type mapping.



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# 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

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
# 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) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
# 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) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



579
580
581
582
583
584
585
586
587
588
589
590
591
# 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) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
# 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) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


479
480
481
# File 'lib/signrequest_client/models/sign_request.rb', line 479

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



485
486
487
# 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

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
# 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

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



559
560
561
# File 'lib/signrequest_client/models/sign_request.rb', line 559

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



565
566
567
568
569
570
571
572
573
# 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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



553
554
555
# File 'lib/signrequest_client/models/sign_request.rb', line 553

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# 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