Class: Twilio::REST::FlexApi::V1::PluginConfigurationContext::ConfiguredPluginContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, configuration_sid, plugin_sid) ⇒ ConfiguredPluginContext

Initialize the ConfiguredPluginContext

Parameters:

  • version (Version)

    Version that contains the resource

  • configuration_sid (String)

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

  • plugin_sid (String)

    The unique string that we created to identify the Flex Plugin resource.



145
146
147
148
149
150
151
152
153
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_configuration/configured_plugin.rb', line 145

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

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

    
end

Instance Method Details

#fetch(flex_metadata: :unset) ⇒ ConfiguredPluginInstance

Fetch the ConfiguredPluginInstance

Parameters:

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

    The Flex-Metadata HTTP request header

Returns:



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_configuration/configured_plugin.rb', line 158

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)
    ConfiguredPluginInstance.new(
        @version,
        payload,
        configuration_sid: @solution[:configuration_sid],
        plugin_sid: @solution[:plugin_sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



187
188
189
190
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_configuration/configured_plugin.rb', line 187

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

#to_sObject

Provide a user friendly representation



180
181
182
183
# File 'lib/twilio-ruby/rest/flex_api/v1/plugin_configuration/configured_plugin.rb', line 180

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