Class: Twilio::REST::Events::V1::EventTypeInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Events::V1::EventTypeInstance
- Defined in:
- lib/twilio-ruby/rest/events/v1/event_type.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#context ⇒ EventTypeContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date this Event Type was created.
-
#date_updated ⇒ Time
The date this Event Type was updated.
-
#description ⇒ String
Event Type description.
-
#fetch ⇒ EventTypeInstance
Fetch the EventTypeInstance.
-
#initialize(version, payload, type: nil) ⇒ EventTypeInstance
constructor
Initialize the EventTypeInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The links.
-
#schema_id ⇒ String
The Schema identifier for this Event Type.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#type ⇒ String
The Event Type identifier.
-
#url ⇒ String
The URL of this resource.
Constructor Details
#initialize(version, payload, type: nil) ⇒ EventTypeInstance
Initialize the EventTypeInstance
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 202 def initialize(version, payload, type: nil) super(version) # Marshaled Properties @properties = { 'type' => payload['type'], 'schema_id' => payload['schema_id'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'description' => payload['description'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = {'type' => type || @properties['type'], } end |
Instance Method Details
#context ⇒ EventTypeContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
225 226 227 228 229 230 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 225 def context unless @instance_context @instance_context = EventTypeContext.new(@version, @params['type'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date this Event Type was created.
246 247 248 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 246 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this Event Type was updated.
252 253 254 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 252 def date_updated @properties['date_updated'] end |
#description ⇒ String
Returns Event Type description.
258 259 260 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 258 def description @properties['description'] end |
#fetch ⇒ EventTypeInstance
Fetch the EventTypeInstance
277 278 279 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 277 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
290 291 292 293 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 290 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Events.V1.EventTypeInstance #{values}>" end |
#links ⇒ String
Returns The links.
270 271 272 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 270 def links @properties['links'] end |
#schema_id ⇒ String
Returns The Schema identifier for this Event Type.
240 241 242 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 240 def schema_id @properties['schema_id'] end |
#to_s ⇒ Object
Provide a user friendly representation
283 284 285 286 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 283 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Events.V1.EventTypeInstance #{values}>" end |
#type ⇒ String
Returns The Event Type identifier.
234 235 236 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 234 def type @properties['type'] end |
#url ⇒ String
Returns The URL of this resource.
264 265 266 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 264 def url @properties['url'] end |