Class: Twilio::REST::Voice::V2::AccountDefaultConfigurationContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Voice::V2::AccountDefaultConfigurationContext
- Defined in:
- lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb
Instance Method Summary collapse
-
#create(voice_v2_account_default_configuration_request: :unset) ⇒ AccountDefaultConfigurationInstance
Create the AccountDefaultConfigurationInstance.
-
#create_with_metadata(voice_v2_account_default_configuration_request: :unset) ⇒ AccountDefaultConfigurationInstance
Create the AccountDefaultConfigurationInstanceMetadata.
-
#delete ⇒ Boolean
Delete the AccountDefaultConfigurationInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the AccountDefaultConfigurationInstanceMetadata.
-
#fetch ⇒ AccountDefaultConfigurationInstance
Fetch the AccountDefaultConfigurationInstance.
-
#fetch_with_metadata ⇒ AccountDefaultConfigurationInstance
Fetch the AccountDefaultConfigurationInstanceMetadata.
-
#initialize(version, type) ⇒ AccountDefaultConfigurationContext
constructor
Initialize the AccountDefaultConfigurationContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(voice_v2_account_default_configuration_request: :unset) ⇒ AccountDefaultConfigurationInstance
Update the AccountDefaultConfigurationInstance.
-
#update_with_metadata(voice_v2_account_default_configuration_request: :unset) ⇒ AccountDefaultConfigurationInstance
Update the AccountDefaultConfigurationInstanceMetadata.
Constructor Details
#initialize(version, type) ⇒ AccountDefaultConfigurationContext
Initialize the AccountDefaultConfigurationContext
67 68 69 70 71 72 73 74 75 76 |
# File 'lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb', line 67 def initialize(version, type) super(version) # Path Solution @solution = { type: type, } @uri = "/AccountDefaultConfiguration/#{@solution[:type]}" end |
Instance Method Details
#create(voice_v2_account_default_configuration_request: :unset) ⇒ AccountDefaultConfigurationInstance
Create the AccountDefaultConfigurationInstance
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb', line 81 def create(voice_v2_account_default_configuration_request: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' payload = @version.create('POST', @uri, headers: headers, data: voice_v2_account_default_configuration_request.to_json) AccountDefaultConfigurationInstance.new( @version, payload, type: @solution[:type], ) end |
#create_with_metadata(voice_v2_account_default_configuration_request: :unset) ⇒ AccountDefaultConfigurationInstance
Create the AccountDefaultConfigurationInstanceMetadata
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb', line 102 def (voice_v2_account_default_configuration_request: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' response = @version.('POST', @uri, headers: headers, data: voice_v2_account_default_configuration_request.to_json) account_default_configuration_instance = AccountDefaultConfigurationInstance.new( @version, response.body, type: @solution[:type], ) AccountDefaultConfigurationInstanceMetadata.new( @version, account_default_configuration_instance, response.headers, response.status_code ) end |
#delete ⇒ Boolean
Delete the AccountDefaultConfigurationInstance
128 129 130 131 132 133 134 135 136 |
# File 'lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb', line 128 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the AccountDefaultConfigurationInstanceMetadata
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb', line 141 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) accountDefaultConfiguration_instance = AccountDefaultConfigurationInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) AccountDefaultConfigurationInstanceMetadata.new(@version, accountDefaultConfiguration_instance, response.headers, response.status_code) end |
#fetch ⇒ AccountDefaultConfigurationInstance
Fetch the AccountDefaultConfigurationInstance
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb', line 160 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) AccountDefaultConfigurationInstance.new( @version, payload, type: @solution[:type], ) end |
#fetch_with_metadata ⇒ AccountDefaultConfigurationInstance
Fetch the AccountDefaultConfigurationInstanceMetadata
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb', line 179 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) account_default_configuration_instance = AccountDefaultConfigurationInstance.new( @version, response.body, type: @solution[:type], ) AccountDefaultConfigurationInstanceMetadata.new( @version, account_default_configuration_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
259 260 261 262 |
# File 'lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb', line 259 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Voice.V2.AccountDefaultConfigurationContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
252 253 254 255 |
# File 'lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb', line 252 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Voice.V2.AccountDefaultConfigurationContext #{context}>" end |
#update(voice_v2_account_default_configuration_request: :unset) ⇒ AccountDefaultConfigurationInstance
Update the AccountDefaultConfigurationInstance
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb', line 205 def update(voice_v2_account_default_configuration_request: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' payload = @version.update('PUT', @uri, headers: headers, data: voice_v2_account_default_configuration_request.to_json) AccountDefaultConfigurationInstance.new( @version, payload, type: @solution[:type], ) end |
#update_with_metadata(voice_v2_account_default_configuration_request: :unset) ⇒ AccountDefaultConfigurationInstance
Update the AccountDefaultConfigurationInstanceMetadata
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 |
# File 'lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb', line 226 def (voice_v2_account_default_configuration_request: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' response = @version.('PUT', @uri, headers: headers, data: voice_v2_account_default_configuration_request.to_json) account_default_configuration_instance = AccountDefaultConfigurationInstance.new( @version, response.body, type: @solution[:type], ) AccountDefaultConfigurationInstanceMetadata.new( @version, account_default_configuration_instance, response.headers, response.status_code ) end |