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



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

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.



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

def accounting
  @accounting
end

#agroObject

Returns the value of attribute agro.



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

def agro
  @agro
end

#approve_voucherObject

Only readable for now



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

def approve_voucher
  @approve_voucher
end

#electroObject

Not readable. Only for input.



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

def electro
  @electro
end

#electronic_vouchersObject

Not readable. Only for input.



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

def electronic_vouchers
  @electronic_vouchers
end

#invoiceObject

Not readable. Only for input.



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

def invoice
  @invoice
end

#mamutObject

Returns the value of attribute mamut.



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

def mamut
  @mamut
end

#module_contactObject

Returns the value of attribute module_contact.



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

def module_contact
  @module_contact
end

#module_currencyObject

Returns the value of attribute module_currency.



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

def module_currency
  @module_currency
end

#module_factoring_visma_financeObject

Returns the value of attribute module_factoring_visma_finance.



69
70
71
# File 'lib/tripletex_ruby_client/models/modules.rb', line 69

def module_factoring_visma_finance
  @module_factoring_visma_finance
end

#module_project_budgetObject

Returns the value of attribute module_project_budget.



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

def module_project_budget
  @module_project_budget
end

#modulecustomerObject

Returns the value of attribute modulecustomer.



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

def modulecustomer
  @modulecustomer
end

#moduledepartmentObject

Returns the value of attribute moduledepartment.



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

def moduledepartment
  @moduledepartment
end

#moduleemployeeObject

Returns the value of attribute moduleemployee.



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

def moduleemployee
  @moduleemployee
end

#moduleinvoiceObject

Returns the value of attribute moduleinvoice.



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

def moduleinvoice
  @moduleinvoice
end

#moduleprojectcategoryObject

Returns the value of attribute moduleprojectcategory.



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

def moduleprojectcategory
  @moduleprojectcategory
end

#moduleprojecteconomyObject

Returns the value of attribute moduleprojecteconomy.



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

def moduleprojecteconomy
  @moduleprojecteconomy
end

#ocrObject

Returns the value of attribute ocr.



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

def ocr
  @ocr
end

#projectObject

Not readable. Only for input.



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

def project
  @project
end

#remitObject

Returns the value of attribute remit.



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

def remit
  @remit
end

#salaryObject

Not readable. Only for input.



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

def salary
  @salary
end

#salary_start_dateObject

Returns the value of attribute salary_start_date.



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

def salary_start_date
  @salary_start_date
end

#vvsObject

Not readable. Only for input.



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

def vvs
  @vvs
end

Class Method Details

.attribute_mapObject

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



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

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.



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

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



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

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



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

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



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

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



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

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


309
310
311
# File 'lib/tripletex_ruby_client/models/modules.rb', line 309

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



315
316
317
# File 'lib/tripletex_ruby_client/models/modules.rb', line 315

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



254
255
256
257
# File 'lib/tripletex_ruby_client/models/modules.rb', line 254

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



389
390
391
# File 'lib/tripletex_ruby_client/models/modules.rb', line 389

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



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

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



383
384
385
# File 'lib/tripletex_ruby_client/models/modules.rb', line 383

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



261
262
263
264
265
# File 'lib/tripletex_ruby_client/models/modules.rb', line 261

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