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 SID of the [Account](www.twilio.com/docs/iam/api/account) that is responsible for the Address resource.
-
#city ⇒ String
The city in which the address is located.
-
#context ⇒ AddressContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#customer_name ⇒ String
The name associated with the address.This property has a maximum length of 16 4-byte characters, or 21 3-byte characters.
-
#date_created ⇒ Time
The date and time in GMT that the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#date_updated ⇒ Time
The date and time in GMT that the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#delete ⇒ Boolean
Delete the AddressInstance.
-
#dependent_phone_numbers ⇒ dependent_phone_numbers
Access the dependent_phone_numbers.
-
#emergency_enabled ⇒ Boolean
Whether emergency calling has been enabled on this number.
-
#fetch ⇒ AddressInstance
Fetch the AddressInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the resource.
-
#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 code of the address.
-
#postal_code ⇒ String
The postal code of the address.
-
#region ⇒ String
The state or region of the address.
-
#sid ⇒ String
The unique string that that we created to identify the Address resource.
-
#street ⇒ String
The number and street address of the address.
-
#street_secondary ⇒ String
The additional number and street address of the address.
-
#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, street_secondary: :unset) ⇒ AddressInstance
Update the AddressInstance.
-
#uri ⇒ String
The URI of the resource, relative to ‘api.twilio.com`.
-
#validated ⇒ Boolean
Whether the address has been validated to comply with local regulation.
-
#verified ⇒ Boolean
Whether the address has been verified to comply with regulation.
Constructor Details
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ AddressInstance
Initialize the AddressInstance
368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 368 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'], 'verified' => payload['verified'], 'street_secondary' => payload['street_secondary'], } # Context @instance_context = nil @params = { 'account_sid' => account_sid ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that is responsible for the Address resource.
409 410 411 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 409 def account_sid @properties['account_sid'] end |
#city ⇒ String
Returns The city in which the address is located.
415 416 417 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 415 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
400 401 402 403 404 405 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 400 def context unless @instance_context @instance_context = AddressContext.new(@version , @params['account_sid'], @params['sid']) end @instance_context end |
#customer_name ⇒ String
Returns The name associated with the address.This property has a maximum length of 16 4-byte characters, or 21 3-byte characters.
421 422 423 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 421 def customer_name @properties['customer_name'] end |
#date_created ⇒ Time
Returns The date and time in GMT that the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
427 428 429 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 427 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT that the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
433 434 435 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 433 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the AddressInstance
506 507 508 509 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 506 def delete context.delete end |
#dependent_phone_numbers ⇒ dependent_phone_numbers
Access the dependent_phone_numbers
559 560 561 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 559 def dependent_phone_numbers context.dependent_phone_numbers end |
#emergency_enabled ⇒ Boolean
Returns Whether emergency calling has been enabled on this number.
481 482 483 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 481 def emergency_enabled @properties['emergency_enabled'] end |
#fetch ⇒ AddressInstance
Fetch the AddressInstance
514 515 516 517 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 514 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the resource.
439 440 441 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 439 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
572 573 574 575 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 572 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.AddressInstance #{values}>" end |
#iso_country ⇒ String
Returns The ISO country code of the address.
445 446 447 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 445 def iso_country @properties['iso_country'] end |
#postal_code ⇒ String
Returns The postal code of the address.
451 452 453 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 451 def postal_code @properties['postal_code'] end |
#region ⇒ String
Returns The state or region of the address.
457 458 459 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 457 def region @properties['region'] end |
#sid ⇒ String
Returns The unique string that that we created to identify the Address resource.
463 464 465 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 463 def sid @properties['sid'] end |
#street ⇒ String
Returns The number and street address of the address.
469 470 471 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 469 def street @properties['street'] end |
#street_secondary ⇒ String
Returns The additional number and street address of the address.
499 500 501 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 499 def street_secondary @properties['street_secondary'] end |
#to_s ⇒ Object
Provide a user friendly representation
565 566 567 568 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 565 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, street_secondary: :unset) ⇒ AddressInstance
Update the AddressInstance
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 531 def update( friendly_name: :unset, customer_name: :unset, street: :unset, city: :unset, region: :unset, postal_code: :unset, emergency_enabled: :unset, auto_correct_address: :unset, street_secondary: :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, street_secondary: street_secondary, ) end |
#uri ⇒ String
Returns The URI of the resource, relative to ‘api.twilio.com`.
475 476 477 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 475 def uri @properties['uri'] end |
#validated ⇒ Boolean
Returns Whether the address has been validated to comply with local regulation. In countries that require valid addresses, an invalid address will not be accepted. ‘true` indicates the Address has been validated. `false` indicate the country doesn’t require validation or the Address is not valid.
487 488 489 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 487 def validated @properties['validated'] end |
#verified ⇒ Boolean
Returns Whether the address has been verified to comply with regulation. In countries that require valid addresses, an invalid address will not be accepted. ‘true` indicates the Address has been verified. `false` indicate the country doesn’t require verified or the Address is not valid.
493 494 495 |
# File 'lib/twilio-ruby/rest/api/v2010/account/address.rb', line 493 def verified @properties['verified'] end |