Class: Twilio::REST::Preview::Marketplace::InstalledAddOnContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Preview::Marketplace::InstalledAddOnContext
- Defined in:
- lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb,
lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb
Defined Under Namespace
Classes: InstalledAddOnExtensionContext, InstalledAddOnExtensionInstance, InstalledAddOnExtensionList, InstalledAddOnExtensionPage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the InstalledAddOnInstance.
-
#extensions(sid = :unset) ⇒ InstalledAddOnExtensionList, InstalledAddOnExtensionContext
Access the extensions.
-
#fetch ⇒ InstalledAddOnInstance
Fetch the InstalledAddOnInstance.
-
#initialize(version, sid) ⇒ InstalledAddOnContext
constructor
Initialize the InstalledAddOnContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(configuration: :unset, unique_name: :unset) ⇒ InstalledAddOnInstance
Update the InstalledAddOnInstance.
Constructor Details
#initialize(version, sid) ⇒ InstalledAddOnContext
Initialize the InstalledAddOnContext
170 171 172 173 174 175 176 177 178 179 |
# File 'lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb', line 170 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/InstalledAddOns/#{@solution[:sid]}" # Dependents @extensions = nil end |
Instance Method Details
#delete ⇒ Boolean
Delete the InstalledAddOnInstance
183 184 185 186 187 188 189 190 |
# File 'lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb', line 183 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#extensions(sid = :unset) ⇒ InstalledAddOnExtensionList, InstalledAddOnExtensionContext
Access the extensions
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb', line 244 def extensions(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return InstalledAddOnExtensionContext.new(@version, @solution[:sid],sid ) end unless @extensions @extensions = InstalledAddOnExtensionList.new( @version, installed_add_on_sid: @solution[:sid], ) end @extensions end |
#fetch ⇒ InstalledAddOnInstance
Fetch the InstalledAddOnInstance
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb', line 195 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) InstalledAddOnInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
269 270 271 272 |
# File 'lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb', line 269 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Marketplace.InstalledAddOnContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
262 263 264 265 |
# File 'lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb', line 262 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Marketplace.InstalledAddOnContext #{context}>" end |
#update(configuration: :unset, unique_name: :unset) ⇒ InstalledAddOnInstance
Update the InstalledAddOnInstance
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
# File 'lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb', line 216 def update( configuration: :unset, unique_name: :unset ) data = Twilio::Values.of({ 'Configuration' => Twilio.serialize_object(configuration), 'UniqueName' => unique_name, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) InstalledAddOnInstance.new( @version, payload, sid: @solution[:sid], ) end |