Method: PureCloud::TimeOffRequest#initialize

Defined in:
lib/purecloud/models/time_off_request.rb

#initialize(attributes = {}) ⇒ TimeOffRequest

Returns a new instance of TimeOffRequest.



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
# File 'lib/purecloud/models/time_off_request.rb', line 142

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}

  
  if attributes[:'id']
    self.id = attributes[:'id']
  end
  
  if attributes[:'name']
    self.name = attributes[:'name']
  end
  
  if attributes[:'user']
    self.user = attributes[:'user']
  end
  
  if attributes[:'isFullDayRequest']
    self.is_full_day_request = attributes[:'isFullDayRequest']
  else
    self.is_full_day_request = false
  end
  
  if attributes[:'markedAsRead']
    self.marked_as_read = attributes[:'markedAsRead']
  else
    self.marked_as_read = false
  end
  
  if attributes[:'activityCodeId']
    self.activity_code_id = attributes[:'activityCodeId']
  end
  
  if attributes[:'status']
    self.status = attributes[:'status']
  end
  
  if attributes[:'partialDayStartDateTimes']
    if (value = attributes[:'partialDayStartDateTimes']).is_a?(Array)
      self.partial_day_start_date_times = value
    end
  end
  
  if attributes[:'dailyDurationMinutes']
    self.daily_duration_minutes = attributes[:'dailyDurationMinutes']
  end
  
  if attributes[:'notes']
    self.notes = attributes[:'notes']
  end
  
  if attributes[:'submittedBy']
    self. = attributes[:'submittedBy']
  end
  
  if attributes[:'submittedDate']
    self. = attributes[:'submittedDate']
  end
  
  if attributes[:'reviewedBy']
    self.reviewed_by = attributes[:'reviewedBy']
  end
  
  if attributes[:'reviewedDate']
    self.reviewed_date = attributes[:'reviewedDate']
  end
  
  if attributes[:'modifiedBy']
    self.modified_by = attributes[:'modifiedBy']
  end
  
  if attributes[:'modifiedDate']
    self.modified_date = attributes[:'modifiedDate']
  end
  
  if attributes[:'selfUri']
    self.self_uri = attributes[:'selfUri']
  end
  
  if attributes[:'fullDayManagementUnitDates']
    if (value = attributes[:'fullDayManagementUnitDates']).is_a?(Array)
      self.full_day_management_unit_dates = value
    end
  end
  
end