class Twilio::REST::Chat::V2::ServiceContext::BindingInstance

Public Class Methods

new(version, payload, service_sid: nil, sid: nil) click to toggle source

Initialize the BindingInstance @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 Binding
resource is associated with.

@param [String] sid The SID of the Binding resource to fetch. @return [BindingInstance] BindingInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/chat/v2/service/binding.rb
238 def initialize(version, payload, service_sid: nil, sid: nil)
239   super(version)
240 
241   # Marshaled Properties
242   @properties = {
243       'sid' => payload['sid'],
244       'account_sid' => payload['account_sid'],
245       'service_sid' => payload['service_sid'],
246       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
247       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
248       'endpoint' => payload['endpoint'],
249       'identity' => payload['identity'],
250       'credential_sid' => payload['credential_sid'],
251       'binding_type' => payload['binding_type'],
252       'message_types' => payload['message_types'],
253       'url' => payload['url'],
254       'links' => payload['links'],
255   }
256 
257   # Context
258   @instance_context = nil
259   @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], }
260 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/chat/v2/service/binding.rb
281 def account_sid
282   @properties['account_sid']
283 end
binding_type() click to toggle source

@return [binding.BindingType] The push technology to use for the binding

    # File lib/twilio-ruby/rest/chat/v2/service/binding.rb
323 def binding_type
324   @properties['binding_type']
325 end
context() click to toggle source

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/chat/v2/service/binding.rb
266 def context
267   unless @instance_context
268     @instance_context = BindingContext.new(@version, @params['service_sid'], @params['sid'], )
269   end
270   @instance_context
271 end
credential_sid() click to toggle source

@return [String] The SID of the Credential for the binding

    # File lib/twilio-ruby/rest/chat/v2/service/binding.rb
317 def credential_sid
318   @properties['credential_sid']
319 end
date_created() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the resource was created

    # File lib/twilio-ruby/rest/chat/v2/service/binding.rb
293 def date_created
294   @properties['date_created']
295 end
date_updated() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the resource was last updated

    # File lib/twilio-ruby/rest/chat/v2/service/binding.rb
299 def date_updated
300   @properties['date_updated']
301 end
delete() click to toggle source

Delete the BindingInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/chat/v2/service/binding.rb
355 def delete
356   context.delete
357 end
endpoint() click to toggle source

@return [String] The unique endpoint identifier for the Binding

    # File lib/twilio-ruby/rest/chat/v2/service/binding.rb
305 def endpoint
306   @properties['endpoint']
307 end
fetch() click to toggle source

Fetch the BindingInstance @return [BindingInstance] Fetched BindingInstance

    # File lib/twilio-ruby/rest/chat/v2/service/binding.rb
348 def fetch
349   context.fetch
350 end
identity() click to toggle source

@return [String] The string that identifies the resource's User

    # File lib/twilio-ruby/rest/chat/v2/service/binding.rb
311 def identity
312   @properties['identity']
313 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/chat/v2/service/binding.rb
368 def inspect
369   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
370   "<Twilio.Chat.V2.BindingInstance #{values}>"
371 end
message_types() click to toggle source

@return [Array] The Programmable Chat message types the binding is subscribed to

    # File lib/twilio-ruby/rest/chat/v2/service/binding.rb
329 def message_types
330   @properties['message_types']
331 end
service_sid() click to toggle source

@return [String] The SID of the Service that the Binding resource is associated with

    # File lib/twilio-ruby/rest/chat/v2/service/binding.rb
287 def service_sid
288   @properties['service_sid']
289 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/chat/v2/service/binding.rb
275 def sid
276   @properties['sid']
277 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/chat/v2/service/binding.rb
361 def to_s
362   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
363   "<Twilio.Chat.V2.BindingInstance #{values}>"
364 end
url() click to toggle source

@return [String] The absolute URL of the Binding resource

    # File lib/twilio-ruby/rest/chat/v2/service/binding.rb
335 def url
336   @properties['url']
337 end