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



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
168
169
170
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
# File 'lib/signrequest_client/models/sign_request.rb', line 142

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?(:'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?(:'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

Returns the value of attribute disable_attachments.



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

def disable_attachments
  @disable_attachments
end

#disable_dateObject

Returns the value of attribute disable_date.



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

def disable_date
  @disable_date
end

#disable_emailsObject

Returns the value of attribute disable_emails.



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

def disable_emails
  @disable_emails
end

#disable_textObject

Returns the value of attribute disable_text.



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

def disable_text
  @disable_text
end

#disable_text_signaturesObject

Returns the value of attribute disable_text_signatures.



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

def disable_text_signatures
  @disable_text_signatures
end

#disable_upload_signaturesObject

Returns the value of attribute disable_upload_signatures.



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

def disable_upload_signatures
  @disable_upload_signatures
end

#documentObject

Returns the value of attribute document.



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

def document
  @document
end

#from_emailObject

Returns the value of attribute from_email.



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

def from_email
  @from_email
end

#from_email_nameObject

Returns the value of attribute from_email_name.



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

def from_email_name
  @from_email_name
end

#integrationObject

Returns the value of attribute integration.



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

def integration
  @integration
end

#integration_dataObject

Returns the value of attribute integration_data.



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

def integration_data
  @integration_data
end

#is_being_preparedObject

Returns the value of attribute is_being_prepared.



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

def is_being_prepared
  @is_being_prepared
end

#messageObject

Returns the value of attribute message.



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

def message
  @message
end

#prepare_urlObject

Returns the value of attribute prepare_url.



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

def prepare_url
  @prepare_url
end

#redirect_urlObject

Returns the value of attribute redirect_url.



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

def redirect_url
  @redirect_url
end

#required_attachmentsObject

Returns the value of attribute required_attachments.



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

def required_attachments
  @required_attachments
end

#send_remindersObject

Returns the value of attribute send_reminders.



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

def send_reminders
  @send_reminders
end

#signersObject

Returns the value of attribute signers.



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

def signers
  @signers
end

#subjectObject

Returns the value of attribute subject.



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

def subject
  @subject
end

#urlObject

Returns the value of attribute url.



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

def url
  @url
end

#uuidObject

Returns the value of attribute uuid.



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

def uuid
  @uuid
end

#whoObject

Returns the value of attribute who.



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

def who
  @who
end

Class Method Details

.attribute_mapObject

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



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/signrequest_client/models/sign_request.rb', line 85

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',
    :'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',
    :'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.



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/signrequest_client/models/sign_request.rb', line 113

def self.swagger_types
  {
    :'from_email' => :'String',
    :'from_email_name' => :'String',
    :'is_being_prepared' => :'BOOLEAN',
    :'prepare_url' => :'String',
    :'redirect_url' => :'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',
    :'subject' => :'String',
    :'message' => :'String',
    :'who' => :'String',
    :'send_reminders' => :'BOOLEAN',
    :'signers' => :'Array<Signer>',
    :'uuid' => :'String',
    :'url' => :'String',
    :'document' => :'String',
    :'integration' => :'String',
    :'integration_data' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
# File 'lib/signrequest_client/models/sign_request.rb', line 398

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 &&
      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 &&
      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



461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
# File 'lib/signrequest_client/models/sign_request.rb', line 461

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



527
528
529
530
531
532
533
534
535
536
537
538
539
# File 'lib/signrequest_client/models/sign_request.rb', line 527

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



440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/signrequest_client/models/sign_request.rb', line 440

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


427
428
429
# File 'lib/signrequest_client/models/sign_request.rb', line 427

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



433
434
435
# File 'lib/signrequest_client/models/sign_request.rb', line 433

def hash
  [from_email, from_email_name, is_being_prepared, prepare_url, redirect_url, required_attachments, disable_attachments, disable_text_signatures, disable_text, disable_date, disable_emails, disable_upload_signatures, 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



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
283
284
285
# File 'lib/signrequest_client/models/sign_request.rb', line 246

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 !@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

  return 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



507
508
509
# File 'lib/signrequest_client/models/sign_request.rb', line 507

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



513
514
515
516
517
518
519
520
521
# File 'lib/signrequest_client/models/sign_request.rb', line 513

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



501
502
503
# File 'lib/signrequest_client/models/sign_request.rb', line 501

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



289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# File 'lib/signrequest_client/models/sign_request.rb', line 289

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 !@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", "txhash"])
  return false unless integration_validator.valid?(@integration)
  return true
end