class Twilio::REST::IpMessaging::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 service_sid @param [String] sid The sid @return [BindingInstance] BindingInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb
211 def initialize(version, payload, service_sid: nil, sid: nil)
212   super(version)
213 
214   # Marshaled Properties
215   @properties = {
216       'sid' => payload['sid'],
217       'account_sid' => payload['account_sid'],
218       'service_sid' => payload['service_sid'],
219       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
220       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
221       'endpoint' => payload['endpoint'],
222       'identity' => payload['identity'],
223       'credential_sid' => payload['credential_sid'],
224       'binding_type' => payload['binding_type'],
225       'message_types' => payload['message_types'],
226       'url' => payload['url'],
227       'links' => payload['links'],
228   }
229 
230   # Context
231   @instance_context = nil
232   @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], }
233 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The account_sid

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb
254 def account_sid
255   @properties['account_sid']
256 end
binding_type() click to toggle source

@return [binding.BindingType] The binding_type

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb
296 def binding_type
297   @properties['binding_type']
298 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/ip_messaging/v2/service/binding.rb
239 def context
240   unless @instance_context
241     @instance_context = BindingContext.new(@version, @params['service_sid'], @params['sid'], )
242   end
243   @instance_context
244 end
credential_sid() click to toggle source

@return [String] The credential_sid

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb
290 def credential_sid
291   @properties['credential_sid']
292 end
date_created() click to toggle source

@return [Time] The date_created

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb
266 def date_created
267   @properties['date_created']
268 end
date_updated() click to toggle source

@return [Time] The date_updated

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb
272 def date_updated
273   @properties['date_updated']
274 end
delete() click to toggle source

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

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb
328 def delete
329   context.delete
330 end
endpoint() click to toggle source

@return [String] The endpoint

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb
278 def endpoint
279   @properties['endpoint']
280 end
fetch() click to toggle source

Fetch the BindingInstance @return [BindingInstance] Fetched BindingInstance

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb
321 def fetch
322   context.fetch
323 end
identity() click to toggle source

@return [String] The identity

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb
284 def identity
285   @properties['identity']
286 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb
341 def inspect
342   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
343   "<Twilio.IpMessaging.V2.BindingInstance #{values}>"
344 end
message_types() click to toggle source

@return [Array] The message_types

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb
302 def message_types
303   @properties['message_types']
304 end
service_sid() click to toggle source

@return [String] The service_sid

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb
260 def service_sid
261   @properties['service_sid']
262 end
sid() click to toggle source

@return [String] The sid

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb
248 def sid
249   @properties['sid']
250 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb
334 def to_s
335   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
336   "<Twilio.IpMessaging.V2.BindingInstance #{values}>"
337 end
url() click to toggle source

@return [String] The url

    # File lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb
308 def url
309   @properties['url']
310 end