Class: Twilio::REST::Conversations::V1::AddressConfigurationInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Conversations::V1::AddressConfigurationInstance
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/address_configuration.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique ID of the [Account](www.twilio.com/docs/iam/api/account) the address belongs to.
-
#address ⇒ String
The unique address to be configured.
-
#address_country ⇒ String
An ISO 3166-1 alpha-2n country code which the address belongs to.
-
#auto_creation ⇒ Hash
Auto Creation configuration for the address.
-
#context ⇒ AddressConfigurationContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this resource was created.
-
#date_updated ⇒ Time
The date that this resource was last updated.
-
#delete ⇒ Boolean
Delete the AddressConfigurationInstance.
-
#fetch ⇒ AddressConfigurationInstance
Fetch the AddressConfigurationInstance.
-
#friendly_name ⇒ String
The human-readable name of this configuration, limited to 256 characters.
-
#initialize(version, payload, sid: nil) ⇒ AddressConfigurationInstance
constructor
Initialize the AddressConfigurationInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
A 34 character string that uniquely identifies this resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#type ⇒ String
Type of Address, value can be ‘whatsapp` or `sms`.
-
#update(friendly_name: :unset, auto_creation_enabled: :unset, auto_creation_type: :unset, auto_creation_conversation_service_sid: :unset, auto_creation_webhook_url: :unset, auto_creation_webhook_method: :unset, auto_creation_webhook_filters: :unset, auto_creation_studio_flow_sid: :unset, auto_creation_studio_retry_count: :unset) ⇒ AddressConfigurationInstance
Update the AddressConfigurationInstance.
-
#url ⇒ String
An absolute API resource URL for this address configuration.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ AddressConfigurationInstance
Initialize the AddressConfigurationInstance
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/twilio-ruby/rest/conversations/v1/address_configuration.rb', line 323 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'type' => payload['type'], 'address' => payload['address'], 'friendly_name' => payload['friendly_name'], 'auto_creation' => payload['auto_creation'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], 'address_country' => payload['address_country'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique ID of the [Account](www.twilio.com/docs/iam/api/account) the address belongs to.
364 365 366 |
# File 'lib/twilio-ruby/rest/conversations/v1/address_configuration.rb', line 364 def account_sid @properties['account_sid'] end |
#address ⇒ String
Returns The unique address to be configured. The address can be a whatsapp address or phone number.
376 377 378 |
# File 'lib/twilio-ruby/rest/conversations/v1/address_configuration.rb', line 376 def address @properties['address'] end |
#address_country ⇒ String
Returns An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses.
412 413 414 |
# File 'lib/twilio-ruby/rest/conversations/v1/address_configuration.rb', line 412 def address_country @properties['address_country'] end |
#auto_creation ⇒ Hash
Returns Auto Creation configuration for the address.
388 389 390 |
# File 'lib/twilio-ruby/rest/conversations/v1/address_configuration.rb', line 388 def auto_creation @properties['auto_creation'] end |
#context ⇒ AddressConfigurationContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
349 350 351 352 353 354 |
# File 'lib/twilio-ruby/rest/conversations/v1/address_configuration.rb', line 349 def context unless @instance_context @instance_context = AddressConfigurationContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date that this resource was created.
394 395 396 |
# File 'lib/twilio-ruby/rest/conversations/v1/address_configuration.rb', line 394 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated.
400 401 402 |
# File 'lib/twilio-ruby/rest/conversations/v1/address_configuration.rb', line 400 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the AddressConfigurationInstance
419 420 421 422 |
# File 'lib/twilio-ruby/rest/conversations/v1/address_configuration.rb', line 419 def delete context.delete end |
#fetch ⇒ AddressConfigurationInstance
Fetch the AddressConfigurationInstance
427 428 429 430 |
# File 'lib/twilio-ruby/rest/conversations/v1/address_configuration.rb', line 427 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The human-readable name of this configuration, limited to 256 characters. Optional.
382 383 384 |
# File 'lib/twilio-ruby/rest/conversations/v1/address_configuration.rb', line 382 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
478 479 480 481 |
# File 'lib/twilio-ruby/rest/conversations/v1/address_configuration.rb', line 478 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.AddressConfigurationInstance #{values}>" end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
358 359 360 |
# File 'lib/twilio-ruby/rest/conversations/v1/address_configuration.rb', line 358 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
471 472 473 474 |
# File 'lib/twilio-ruby/rest/conversations/v1/address_configuration.rb', line 471 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Conversations.V1.AddressConfigurationInstance #{values}>" end |
#type ⇒ String
Returns Type of Address, value can be ‘whatsapp` or `sms`.
370 371 372 |
# File 'lib/twilio-ruby/rest/conversations/v1/address_configuration.rb', line 370 def type @properties['type'] end |
#update(friendly_name: :unset, auto_creation_enabled: :unset, auto_creation_type: :unset, auto_creation_conversation_service_sid: :unset, auto_creation_webhook_url: :unset, auto_creation_webhook_method: :unset, auto_creation_webhook_filters: :unset, auto_creation_studio_flow_sid: :unset, auto_creation_studio_retry_count: :unset) ⇒ AddressConfigurationInstance
Update the AddressConfigurationInstance
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 |
# File 'lib/twilio-ruby/rest/conversations/v1/address_configuration.rb', line 444 def update( friendly_name: :unset, auto_creation_enabled: :unset, auto_creation_type: :unset, auto_creation_conversation_service_sid: :unset, auto_creation_webhook_url: :unset, auto_creation_webhook_method: :unset, auto_creation_webhook_filters: :unset, auto_creation_studio_flow_sid: :unset, auto_creation_studio_retry_count: :unset ) context.update( friendly_name: friendly_name, auto_creation_enabled: auto_creation_enabled, auto_creation_type: auto_creation_type, auto_creation_conversation_service_sid: auto_creation_conversation_service_sid, auto_creation_webhook_url: auto_creation_webhook_url, auto_creation_webhook_method: auto_creation_webhook_method, auto_creation_webhook_filters: auto_creation_webhook_filters, auto_creation_studio_flow_sid: auto_creation_studio_flow_sid, auto_creation_studio_retry_count: auto_creation_studio_retry_count, ) end |
#url ⇒ String
Returns An absolute API resource URL for this address configuration.
406 407 408 |
# File 'lib/twilio-ruby/rest/conversations/v1/address_configuration.rb', line 406 def url @properties['url'] end |