Class: TripletexRubyClient::ProjectOverviewAggregate

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

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ProjectOverviewAggregate

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#access_typeObject

READ/WRITE access on project



52
53
54
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 52

def access_type
  @access_type
end

#completed_budgetObject

Returns the value of attribute completed_budget.



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

def completed_budget
  @completed_budget
end

#customerObject

Returns the value of attribute customer.



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

def customer
  @customer
end

#departmentObject

Returns the value of attribute department.



43
44
45
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 43

def department
  @department
end

#display_nameObject

Returns the value of attribute display_name.



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

def display_name
  @display_name
end

#end_dateObject

Returns the value of attribute end_date.



25
26
27
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 25

def end_date
  @end_date
end

#idObject

Returns the value of attribute id.



15
16
17
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 15

def id
  @id
end

#invoice_akonto_reserve_amount_currencyObject

Returns the value of attribute invoice_akonto_reserve_amount_currency.



56
57
58
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 56

def invoice_akonto_reserve_amount_currency
  @invoice_akonto_reserve_amount_currency
end

#invoice_extracosts_reserve_currencyObject

Returns the value of attribute invoice_extracosts_reserve_currency.



58
59
60
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 58

def invoice_extracosts_reserve_currency
  @invoice_extracosts_reserve_currency
end

#invoice_fee_reserve_currencyObject

Returns the value of attribute invoice_fee_reserve_currency.



60
61
62
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 60

def invoice_fee_reserve_currency
  @invoice_fee_reserve_currency
end

#invoice_reserve_total_amount_currencyObject

Returns the value of attribute invoice_reserve_total_amount_currency.



54
55
56
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 54

def invoice_reserve_total_amount_currency
  @invoice_reserve_total_amount_currency
end

#is_auth_project_overview_contract_typeObject

Returns the value of attribute is_auth_project_overview_contract_type.



35
36
37
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 35

def is_auth_project_overview_contract_type
  @is_auth_project_overview_contract_type
end

#is_closedObject

Returns the value of attribute is_closed.



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

def is_closed
  @is_closed
end

#is_fixed_priceObject

Returns the value of attribute is_fixed_price.



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

def is_fixed_price
  @is_fixed_price
end

#is_internalObject

Returns the value of attribute is_internal.



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

def is_internal
  @is_internal
end

#is_ready_for_invoicingObject

Returns the value of attribute is_ready_for_invoicing.



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

def is_ready_for_invoicing
  @is_ready_for_invoicing
end

#main_projectObject

Returns the value of attribute main_project.



41
42
43
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 41

def main_project
  @main_project
end

#nameObject

Returns the value of attribute name.



17
18
19
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 17

def name
  @name
end

#numberObject

Returns the value of attribute number.



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

def number
  @number
end

#planned_budgetObject

Returns the value of attribute planned_budget.



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

def planned_budget
  @planned_budget
end

#project_categoryObject

Returns the value of attribute project_category.



45
46
47
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 45

def project_category
  @project_category
end

#project_managerObject

Returns the value of attribute project_manager.



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

def project_manager
  @project_manager
end

#start_dateObject

Returns the value of attribute start_date.



23
24
25
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 23

def start_date
  @start_date
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
111
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 85

def self.attribute_map
  {
    :'id' => :'id',
    :'name' => :'name',
    :'display_name' => :'displayName',
    :'number' => :'number',
    :'start_date' => :'startDate',
    :'end_date' => :'endDate',
    :'is_ready_for_invoicing' => :'isReadyForInvoicing',
    :'is_closed' => :'isClosed',
    :'is_fixed_price' => :'isFixedPrice',
    :'is_internal' => :'isInternal',
    :'is_auth_project_overview_contract_type' => :'isAuthProjectOverviewContractType',
    :'project_manager' => :'projectManager',
    :'customer' => :'customer',
    :'main_project' => :'mainProject',
    :'department' => :'department',
    :'project_category' => :'projectCategory',
    :'planned_budget' => :'plannedBudget',
    :'completed_budget' => :'completedBudget',
    :'access_type' => :'accessType',
    :'invoice_reserve_total_amount_currency' => :'invoiceReserveTotalAmountCurrency',
    :'invoice_akonto_reserve_amount_currency' => :'invoiceAkontoReserveAmountCurrency',
    :'invoice_extracosts_reserve_currency' => :'invoiceExtracostsReserveCurrency',
    :'invoice_fee_reserve_currency' => :'invoiceFeeReserveCurrency'
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    :'id' => :'Integer',
    :'name' => :'String',
    :'display_name' => :'String',
    :'number' => :'String',
    :'start_date' => :'String',
    :'end_date' => :'String',
    :'is_ready_for_invoicing' => :'BOOLEAN',
    :'is_closed' => :'BOOLEAN',
    :'is_fixed_price' => :'BOOLEAN',
    :'is_internal' => :'BOOLEAN',
    :'is_auth_project_overview_contract_type' => :'BOOLEAN',
    :'project_manager' => :'Employee',
    :'customer' => :'Company',
    :'main_project' => :'Project',
    :'department' => :'Department',
    :'project_category' => :'ProjectCategory',
    :'planned_budget' => :'Float',
    :'completed_budget' => :'Float',
    :'access_type' => :'String',
    :'invoice_reserve_total_amount_currency' => :'Float',
    :'invoice_akonto_reserve_amount_currency' => :'Float',
    :'invoice_extracosts_reserve_currency' => :'Float',
    :'invoice_fee_reserve_currency' => :'Float'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 270

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      name == o.name &&
      display_name == o.display_name &&
      number == o.number &&
      start_date == o.start_date &&
      end_date == o.end_date &&
      is_ready_for_invoicing == o.is_ready_for_invoicing &&
      is_closed == o.is_closed &&
      is_fixed_price == o.is_fixed_price &&
      is_internal == o.is_internal &&
      is_auth_project_overview_contract_type == o.is_auth_project_overview_contract_type &&
      project_manager == o.project_manager &&
      customer == o.customer &&
      main_project == o.main_project &&
      department == o.department &&
      project_category == o.project_category &&
      planned_budget == o.planned_budget &&
      completed_budget == o.completed_budget &&
      access_type == o.access_type &&
      invoice_reserve_total_amount_currency == o.invoice_reserve_total_amount_currency &&
      invoice_akonto_reserve_amount_currency == o.invoice_akonto_reserve_amount_currency &&
      invoice_extracosts_reserve_currency == o.invoice_extracosts_reserve_currency &&
      invoice_fee_reserve_currency == o.invoice_fee_reserve_currency
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



334
335
336
337
338
339
340
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
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 334

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



400
401
402
403
404
405
406
407
408
409
410
411
412
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 400

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



313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 313

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


300
301
302
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 300

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



306
307
308
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 306

def hash
  [id, name, display_name, number, start_date, end_date, is_ready_for_invoicing, is_closed, is_fixed_price, is_internal, is_auth_project_overview_contract_type, project_manager, customer, main_project, department, project_category, planned_budget, completed_budget, access_type, invoice_reserve_total_amount_currency, invoice_akonto_reserve_amount_currency, invoice_extracosts_reserve_currency, invoice_fee_reserve_currency].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



245
246
247
248
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 245

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



380
381
382
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 380

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



386
387
388
389
390
391
392
393
394
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 386

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



374
375
376
# File 'lib/tripletex_ruby_client/models/project_overview_aggregate.rb', line 374

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



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

def valid?
  access_type_validator = EnumAttributeValidator.new('String', ['NONE', 'READ', 'WRITE'])
  return false unless access_type_validator.valid?(@access_type)
  true
end