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
241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 241 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
256 257 258 259 260 261 262 263 264 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 256 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
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 269 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
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 408 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
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 288 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
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 307 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
433 434 435 436 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 433 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Marketplace.V1.InstalledAddOnContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
426 427 428 429 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 426 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
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 334 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
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 363 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
397 398 399 400 401 402 403 |
# File 'lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb', line 397 def usage unless @usage @usage = InstalledAddOnUsageList.new( @version, installed_add_on_sid: @solution[:sid], ) end @usage end |