class Twilio::REST::Chat::V2::ServiceContext::UserContext::UserBindingContext
Public Class Methods
new(version, service_sid, user_sid, sid)
click to toggle source
Initialize the UserBindingContext
@param [Version] version Version
that contains the resource @param [String] service_sid The SID of the
{Service}[https://www.twilio.com/docs/chat/rest/service-resource] to fetch the User Binding resource from.
@param [String] user_sid The SID of the
{User}[https://www.twilio.com/docs/chat/rest/user-resource] with the User Binding resource to fetch. See {push notification configuration}[https://www.twilio.com/docs/chat/push-notification-configuration] for more info.
@param [String] sid The SID of the User Binding resource to fetch. @return [UserBindingContext] UserBindingContext
Calls superclass method
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 187 def initialize(version, service_sid, user_sid, sid) 188 super(version) 189 190 # Path Solution 191 @solution = {service_sid: service_sid, user_sid: user_sid, sid: sid, } 192 @uri = "/Services/#{@solution[:service_sid]}/Users/#{@solution[:user_sid]}/Bindings/#{@solution[:sid]}" 193 end
Public Instance Methods
delete()
click to toggle source
Delete the UserBindingInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 213 def delete 214 @version.delete('DELETE', @uri) 215 end
fetch()
click to toggle source
Fetch the UserBindingInstance
@return [UserBindingInstance] Fetched UserBindingInstance
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 198 def fetch 199 payload = @version.fetch('GET', @uri) 200 201 UserBindingInstance.new( 202 @version, 203 payload, 204 service_sid: @solution[:service_sid], 205 user_sid: @solution[:user_sid], 206 sid: @solution[:sid], 207 ) 208 end
inspect()
click to toggle source
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 226 def inspect 227 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 228 "#<Twilio.Chat.V2.UserBindingContext #{context}>" 229 end
to_s()
click to toggle source
Provide a user friendly representation
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 219 def to_s 220 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 221 "#<Twilio.Chat.V2.UserBindingContext #{context}>" 222 end