class Twilio::REST::Events::V1::SchemaInstance
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
Initialize the SchemaInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] id The unique identifier of the schema. Each schema can have
multiple versions, that share the same id.
@return [SchemaInstance] SchemaInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/events/v1/schema.rb 137 def initialize(version, payload, id: nil) 138 super(version) 139 140 # Marshaled Properties 141 @properties = { 142 'id' => payload['id'], 143 'url' => payload['url'], 144 'links' => payload['links'], 145 'latest_version_date_created' => Twilio.deserialize_iso8601_datetime(payload['latest_version_date_created']), 146 'latest_version' => payload['latest_version'].to_i, 147 } 148 149 # Context 150 @instance_context = nil 151 @params = {'id' => id || @properties['id'], } 152 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 [SchemaContext] SchemaContext
for this SchemaInstance
# File lib/twilio-ruby/rest/events/v1/schema.rb 158 def context 159 unless @instance_context 160 @instance_context = SchemaContext.new(@version, @params['id'], ) 161 end 162 @instance_context 163 end
Fetch the SchemaInstance
@return [SchemaInstance] Fetched SchemaInstance
# File lib/twilio-ruby/rest/events/v1/schema.rb 198 def fetch 199 context.fetch 200 end
@return [String] Schema Identifier.
# File lib/twilio-ruby/rest/events/v1/schema.rb 167 def id 168 @properties['id'] 169 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/events/v1/schema.rb 218 def inspect 219 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 220 "<Twilio.Events.V1.SchemaInstance #{values}>" 221 end
@return [String] Latest schema version.
# File lib/twilio-ruby/rest/events/v1/schema.rb 191 def latest_version 192 @properties['latest_version'] 193 end
@return [Time] The date that the latest schema version was created.
# File lib/twilio-ruby/rest/events/v1/schema.rb 185 def latest_version_date_created 186 @properties['latest_version_date_created'] 187 end
@return [String] Nested resource URLs.
# File lib/twilio-ruby/rest/events/v1/schema.rb 179 def links 180 @properties['links'] 181 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/events/v1/schema.rb 211 def to_s 212 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 213 "<Twilio.Events.V1.SchemaInstance #{values}>" 214 end
@return [String] The URL of this resource.
# File lib/twilio-ruby/rest/events/v1/schema.rb 173 def url 174 @properties['url'] 175 end
Access the versions @return [versions] versions
# File lib/twilio-ruby/rest/events/v1/schema.rb 205 def versions 206 context.versions 207 end