Class: ConnectWise::ProjectPhase

Inherits:
Object
  • Object
show all
Defined in:
lib/connectwise-ruby-sdk/models/project_phase.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ProjectPhase

Initializes the object

Parameters:

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

    Model attributes in the form of hash



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
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
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 235

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

end

Instance Attribute Details

#_infoObject

Metadata of the entity



103
104
105
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 103

def _info
  @_info
end

#actual_endObject

Returns the value of attribute actual_end.



52
53
54
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 52

def actual_end
  @actual_end
end

#actual_hoursObject

Returns the value of attribute actual_hours.



48
49
50
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 48

def actual_hours
  @actual_hours
end

#actual_startObject

Returns the value of attribute actual_start.



50
51
52
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 50

def actual_start
  @actual_start
end

#agreementObject

Returns the value of attribute agreement.



17
18
19
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 17

def agreement
  @agreement
end

#bill_expensesObject

Returns the value of attribute bill_expenses.



27
28
29
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 27

def bill_expenses
  @bill_expenses
end

#bill_phase_closed_flagObject

This phase can only be billed after it has been closed



65
66
67
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 65

def bill_phase_closed_flag
  @bill_phase_closed_flag
end

#bill_productsObject

Returns the value of attribute bill_products.



29
30
31
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 29

def bill_products
  @bill_products
end

#bill_project_closed_flagObject

This phase can only be billed after the project has been closed



68
69
70
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 68

def bill_project_closed_flag
  @bill_project_closed_flag
end

#bill_separately_flagObject

Returns the value of attribute bill_separately_flag.



37
38
39
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 37

def bill_separately_flag
  @bill_separately_flag
end

#bill_timeObject

Returns the value of attribute bill_time.



25
26
27
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 25

def bill_time
  @bill_time
end

#bill_to_companyObject

Returns the value of attribute bill_to_company.



90
91
92
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 90

def bill_to_company
  @bill_to_company
end

#bill_to_contactObject

Returns the value of attribute bill_to_contact.



92
93
94
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 92

def bill_to_contact
  @bill_to_contact
end

#bill_to_siteObject

Returns the value of attribute bill_to_site.



94
95
96
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 94

def bill_to_site
  @bill_to_site
end

#billing_methodObject

billingMethod is required if the phase billSeparatelyFlag is true



40
41
42
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 40

def billing_method
  @billing_method
end

#billing_start_dateObject

Returns the value of attribute billing_start_date.



62
63
64
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 62

def billing_start_date
  @billing_start_date
end

#boardObject

Returns the value of attribute board.



13
14
15
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 13

def board
  @board
end

#budget_hoursObject

Returns the value of attribute budget_hours.



54
55
56
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 54

def budget_hours
  @budget_hours
end

#business_unit_idObject

Returns the value of attribute business_unit_id.



58
59
60
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 58

def business_unit_id
  @business_unit_id
end

#currencyObject

Returns the value of attribute currency.



88
89
90
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 88

def currency
  @currency
end

#deadline_dateObject

Returns the value of attribute deadline_date.



35
36
37
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 35

def deadline_date
  @deadline_date
end

#descriptionObject

Returns the value of attribute description.



11
12
13
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 11

def description
  @description
end

#downpaymentObject

Returns the value of attribute downpayment.



70
71
72
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 70

def downpayment
  @downpayment
end

#estimated_expense_costObject

Returns the value of attribute estimated_expense_cost.



78
79
80
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 78

def estimated_expense_cost
  @estimated_expense_cost
end

#estimated_expense_revenueObject

Returns the value of attribute estimated_expense_revenue.



84
85
86
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 84

def estimated_expense_revenue
  @estimated_expense_revenue
end

#estimated_product_costObject

Returns the value of attribute estimated_product_cost.



80
81
82
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 80

def estimated_product_cost
  @estimated_product_cost
end

#estimated_product_revenueObject

Returns the value of attribute estimated_product_revenue.



86
87
88
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 86

def estimated_product_revenue
  @estimated_product_revenue
