class Twilio::REST::Events::V1::SinkInstance
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
Initialize the SinkInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] sid A 34 character string that uniquely identifies this Sink. @return [SinkInstance] SinkInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/events/v1/sink.rb 278 def initialize(version, payload, sid: nil) 279 super(version) 280 281 # Marshaled Properties 282 @properties = { 283 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 284 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 285 'description' => payload['description'], 286 'sid' => payload['sid'], 287 'sink_configuration' => payload['sink_configuration'], 288 'sink_type' => payload['sink_type'], 289 'status' => payload['status'], 290 'url' => payload['url'], 291 'links' => payload['links'], 292 } 293 294 # Context 295 @instance_context = nil 296 @params = {'sid' => sid || @properties['sid'], } 297 end
Public Instance Methods
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [SinkContext] SinkContext
for this SinkInstance
# File lib/twilio-ruby/rest/events/v1/sink.rb 303 def context 304 unless @instance_context 305 @instance_context = SinkContext.new(@version, @params['sid'], ) 306 end 307 @instance_context 308 end
@return [Time] The date this Sink was created
# File lib/twilio-ruby/rest/events/v1/sink.rb 312 def date_created 313 @properties['date_created'] 314 end
@return [Time] The date this Sink was updated
# File lib/twilio-ruby/rest/events/v1/sink.rb 318 def date_updated 319 @properties['date_updated'] 320 end
Delete the SinkInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/events/v1/sink.rb 374 def delete 375 context.delete 376 end
@return [String] Sink Description
# File lib/twilio-ruby/rest/events/v1/sink.rb 324 def description 325 @properties['description'] 326 end
Fetch the SinkInstance
@return [SinkInstance] Fetched SinkInstance
# File lib/twilio-ruby/rest/events/v1/sink.rb 367 def fetch 368 context.fetch 369 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/events/v1/sink.rb 410 def inspect 411 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 412 "<Twilio.Events.V1.SinkInstance #{values}>" 413 end
@return [String] Nested resource URLs.
# File lib/twilio-ruby/rest/events/v1/sink.rb 360 def links 361 @properties['links'] 362 end
@return [String] A string that uniquely identifies this Sink.
# File lib/twilio-ruby/rest/events/v1/sink.rb 330 def sid 331 @properties['sid'] 332 end
@return [Hash] JSON Sink configuration.
# File lib/twilio-ruby/rest/events/v1/sink.rb 336 def sink_configuration 337 @properties['sink_configuration'] 338 end
@return [sink.SinkType] Sink type.
# File lib/twilio-ruby/rest/events/v1/sink.rb 342 def sink_type 343 @properties['sink_type'] 344 end
Access the sink_validate
@return [sink_validate] sink_validate
# File lib/twilio-ruby/rest/events/v1/sink.rb 397 def sink_validate 398 context.sink_validate 399 end
@return [sink.Status] The Status of this Sink
# File lib/twilio-ruby/rest/events/v1/sink.rb 348 def status 349 @properties['status'] 350 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/events/v1/sink.rb 403 def to_s 404 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 405 "<Twilio.Events.V1.SinkInstance #{values}>" 406 end
Update the SinkInstance
@param [String] description A human readable description for the Sink **This
value should not contain PII.**
@return [SinkInstance] Updated SinkInstance
# File lib/twilio-ruby/rest/events/v1/sink.rb 383 def update(description: nil) 384 context.update(description: description, ) 385 end
@return [String] The URL of this resource.
# File lib/twilio-ruby/rest/events/v1/sink.rb 354 def url 355 @properties['url'] 356 end