class Twilio::REST::Notify::V1::ServiceContext::BindingInstance
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
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] service_sid
The SID of the
{Service}[https://www.twilio.com/docs/notify/api/service-resource] the resource is associated with.
@param [String] sid The Twilio-provided string that uniquely identifies the
Binding resource to fetch.
@return [BindingInstance] BindingInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 306 def initialize(version, payload, service_sid: nil, sid: nil) 307 super(version) 308 309 # Marshaled Properties 310 @properties = { 311 'sid' => payload['sid'], 312 'account_sid' => payload['account_sid'], 313 'service_sid' => payload['service_sid'], 314 'credential_sid' => payload['credential_sid'], 315 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 316 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 317 'notification_protocol_version' => payload['notification_protocol_version'], 318 'endpoint' => payload['endpoint'], 319 'identity' => payload['identity'], 320 'binding_type' => payload['binding_type'], 321 'address' => payload['address'], 322 'tags' => payload['tags'], 323 'url' => payload['url'], 324 'links' => payload['links'], 325 } 326 327 # Context 328 @instance_context = nil 329 @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], } 330 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 351 def account_sid 352 @properties['account_sid'] 353 end
@return [String] The channel-specific address
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 405 def address 406 @properties['address'] 407 end
@return [String] The type of the Binding
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 399 def binding_type 400 @properties['binding_type'] 401 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/notify/v1/service/binding.rb 336 def context 337 unless @instance_context 338 @instance_context = BindingContext.new(@version, @params['service_sid'], @params['sid'], ) 339 end 340 @instance_context 341 end
@return [String] The SID of the Credential resource to be used to send notifications to this Binding
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 363 def credential_sid 364 @properties['credential_sid'] 365 end
@return [Time] The RFC 2822 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 369 def date_created 370 @properties['date_created'] 371 end
@return [Time] The RFC 2822 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 375 def date_updated 376 @properties['date_updated'] 377 end
Delete the BindingInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 437 def delete 438 context.delete 439 end
@return [String] Deprecated
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 387 def endpoint 388 @properties['endpoint'] 389 end
Fetch the BindingInstance
@return [BindingInstance] Fetched BindingInstance
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 430 def fetch 431 context.fetch 432 end
@return [String] The `identity` value that identifies the new resource's User
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 393 def identity 394 @properties['identity'] 395 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 450 def inspect 451 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 452 "<Twilio.Notify.V1.BindingInstance #{values}>" 453 end
@return [String] The URLs of related resources
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 423 def links 424 @properties['links'] 425 end
@return [String] The protocol version to use to send the notification
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 381 def notification_protocol_version 382 @properties['notification_protocol_version'] 383 end
@return [String] The SID of the Service that the resource is associated with
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 357 def service_sid 358 @properties['service_sid'] 359 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 345 def sid 346 @properties['sid'] 347 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 443 def to_s 444 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 445 "<Twilio.Notify.V1.BindingInstance #{values}>" 446 end
@return [String] The absolute URL of the Binding resource
# File lib/twilio-ruby/rest/notify/v1/service/binding.rb 417 def url 418 @properties['url'] 419 end