Class: TripletexRubyClient::Modules

Inherits:
Object
  • Object
show all
Defined in:
lib/tripletex_ruby_client/models/modules.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Modules

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
243
244
245
246
247
248
# File 'lib/tripletex_ruby_client/models/modules.rb', line 151

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#accountingObject

Not readable. Only for input.



16
17
18
# File 'lib/tripletex_ruby_client/models/modules.rb', line 16

def accounting
  @accounting
end

#agroObject

Returns the value of attribute agro.



42
43
44
# File 'lib/tripletex_ruby_client/models/modules.rb', line 42

def agro
  @agro
end

#approve_voucherObject

Only readable for now



47
48
49
# File 'lib/tripletex_ruby_client/models/modules.rb', line 47

def approve_voucher
  @approve_voucher
end

#electroObject

Not readable. Only for input.



37
38
39
# File 'lib/tripletex_ruby_client/models/modules.rb', line 37

def electro
  @electro
end

#electronic_vouchersObject

Not readable. Only for input.



34
35
36
# File 'lib/tripletex_ruby_client/models/modules.rb', line 34

def electronic_vouchers
  @electronic_vouchers
end

#invoiceObject

Not readable. Only for input.



19
20
21
# File 'lib/tripletex_ruby_client/models/modules.rb', line 19

def invoice
  @invoice
end

#mamutObject

Returns the value of attribute mamut.



44
45
46
# File 'lib/tripletex_ruby_client/models/modules.rb', line 44

def mamut
  @mamut
end

#module_contactObject

Returns the value of attribute module_contact.



53
54
55
# File 'lib/tripletex_ruby_client/models/modules.rb', line 53

def module_contact
  @module_contact
end

#module_currencyObject

Returns the value of attribute module_currency.



63
64
65
# File 'lib/tripletex_ruby_client/models/modules.rb', line 63

def module_currency
  @module_currency
end

#module_factoring_visma_financeObject

Returns the value of attribute module_factoring_visma_finance.



67
68
69
# File 'lib/tripletex_ruby_client/models/modules.rb', line 67

def module_factoring_visma_finance
  @module_factoring_visma_finance
end

#module_project_budgetObject

Returns the value of attribute module_project_budget.



65
66
67
# File 'lib/tripletex_ruby_client/models/modules.rb', line 65

def module_project_budget
  @module_project_budget
end

#modulecustomerObject

Returns the value of attribute modulecustomer.



55
56
57
# File 'lib/tripletex_ruby_client/models/modules.rb', line 55

def modulecustomer
  @modulecustomer
end

#moduledepartmentObject

Returns the value of attribute moduledepartment.



57
58
59
# File 'lib/tripletex_ruby_client/models/modules.rb', line 57

def moduledepartment
  @moduledepartment
end

#moduleemployeeObject

Returns the value of attribute moduleemployee.



51
52
53
# File 'lib/tripletex_ruby_client/models/modules.rb', line 51

def moduleemployee
  @moduleemployee
end

#moduleinvoiceObject

Returns the value of attribute moduleinvoice.



61
62
63
# File 'lib/tripletex_ruby_client/models/modules.rb', line 61

def moduleinvoice
  @moduleinvoice
end

#moduleprojectcategoryObject

Returns the value of attribute moduleprojectcategory.



59
60
61
# File 'lib/tripletex_ruby_client/models/modules.rb', line 59

def moduleprojectcategory
  @moduleprojectcategory
end

#moduleprojecteconomyObject

Returns the value of attribute moduleprojecteconomy.



49
50
51
# File 'lib/tripletex_ruby_client/models/modules.rb', line 49

def moduleprojecteconomy
  @moduleprojecteconomy
end

#ocrObject

Returns the value of attribute ocr.



29
30
31
# File 'lib/tripletex_ruby_client/models/modules.rb', line 29

def ocr
  @ocr
end

#projectObject

Not readable. Only for input.



27
28
29
# File 'lib/tripletex_ruby_client/models/modules.rb', line 27

def project
  @project
end

#remitObject

Returns the value of attribute remit.



31
32
33
# File 'lib/tripletex_ruby_client/models/modules.rb', line 31

def remit
  @remit
end

#salaryObject

Not readable. Only for input.



22
23
24
# File 'lib/tripletex_ruby_client/models/modules.rb', line 22

def salary
  @salary
end

#salary_start_dateObject

Returns the value of attribute salary_start_date.



24
25
26
# File 'lib/tripletex_ruby_client/models/modules.rb', line 24

def salary_start_date
  @salary_start_date
end

#vvsObject

Not readable. Only for input.



40
41
42
# File 'lib/tripletex_ruby_client/models/modules.rb', line 40

def vvs
  @vvs
end

Class Method Details

.attribute_mapObject

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



92
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
# File 'lib/tripletex_ruby_client/models/modules.rb', line 92

