Class: Twilio::REST::Api::V2010::AccountContext::ApplicationContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Api::V2010::AccountContext::ApplicationContext
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/application.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the ApplicationInstance.
-
#fetch ⇒ ApplicationInstance
Fetch the ApplicationInstance.
-
#initialize(version, account_sid, sid) ⇒ ApplicationContext
constructor
Initialize the ApplicationContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, api_version: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, voice_caller_id_lookup: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset, sms_status_callback: :unset, message_status_callback: :unset, public_application_connect_enabled: :unset) ⇒ ApplicationInstance
Update the ApplicationInstance.
Constructor Details
#initialize(version, account_sid, sid) ⇒ ApplicationContext
Initialize the ApplicationContext
216 217 218 219 220 221 222 223 224 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 216 def initialize(version, account_sid, sid) super(version) # Path Solution @solution = { account_sid: account_sid, sid: sid, } @uri = "/Accounts/#{@solution[:account_sid]}/Applications/#{@solution[:sid]}.json" end |
Instance Method Details
#delete ⇒ Boolean
Delete the ApplicationInstance
228 229 230 231 232 233 234 235 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 228 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ ApplicationInstance
Fetch the ApplicationInstance
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 240 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ApplicationInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
339 340 341 342 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 339 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.ApplicationContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
332 333 334 335 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 332 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.ApplicationContext #{context}>" end |
#update(friendly_name: :unset, api_version: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, voice_caller_id_lookup: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset, sms_status_callback: :unset, message_status_callback: :unset, public_application_connect_enabled: :unset) ⇒ ApplicationInstance
Update the ApplicationInstance
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 276 def update( friendly_name: :unset, api_version: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, voice_caller_id_lookup: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset, sms_status_callback: :unset, message_status_callback: :unset, public_application_connect_enabled: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'ApiVersion' => api_version, 'VoiceUrl' => voice_url, 'VoiceMethod' => voice_method, 'VoiceFallbackUrl' => voice_fallback_url, 'VoiceFallbackMethod' => voice_fallback_method, 'StatusCallback' => status_callback, 'StatusCallbackMethod' => status_callback_method, 'VoiceCallerIdLookup' => voice_caller_id_lookup, 'SmsUrl' => sms_url, 'SmsMethod' => sms_method, 'SmsFallbackUrl' => sms_fallback_url, 'SmsFallbackMethod' => sms_fallback_method, 'SmsStatusCallback' => sms_status_callback, 'MessageStatusCallback' => , 'PublicApplicationConnectEnabled' => public_application_connect_enabled, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) ApplicationInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |