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