Class: Twilio::REST::FlexApi::V1::PluginContext::PluginVersionsContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, plugin_sid, sid) ⇒ PluginVersionsContext

Initialize the PluginVersionsContext

Parameters:

  • version (Version)

    Version that contains the resource

  • plugin_sid (String)

    The SID of the Flex Plugin the resource to belongs to.

  • sid (String)

    The SID of the Flex Plugin Version resource to fetch.



188
189
190
191
192
193
194
195
196
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 188

def initialize(version, plugin_sid, sid)
    super(version)

    # Path Solution
    @solution = { plugin_sid: plugin_sid, sid: sid,  }
    @uri = "/PluginService/Plugins/#{@solution[:plugin_sid]}/Versions/#{@solution[:sid]}"

    
end

Instance Method Details

#fetch(flex_metadata: :unset) ⇒ PluginVersionsInstance

Fetch the PluginVersionsInstance

Parameters:

  • flex_metadata (String) (defaults to: :unset)

    The Flex-Metadata HTTP request header

Returns:



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 201

def fetch(
    flex_metadata: :unset
)

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

#inspectObject

Provide a detailed, user friendly representation



230
231
232
233
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 230

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

#to_sObject

Provide a user friendly representation



223
224
225
226
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb', line 223

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