Class: Bandwidth::ApiCallResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/bandwidth/voice_lib/voice/models/api_call_response.rb

Overview

ApiCallResponse Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(call_id = nil, application_id = nil, to = nil, from = nil, call_url = nil, answer_url = nil, answer_method = nil, disconnect_method = nil, start_time = nil, call_timeout = nil, disconnect_url = nil, username = nil, password = nil, tag = nil) ⇒ ApiCallResponse

Returns a new instance of ApiCallResponse.



86
87
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 86

def initialize(call_id = nil,
               application_id = nil,
               to = nil,
               from = nil,
               call_url = nil,
               answer_url = nil,
               answer_method = nil,
               disconnect_method = nil,
               start_time = nil,
               call_timeout = nil,
               disconnect_url = nil,
               username = nil,
               password = nil,
               tag = nil)
  @call_id = call_id
  @application_id = application_id
  @to = to
  @from = from
  @start_time = start_time
  @call_url = call_url
  @call_timeout = call_timeout
  @answer_url = answer_url
  @answer_method = answer_method
  @disconnect_url = disconnect_url
  @disconnect_method = disconnect_method
  @username = username
  @password = password
  @tag = tag
end

Instance Attribute Details

#answer_methodAnswerMethodEnum

TODO: Write general description for this method

Returns:



44
45
46
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 44

def answer_method
  @answer_method
end

#answer_urlString

TODO: Write general description for this method

Returns:

  • (String)


40
41
42
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 40

def answer_url
  @answer_url
end

#application_idString

TODO: Write general description for this method

Returns:

  • (String)


16
17
18
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 16

def application_id
  @application_id
end

#call_idString

TODO: Write general description for this method

Returns:

  • (String)


12
13
14
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 12

def call_id
  @call_id
end

#call_timeoutFloat

TODO: Write general description for this method

Returns:

  • (Float)


36
37
38
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 36

def call_timeout
  @call_timeout
end

#call_urlString

TODO: Write general description for this method

Returns:

  • (String)


32
33
34
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 32

def call_url
  @call_url
end

#disconnect_methodDisconnectMethodEnum

TODO: Write general description for this method



52
53
54
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 52

def disconnect_method
  @disconnect_method
end

#disconnect_urlString

TODO: Write general description for this method

Returns:

  • (String)


48
49
50
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 48

def disconnect_url
  @disconnect_url
end

#fromString

TODO: Write general description for this method

Returns:

  • (String)


24
25
26
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 24

def from
  @from
end

#passwordString

TODO: Write general description for this method

Returns:

  • (String)


60
61
62
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 60

def password
  @password
end

#start_timeDateTime

TODO: Write general description for this method

Returns:

  • (DateTime)


28
29
30
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 28

def start_time
  @start_time
end

#tagString

TODO: Write general description for this method

Returns:

  • (String)


64
65
66
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 64

def tag
  @tag
end

#toString

TODO: Write general description for this method

Returns:

  • (String)


20
21
22
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 20

def to
  @to
end

#usernameString

TODO: Write general description for this method

Returns:

  • (String)


56
57
58
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 56

def username
  @username
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 117

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.

  call_id = hash['callId']
  application_id = hash['applicationId']
  to = hash['to']
  from = hash['from']
  call_url = hash['callUrl']
  answer_url = hash['answerUrl']
  answer_method = hash['answerMethod']
  disconnect_method = hash['disconnectMethod']
  start_time = APIHelper.rfc3339(hash['startTime']) if hash['startTime']
  call_timeout = hash['callTimeout']
  disconnect_url = hash['disconnectUrl']
  username = hash['username']
  password = hash['password']
  tag = hash['tag']

  # Create object from extracted values.

  ApiCallResponse.new(call_id,
                      application_id,
                      to,
                      from,
                      call_url,
                      answer_url,
                      answer_method,
                      disconnect_method,
                      start_time,
                      call_timeout,
                      disconnect_url,
                      username,
                      password,
                      tag)
end

.namesObject

A mapping from model property names to API property names.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/bandwidth/voice_lib/voice/models/api_call_response.rb', line 67

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['call_id'] = 'callId'
  @_hash['application_id'] = 'applicationId'
  @_hash['to'] = 'to'
  @_hash['from'] = 'from'
  @_hash['start_time'] = 'startTime'
  @_hash['call_url'] = 'callUrl'
  @_hash['call_timeout'] = 'callTimeout'
  @_hash['answer_url'] = 'answerUrl'
  @_hash['answer_method'] = 'answerMethod'
  @_hash['disconnect_url'] = 'disconnectUrl'
  @_hash['disconnect_method'] = 'disconnectMethod'
  @_hash['username'] = 'username'
  @_hash['password'] = 'password'
  @_hash['tag'] = 'tag'
  @_hash
end