Class: Bandwidth::ModifyCallRequest
- Defined in:
- lib/bandwidth/voice_lib/voice/models/modify_call_request.rb
Overview
ModifyCallRequest Model.
Instance Attribute Summary collapse
-
#fallback_password ⇒ String
Required if state is ‘active’.
-
#fallback_username ⇒ String
Required if state is ‘active’.
-
#password ⇒ String
Required if state is ‘active’.
-
#redirect_fallback_method ⇒ RedirectFallbackMethodEnum
Required if state is ‘active’.
-
#redirect_fallback_url ⇒ String
Required if state is ‘active’.
-
#redirect_method ⇒ RedirectMethodEnum
Required if state is ‘active’.
-
#redirect_url ⇒ String
Required if state is ‘active’.
-
#state ⇒ StateEnum
TODO: Write general description for this method.
-
#tag ⇒ String
Required if state is ‘active’.
-
#username ⇒ String
Required if state is ‘active’.
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(state = StateEnum::ACTIVE, redirect_url = nil, redirect_fallback_url = nil, redirect_method = nil, redirect_fallback_method = nil, username = nil, password = nil, fallback_username = nil, fallback_password = nil, tag = nil) ⇒ ModifyCallRequest
constructor
A new instance of ModifyCallRequest.
-
#nullables ⇒ Object
An array for nullable fields.
-
#optionals ⇒ Object
An array for optional fields.
Methods inherited from BaseModel
Constructor Details
#initialize(state = StateEnum::ACTIVE, redirect_url = nil, redirect_fallback_url = nil, redirect_method = nil, redirect_fallback_method = nil, username = nil, password = nil, fallback_username = nil, fallback_password = nil, tag = nil) ⇒ ModifyCallRequest
Returns a new instance of ModifyCallRequest.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/bandwidth/voice_lib/voice/models/modify_call_request.rb', line 100 def initialize(state = StateEnum::ACTIVE, redirect_url = nil, redirect_fallback_url = nil, redirect_method = nil, redirect_fallback_method = nil, username = nil, password = nil, fallback_username = nil, fallback_password = nil, tag = nil) @state = state unless state == SKIP @redirect_url = redirect_url unless redirect_url == SKIP @redirect_fallback_url = redirect_fallback_url unless redirect_fallback_url == SKIP @redirect_method = redirect_method unless redirect_method == SKIP @redirect_fallback_method = redirect_fallback_method unless redirect_fallback_method == SKIP @username = username unless username == SKIP @password = password unless password == SKIP @fallback_username = fallback_username unless fallback_username == SKIP @fallback_password = fallback_password unless fallback_password == SKIP @tag = tag unless tag == SKIP end |
Instance Attribute Details
#fallback_password ⇒ String
Required if state is ‘active’
46 47 48 |
# File 'lib/bandwidth/voice_lib/voice/models/modify_call_request.rb', line 46 def fallback_password @fallback_password end |
#fallback_username ⇒ String
Required if state is ‘active’
42 43 44 |
# File 'lib/bandwidth/voice_lib/voice/models/modify_call_request.rb', line 42 def fallback_username @fallback_username end |
#password ⇒ String
Required if state is ‘active’
38 39 40 |
# File 'lib/bandwidth/voice_lib/voice/models/modify_call_request.rb', line 38 def password @password end |
#redirect_fallback_method ⇒ RedirectFallbackMethodEnum
Required if state is ‘active’
30 31 32 |
# File 'lib/bandwidth/voice_lib/voice/models/modify_call_request.rb', line 30 def redirect_fallback_method @redirect_fallback_method end |
#redirect_fallback_url ⇒ String
Required if state is ‘active’
22 23 24 |
# File 'lib/bandwidth/voice_lib/voice/models/modify_call_request.rb', line 22 def redirect_fallback_url @redirect_fallback_url end |
#redirect_method ⇒ RedirectMethodEnum
Required if state is ‘active’
26 27 28 |
# File 'lib/bandwidth/voice_lib/voice/models/modify_call_request.rb', line 26 def redirect_method @redirect_method end |
#redirect_url ⇒ String
Required if state is ‘active’
18 19 20 |
# File 'lib/bandwidth/voice_lib/voice/models/modify_call_request.rb', line 18 def redirect_url @redirect_url end |
#state ⇒ StateEnum
TODO: Write general description for this method
14 15 16 |
# File 'lib/bandwidth/voice_lib/voice/models/modify_call_request.rb', line 14 def state @state end |
#tag ⇒ String
Required if state is ‘active’
50 51 52 |
# File 'lib/bandwidth/voice_lib/voice/models/modify_call_request.rb', line 50 def tag @tag end |
#username ⇒ String
Required if state is ‘active’
34 35 36 |
# File 'lib/bandwidth/voice_lib/voice/models/modify_call_request.rb', line 34 def username @username end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 152 153 154 |
# File 'lib/bandwidth/voice_lib/voice/models/modify_call_request.rb', line 123 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. state = hash['state'] ||= StateEnum::ACTIVE redirect_url = hash.key?('redirectUrl') ? hash['redirectUrl'] : SKIP redirect_fallback_url = hash.key?('redirectFallbackUrl') ? hash['redirectFallbackUrl'] : SKIP redirect_method = hash.key?('redirectMethod') ? hash['redirectMethod'] : SKIP redirect_fallback_method = hash.key?('redirectFallbackMethod') ? hash['redirectFallbackMethod'] : SKIP username = hash.key?('username') ? hash['username'] : SKIP password = hash.key?('password') ? hash['password'] : SKIP fallback_username = hash.key?('fallbackUsername') ? hash['fallbackUsername'] : SKIP fallback_password = hash.key?('fallbackPassword') ? hash['fallbackPassword'] : SKIP tag = hash.key?('tag') ? hash['tag'] : SKIP # Create object from extracted values. ModifyCallRequest.new(state, redirect_url, redirect_fallback_url, redirect_method, redirect_fallback_method, username, password, fallback_username, fallback_password, tag) end |
.names ⇒ Object
A mapping from model property names to API property names.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/bandwidth/voice_lib/voice/models/modify_call_request.rb', line 53 def self.names @_hash = {} if @_hash.nil? @_hash['state'] = 'state' @_hash['redirect_url'] = 'redirectUrl' @_hash['redirect_fallback_url'] = 'redirectFallbackUrl' @_hash['redirect_method'] = 'redirectMethod' @_hash['redirect_fallback_method'] = 'redirectFallbackMethod' @_hash['username'] = 'username' @_hash['password'] = 'password' @_hash['fallback_username'] = 'fallbackUsername' @_hash['fallback_password'] = 'fallbackPassword' @_hash['tag'] = 'tag' @_hash end |
Instance Method Details
#nullables ⇒ Object
An array for nullable fields
85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/bandwidth/voice_lib/voice/models/modify_call_request.rb', line 85 def nullables %w[ state redirect_url redirect_fallback_url redirect_method redirect_fallback_method username password fallback_username fallback_password tag ] end |
#optionals ⇒ Object
An array for optional fields
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/bandwidth/voice_lib/voice/models/modify_call_request.rb', line 69 def optionals %w[ state redirect_url redirect_fallback_url redirect_method redirect_fallback_method username password fallback_username fallback_password tag ] end |