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
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 that this Event Type was created, given in ISO 8601 format.
-
#date_updated ⇒ Time
The date that this Event Type was updated, given in ISO 8601 format.
-
#description ⇒ String
A human readable description for this Event Type.
-
#documentation_url ⇒ String
The URL to the documentation or to the most relevant Twilio Changelog entry of this Event Type.
-
#fetch ⇒ EventTypeInstance
Fetch the EventTypeInstance.
-
#initialize(version, payload, type: nil) ⇒ EventTypeInstance
constructor
Initialize the EventTypeInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
- #links ⇒ Hash
-
#schema_id ⇒ String
A string that uniquely identifies the Schema this Event Type adheres to.
-
#status ⇒ String
A string that describes how this Event Type can be used.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#type ⇒ String
A string that uniquely identifies this Event Type.
-
#url ⇒ String
The URL of this resource.
Constructor Details
#initialize(version, payload, type: nil) ⇒ EventTypeInstance
Initialize the EventTypeInstance
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 217 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'], 'status' => payload['status'], 'documentation_url' => payload['documentation_url'], '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
242 243 244 245 246 247 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 242 def context unless @instance_context @instance_context = EventTypeContext.new(@version , @params['type']) end @instance_context end |
#date_created ⇒ Time
Returns The date that this Event Type was created, given in ISO 8601 format.
263 264 265 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 263 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this Event Type was updated, given in ISO 8601 format.
269 270 271 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 269 def date_updated @properties['date_updated'] end |
#description ⇒ String
Returns A human readable description for this Event Type.
275 276 277 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 275 def description @properties['description'] end |
#documentation_url ⇒ String
Returns The URL to the documentation or to the most relevant Twilio Changelog entry of this Event Type.
287 288 289 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 287 def documentation_url @properties['documentation_url'] end |
#fetch ⇒ EventTypeInstance
Fetch the EventTypeInstance
306 307 308 309 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 306 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
320 321 322 323 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 320 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Events.V1.EventTypeInstance #{values}>" end |
#links ⇒ Hash
299 300 301 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 299 def links @properties['links'] end |
#schema_id ⇒ String
Returns A string that uniquely identifies the Schema this Event Type adheres to.
257 258 259 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 257 def schema_id @properties['schema_id'] end |
#status ⇒ String
Returns A string that describes how this Event Type can be used. For example: ‘available`, `deprecated`, `restricted`, `discontinued`. When the status is `available`, the Event Type can be used normally.
281 282 283 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 281 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
313 314 315 316 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 313 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Events.V1.EventTypeInstance #{values}>" end |
#type ⇒ String
Returns A string that uniquely identifies this Event Type.
251 252 253 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 251 def type @properties['type'] end |
#url ⇒ String
Returns The URL of this resource.
293 294 295 |
# File 'lib/twilio-ruby/rest/events/v1/event_type.rb', line 293 def url @properties['url'] end |