class Twilio::REST::Conversations::V1::ServiceContext::BindingInstance
Public Class Methods
Initialize the BindingInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] chat_service_sid
The SID of the {Conversation
Service}[https://www.twilio.com/docs/conversations/api/service-resource] the Binding resource is associated with.
@param [String] sid A 34 character string that uniquely identifies this
resource.
@return [BindingInstance] BindingInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/conversations/v1/service/binding.rb 248 def initialize(version, payload, chat_service_sid: nil, sid: nil) 249 super(version) 250 251 # Marshaled Properties 252 @properties = { 253 'sid' => payload['sid'], 254 'account_sid' => payload['account_sid'], 255 'chat_service_sid' => payload['chat_service_sid'], 256 'credential_sid' => payload['credential_sid'], 257 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 258 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 259 'endpoint' => payload['endpoint'], 260 'identity' => payload['identity'], 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 = {'chat_service_sid' => chat_service_sid, 'sid' => sid || @properties['sid'], } 269 end
Public Instance Methods
@return [String] The unique ID of the Account responsible for this binding.
# File lib/twilio-ruby/rest/conversations/v1/service/binding.rb 290 def account_sid 291 @properties['account_sid'] 292 end
@return [binding.BindingType] The push technology to use for the binding.
# File lib/twilio-ruby/rest/conversations/v1/service/binding.rb 332 def binding_type 333 @properties['binding_type'] 334 end
@return [String] The SID of the Conversation Service that the resource is associated with.
# File lib/twilio-ruby/rest/conversations/v1/service/binding.rb 296 def chat_service_sid 297 @properties['chat_service_sid'] 298 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 [BindingContext] BindingContext
for this BindingInstance
# File lib/twilio-ruby/rest/conversations/v1/service/binding.rb 275 def context 276 unless @instance_context 277 @instance_context = BindingContext.new(@version, @params['chat_service_sid'], @params['sid'], ) 278 end 279 @instance_context 280 end
@return [String] The SID of the Credential for the binding.
# File lib/twilio-ruby/rest/conversations/v1/service/binding.rb 302 def credential_sid 303 @properties['credential_sid'] 304 end
@return [Time] The date that this resource was created.
# File lib/twilio-ruby/rest/conversations/v1/service/binding.rb 308 def date_created 309 @properties['date_created'] 310 end
@return [Time] The date that this resource was last updated.
# File lib/twilio-ruby/rest/conversations/v1/service/binding.rb 314 def date_updated 315 @properties['date_updated'] 316 end
Delete the BindingInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/conversations/v1/service/binding.rb 351 def delete 352 context.delete 353 end
@return [String] The unique endpoint identifier for the Binding.
# File lib/twilio-ruby/rest/conversations/v1/service/binding.rb 320 def endpoint 321 @properties['endpoint'] 322 end
Fetch the BindingInstance
@return [BindingInstance] Fetched BindingInstance
# File lib/twilio-ruby/rest/conversations/v1/service/binding.rb 358 def fetch 359 context.fetch 360 end
@return [String] The identity of Conversation User associated with this binding.
# File lib/twilio-ruby/rest/conversations/v1/service/binding.rb 326 def identity 327 @properties['identity'] 328 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/conversations/v1/service/binding.rb 371 def inspect 372 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 373 "<Twilio.Conversations.V1.BindingInstance #{values}>" 374 end
@return [Array] The Conversation message types the binding is subscribed to.
# File lib/twilio-ruby/rest/conversations/v1/service/binding.rb 338 def message_types 339 @properties['message_types'] 340 end
@return [String] A 34 character string that uniquely identifies this resource.
# File lib/twilio-ruby/rest/conversations/v1/service/binding.rb 284 def sid 285 @properties['sid'] 286 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/conversations/v1/service/binding.rb 364 def to_s 365 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 366 "<Twilio.Conversations.V1.BindingInstance #{values}>" 367 end
@return [String] An absolute URL for this binding.
# File lib/twilio-ruby/rest/conversations/v1/service/binding.rb 344 def url 345 @properties['url'] 346 end