class Twilio::REST::Events::V1::SchemaContext::SchemaVersionInstance
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
Initialize the SchemaVersionInstance
@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.
@param [String] schema_version
The version of the schema @return [SchemaVersionInstance] SchemaVersionInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/events/v1/schema/version.rb 207 def initialize(version, payload, id: nil, schema_version: nil) 208 super(version) 209 210 # Marshaled Properties 211 @properties = { 212 'id' => payload['id'], 213 'schema_version' => payload['schema_version'].to_i, 214 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 215 'url' => payload['url'], 216 'raw' => payload['raw'], 217 } 218 219 # Context 220 @instance_context = nil 221 @params = {'id' => id, 'schema_version' => schema_version || @properties['schema_version'], } 222 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 [SchemaVersionContext] SchemaVersionContext
for this SchemaVersionInstance
# File lib/twilio-ruby/rest/events/v1/schema/version.rb 228 def context 229 unless @instance_context 230 @instance_context = SchemaVersionContext.new(@version, @params['id'], @params['schema_version'], ) 231 end 232 @instance_context 233 end
@return [Time] The date the schema version was created.
# File lib/twilio-ruby/rest/events/v1/schema/version.rb 249 def date_created 250 @properties['date_created'] 251 end
Fetch the SchemaVersionInstance
@return [SchemaVersionInstance] Fetched SchemaVersionInstance
# File lib/twilio-ruby/rest/events/v1/schema/version.rb 268 def fetch 269 context.fetch 270 end
@return [String] The unique identifier of the schema.
# File lib/twilio-ruby/rest/events/v1/schema/version.rb 237 def id 238 @properties['id'] 239 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/events/v1/schema/version.rb 281 def inspect 282 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 283 "<Twilio.Events.V1.SchemaVersionInstance #{values}>" 284 end
@return [String] The raw
# File lib/twilio-ruby/rest/events/v1/schema/version.rb 261 def raw 262 @properties['raw'] 263 end
@return [String] The version of this schema.
# File lib/twilio-ruby/rest/events/v1/schema/version.rb 243 def schema_version 244 @properties['schema_version'] 245 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/events/v1/schema/version.rb 274 def to_s 275 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 276 "<Twilio.Events.V1.SchemaVersionInstance #{values}>" 277 end
@return [String] The URL of this resource.
# File lib/twilio-ruby/rest/events/v1/schema/version.rb 255 def url 256 @properties['url'] 257 end