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:

  • attributes (Hash) (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
161
# 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?(:'status')
    self.status = attributes[:'status']
  end

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

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

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

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

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

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

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

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

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

  if attributes.has_key?(:'subdomain')
    self.subdomain = attributes[:'subdomain']
  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

end

Instance Attribute Details

#autocompleteObject

Returns the value of attribute autocomplete.



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

def autocomplete
  @autocomplete
end

#createdObject

Returns the value of attribute created.



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

def created
  @created
end

#created_timestampObject

Returns the value of attribute created_timestamp.



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

def created_timestamp
  @created_timestamp
end

#finished_onObject

Returns the value of attribute finished_on.



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

def finished_on
  @finished_on
end

#finished_on_timestampObject

Returns the value of attribute finished_on_timestamp.



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

def finished_on_timestamp
  @finished_on_timestamp
end

#from_emailObject

Returns the value of attribute from_email.



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

def from_email
  @from_email
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#nr_extra_docsObject

Returns the value of attribute nr_extra_docs.



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

def nr_extra_docs
  @nr_extra_docs
end

#parent_docObject

Returns the value of attribute parent_doc.



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

def parent_doc
  @parent_doc
end

#signer_emailsObject

Returns the value of attribute signer_emails.



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

def signer_emails
  @signer_emails
end

#statusObject

Returns the value of attribute status.



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

def status
  @status
end

#status_displayObject

Returns the value of attribute status_display.



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

def status_display
  @status_display
end

#subdomainObject

Returns the value of attribute subdomain.



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

def subdomain
  @subdomain
end

#uuidObject

Returns the value of attribute uuid.



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

def uuid
  @uuid
end

#whoObject

Returns the value of attribute who.



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

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
  {
    :'status' => :'status',
    :'name' => :'name',
    :'who' => :'who',
    :'nr_extra_docs' => :'nr_extra_docs',
    :'from_email' => :'from_email',
    :'parent_doc' => :'parent_doc',
    :'uuid' => :'uuid',
    :'created' => :'created',
    :'autocomplete' => :'autocomplete',
    :'finished_on' => :'finished_on',
    :'subdomain' => :'subdomain',
    :'signer_emails' => :'signer_emails',
    :'status_display' => :'status_display',
    :'created_timestamp' => :'created_timestamp',
    :'finished_on_timestamp' => :'finished_on_timestamp'
  }
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
  {
    :'status' => :'String',
    :'name' => :'String',
    :'who' => :'String',
    :'nr_extra_docs' => :'Integer',
    :'from_email' => :'String',
    :'parent_doc' => :'String',
    :'uuid' => :'String',
    :'created' => :'DateTime',
    :'autocomplete' => :'String',
    :'finished_on' => :'DateTime',
    :'subdomain' => :'String',
    :'signer_emails' => :'Array<String>',
    :'status_display' => :'String',
    :'created_timestamp' => :'Integer',
    :'finished_on_timestamp' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
# File 'lib/signrequest_client/models/document_search.rb', line 381

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      status == o.status &&
      name == o.name &&
      who == o.who &&
      nr_extra_docs == o.nr_extra_docs &&
      from_email == o.from_email &&
      parent_doc == o.parent_doc &&
      uuid == o.uuid &&
      created == o.created &&
      autocomplete == o.autocomplete &&
      finished_on == o.finished_on &&
      subdomain == o.subdomain &&
      signer_emails == o.signer_emails &&
      status_display == o.status_display &&
      created_timestamp == o.created_timestamp &&
      finished_on_timestamp == o.finished_on_timestamp
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



437
438
439
440
441
442
443
444
445
446
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
# File 'lib/signrequest_client/models/document_search.rb', line 437

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



503
504
505
506
507
508
509
510
511
512
513
514
515
# File 'lib/signrequest_client/models/document_search.rb', line 503

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



416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
# File 'lib/signrequest_client/models/document_search.rb', line 416

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


403
404
405
# File 'lib/signrequest_client/models/document_search.rb', line 403

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



409
410
411
# File 'lib/signrequest_client/models/document_search.rb', line 409

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

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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

def list_invalid_properties
  invalid_properties = Array.new
  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 !@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 @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 @nr_extra_docs.nil?
    invalid_properties.push("invalid value for 'nr_extra_docs', nr_extra_docs cannot be nil.")
  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 @parent_doc.nil?
    invalid_properties.push("invalid value for 'parent_doc', parent_doc cannot be nil.")
  end

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

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

  if @subdomain.to_s.length < 1
    invalid_properties.push("invalid value for 'subdomain', the character length must be great than or equal to 1.")
  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

  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



483
484
485
# File 'lib/signrequest_client/models/document_search.rb', line 483

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



489
490
491
492
493
494
495
496
497
# File 'lib/signrequest_client/models/document_search.rb', line 489

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



477
478
479
# File 'lib/signrequest_client/models/document_search.rb', line 477

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



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/signrequest_client/models/document_search.rb', line 240

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