Class: Twilio::REST::Api::V2010::AccountContext::IncomingPhoneNumberContext::AssignedAddOnContext::AssignedAddOnExtensionInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb

Overview

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil, resource_sid: nil, assigned_add_on_sid: nil, sid: nil) ⇒ AssignedAddOnExtensionInstance

Initialize the AssignedAddOnExtensionInstance

Parameters:

  • Version that contains the resource

  • payload that contains response from Twilio

  • (defaults to: nil)

    The SID of the Account that created the resource.

  • (defaults to: nil)

    The SID of the Phone Number to which the Add-on is assigned.

  • (defaults to: nil)

    The SID that uniquely identifies the assigned Add-on installation.

  • (defaults to: nil)

    The Twilio-provided string that uniquely identifies the resource to fetch.



251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 251

def initialize(version, payload, account_sid: nil, resource_sid: nil, assigned_add_on_sid: nil, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'account_sid' => payload['account_sid'],
      'resource_sid' => payload['resource_sid'],
      'assigned_add_on_sid' => payload['assigned_add_on_sid'],
      'friendly_name' => payload['friendly_name'],
      'product_name' => payload['product_name'],
      'unique_name' => payload['unique_name'],
      'uri' => payload['uri'],
      'enabled' => payload['enabled'],
  }

  # Context
  @instance_context = nil
  @params = {
      'account_sid' => ,
      'resource_sid' => resource_sid,
      'assigned_add_on_sid' => assigned_add_on_sid,
      'sid' => sid || @properties['sid'],
  }
end

Instance Method Details

#account_sid ⇒ String

Returns The SID of the Account that created the resource.

Returns:

  • The SID of the Account that created the resource



302
303
304
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 302

def 
  @properties['account_sid']
end

#assigned_add_on_sid ⇒ String

Returns The SID that uniquely identifies the assigned Add-on installation.

Returns:

  • The SID that uniquely identifies the assigned Add-on installation



314
315
316
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 314

def assigned_add_on_sid
  @properties['assigned_add_on_sid']
end

#context ⇒ AssignedAddOnExtensionContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:

  • AssignedAddOnExtensionContext for this AssignedAddOnExtensionInstance



281
282
283
284
285
286
287
288
289
290
291
292
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 281

def context
  unless @instance_context
    @instance_context = AssignedAddOnExtensionContext.new(
        @version,
        @params['account_sid'],
        @params['resource_sid'],
        @params['assigned_add_on_sid'],
        @params['sid'],
    )
  end
  @instance_context
end

#enabled ⇒ Boolean

Returns Whether the Extension will be invoked.

Returns:

  • Whether the Extension will be invoked



344
345
346
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 344

def enabled
  @properties['enabled']
end

#fetch ⇒ AssignedAddOnExtensionInstance

Fetch a AssignedAddOnExtensionInstance

Returns:

  • Fetched AssignedAddOnExtensionInstance



351
352
353
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 351

def fetch
  context.fetch
end

#friendly_name ⇒ String

Returns The string that you assigned to describe the resource.

Returns:

  • The string that you assigned to describe the resource



320
321
322
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 320

def friendly_name
  @properties['friendly_name']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



364
365
366
367
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 364

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Api.V2010.AssignedAddOnExtensionInstance #{values}>"
end

#product_name ⇒ String

Returns A string that you assigned to describe the Product this Extension is used within.

Returns:

  • A string that you assigned to describe the Product this Extension is used within



326
327
328
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 326

def product_name
  @properties['product_name']
end

#resource_sid ⇒ String

Returns The SID of the Phone Number to which the Add-on is assigned.

Returns:

  • The SID of the Phone Number to which the Add-on is assigned



308
309
310
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 308

def resource_sid
  @properties['resource_sid']
end

#sid ⇒ String

Returns The unique string that identifies the resource.

Returns:

  • The unique string that identifies the resource



296
297
298
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 296

def sid
  @properties['sid']
end

#to_s ⇒ Object

Provide a user friendly representation



357
358
359
360
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 357

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Api.V2010.AssignedAddOnExtensionInstance #{values}>"
end

#unique_name ⇒ String

Returns An application-defined string that uniquely identifies the resource.

Returns:

  • An application-defined string that uniquely identifies the resource



332
333
334
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 332

def unique_name
  @properties['unique_name']
end

#uri ⇒ String

Returns The URI of the resource, relative to https://api.twilio.com.

Returns:

  • The URI of the resource, relative to https://api.twilio.com



338
339
340
# File 'lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb', line 338

def uri
  @properties['uri']
end