Class: Twilio::REST::Api::V2010::AccountContext::AddressInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::AddressInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/address.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The account_sid.
-
#city ⇒ String
The city.
-
#context ⇒ AddressContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#customer_name ⇒ String
The customer_name.
-
#date_created ⇒ Time
The date_created.
-
#date_updated ⇒ Time
The date_updated.
-
#delete ⇒ Boolean
Deletes the AddressInstance.
-
#dependent_phone_numbers ⇒ dependent_phone_numbers
Access the dependent_phone_numbers.
-
#emergency_enabled ⇒ Boolean
The emergency_enabled.
-
#fetch ⇒ AddressInstance
Fetch a AddressInstance.
-
#friendly_name ⇒ String
The friendly_name.
-
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ AddressInstance
constructor
Initialize the AddressInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#iso_country ⇒ String
The iso_country.
-
#postal_code ⇒ String
The postal_code.
-
#region ⇒ String
The region.
-
#sid ⇒ String
The sid.
-
#street ⇒ String
The street.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, customer_name: :unset, street: :unset, city: :unset, region: :unset, postal_code: :unset, emergency_enabled: :unset, auto_correct_address: :unset) ⇒ AddressInstance
Update the AddressInstance.
-
#uri ⇒ String
The uri.
-
#validated ⇒ Boolean
The validated.
Constructor Details
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ AddressInstance
Initialize the AddressInstance
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 306 def initialize(version, payload, account_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'city' => payload['city'], 'customer_name' => payload['customer_name'], 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'friendly_name' => payload['friendly_name'], 'iso_country' => payload['iso_country'], 'postal_code' => payload['postal_code'], 'region' => payload['region'], 'sid' => payload['sid'], 'street' => payload['street'], 'uri' => payload['uri'], 'emergency_enabled' => payload['emergency_enabled'], 'validated' => payload['validated'], } # Context @instance_context = nil @params = {'account_sid' => account_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The account_sid.
345 346 347 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 345 def account_sid @properties['account_sid'] end |
#city ⇒ String
Returns The city.
351 352 353 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 351 def city @properties['city'] end |
#context ⇒ AddressContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
336 337 338 339 340 341 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 336 def context unless @instance_context @instance_context = AddressContext.new(@version, @params['account_sid'], @params['sid'], ) end @instance_context end |
#customer_name ⇒ String
Returns The customer_name.
357 358 359 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 357 def customer_name @properties['customer_name'] end |
#date_created ⇒ Time
Returns The date_created.
363 364 365 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 363 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date_updated.
369 370 371 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 369 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the AddressInstance
430 431 432 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 430 def delete context.delete end |
#dependent_phone_numbers ⇒ dependent_phone_numbers
Access the dependent_phone_numbers
468 469 470 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 468 def dependent_phone_numbers context.dependent_phone_numbers end |
#emergency_enabled ⇒ Boolean
Returns The emergency_enabled.
417 418 419 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 417 def emergency_enabled @properties['emergency_enabled'] end |
#fetch ⇒ AddressInstance
Fetch a AddressInstance
437 438 439 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 437 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The friendly_name.
375 376 377 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 375 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
481 482 483 484 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 481 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.AddressInstance #{values}>" end |
#iso_country ⇒ String
Returns The iso_country.
381 382 383 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 381 def iso_country @properties['iso_country'] end |
#postal_code ⇒ String
Returns The postal_code.
387 388 389 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 387 def postal_code @properties['postal_code'] end |
#region ⇒ String
Returns The region.
393 394 395 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 393 def region @properties['region'] end |
#sid ⇒ String
Returns The sid.
399 400 401 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 399 def sid @properties['sid'] end |
#street ⇒ String
Returns The street.
405 406 407 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 405 def street @properties['street'] end |
#to_s ⇒ Object
Provide a user friendly representation
474 475 476 477 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 474 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.AddressInstance #{values}>" end |
#update(friendly_name: :unset, customer_name: :unset, street: :unset, city: :unset, region: :unset, postal_code: :unset, emergency_enabled: :unset, auto_correct_address: :unset) ⇒ AddressInstance
Update the AddressInstance
452 453 454 455 456 457 458 459 460 461 462 463 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 452 def update(friendly_name: :unset, customer_name: :unset, street: :unset, city: :unset, region: :unset, postal_code: :unset, emergency_enabled: :unset, auto_correct_address: :unset) context.update( friendly_name: friendly_name, customer_name: customer_name, street: street, city: city, region: region, postal_code: postal_code, emergency_enabled: emergency_enabled, auto_correct_address: auto_correct_address, ) end |
#uri ⇒ String
Returns The uri.
411 412 413 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 411 def uri @properties['uri'] end |
#validated ⇒ Boolean
Returns The validated.
423 424 425 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 423 def validated @properties['validated'] end |