Class: VoiceML::ValidationRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/voiceml/models/outgoing_caller_ids.rb

Overview

POST /OutgoingCallerIds response — the verify-by-callback flow used to provision a new outgoing caller id. No sid on the wire (the resource doesn't exist until the validation_code is dialled back); the validation_code is what the user is prompted to enter on the live call.

Constant Summary collapse

ATTRIBUTES =
%w[account_sid call_sid friendly_name phone_number validation_code].freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ ValidationRequest

Returns a new instance of ValidationRequest.



57
58
59
60
61
62
# File 'lib/voiceml/models/outgoing_caller_ids.rb', line 57

def initialize(attrs = {})
  ATTRIBUTES.each do |field|
    value = attrs.key?(field) ? attrs[field] : attrs[field.to_sym]
    instance_variable_set("@#{field}", value)
  end
end

Class Method Details

.from_hash(hash) ⇒ Object



64
65
66
67
68
# File 'lib/voiceml/models/outgoing_caller_ids.rb', line 64

def self.from_hash(hash)
  return nil if hash.nil?

  new(hash)
end