end

#estimated_time_costObject

Returns the value of attribute estimated_time_cost.



76
77
78
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 76

def estimated_time_cost
  @estimated_time_cost
end

#estimated_time_revenueObject

Returns the value of attribute estimated_time_revenue.



82
83
84
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 82

def estimated_time_revenue
  @estimated_time_revenue
end

#hourly_rateObject

Returns the value of attribute hourly_rate.



60
61
62
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 60

def hourly_rate
  @hourly_rate
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 7

def id
  @id
end

#location_idObject

Returns the value of attribute location_id.



56
57
58
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 56

def location_id
  @location_id
end

#mark_as_milestone_flagObject

Returns the value of attribute mark_as_milestone_flag.



31
32
33
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 31

def mark_as_milestone_flag
  @mark_as_milestone_flag
end

#notesObject

Returns the value of attribute notes.



33
34
35
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 33

def notes
  @notes
end

#opportunityObject

Returns the value of attribute opportunity.



19
20
21
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 19

def opportunity
  @opportunity
end

#parent_phaseObject

Returns the value of attribute parent_phase.



21
22
23
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 21

def parent_phase
  @parent_phase
end

#po_amountObject

Returns the value of attribute po_amount.



74
75
76
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 74

def po_amount
  @po_amount
end

#po_numberObject

Returns the value of attribute po_number.



72
73
74
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 72

def po_number
  @po_number
end

#project_idObject

Returns the value of attribute project_id.



9
10
11
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 9

def project_id
  @project_id
end

#scheduled_endObject

Returns the value of attribute scheduled_end.



46
47
48
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 46

def scheduled_end
  @scheduled_end
end

#scheduled_hoursObject

Returns the value of attribute scheduled_hours.



42
43
44
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 42

def scheduled_hours
  @scheduled_hours
end

#scheduled_startObject

Returns the value of attribute scheduled_start.



44
45
46
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 44

def scheduled_start
  @scheduled_start
end

#ship_to_companyObject

Returns the value of attribute ship_to_company.



96
97
98
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 96

def ship_to_company
  @ship_to_company
end

#ship_to_contactObject

Returns the value of attribute ship_to_contact.



98
99
100
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 98

def ship_to_contact
  @ship_to_contact
end

#ship_to_siteObject

Returns the value of attribute ship_to_site.



100
101
102
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 100

def ship_to_site
  @ship_to_site
end

#statusObject

Returns the value of attribute status.



15
16
17
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 15

def status
  @status
end

#wbs_codeObject

Returns the value of attribute wbs_code.



23
24
25
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 23

def wbs_code
  @wbs_code
end

Class Method Details

.attribute_mapObject

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



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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 128

