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

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

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



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

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:



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/twilio-ruby/rest/events/v1/schema/schema_version.rb', line 151

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    SchemaVersionInstance.new(
        @version,
        payload,
        id: @solution[:id],
        schema_version: @solution[:schema_version],
    )
end

#inspectObject

Provide a detailed, user friendly representation



178
179
180
181
# File 'lib/twilio-ruby/rest/events/v1/schema/schema_version.rb', line 178

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

#to_sObject

Provide a user friendly representation



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

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