class Twilio::REST::Api::V2010::AccountContext::AddressInstance

Public Class Methods

new(version, payload, account_sid: nil, sid: nil) click to toggle source

Initialize the AddressInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] account_sid The SID of the

{Account}[https://www.twilio.com/docs/iam/api/account] that is responsible for
the Address resource.

@param [String] sid The Twilio-provided string that uniquely identifies the

Address resource to fetch.

@return [AddressInstance] AddressInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
325 def initialize(version, payload, account_sid: nil, sid: nil)
326   super(version)
327 
328   # Marshaled Properties
329   @properties = {
330       'account_sid' => payload['account_sid'],
331       'city' => payload['city'],
332       'customer_name' => payload['customer_name'],
333       'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
334       'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
335       'friendly_name' => payload['friendly_name'],
336       'iso_country' => payload['iso_country'],
337       'postal_code' => payload['postal_code'],
338       'region' => payload['region'],
339       'sid' => payload['sid'],
340       'street' => payload['street'],
341       'uri' => payload['uri'],
342       'emergency_enabled' => payload['emergency_enabled'],
343       'validated' => payload['validated'],
344       'verified' => payload['verified'],
345   }
346 
347   # Context
348   @instance_context = nil
349   @params = {'account_sid' => account_sid, 'sid' => sid || @properties['sid'], }
350 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that is responsible for the resource

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
365 def account_sid
366   @properties['account_sid']
367 end
city() click to toggle source

@return [String] The city in which the address is located

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
371 def city
372   @properties['city']
373 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [AddressContext] AddressContext for this AddressInstance

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
356 def context
357   unless @instance_context
358     @instance_context = AddressContext.new(@version, @params['account_sid'], @params['sid'], )
359   end
360   @instance_context
361 end
customer_name() click to toggle source

@return [String] The name associated with the address

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
377 def customer_name
378   @properties['customer_name']
379 end
date_created() click to toggle source

@return [Time] The RFC 2822 date and time in GMT that the resource was created

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
383 def date_created
384   @properties['date_created']
385 end
date_updated() click to toggle source

@return [Time] The RFC 2822 date and time in GMT that the resource was last updated

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
389 def date_updated
390   @properties['date_updated']
391 end
delete() click to toggle source

Delete the AddressInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
456 def delete
457   context.delete
458 end
dependent_phone_numbers() click to toggle source

Access the dependent_phone_numbers @return [dependent_phone_numbers] dependent_phone_numbers

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
499 def dependent_phone_numbers
500   context.dependent_phone_numbers
501 end
emergency_enabled() click to toggle source

@return [Boolean] Whether emergency calling has been enabled on this number

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
437 def emergency_enabled
438   @properties['emergency_enabled']
439 end
fetch() click to toggle source

Fetch the AddressInstance @return [AddressInstance] Fetched AddressInstance

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
463 def fetch
464   context.fetch
465 end
friendly_name() click to toggle source

@return [String] The string that you assigned to describe the resource

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
395 def friendly_name
396   @properties['friendly_name']
397 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
512 def inspect
513   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
514   "<Twilio.Api.V2010.AddressInstance #{values}>"
515 end
iso_country() click to toggle source

@return [String] The ISO country code of the address

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
401 def iso_country
402   @properties['iso_country']
403 end
postal_code() click to toggle source

@return [String] The postal code of the address

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
407 def postal_code
408   @properties['postal_code']
409 end
region() click to toggle source

@return [String] The state or region of the address

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
413 def region
414   @properties['region']
415 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
419 def sid
420   @properties['sid']
421 end
street() click to toggle source

@return [String] The number and street address of the address

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
425 def street
426   @properties['street']
427 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
505 def to_s
506   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
507   "<Twilio.Api.V2010.AddressInstance #{values}>"
508 end
update(friendly_name: :unset, customer_name: :unset, street: :unset, city: :unset, region: :unset, postal_code: :unset, emergency_enabled: :unset, auto_correct_address: :unset) click to toggle source

Update the AddressInstance @param [String] friendly_name A descriptive string that you create to describe

the address. It can be up to 64 characters long.

@param [String] customer_name The name to associate with the address. @param [String] street The number and street address of the address. @param [String] city The city of the address. @param [String] region The state or region of the address. @param [String] postal_code The postal code of the address. @param [Boolean] emergency_enabled Whether to enable emergency calling on the

address. Can be: `true` or `false`.

@param [Boolean] auto_correct_address Whether we should automatically correct

the address. Can be: `true` or `false` and the default is `true`. If empty or
`true`, we will correct the address you provide if necessary. If `false`, we
won't alter the address you provide.

@return [AddressInstance] Updated AddressInstance

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
483 def update(friendly_name: :unset, customer_name: :unset, street: :unset, city: :unset, region: :unset, postal_code: :unset, emergency_enabled: :unset, auto_correct_address: :unset)
484   context.update(
485       friendly_name: friendly_name,
486       customer_name: customer_name,
487       street: street,
488       city: city,
489       region: region,
490       postal_code: postal_code,
491       emergency_enabled: emergency_enabled,
492       auto_correct_address: auto_correct_address,
493   )
494 end
uri() click to toggle source

@return [String] The URI of the resource, relative to `api.twilio.com`

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
431 def uri
432   @properties['uri']
433 end
validated() click to toggle source

@return [Boolean] Whether the address has been validated to comply with local regulation

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
443 def validated
444   @properties['validated']
445 end
verified() click to toggle source

@return [Boolean] Whether the address has been verified to comply with regulation

    # File lib/twilio-ruby/rest/api/v2010/account/address.rb
449 def verified
450   @properties['verified']
451 end