def self.attribute_map
  {
    :'id' => :'id',
    :'project_id' => :'projectId',
    :'description' => :'description',
    :'board' => :'board',
    :'status' => :'status',
    :'agreement' => :'agreement',
    :'opportunity' => :'opportunity',
    :'parent_phase' => :'parentPhase',
    :'wbs_code' => :'wbsCode',
    :'bill_time' => :'billTime',
    :'bill_expenses' => :'billExpenses',
    :'bill_products' => :'billProducts',
    :'mark_as_milestone_flag' => :'markAsMilestoneFlag',
    :'notes' => :'notes',
    :'deadline_date' => :'deadlineDate',
    :'bill_separately_flag' => :'billSeparatelyFlag',
    :'billing_method' => :'billingMethod',
    :'scheduled_hours' => :'scheduledHours',
    :'scheduled_start' => :'scheduledStart',
    :'scheduled_end' => :'scheduledEnd',
    :'actual_hours' => :'actualHours',
    :'actual_start' => :'actualStart',
    :'actual_end' => :'actualEnd',
    :'budget_hours' => :'budgetHours',
    :'location_id' => :'locationId',
    :'business_unit_id' => :'businessUnitId',
    :'hourly_rate' => :'hourlyRate',
    :'billing_start_date' => :'billingStartDate',
    :'bill_phase_closed_flag' => :'billPhaseClosedFlag',
    :'bill_project_closed_flag' => :'billProjectClosedFlag',
    :'downpayment' => :'downpayment',
    :'po_number' => :'poNumber',
    :'po_amount' => :'poAmount',
    :'estimated_time_cost' => :'estimatedTimeCost',
    :'estimated_expense_cost' => :'estimatedExpenseCost',
    :'estimated_product_cost' => :'estimatedProductCost',
    :'estimated_time_revenue' => :'estimatedTimeRevenue',
    :'estimated_expense_revenue' => :'estimatedExpenseRevenue',
    :'estimated_product_revenue' => :'estimatedProductRevenue',
    :'currency' => :'currency',
    :'bill_to_company' => :'billToCompany',
    :'bill_to_contact' => :'billToContact',
    :'bill_to_site' => :'billToSite',
    :'ship_to_company' => :'shipToCompany',
    :'ship_to_contact' => :'shipToContact',
    :'ship_to_site' => :'shipToSite',
    :'_info' => :'_info'
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 181

def self.swagger_types
  {
    :'id' => :'Integer',
    :'project_id' => :'Integer',
    :'description' => :'String',
    :'board' => :'ProjectBoardReference',
    :'status' => :'PhaseStatusReference',
    :'agreement' => :'AgreementReference',
    :'opportunity' => :'OpportunityReference',
    :'parent_phase' => :'ProjectPhaseReference',
    :'wbs_code' => :'String',
    :'bill_time' => :'String',
    :'bill_expenses' => :'String',
    :'bill_products' => :'String',
    :'mark_as_milestone_flag' => :'BOOLEAN',
    :'notes' => :'String',
    :'deadline_date' => :'DateTime',
    :'bill_separately_flag' => :'BOOLEAN',
    :'billing_method' => :'String',
    :'scheduled_hours' => :'Float',
    :'scheduled_start' => :'String',
    :'scheduled_end' => :'String',
    :'actual_hours' => :'Float',
    :'actual_start' => :'String',
    :'actual_end' => :'String',
    :'budget_hours' => :'Float',
    :'location_id' => :'Integer',
    :'business_unit_id' => :'Integer',
    :'hourly_rate' => :'Float',
    :'billing_start_date' => :'DateTime',
    :'bill_phase_closed_flag' => :'BOOLEAN',
    :'bill_project_closed_flag' => :'BOOLEAN',
    :'downpayment' => :'Float',
    :'po_number' => :'String',
    :'po_amount' => :'Float',
    :'estimated_time_cost' => :'Float',
    :'estimated_expense_cost' => :'Float',
    :'estimated_product_cost' => :'Float',
    :'estimated_time_revenue' => :'Float',
    :'estimated_expense_revenue' => :'Float',
    :'estimated_product_revenue' => :'Float',
    :'currency' => :'CurrencyReference',
    :'bill_to_company' => :'CompanyReference',
    :'bill_to_contact' => :'ContactReference',
    :'bill_to_site' => :'SiteReference',
    :'ship_to_company' => :'CompanyReference',
    :'ship_to_contact' => :'ContactReference',
    :'ship_to_site' => :'SiteReference',
    :'_info' => :'Metadata'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 550

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      project_id == o.project_id &&
      description == o.description &&
      board == o.board &&
      status == o.status &&
      agreement == o.agreement &&
      opportunity == o.opportunity &&
      parent_phase == o.parent_phase &&
      wbs_code == o.wbs_code &&
      bill_time == o.bill_time &&
      bill_expenses == o.bill_expenses &&
      bill_products == o.bill_products &&
      mark_as_milestone_flag == o.mark_as_milestone_flag &&
      notes == o.notes &&
      deadline_date == o.deadline_date &&
      bill_separately_flag == o.bill_separately_flag &&
      billing_method == o.billing_method &&
      scheduled_hours == o.scheduled_hours &&
      scheduled_start == o.scheduled_start &&
      scheduled_end == o.scheduled_end &&
      actual_hours == o.actual_hours &&
      actual_start == o.actual_start &&
      actual_end == o.actual_end &&
      budget_hours == o.budget_hours &&
      location_id == o.location_id &&
      business_unit_id == o.business_unit_id &&
      hourly_rate == o.hourly_rate &&
      billing_start_date == o.billing_start_date &&
      bill_phase_closed_flag == o.bill_phase_closed_flag &&
      bill_project_closed_flag == o.bill_project_closed_flag &&
      downpayment == o.downpayment &&
      po_number == o.po_number &&
      po_amount == o.po_amount &&
      estimated_time_cost == o.estimated_time_cost &&
      estimated_expense_cost == o.estimated_expense_cost &&
      estimated_product_cost == o.estimated_product_cost &&
      estimated_time_revenue == o.estimated_time_revenue &&
      estimated_expense_revenue == o.estimated_expense_revenue &&
      estimated_product_revenue == o.estimated_product_revenue &&
      currency == o.currency &&
      bill_to_company == o.bill_to_company &&
      bill_to_contact == o.bill_to_contact &&
      bill_to_site == o.bill_to_site &&
      ship_to_company == o.ship_to_company &&
      ship_to_contact == o.ship_to_contact &&
      ship_to_site == o.ship_to_site &&
      _info == o._info
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



638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 638

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



704
705
706
707
708
709
710
711
712
713
714
715
716
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 704

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



617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 617

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


604
605
606
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 604

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



610
611
612
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 610

def hash
  [id, project_id, description, board, status, agreement, opportunity, parent_phase, wbs_code, bill_time, bill_expenses, bill_products, mark_as_milestone_flag, notes, deadline_date, bill_separately_flag, billing_method, scheduled_hours, scheduled_start, scheduled_end, actual_hours, actual_start, actual_end, budget_hours, location_id, business_unit_id, hourly_rate, billing_start_date, bill_phase_closed_flag, bill_project_closed_flag, downpayment, po_number, po_amount, estimated_time_cost, estimated_expense_cost, estimated_product_cost, estimated_time_revenue, estimated_expense_revenue, estimated_product_revenue, currency, bill_to_company, bill_to_contact, bill_to_site, ship_to_company, ship_to_contact, ship_to_site, _info].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properies with the reasons



433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 433

def list_invalid_properties
  invalid_properties = Array.new
  if @description.nil?
    invalid_properties.push("invalid value for 'description', description cannot be nil.")
  end

  if @description.to_s.length > 100
    invalid_properties.push("invalid value for 'description', the character length must be smaller than or equal to 100.")
  end

  if !@wbs_code.nil? && @wbs_code.to_s.length > 50
    invalid_properties.push("invalid value for 'wbs_code', the character length must be smaller than or equal to 50.")
  end

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



684
685
686
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 684

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



690
691
692
693
694
695
696
697
698
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 690

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



678
679
680
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 678

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



456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
# File 'lib/connectwise-ruby-sdk/models/project_phase.rb', line 456

def valid?
  return false if @description.nil?
  return false if @description.to_s.length > 100
  return false if !@wbs_code.nil? && @wbs_code.to_s.length > 50
  bill_time_validator = EnumAttributeValidator.new('String', ["Billable", "DoNotBill", "NoCharge", "NoDefault"])
  return false unless bill_time_validator.valid?(@bill_time)
  bill_expenses_validator = EnumAttributeValidator.new('String', ["Billable", "DoNotBill", "NoCharge", "NoDefault"])
  return false unless bill_expenses_validator.valid?(@bill_expenses)
  bill_products_validator = EnumAttributeValidator.new('String', ["Billable", "DoNotBill", "NoCharge", "NoDefault"])
  return false unless bill_products_validator.valid?(@bill_products)
  billing_method_validator = EnumAttributeValidator.new('String', ["ActualRates", "FixedFee", "NotToExceed", "OverrideRate"])
  return false unless billing_method_validator.valid?(@billing_method)
  return false if !@po_number.nil? && @po_number.to_s.length > 25
  return true
end