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

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/events/v1/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


159
160
161
162
163
164
165
# File 'lib/twilio-ruby/rest/events/v1/schema/version.rb', line 159

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:


170
171
172
173
174
175
176
177
178
179
# File 'lib/twilio-ruby/rest/events/v1/schema/version.rb', line 170

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


190
191
192
193
# File 'lib/twilio-ruby/rest/events/v1/schema/version.rb', line 190

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

#to_sObject

Provide a user friendly representation


183
184
185
186
# File 'lib/twilio-ruby/rest/events/v1/schema/version.rb', line 183

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