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