Class: Twilio::REST::Monitor::V1::EventInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Monitor::V1::EventInstance
- Defined in:
- lib/twilio-ruby/rest/monitor/v1/event.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The account_sid.
-
#actor_sid ⇒ String
The actor_sid.
-
#actor_type ⇒ String
The actor_type.
-
#context ⇒ EventContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#description ⇒ String
The description.
-
#event_data ⇒ Hash
The event_data.
-
#event_date ⇒ Time
The event_date.
-
#event_type ⇒ String
The event_type.
-
#fetch ⇒ EventInstance
Fetch a EventInstance.
-
#initialize(version, payload, sid: nil) ⇒ EventInstance
constructor
Initialize the EventInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The links.
-
#resource_sid ⇒ String
The resource_sid.
-
#resource_type ⇒ String
The resource_type.
-
#sid ⇒ String
The sid.
-
#source ⇒ String
The source.
-
#source_ip_address ⇒ String
The source_ip_address.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ EventInstance
Initialize the EventInstance
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 238 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'actor_sid' => payload['actor_sid'], 'actor_type' => payload['actor_type'], 'description' => payload['description'], 'event_data' => payload['event_data'], 'event_date' => Twilio.deserialize_iso8601_datetime(payload['event_date']), 'event_type' => payload['event_type'], 'resource_sid' => payload['resource_sid'], 'resource_type' => payload['resource_type'], 'sid' => payload['sid'], 'source' => payload['source'], 'source_ip_address' => payload['source_ip_address'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The account_sid.
282 283 284 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 282 def account_sid @properties['account_sid'] end |
#actor_sid ⇒ String
Returns The actor_sid.
288 289 290 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 288 def actor_sid @properties['actor_sid'] end |
#actor_type ⇒ String
Returns The actor_type.
294 295 296 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 294 def actor_type @properties['actor_type'] end |
#context ⇒ EventContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
270 271 272 273 274 275 276 277 278 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 270 def context unless @instance_context @instance_context = EventContext.new( @version, @params['sid'], ) end @instance_context end |
#description ⇒ String
Returns The description.
300 301 302 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 300 def description @properties['description'] end |
#event_data ⇒ Hash
Returns The event_data.
306 307 308 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 306 def event_data @properties['event_data'] end |
#event_date ⇒ Time
Returns The event_date.
312 313 314 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 312 def event_date @properties['event_date'] end |
#event_type ⇒ String
Returns The event_type.
318 319 320 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 318 def event_type @properties['event_type'] end |
#fetch ⇒ EventInstance
Fetch a EventInstance
367 368 369 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 367 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
380 381 382 383 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 380 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Monitor.V1.EventInstance #{values}>" end |
#links ⇒ String
Returns The links.
360 361 362 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 360 def links @properties['links'] end |
#resource_sid ⇒ String
Returns The resource_sid.
324 325 326 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 324 def resource_sid @properties['resource_sid'] end |
#resource_type ⇒ String
Returns The resource_type.
330 331 332 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 330 def resource_type @properties['resource_type'] end |
#sid ⇒ String
Returns The sid.
336 337 338 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 336 def sid @properties['sid'] end |
#source ⇒ String
Returns The source.
342 343 344 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 342 def source @properties['source'] end |
#source_ip_address ⇒ String
Returns The source_ip_address.
348 349 350 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 348 def source_ip_address @properties['source_ip_address'] end |
#to_s ⇒ Object
Provide a user friendly representation
373 374 375 376 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 373 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Monitor.V1.EventInstance #{values}>" end |
#url ⇒ String
Returns The url.
354 355 356 |
# File 'lib/twilio-ruby/rest/monitor/v1/event.rb', line 354 def url @properties['url'] end |