Class: SignRequestClient::DocumentSearch

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DocumentSearch

Initializes the object

Parameters:

  • (defaults to: {})

    Model attributes in the form of hash



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/signrequest_client/models/document_search.rb', line 93

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?(:'uuid')
    self.uuid = attributes[:'uuid']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#autocompleteObject

Returns the value of attribute autocomplete.



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

def autocomplete
  @autocomplete
end

#createdObject

Returns the value of attribute created.



19
20
21
# File 'lib/signrequest_client/models/document_search.rb', line 19

def created
  @created
end

#created_timestampObject

Returns the value of attribute created_timestamp.



39
40
41
# File 'lib/signrequest_client/models/document_search.rb', line 39

def created_timestamp
  @created_timestamp
end

#finished_onObject

Returns the value of attribute finished_on.



45
46
47
# File 'lib/signrequest_client/models/document_search.rb', line 45

def finished_on
  @finished_on
end

#finished_on_timestampObject

Returns the value of attribute finished_on_timestamp.



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

def finished_on_timestamp
  @finished_on_timestamp
end

#from_emailObject

Returns the value of attribute from_email.



31
32
33
# File 'lib/signrequest_client/models/document_search.rb', line 31

def from_email
  @from_email
end

#nameObject

Defaults to filename



27
28
29
# File 'lib/signrequest_client/models/document_search.rb', line 27

def name
  @name
end

#nr_extra_docsObject

Returns the value of attribute nr_extra_docs.



33
34
35
# File 'lib/signrequest_client/models/document_search.rb', line 33

def nr_extra_docs
  @nr_extra_docs
end

#parent_docObject

Returns the value of attribute parent_doc.



43
44
45
# File 'lib/signrequest_client/models/document_search.rb', line 43

def parent_doc
  @parent_doc
end

#signer_emailsObject

Returns the value of attribute signer_emails.



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

def signer_emails
  @signer_emails
end

#statusObject

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



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

def status
  @status
end

#status_displayObject

Returns the value of attribute status_display.



37
38
39
# File 'lib/signrequest_client/models/document_search.rb', line 37

def status_display
  @status_display
end

#subdomainObject

Returns the value of attribute subdomain.



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

def subdomain
  @subdomain
end

#uuidObject

Returns the value of attribute uuid.



17
18
19
# File 'lib/signrequest_client/models/document_search.rb', line 17

def uuid
  @uuid
end

#whoObject

Returns the value of attribute who.



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

def who
  @who
end

Class Method Details

.attribute_mapObject

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



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/signrequest_client/models/document_search.rb', line 50

def self.attribute_map
  {
    :'uuid' => :'uuid',
    :'created' => :'created',
    :'status' => :'status',
    :'who' => :'who',
    :'name' => :'name',
    :'autocomplete' => :'autocomplete',
    :'from_email' => :'from_email',
    :'nr_extra_docs' => :'nr_extra_docs',
    :'signer_emails' => :'signer_emails',
    :'status_display' => :'status_display',
    :'created_timestamp' => :'created_timestamp',
    :'finished_on_timestamp' => :'finished_on_timestamp',
    :'parent_doc' => :'parent_doc',
    :'finished_on' => :'finished_on',
    :'subdomain' => :'subdomain'
  }
end

.swagger_typesObject

Attribute type mapping.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/signrequest_client/models/document_search.rb', line 71

def self.swagger_types
  {
    :'uuid' => :'String',
    :'created' => :'DateTime',
    :'status' => :'String',
    :'who' => :'String',
    :'name' => :'String',
    :'autocomplete' => :'String',
    :'from_email' => :'String',
    :'nr_extra_docs' => :'Integer',
    :'signer_emails' => :'Array<String>',
    :'status_display' => :'String',
    :'created_timestamp' => :'Integer',
    :'finished_on_timestamp' => :'Integer',
    :'parent_doc' => :'String',
    :'finished_on' => :'DateTime',
    :'subdomain' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • to be compared



353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
# File 'lib/signrequest_client/models/document_search.rb', line 353

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      uuid == o.uuid &&
      created == o.created &&
      status == o.status &&
      who == o.who &&
      name == o.name &&
      autocomplete == o.autocomplete &&
      from_email == o.from_email &&
      nr_extra_docs == o.nr_extra_docs &&
      signer_emails == o.signer_emails &&
      status_display == o.status_display &&
      created_timestamp == o.created_timestamp &&
      finished_on_timestamp == o.finished_on_timestamp &&
      parent_doc == o.parent_doc &&
      finished_on == o.finished_on &&
      subdomain == o.subdomain
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • type Data type

  • value Value to be deserialized

Returns:

  • Deserialized data



409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
# File 'lib/signrequest_client/models/document_search.rb', line 409

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:

  • Any valid value

Returns:

  • Returns the value in the form of hash



475
476
477
478
479
480
481
482
483
484
485
486
487
# File 'lib/signrequest_client/models/document_search.rb', line 475

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:

  • Model attributes in the form of hash

Returns:

  • Returns the model itself



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'lib/signrequest_client/models/document_search.rb', line 388

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

See Also:

  • `==` method

Parameters:

  • to be compared

Returns:



375
376
377
# File 'lib/signrequest_client/models/document_search.rb', line 375

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • Hash code



381
382
383
# File 'lib/signrequest_client/models/document_search.rb', line 381

def hash
  [uuid, created, status, who, name, autocomplete, from_email, nr_extra_docs, signer_emails, status_display, created_timestamp, finished_on_timestamp, parent_doc, finished_on, subdomain].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
# File 'lib/signrequest_client/models/document_search.rb', line 164

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 !@status.nil? && @status.to_s.length > 2
    invalid_properties.push('invalid value for "status", the character length must be smaller than or equal to 2.')
  end

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

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

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

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

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

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

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

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

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

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

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

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • Returns the object in the form of hash



455
456
457
# File 'lib/signrequest_client/models/document_search.rb', line 455

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • Returns the object in the form of hash



461
462
463
464
465
466
467
468
469
# File 'lib/signrequest_client/models/document_search.rb', line 461

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 presentation of the object



449
450
451
# File 'lib/signrequest_client/models/document_search.rb', line 449

def to_s
  to_hash.to_s
end

#valid?Boolean

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

Returns:

  • true if the model is valid



227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/signrequest_client/models/document_search.rb', line 227

def valid?
  return false if !@uuid.nil? && @uuid.to_s.length < 1
  return false if !@status.nil? && @status.to_s.length > 2
  return false if !@status.nil? && @status.to_s.length < 1
  return false if @who.nil?
  return false if @who.to_s.length < 1
  return false if !@name.nil? && @name.to_s.length < 1
  return false if @autocomplete.nil?
  return false if @autocomplete.to_s.length < 1
  return false if @from_email.nil?
  return false if @from_email.to_s.length < 1
  return false if @nr_extra_docs.nil?
  return false if !@status_display.nil? && @status_display.to_s.length < 1
  return false if !@parent_doc.nil? && @parent_doc.to_s.length < 1
  return false if !@subdomain.nil? && @subdomain.to_s.length < 1
  true
end