def self.attribute_map
  {
    :'accounting' => :'accounting',
    :'invoice' => :'invoice',
    :'salary' => :'salary',
    :'salary_start_date' => :'salaryStartDate',
    :'project' => :'project',
    :'ocr' => :'ocr',
    :'remit' => :'remit',
    :'electronic_vouchers' => :'electronicVouchers',
    :'electro' => :'electro',
    :'vvs' => :'vvs',
    :'agro' => :'agro',
    :'mamut' => :'mamut',
    :'approve_voucher' => :'approveVoucher',
    :'moduleprojecteconomy' => :'moduleprojecteconomy',
    :'moduleemployee' => :'moduleemployee',
    :'module_contact' => :'moduleContact',
    :'modulecustomer' => :'modulecustomer',
    :'moduledepartment' => :'moduledepartment',
    :'moduleprojectcategory' => :'moduleprojectcategory',
    :'moduleinvoice' => :'moduleinvoice',
    :'module_currency' => :'moduleCurrency',
    :'module_project_budget' => :'moduleProjectBudget',
    :'module_factoring_visma_finance' => :'moduleFactoringVismaFinance'
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/tripletex_ruby_client/models/modules.rb', line 121

def self.swagger_types
  {
    :'accounting' => :'BOOLEAN',
    :'invoice' => :'BOOLEAN',
    :'salary' => :'BOOLEAN',
    :'salary_start_date' => :'Date',
    :'project' => :'BOOLEAN',
    :'ocr' => :'BOOLEAN',
    :'remit' => :'BOOLEAN',
    :'electronic_vouchers' => :'BOOLEAN',
    :'electro' => :'BOOLEAN',
    :'vvs' => :'BOOLEAN',
    :'agro' => :'BOOLEAN',
    :'mamut' => :'BOOLEAN',
    :'approve_voucher' => :'BOOLEAN',
    :'moduleprojecteconomy' => :'BOOLEAN',
    :'moduleemployee' => :'BOOLEAN',
    :'module_contact' => :'BOOLEAN',
    :'modulecustomer' => :'BOOLEAN',
    :'moduledepartment' => :'BOOLEAN',
    :'moduleprojectcategory' => :'BOOLEAN',
    :'moduleinvoice' => :'BOOLEAN',
    :'module_currency' => :'BOOLEAN',
    :'module_project_budget' => :'BOOLEAN',
    :'module_factoring_visma_finance' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# File 'lib/tripletex_ruby_client/models/modules.rb', line 277

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      accounting == o.accounting &&
      invoice == o.invoice &&
      salary == o.salary &&
      salary_start_date == o.salary_start_date &&
      project == o.project &&
      ocr == o.ocr &&
      remit == o.remit &&
      electronic_vouchers == o.electronic_vouchers &&
      electro == o.electro &&
      vvs == o.vvs &&
      agro == o.agro &&
      mamut == o.mamut &&
      approve_voucher == o.approve_voucher &&
      moduleprojecteconomy == o.moduleprojecteconomy &&
      moduleemployee == o.moduleemployee &&
      module_contact == o.module_contact &&
      modulecustomer == o.modulecustomer &&
      moduledepartment == o.moduledepartment &&
      moduleprojectcategory == o.moduleprojectcategory &&
      moduleinvoice == o.moduleinvoice &&
      module_currency == o.module_currency &&
      module_project_budget == o.module_project_budget &&
      module_factoring_visma_finance == o.module_factoring_visma_finance
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



341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
# File 'lib/tripletex_ruby_client/models/modules.rb', line 341

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 = TripletexRubyClient.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



407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/tripletex_ruby_client/models/modules.rb', line 407

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



320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/tripletex_ruby_client/models/modules.rb', line 320

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


307
308
309
# File 'lib/tripletex_ruby_client/models/modules.rb', line 307

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



313
314
315
# File 'lib/tripletex_ruby_client/models/modules.rb', line 313

def hash
  [accounting, invoice, salary, salary_start_date, project, ocr, remit, electronic_vouchers, electro, vvs, agro, mamut, approve_voucher, moduleprojecteconomy, moduleemployee, module_contact, modulecustomer, moduledepartment, moduleprojectcategory, moduleinvoice, module_currency, module_project_budget, module_factoring_visma_finance].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



252
253
254
255
# File 'lib/tripletex_ruby_client/models/modules.rb', line 252

def list_invalid_properties
  invalid_properties = Array.new
  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



387
388
389
# File 'lib/tripletex_ruby_client/models/modules.rb', line 387

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



393
394
395
396
397
398
399
400
401
# File 'lib/tripletex_ruby_client/models/modules.rb', line 393

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



381
382
383
# File 'lib/tripletex_ruby_client/models/modules.rb', line 381

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



259
260
261
262
263
# File 'lib/tripletex_ruby_client/models/modules.rb', line 259

def valid?
  module_factoring_visma_finance_validator = EnumAttributeValidator.new('String', ['UNKNOWN', 'OFF', 'PROCESSING', 'REJECTED', 'ON', 'DEACTIVATED', 'ON_FOR_SEND_ONLY', 'ON_FOR_RECEIVE_ONLY_NOT_UPGRADABLE_TO_SEND', 'ON_FOR_SEND_ONLY_NOT_UPGRADABLE_TO_RECEIVE', 'ON_FOR_SEND_ONLY_BUT_PROCESSING_TO_RECEIVE'])
  return false unless module_factoring_visma_finance_validator.valid?(@module_factoring_visma_finance)
  true
end