Class: Twilio::REST::Marketplace::V1::InstalledAddOnContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Marketplace::V1::InstalledAddOnContext
- Defined in:
- lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb,
lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_usage.rb,
lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_extension.rb
Defined Under Namespace
Classes: InstalledAddOnExtensionContext, InstalledAddOnExtensionInstance, InstalledAddOnExtensionInstanceMetadata, InstalledAddOnExtensionList, InstalledAddOnExtensionListResponse, InstalledAddOnExtensionPage, InstalledAddOnExtensionPageMetadata, InstalledAddOnUsageInstance, InstalledAddOnUsageList, InstalledAddOnUsageListResponse, InstalledAddOnUsagePage, InstalledAddOnUsagePageMetadata
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the InstalledAddOnInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the InstalledAddOnInstanceMetadata.
-
#extensions(sid = :unset) ⇒ InstalledAddOnExtensionList, InstalledAddOnExtensionContext
Access the extensions.
-
#fetch ⇒ InstalledAddOnInstance
Fetch the InstalledAddOnInstance.
-
#fetch_with_metadata ⇒ InstalledAddOnInstance
Fetch the InstalledAddOnInstanceMetadata.
-
#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.
-
#update_with_metadata(configuration: :unset, unique_name: :unset) ⇒ InstalledAddOnInstance
Update the InstalledAddOnInstanceMetadata.
-
#usage ⇒ InstalledAddOnUsageList, InstalledAddOnUsageContext
Access the usage.
Constructor Details
#initialize(version, sid) ⇒ InstalledAddOnContext
Initialize the InstalledAddOnContext
233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 233 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/InstalledAddOns/#{@solution[:sid]}" # Dependents @usage = nil @extensions = nil end |
Instance Method Details
#delete ⇒ Boolean
Delete the InstalledAddOnInstance
248 249 250 251 252 253 254 255 256 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 248 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the InstalledAddOnInstanceMetadata
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 261 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) installedAddOn_instance = InstalledAddOnInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) InstalledAddOnInstanceMetadata.new(@version, installedAddOn_instance, response.headers, response.status_code) end |
#extensions(sid = :unset) ⇒ InstalledAddOnExtensionList, InstalledAddOnExtensionContext
Access the extensions
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 400 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
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 280 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 |
#fetch_with_metadata ⇒ InstalledAddOnInstance
Fetch the InstalledAddOnInstanceMetadata
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 299 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) installed_add_on_instance = InstalledAddOnInstance.new( @version, response.body, sid: @solution[:sid], ) InstalledAddOnInstanceMetadata.new( @version, installed_add_on_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
425 426 427 428 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 425 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Marketplace.V1.InstalledAddOnContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
418 419 420 421 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 418 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Marketplace.V1.InstalledAddOnContext #{context}>" end |
#update(configuration: :unset, unique_name: :unset) ⇒ InstalledAddOnInstance
Update the InstalledAddOnInstance
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 326 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 |
#update_with_metadata(configuration: :unset, unique_name: :unset) ⇒ InstalledAddOnInstance
Update the InstalledAddOnInstanceMetadata
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 355 def ( 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', }) response = @version.('POST', @uri, data: data, headers: headers) installed_add_on_instance = InstalledAddOnInstance.new( @version, response.body, sid: @solution[:sid], ) InstalledAddOnInstanceMetadata.new( @version, installed_add_on_instance, response.headers, response.status_code ) end |
#usage ⇒ InstalledAddOnUsageList, InstalledAddOnUsageContext
Access the usage
389 390 391 392 393 394 395 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 389 def usage unless @usage @usage = InstalledAddOnUsageList.new( @version, installed_add_on_sid: @solution[:sid], ) end @usage end |