Class: Twilio::REST::FlexApi::V1::InteractionContext::InteractionChannelContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::FlexApi::V1::InteractionContext::InteractionChannelContext
- Defined in:
- lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb,
lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.rb,
lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb
Defined Under Namespace
Classes: InteractionChannelInviteInstance, InteractionChannelInviteList, InteractionChannelInvitePage, InteractionChannelParticipantContext, InteractionChannelParticipantInstance, InteractionChannelParticipantList, InteractionChannelParticipantPage
Instance Method Summary collapse
-
#fetch ⇒ InteractionChannelInstance
Fetch the InteractionChannelInstance.
-
#initialize(version, interaction_sid, sid) ⇒ InteractionChannelContext
constructor
Initialize the InteractionChannelContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#invites ⇒ InteractionChannelInviteList, InteractionChannelInviteContext
Access the invites.
-
#participants(sid = :unset) ⇒ InteractionChannelParticipantList, InteractionChannelParticipantContext
Access the participants.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(status: nil, routing: :unset) ⇒ InteractionChannelInstance
Update the InteractionChannelInstance.
Constructor Details
#initialize(version, interaction_sid, sid) ⇒ InteractionChannelContext
Initialize the InteractionChannelContext
139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 139 def initialize(version, interaction_sid, sid) super(version) # Path Solution @solution = { interaction_sid: interaction_sid, sid: sid, } @uri = "/Interactions/#{@solution[:interaction_sid]}/Channels/#{@solution[:sid]}" # Dependents @invites = nil @participants = nil end |
Instance Method Details
#fetch ⇒ InteractionChannelInstance
Fetch the InteractionChannelInstance
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 153 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) InteractionChannelInstance.new( @version, payload, interaction_sid: @solution[:interaction_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
240 241 242 243 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 240 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.FlexApi.V1.InteractionChannelContext #{context}>" end |
#invites ⇒ InteractionChannelInviteList, InteractionChannelInviteContext
Access the invites
204 205 206 207 208 209 210 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 204 def invites unless @invites @invites = InteractionChannelInviteList.new( @version, interaction_sid: @solution[:interaction_sid], channel_sid: @solution[:sid], ) end @invites end |
#participants(sid = :unset) ⇒ InteractionChannelParticipantList, InteractionChannelParticipantContext
Access the participants
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 215 def participants(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return InteractionChannelParticipantContext.new(@version, @solution[:interaction_sid], @solution[:sid],sid ) end unless @participants @participants = InteractionChannelParticipantList.new( @version, interaction_sid: @solution[:interaction_sid], channel_sid: @solution[:sid], ) end @participants end |
#to_s ⇒ Object
Provide a user friendly representation
233 234 235 236 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 233 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.FlexApi.V1.InteractionChannelContext #{context}>" end |
#update(status: nil, routing: :unset) ⇒ InteractionChannelInstance
Update the InteractionChannelInstance
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb', line 175 def update( status: nil, routing: :unset ) data = Twilio::Values.of({ 'Status' => status, 'Routing' => Twilio.serialize_object(routing), }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) InteractionChannelInstance.new( @version, payload, interaction_sid: @solution[:interaction_sid], sid: @solution[:sid], ) end |