class Twilio::REST::Events::V1::SchemaContext

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Public Class Methods

new(version, id) click to toggle source

Initialize the SchemaContext @param [Version] version Version that contains the resource @param [String] id The unique identifier of the schema. Each schema can have

multiple versions, that share the same id.

@return [SchemaContext] SchemaContext

Calls superclass method Twilio::REST::InstanceContext::new
   # File lib/twilio-ruby/rest/events/v1/schema.rb
74 def initialize(version, id)
75   super(version)
76 
77   # Path Solution
78   @solution = {id: id, }
79   @uri = "/Schemas/#{@solution[:id]}"
80 
81   # Dependents
82   @versions = nil
83 end

Public Instance Methods

fetch() click to toggle source

Fetch the SchemaInstance @return [SchemaInstance] Fetched SchemaInstance

   # File lib/twilio-ruby/rest/events/v1/schema.rb
88 def fetch
89   payload = @version.fetch('GET', @uri)
90 
91   SchemaInstance.new(@version, payload, id: @solution[:id], )
92 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/events/v1/schema.rb
121 def inspect
122   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
123   "#<Twilio.Events.V1.SchemaContext #{context}>"
124 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/events/v1/schema.rb
114 def to_s
115   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
116   "#<Twilio.Events.V1.SchemaContext #{context}>"
117 end
versions(schema_version=:unset) click to toggle source

Access the versions @return [SchemaVersionList] @return [SchemaVersionContext] if schema_version was passed.

    # File lib/twilio-ruby/rest/events/v1/schema.rb
 98 def versions(schema_version=:unset)
 99   raise ArgumentError, 'schema_version cannot be nil' if schema_version.nil?
100 
101   if schema_version != :unset
102     return SchemaVersionContext.new(@version, @solution[:id], schema_version, )
103   end
104 
105   unless @versions
106     @versions = SchemaVersionList.new(@version, id: @solution[:id], )
107   end
108 
109   @versions
110 end