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

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

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

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

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

Fetch the SchemaInstance @return [SchemaInstance] Fetched SchemaInstance

    # File lib/twilio-ruby/rest/events/v1/schema.rb
198 def fetch
199   context.fetch
200 end
id() click to toggle source

@return [String] Schema Identifier.

    # File lib/twilio-ruby/rest/events/v1/schema.rb
167 def id
168   @properties['id']
169 end
inspect() click to toggle source

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

@return [String] Latest schema version.

    # File lib/twilio-ruby/rest/events/v1/schema.rb
191 def latest_version
192   @properties['latest_version']
193 end
latest_version_date_created() click to toggle source

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

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

@return [String] The URL of this resource.

    # File lib/twilio-ruby/rest/events/v1/schema.rb
173 def url
174   @properties['url']
175 end
versions() click to toggle source

Access the versions @return [versions] versions

    # File lib/twilio-ruby/rest/events/v1/schema.rb
205 def versions
206   context.versions
207 end