Class: Twilio::REST::Events::V1::SchemaContext::SchemaVersionContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/events/v1/schema/schema_version.rb

Overview

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

Instance Method Summary collapse

Constructor Details

#initialize(version, id, schema_version) ⇒ SchemaVersionContext

Initialize the SchemaVersionContext

Parameters:

  • version (Version)

    Version that contains the resource

  • id (String)

    The unique identifier of the schema. Each schema can have multiple versions, that share the same id.

  • schema_version (String)

    The version of the schema



137
138
139
140
141
142
143
144
145
# File 'lib/twilio-ruby/rest/events/v1/schema/schema_version.rb', line 137

def initialize(version, id, schema_version)
    super(version)

    # Path Solution
    @solution = { id: id, schema_version: schema_version,  }
    @uri = "/Schemas/#{@solution[:id]}/Versions/#{@solution[:schema_version]}"

    
end

Instance Method Details

#fetchSchemaVersionInstance

Fetch the SchemaVersionInstance

Returns:



149
150
151
152
153
154
155
156
157
158
# File 'lib/twilio-ruby/rest/events/v1/schema/schema_version.rb', line 149

def fetch

    payload = @version.fetch('GET', @uri)
    SchemaVersionInstance.new(
        @version,
        payload,
        id: @solution[:id],
        schema_version: @solution[:schema_version],
    )
end

#inspectObject

Provide a detailed, user friendly representation



170
171
172
173
# File 'lib/twilio-ruby/rest/events/v1/schema/schema_version.rb', line 170

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Events.V1.SchemaVersionContext #{context}>"
end

#to_sObject

Provide a user friendly representation



163
164
165
166
# File 'lib/twilio-ruby/rest/events/v1/schema/schema_version.rb', line 163

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Events.V1.SchemaVersionContext #{context}>"
end