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

new(version, payload, id: nil, schema_version: nil) click to toggle source

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

Calls superclass method 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

context() click to toggle source

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
date_created() click to toggle source

@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() click to toggle source

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
id() click to toggle source

@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
inspect() click to toggle source

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
raw() click to toggle source

@return [String] The raw

    # File lib/twilio-ruby/rest/events/v1/schema/version.rb
261 def raw
262   @properties['raw']
263 end
schema_version() click to toggle source

@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
to_s() click to toggle source

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
url() click to toggle source

@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