Class: Teams::Api::ChannelData

Inherits:
Model
  • Object
show all
Defined in:
lib/teams/api/channel_data.rb

Instance Attribute Summary

Attributes inherited from Model

#raw

Instance Method Summary collapse

Methods inherited from Model

#initialize

Constructor Details

This class inherits a constructor from Teams::Api::Model

Instance Method Details

#channelObject



14
15
16
# File 'lib/teams/api/channel_data.rb', line 14

def channel
  wrap(read("channel"), ChannelInfo)
end

#event_typeObject



26
27
28
# File 'lib/teams/api/channel_data.rb', line 26

def event_type
  read("eventType", "event_type")
end

#feedback_loopObject



39
40
41
42
# File 'lib/teams/api/channel_data.rb', line 39

def feedback_loop
  value = read("feedbackLoop", "feedback_loop")
  value.is_a?(Hash) ? ActivityValue.new(value) : value
end

#feedback_loop_enabledObject



35
36
37
# File 'lib/teams/api/channel_data.rb', line 35

def feedback_loop_enabled
  read("feedbackLoopEnabled", "feedback_loop_enabled")
end

#meetingObject



18
19
20
# File 'lib/teams/api/channel_data.rb', line 18

def meeting
  wrap(read("meeting"), MeetingInfo)
end

#notificationObject



22
23
24
# File 'lib/teams/api/channel_data.rb', line 22

def notification
  wrap(read("notification"), NotificationInfo)
end

#settingsObject



30
31
32
33
# File 'lib/teams/api/channel_data.rb', line 30

def settings
  value = read("settings")
  value.is_a?(Hash) ? ActivityValue.new(value) : value
end

#stream_idObject



44
45
46
# File 'lib/teams/api/channel_data.rb', line 44

def stream_id
  read("streamId", "stream_id")
end

#stream_sequenceObject



52
53
54
# File 'lib/teams/api/channel_data.rb', line 52

def stream_sequence
  read("streamSequence", "stream_sequence")
end

#stream_typeObject



48
49
50
# File 'lib/teams/api/channel_data.rb', line 48

def stream_type
  read("streamType", "stream_type")
end

#teamObject



10
11
12
# File 'lib/teams/api/channel_data.rb', line 10

def team
  wrap(read("team"), TeamInfo)
end

#tenantObject



6
7
8
# File 'lib/teams/api/channel_data.rb', line 6

def tenant
  wrap(read("tenant"), TenantInfo)
end

#to_hObject



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/teams/api/channel_data.rb', line 56

def to_h
  body = raw.dup
  body["tenant"] = tenant.to_h if tenant
  body["team"] = team.to_h if team
  body["channel"] = channel.to_h if channel
  body["meeting"] = meeting.to_h if meeting
  body["notification"] = notification.to_h if notification
  body["eventType"] = event_type if event_type
  body["settings"] = settings.to_h if settings.respond_to?(:to_h)
  body["feedbackLoopEnabled"] = feedback_loop_enabled unless feedback_loop_enabled.nil?
  body["feedbackLoop"] = feedback_loop.to_h if feedback_loop.respond_to?(:to_h)
  body["streamId"] = stream_id if stream_id
  body["streamType"] = stream_type if stream_type
  body["streamSequence"] = stream_sequence if stream_sequence
  body.delete("event_type")
  body.delete("feedback_loop_enabled")
  body.delete("feedback_loop")
  body.delete("stream_id")
  body.delete("stream_type")
  body.delete("stream_sequence")
  body
end