class Twilio::REST::Chat::V2::ServiceContext::UserContext::UserBindingInstance
Public Class Methods
Initialize the UserBindingInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] service_sid
The SID of the
{Service}[https://www.twilio.com/docs/chat/rest/service-resource] the User Binding resource is associated with.
@param [String] user_sid
The SID of the
{User}[https://www.twilio.com/docs/chat/rest/user-resource] with the User Binding resource. 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 [UserBindingInstance] UserBindingInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 247 def initialize(version, payload, service_sid: nil, user_sid: nil, sid: nil) 248 super(version) 249 250 # Marshaled Properties 251 @properties = { 252 'sid' => payload['sid'], 253 'account_sid' => payload['account_sid'], 254 'service_sid' => payload['service_sid'], 255 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 256 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 257 'endpoint' => payload['endpoint'], 258 'identity' => payload['identity'], 259 'user_sid' => payload['user_sid'], 260 'credential_sid' => payload['credential_sid'], 261 'binding_type' => payload['binding_type'], 262 'message_types' => payload['message_types'], 263 'url' => payload['url'], 264 } 265 266 # Context 267 @instance_context = nil 268 @params = {'service_sid' => service_sid, 'user_sid' => user_sid, 'sid' => sid || @properties['sid'], } 269 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 295 def account_sid 296 @properties['account_sid'] 297 end
@return [user_binding.BindingType] The push technology to use for the binding
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 343 def binding_type 344 @properties['binding_type'] 345 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [UserBindingContext] UserBindingContext
for this UserBindingInstance
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 275 def context 276 unless @instance_context 277 @instance_context = UserBindingContext.new( 278 @version, 279 @params['service_sid'], 280 @params['user_sid'], 281 @params['sid'], 282 ) 283 end 284 @instance_context 285 end
@return [String] The SID of the Credential for the binding
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 337 def credential_sid 338 @properties['credential_sid'] 339 end
@return [Time] The ISO 8601 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 307 def date_created 308 @properties['date_created'] 309 end
@return [Time] The ISO 8601 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 313 def date_updated 314 @properties['date_updated'] 315 end
Delete the UserBindingInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 369 def delete 370 context.delete 371 end
@return [String] The unique endpoint identifier for the User Binding
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 319 def endpoint 320 @properties['endpoint'] 321 end
Fetch the UserBindingInstance
@return [UserBindingInstance] Fetched UserBindingInstance
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 362 def fetch 363 context.fetch 364 end
@return [String] The string that identifies the resource's User
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 325 def identity 326 @properties['identity'] 327 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 382 def inspect 383 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 384 "<Twilio.Chat.V2.UserBindingInstance #{values}>" 385 end
@return [String] The SID of the Service that the resource is associated with
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 301 def service_sid 302 @properties['service_sid'] 303 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 289 def sid 290 @properties['sid'] 291 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 375 def to_s 376 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 377 "<Twilio.Chat.V2.UserBindingInstance #{values}>" 378 end
@return [String] The absolute URL of the User Binding resource
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 355 def url 356 @properties['url'] 357 end
@return [String] The SID of the User with the binding
# File lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb 331 def user_sid 332 @properties['user_sid'] 333 end