Class: Bandwidth::ApiCallResponse
- Defined in:
- lib/bandwidth/voice_lib/voice/models/api_call_response.rb
Overview
ApiCallResponse Model.
Instance Attribute Summary collapse
-
#answer_method ⇒ AnswerMethodEnum
Format is E164.
-
#answer_url ⇒ String
Format is E164.
-
#application_id ⇒ String
Format is E164.
-
#call_id ⇒ String
Format is E164.
-
#call_timeout ⇒ Float
Format is E164.
-
#disconnect_method ⇒ DisconnectMethodEnum
Format is E164.
-
#disconnect_url ⇒ String
Format is E164.
-
#from ⇒ String
Format is E164.
-
#tag ⇒ String
Format is E164.
-
#to ⇒ String
Format is E164.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(from = nil, to = nil, answer_url = nil, call_id = nil, application_id = nil, call_timeout = nil, answer_method = nil, disconnect_url = nil, disconnect_method = nil, tag = nil) ⇒ ApiCallResponse
constructor
A new instance of ApiCallResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(from = nil, to = nil, answer_url = nil, call_id = nil, application_id = nil, call_timeout = nil, answer_method = nil, disconnect_url = nil, disconnect_method = nil, tag = nil) ⇒ ApiCallResponse
Returns a new instance of ApiCallResponse.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 65 def initialize(from = nil, to = nil, answer_url = nil, call_id = nil, application_id = nil, call_timeout = nil, answer_method = nil, disconnect_url = nil, disconnect_method = nil, tag = nil) @from = from @to = to @call_timeout = call_timeout @answer_url = answer_url @call_id = call_id @answer_method = answer_method @disconnect_url = disconnect_url @disconnect_method = disconnect_method @tag = tag @application_id = application_id end |
Instance Attribute Details
#answer_method ⇒ AnswerMethodEnum
Format is E164
31 32 33 |
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 31 def answer_method @answer_method end |
#answer_url ⇒ String
Format is E164
23 24 25 |
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 23 def answer_url @answer_url end |
#application_id ⇒ String
Format is E164
47 48 49 |
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 47 def application_id @application_id end |
#call_id ⇒ String
Format is E164
27 28 29 |
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 27 def call_id @call_id end |
#call_timeout ⇒ Float
Format is E164
19 20 21 |
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 19 def call_timeout @call_timeout end |
#disconnect_method ⇒ DisconnectMethodEnum
Format is E164
39 40 41 |
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 39 def disconnect_method @disconnect_method end |
#disconnect_url ⇒ String
Format is E164
35 36 37 |
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 35 def disconnect_url @disconnect_url end |
#from ⇒ String
Format is E164
11 12 13 |
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 11 def from @from end |
#tag ⇒ String
Format is E164
43 44 45 |
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 43 def tag @tag end |
#to ⇒ String
Format is E164
15 16 17 |
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 15 def to @to end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 88 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. from = hash['from'] to = hash['to'] answer_url = hash['answerUrl'] call_id = hash['callId'] application_id = hash['applicationId'] call_timeout = hash['callTimeout'] answer_method = hash['answerMethod'] disconnect_url = hash['disconnectUrl'] disconnect_method = hash['disconnectMethod'] tag = hash['tag'] # Create object from extracted values. ApiCallResponse.new(from, to, answer_url, call_id, application_id, call_timeout, answer_method, disconnect_url, disconnect_method, tag) end |
.names ⇒ Object
A mapping from model property names to API property names.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 50 def self.names @_hash = {} if @_hash.nil? @_hash['from'] = 'from' @_hash['to'] = 'to' @_hash['call_timeout'] = 'callTimeout' @_hash['answer_url'] = 'answerUrl' @_hash['call_id'] = 'callId' @_hash['answer_method'] = 'answerMethod' @_hash['disconnect_url'] = 'disconnectUrl' @_hash['disconnect_method'] = 'disconnectMethod' @_hash['tag'] = 'tag' @_hash['application_id'] = 'applicationId' @_hash end |