Class: GongAPI::AggregateActivity

Inherits:
Object
  • Object
show all
Defined in:
lib/gong_api/models/aggregate_activity.rb

Overview

Aggregated activity for a user within a time period

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AggregateActivity

Initializes the object

Parameters:

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

    Model attributes in the form of hash



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
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
179
180
181
182
183
184
# File 'lib/gong_api/models/aggregate_activity.rb', line 112

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `GongAPI::AggregateActivity` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `GongAPI::AggregateActivity`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'calls_as_host')
    self.calls_as_host = attributes[:'calls_as_host']
  end

  if attributes.key?(:'calls_attended')
    self.calls_attended = attributes[:'calls_attended']
  end

  if attributes.key?(:'calls_comments_given')
    self.calls_comments_given = attributes[:'calls_comments_given']
  end

  if attributes.key?(:'calls_comments_received')
    self.calls_comments_received = attributes[:'calls_comments_received']
  end

  if attributes.key?(:'calls_gave_feedback')
    self.calls_gave_feedback = attributes[:'calls_gave_feedback']
  end

  if attributes.key?(:'calls_marked_as_feedback_given')
    self.calls_marked_as_feedback_given = attributes[:'calls_marked_as_feedback_given']
  end

  if attributes.key?(:'calls_marked_as_feedback_received')
    self.calls_marked_as_feedback_received = attributes[:'calls_marked_as_feedback_received']
  end

  if attributes.key?(:'calls_received_feedback')
    self.calls_received_feedback = attributes[:'calls_received_feedback']
  end

  if attributes.key?(:'calls_requested_feedback')
    self.calls_requested_feedback = attributes[:'calls_requested_feedback']
  end

  if attributes.key?(:'calls_scorecards_filled')
    self.calls_scorecards_filled = attributes[:'calls_scorecards_filled']
  end

  if attributes.key?(:'calls_scorecards_received')
    self.calls_scorecards_received = attributes[:'calls_scorecards_received']
  end

  if attributes.key?(:'calls_shared_externally')
    self.calls_shared_externally = attributes[:'calls_shared_externally']
  end

  if attributes.key?(:'calls_shared_internally')
    self.calls_shared_internally = attributes[:'calls_shared_internally']
  end

  if attributes.key?(:'others_calls_listened_to')
    self.others_calls_listened_to = attributes[:'others_calls_listened_to']
  end

  if attributes.key?(:'own_calls_listened_to')
    self.own_calls_listened_to = attributes[:'own_calls_listened_to']
  end
end

Instance Attribute Details

#calls_as_hostObject

The number of recorded calls this user hosted.



18
19
20
# File 'lib/gong_api/models/aggregate_activity.rb', line 18

def calls_as_host
  @calls_as_host
end

#calls_attendedObject

The number of calls in which this user is participant (not host).



21
22
23
# File 'lib/gong_api/models/aggregate_activity.rb', line 21

def calls_attended
  @calls_attended
end

#calls_comments_givenObject

The number of calls in which a user gave at least one comment.



24
25
26
# File 'lib/gong_api/models/aggregate_activity.rb', line 24

def calls_comments_given
  @calls_comments_given
end

#calls_comments_receivedObject

The number of calls in which a user received at least one comment on the users calls.



27
28
29
# File 'lib/gong_api/models/aggregate_activity.rb', line 27

def calls_comments_received
  @calls_comments_received
end

#calls_gave_feedbackObject

The number of recorded calls the user gave feedback on.



30
31
32
# File 'lib/gong_api/models/aggregate_activity.rb', line 30

def calls_gave_feedback
  @calls_gave_feedback
end

#calls_marked_as_feedback_givenObject

The number of calls in which someone pressed the "Mark as reviewed".



33
34
35
# File 'lib/gong_api/models/aggregate_activity.rb', line 33

def calls_marked_as_feedback_given
  @calls_marked_as_feedback_given
end

#calls_marked_as_feedback_receivedObject

The number of calls in which someone pressed the “Mark as reviewed” on the users calls.



36
37
38
# File 'lib/gong_api/models/aggregate_activity.rb', line 36

def calls_marked_as_feedback_received
  @calls_marked_as_feedback_received
end

#calls_received_feedbackObject

The number of recorded calls the user received feedback on.



39
40
41
# File 'lib/gong_api/models/aggregate_activity.rb', line 39

def calls_received_feedback
  @calls_received_feedback
end

#calls_requested_feedbackObject

The number of recorded calls the user requested feedback on.



42
43
44
# File 'lib/gong_api/models/aggregate_activity.rb', line 42

def calls_requested_feedback
  @calls_requested_feedback
end

#calls_scorecards_filledObject

The number of scorecards the user completed.



45
46
47
# File 'lib/gong_api/models/aggregate_activity.rb', line 45

def calls_scorecards_filled
  @calls_scorecards_filled
end

#calls_scorecards_receivedObject

The number of calls in which someone filled a scorecard on the user’s calls.



48
49
50
# File 'lib/gong_api/models/aggregate_activity.rb', line 48

def calls_scorecards_received
  @calls_scorecards_received
end

#calls_shared_externallyObject

The number of calls the user shared with others outside the company.



51
52
53
# File 'lib/gong_api/models/aggregate_activity.rb', line 51

