Method: PureCloud::UserActionMetadataRequest#build_from_hash

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

#build_from_hash(attributes) ⇒ Object

build the object from hash



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/purecloud/models/user_action_metadata_request.rb', line 105

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
      else
        #TODO show warning in debug mode
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    else
      # data not found in attributes(hash), not an issue as the data can be optional
    end
  end

  self
end