Class: CrelateClient::PublicApiPlacementResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/crelate_client/models/public_api_placement_response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ PublicApiPlacementResponse

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 133

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

end

Instance Attribute Details

#_whenObject

Returns the value of attribute _when.



66
67
68
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 66

def _when
  @_when
end

#bill_dateObject

Returns the value of attribute bill_date.



18
19
20
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 18

def bill_date
  @bill_date
end

#bill_rateObject

Returns the value of attribute bill_rate.



20
21
22
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 20

def bill_rate
  @bill_rate
end

#bonusObject

Returns the value of attribute bonus.



22
23
24
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 22

def bonus
  @bonus
end

#commissionObject

Returns the value of attribute commission.



24
25
26
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 24

def commission
  @commission
end

#created_by_idObject

Returns the value of attribute created_by_id.



26
27
28
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 26

def created_by_id
  @created_by_id
end

#created_by_nameObject

Returns the value of attribute created_by_name.



28
29
30
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 28

def created_by_name
  @created_by_name
end

#discountObject

Returns the value of attribute discount.



30
31
32
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 30

def discount
  @discount
end

#end_dateObject

Returns the value of attribute end_date.



32
33
34
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 32

def end_date
  @end_date
end

#feeObject

Returns the value of attribute fee.



34
35
36
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 34

def fee
  @fee
end

#fee_percentObject

Returns the value of attribute fee_percent.



36
37
38
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 36

def fee_percent
  @fee_percent
end

#hourly_rateObject

Returns the value of attribute hourly_rate.



38
39
40
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 38

def hourly_rate
  @hourly_rate
end

#idObject

Returns the value of attribute id.



40
41
42
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 40

def id
  @id
end

#job_open_dateObject

Returns the value of attribute job_open_date.



42
43
44
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 42

def job_open_date
  @job_open_date
end

#marginObject

Returns the value of attribute margin.



44
45
46
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 44

def margin
  @margin
end

#pay_rateObject

Returns the value of attribute pay_rate.



46
47
48
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 46

def pay_rate
  @pay_rate
end

#placed_contact_idObject

Returns the value of attribute placed_contact_id.



48
49
50
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 48

def placed_contact_id
  @placed_contact_id
end

#placed_contact_nameObject

Returns the value of attribute placed_contact_name.



50
51
52
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 50

def placed_contact_name
  @placed_contact_name
end

#regarding_idObject

Returns the value of attribute regarding_id.



52
53
54
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 52

def regarding_id
  @regarding_id
end

#regarding_titleObject

Returns the value of attribute regarding_title.



54
55
56
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 54

def regarding_title
  @regarding_title
end

#salaryObject

Returns the value of attribute salary.



56
57
58
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 56

def salary
  @salary
end

#start_dateObject

Returns the value of attribute start_date.



58
59
60
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 58

def start_date
  @start_date
end

#time_to_fillObject

Returns the value of attribute time_to_fill.



60
61
62
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 60

def time_to_fill
  @time_to_fill
end

#total_hoursObject

Returns the value of attribute total_hours.



62
63
64
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 62

def total_hours
  @total_hours
end

#valueObject

Returns the value of attribute value.



64
65
66
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 64

def value
  @value
end

Class Method Details

.attribute_mapObject

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



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 70

def self.attribute_map
  {
    :'bill_date' => :'BillDate',
    :'bill_rate' => :'BillRate',
    :'bonus' => :'Bonus',
    :'commission' => :'Commission',
    :'created_by_id' => :'CreatedBy_Id',
    :'created_by_name' => :'CreatedBy_Name',
    :'discount' => :'Discount',
    :'end_date' => :'EndDate',
    :'fee' => :'Fee',
    :'fee_percent' => :'FeePercent',
    :'hourly_rate' => :'HourlyRate',
    :'id' => :'Id',
    :'job_open_date' => :'JobOpenDate',
    :'margin' => :'Margin',
    :'pay_rate' => :'PayRate',
    :'placed_contact_id' => :'PlacedContact_Id',
    :'placed_contact_name' => :'PlacedContact_Name',
    :'regarding_id' => :'Regarding_Id',
    :'regarding_title' => :'Regarding_Title',
    :'salary' => :'Salary',
    :'start_date' => :'StartDate',
    :'time_to_fill' => :'TimeToFill',
    :'total_hours' => :'TotalHours',
    :'value' => :'Value',
    :'_when' => :'When'
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 101

def self.swagger_types
  {
    :'bill_date' => :'DateTime',
    :'bill_rate' => :'Float',
    :'bonus' => :'Float',
    :'commission' => :'Float',
    :'created_by_id' => :'String',
    :'created_by_name' => :'String',
    :'discount' => :'Float',
    :'end_date' => :'DateTime',
    :'fee' => :'Float',
    :'fee_percent' => :'Float',
    :'hourly_rate' => :'Float',
    :'id' => :'String',
    :'job_open_date' => :'DateTime',
    :'margin' => :'Float',
    :'pay_rate' => :'Float',
    :'placed_contact_id' => :'String',
    :'placed_contact_name' => :'String',
    :'regarding_id' => :'String',
    :'regarding_title' => :'String',
    :'salary' => :'Float',
    :'start_date' => :'DateTime',
    :'time_to_fill' => :'Float',
    :'total_hours' => :'Integer',
    :'value' => :'Float',
    :'_when' => :'DateTime'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 256

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      bill_date == o.bill_date &&
      bill_rate == o.bill_rate &&
      bonus == o.bonus &&
      commission == o.commission &&
      created_by_id == o.created_by_id &&
      created_by_name == o.created_by_name &&
      discount == o.discount &&
      end_date == o.end_date &&
      fee == o.fee &&
      fee_percent == o.fee_percent &&
      hourly_rate == o.hourly_rate &&
      id == o.id &&
      job_open_date == o.job_open_date &&
      margin == o.margin &&
      pay_rate == o.pay_rate &&
      placed_contact_id == o.placed_contact_id &&
      placed_contact_name == o.placed_contact_name &&
      regarding_id == o.regarding_id &&
      regarding_title == o.regarding_title &&
      salary == o.salary &&
      start_date == o.start_date &&
      time_to_fill == o.time_to_fill &&
      total_hours == o.total_hours &&
      value == o.value &&
      _when == o._when
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



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
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 322

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



388
389
390
391
392
393
394
395
396
397
398
399
400
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 388

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



301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 301

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


288
289
290
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 288

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



294
295
296
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 294

def hash
  [bill_date, bill_rate, bonus, commission, created_by_id, created_by_name, discount, end_date, fee, fee_percent, hourly_rate, id, job_open_date, margin, pay_rate, placed_contact_id, placed_contact_name, regarding_id, regarding_title, salary, start_date, time_to_fill, total_hours, value, _when].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



243
244
245
246
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 243

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



368
369
370
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 368

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



374
375
376
377
378
379
380
381
382
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 374

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



362
363
364
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 362

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



250
251
252
# File 'lib/crelate_client/models/public_api_placement_response.rb', line 250

def valid?
  return true
end