def calls_shared_externally
  @calls_shared_externally
end

#calls_shared_internallyObject

The number of calls the user shared with others inside the company.



54
55
56
# File 'lib/gong_api/models/aggregate_activity.rb', line 54

def calls_shared_internally
  @calls_shared_internally
end

#others_calls_listened_toObject

The number of other users’ calls the user listened to.



57
58
59
# File 'lib/gong_api/models/aggregate_activity.rb', line 57

def others_calls_listened_to
  @others_calls_listened_to
end

#own_calls_listened_toObject

The number of the user’s own calls the user listened to.



60
61
62
# File 'lib/gong_api/models/aggregate_activity.rb', line 60

def own_calls_listened_to
  @own_calls_listened_to
end

Class Method Details

.attribute_mapObject

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



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/gong_api/models/aggregate_activity.rb', line 63

def self.attribute_map
  {
    :'calls_as_host' => :'callsAsHost',
    :'calls_attended' => :'callsAttended',
    :'calls_comments_given' => :'callsCommentsGiven',
    :'calls_comments_received' => :'callsCommentsReceived',
    :'calls_gave_feedback' => :'callsGaveFeedback',
    :'calls_marked_as_feedback_given' => :'callsMarkedAsFeedbackGiven',
    :'calls_marked_as_feedback_received' => :'callsMarkedAsFeedbackReceived',
    :'calls_received_feedback' => :'callsReceivedFeedback',
    :'calls_requested_feedback' => :'callsRequestedFeedback',
    :'calls_scorecards_filled' => :'callsScorecardsFilled',
    :'calls_scorecards_received' => :'callsScorecardsReceived',
    :'calls_shared_externally' => :'callsSharedExternally',
    :'calls_shared_internally' => :'callsSharedInternally',
    :'others_calls_listened_to' => :'othersCallsListenedTo',
    :'own_calls_listened_to' => :'ownCallsListenedTo'
  }
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



236
237
238
# File 'lib/gong_api/models/aggregate_activity.rb', line 236

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



105
106
107
108
# File 'lib/gong_api/models/aggregate_activity.rb', line 105

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/gong_api/models/aggregate_activity.rb', line 84

def self.openapi_types
  {
    :'calls_as_host' => :'Object',
    :'calls_attended' => :'Object',
    :'calls_comments_given' => :'Object',
    :'calls_comments_received' => :'Object',
    :'calls_gave_feedback' => :'Object',
    :'calls_marked_as_feedback_given' => :'Object',
    :'calls_marked_as_feedback_received' => :'Object',
    :'calls_received_feedback' => :'Object',
    :'calls_requested_feedback' => :'Object',
    :'calls_scorecards_filled' => :'Object',
    :'calls_scorecards_received' => :'Object',
    :'calls_shared_externally' => :'Object',
    :'calls_shared_internally' => :'Object',
    :'others_calls_listened_to' => :'Object',
    :'own_calls_listened_to' => :'Object'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/gong_api/models/aggregate_activity.rb', line 201

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      calls_as_host == o.calls_as_host &&
      calls_attended == o.calls_attended &&
      calls_comments_given == o.calls_comments_given &&
      calls_comments_received == o.calls_comments_received &&
      calls_gave_feedback == o.calls_gave_feedback &&
      calls_marked_as_feedback_given == o.calls_marked_as_feedback_given &&
      calls_marked_as_feedback_received == o.calls_marked_as_feedback_received &&
      calls_received_feedback == o.calls_received_feedback &&
      calls_requested_feedback == o.calls_requested_feedback &&
      calls_scorecards_filled == o.calls_scorecards_filled &&
      calls_scorecards_received == o.calls_scorecards_received &&
      calls_shared_externally == o.calls_shared_externally &&
      calls_shared_internally == o.calls_shared_internally &&
      others_calls_listened_to == o.others_calls_listened_to &&
      own_calls_listened_to == o.own_calls_listened_to
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



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
# File 'lib/gong_api/models/aggregate_activity.rb', line 266

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
    GongAPI.const_get(type).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



335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/gong_api/models/aggregate_activity.rb', line 335

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



243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/gong_api/models/aggregate_activity.rb', line 243

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that 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]]))
    elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


223
224
225
# File 'lib/gong_api/models/aggregate_activity.rb', line 223

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



229
230
231
# File 'lib/gong_api/models/aggregate_activity.rb', line 229

def hash
  [calls_as_host, calls_attended, calls_comments_given, calls_comments_received, calls_gave_feedback, calls_marked_as_feedback_given, calls_marked_as_feedback_received, calls_received_feedback, calls_requested_feedback, calls_scorecards_filled, calls_scorecards_received, calls_shared_externally, calls_shared_internally, others_calls_listened_to, own_calls_listened_to].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



188
189
190
191
# File 'lib/gong_api/models/aggregate_activity.rb', line 188

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



311
312
313
# File 'lib/gong_api/models/aggregate_activity.rb', line 311

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



317
318
319
320
321
322
323
324
325
326
327
328
329
# File 'lib/gong_api/models/aggregate_activity.rb', line 317

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



305
306
307
# File 'lib/gong_api/models/aggregate_activity.rb', line 305

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



195
196
197
# File 'lib/gong_api/models/aggregate_activity.rb', line 195

def valid?
  true
end