class Twilio::REST::Preview::Marketplace::InstalledAddOnContext
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
Public Class Methods
Initialize the InstalledAddOnContext
@param [Version] version Version
that contains the resource @param [String] sid The SID of the InstalledAddOn resource to fetch. @return [InstalledAddOnContext] InstalledAddOnContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb 177 def initialize(version, sid) 178 super(version) 179 180 # Path Solution 181 @solution = {sid: sid, } 182 @uri = "/InstalledAddOns/#{@solution[:sid]}" 183 184 # Dependents 185 @extensions = nil 186 end
Public Instance Methods
Delete the InstalledAddOnInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb 191 def delete 192 @version.delete('DELETE', @uri) 193 end
Access the extensions @return [InstalledAddOnExtensionList] @return [InstalledAddOnExtensionContext] if sid was passed.
# File lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb 227 def extensions(sid=:unset) 228 raise ArgumentError, 'sid cannot be nil' if sid.nil? 229 230 if sid != :unset 231 return InstalledAddOnExtensionContext.new(@version, @solution[:sid], sid, ) 232 end 233 234 unless @extensions 235 @extensions = InstalledAddOnExtensionList.new(@version, installed_add_on_sid: @solution[:sid], ) 236 end 237 238 @extensions 239 end
Fetch the InstalledAddOnInstance
@return [InstalledAddOnInstance] Fetched InstalledAddOnInstance
# File lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb 198 def fetch 199 payload = @version.fetch('GET', @uri) 200 201 InstalledAddOnInstance.new(@version, payload, sid: @solution[:sid], ) 202 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb 250 def inspect 251 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 252 "#<Twilio.Preview.Marketplace.InstalledAddOnContext #{context}>" 253 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb 243 def to_s 244 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 245 "#<Twilio.Preview.Marketplace.InstalledAddOnContext #{context}>" 246 end
Update the InstalledAddOnInstance
@param [Hash] configuration Valid JSON object that conform to the configuration
schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured
@param [String] unique_name An application-defined string that uniquely
identifies the resource. This value must be unique within the Account.
@return [InstalledAddOnInstance] Updated InstalledAddOnInstance
# File lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb 212 def update(configuration: :unset, unique_name: :unset) 213 data = Twilio::Values.of({ 214 'Configuration' => Twilio.serialize_object(configuration), 215 'UniqueName' => unique_name, 216 }) 217 218 payload = @version.update('POST', @uri, data: data) 219 220 InstalledAddOnInstance.new(@version, payload, sid: @solution[:sid], ) 221 end