Class: Twilio::REST::Events::V1::SubscriptionInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Events::V1::SubscriptionInstance
- Defined in:
- lib/twilio-ruby/rest/events/v1/subscription.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique SID identifier of the Account.
-
#context ⇒ SubscriptionContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this Subscription was created, given in ISO 8601 format.
-
#date_updated ⇒ Time
The date that this Subscription was updated, given in ISO 8601 format.
-
#delete ⇒ Boolean
Delete the SubscriptionInstance.
-
#description ⇒ String
A human readable description for the Subscription.
-
#fetch ⇒ SubscriptionInstance
Fetch the SubscriptionInstance.
-
#initialize(version, payload, sid: nil) ⇒ SubscriptionInstance
constructor
Initialize the SubscriptionInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
Contains a dictionary of URL links to nested resources of this Subscription.
-
#sid ⇒ String
A 34 character string that uniquely identifies this Subscription.
-
#sink_sid ⇒ String
The SID of the sink that events selected by this subscription should be sent to.
-
#subscribed_events ⇒ subscribed_events
Access the subscribed_events.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(description: :unset, sink_sid: :unset) ⇒ SubscriptionInstance
Update the SubscriptionInstance.
-
#url ⇒ String
The URL of this resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ SubscriptionInstance
Initialize the SubscriptionInstance
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
# File 'lib/twilio-ruby/rest/events/v1/subscription.rb', line 294 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'sid' => payload['sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'description' => payload['description'], 'sink_sid' => payload['sink_sid'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique SID identifier of the Account.
327 328 329 |
# File 'lib/twilio-ruby/rest/events/v1/subscription.rb', line 327 def account_sid @properties['account_sid'] end |
#context ⇒ SubscriptionContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
318 319 320 321 322 323 |
# File 'lib/twilio-ruby/rest/events/v1/subscription.rb', line 318 def context unless @instance_context @instance_context = SubscriptionContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date that this Subscription was created, given in ISO 8601 format.
339 340 341 |
# File 'lib/twilio-ruby/rest/events/v1/subscription.rb', line 339 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this Subscription was updated, given in ISO 8601 format.
345 346 347 |
# File 'lib/twilio-ruby/rest/events/v1/subscription.rb', line 345 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the SubscriptionInstance
376 377 378 379 |
# File 'lib/twilio-ruby/rest/events/v1/subscription.rb', line 376 def delete context.delete end |
#description ⇒ String
Returns A human readable description for the Subscription.
351 352 353 |
# File 'lib/twilio-ruby/rest/events/v1/subscription.rb', line 351 def description @properties['description'] end |
#fetch ⇒ SubscriptionInstance
Fetch the SubscriptionInstance
384 385 386 387 |
# File 'lib/twilio-ruby/rest/events/v1/subscription.rb', line 384 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
421 422 423 424 |
# File 'lib/twilio-ruby/rest/events/v1/subscription.rb', line 421 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Events.V1.SubscriptionInstance #{values}>" end |
#links ⇒ Hash
Returns Contains a dictionary of URL links to nested resources of this Subscription.
369 370 371 |
# File 'lib/twilio-ruby/rest/events/v1/subscription.rb', line 369 def links @properties['links'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this Subscription.
333 334 335 |
# File 'lib/twilio-ruby/rest/events/v1/subscription.rb', line 333 def sid @properties['sid'] end |
#sink_sid ⇒ String
Returns The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created.
357 358 359 |
# File 'lib/twilio-ruby/rest/events/v1/subscription.rb', line 357 def sink_sid @properties['sink_sid'] end |
#subscribed_events ⇒ subscribed_events
Access the subscribed_events
408 409 410 |
# File 'lib/twilio-ruby/rest/events/v1/subscription.rb', line 408 def subscribed_events context.subscribed_events end |
#to_s ⇒ Object
Provide a user friendly representation
414 415 416 417 |
# File 'lib/twilio-ruby/rest/events/v1/subscription.rb', line 414 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Events.V1.SubscriptionInstance #{values}>" end |
#update(description: :unset, sink_sid: :unset) ⇒ SubscriptionInstance
Update the SubscriptionInstance
394 395 396 397 398 399 400 401 402 403 |
# File 'lib/twilio-ruby/rest/events/v1/subscription.rb', line 394 def update( description: :unset, sink_sid: :unset ) context.update( description: description, sink_sid: sink_sid, ) end |
#url ⇒ String
Returns The URL of this resource.
363 364 365 |
# File 'lib/twilio-ruby/rest/events/v1/subscription.rb', line 363 def url @properties['url'] end |