Method: PureCloud::AggregationQuery#initialize

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

#initialize(attributes = {}) ⇒ AggregationQuery

Returns a new instance of AggregationQuery.



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
99
100
101
102
103
104
105
106
107
108
# File 'lib/purecloud/models/aggregation_query.rb', line 71

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[:'interval']
    self.interval = attributes[:'interval']
  end
  
  if attributes[:'granularity']
    self.granularity = attributes[:'granularity']
  end
  
  if attributes[:'groupBy']
    if (value = attributes[:'groupBy']).is_a?(Array)
      self.group_by = value
    end
  end
  
  if attributes[:'filter']
    self.filter = attributes[:'filter']
  end
  
  if attributes[:'metrics']
    if (value = attributes[:'metrics']).is_a?(Array)
      self.metrics = value
    end
  end
  
  if attributes[:'flattenMultivaluedDimensions']
    self.flatten_multivalued_dimensions = attributes[:'flattenMultivaluedDimensions']
  else
    self.flatten_multivalued_dimensions = false
  end
  
end