class Twilio::REST::Api::V2010::AccountContext::ApplicationInstance

Public Class Methods

new(version, payload, account_sid: nil, sid: nil) click to toggle source

Initialize the ApplicationInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] account_sid The SID of the

{Account}[https://www.twilio.com/docs/iam/api/account] that created the
Application resource.

@param [String] sid The Twilio-provided string that uniquely identifies the

Application resource to fetch.

@return [ApplicationInstance] ApplicationInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
342 def initialize(version, payload, account_sid: nil, sid: nil)
343   super(version)
344 
345   # Marshaled Properties
346   @properties = {
347       'account_sid' => payload['account_sid'],
348       'api_version' => payload['api_version'],
349       'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
350       'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
351       'friendly_name' => payload['friendly_name'],
352       'message_status_callback' => payload['message_status_callback'],
353       'sid' => payload['sid'],
354       'sms_fallback_method' => payload['sms_fallback_method'],
355       'sms_fallback_url' => payload['sms_fallback_url'],
356       'sms_method' => payload['sms_method'],
357       'sms_status_callback' => payload['sms_status_callback'],
358       'sms_url' => payload['sms_url'],
359       'status_callback' => payload['status_callback'],
360       'status_callback_method' => payload['status_callback_method'],
361       'uri' => payload['uri'],
362       'voice_caller_id_lookup' => payload['voice_caller_id_lookup'],
363       'voice_fallback_method' => payload['voice_fallback_method'],
364       'voice_fallback_url' => payload['voice_fallback_url'],
365       'voice_method' => payload['voice_method'],
366       'voice_url' => payload['voice_url'],
367   }
368 
369   # Context
370   @instance_context = nil
371   @params = {'account_sid' => account_sid, 'sid' => sid || @properties['sid'], }
372 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
387 def account_sid
388   @properties['account_sid']
389 end
api_version() click to toggle source

@return [String] The API version used to start a new TwiML session

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
393 def api_version
394   @properties['api_version']
395 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [ApplicationContext] ApplicationContext for this ApplicationInstance

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
378 def context
379   unless @instance_context
380     @instance_context = ApplicationContext.new(@version, @params['account_sid'], @params['sid'], )
381   end
382   @instance_context
383 end
date_created() click to toggle source

@return [Time] The RFC 2822 date and time in GMT that the resource was created

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
399 def date_created
400   @properties['date_created']
401 end
date_updated() click to toggle source

@return [Time] The RFC 2822 date and time in GMT that the resource was last updated

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
405 def date_updated
406   @properties['date_updated']
407 end
delete() click to toggle source

Delete the ApplicationInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
508 def delete
509   context.delete
510 end
fetch() click to toggle source

Fetch the ApplicationInstance @return [ApplicationInstance] Fetched ApplicationInstance

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
515 def fetch
516   context.fetch
517 end
friendly_name() click to toggle source

@return [String] The string that you assigned to describe the resource

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
411 def friendly_name
412   @properties['friendly_name']
413 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
584 def inspect
585   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
586   "<Twilio.Api.V2010.ApplicationInstance #{values}>"
587 end
message_status_callback() click to toggle source

@return [String] The URL to send message status information to your application

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
417 def message_status_callback
418   @properties['message_status_callback']
419 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
423 def sid
424   @properties['sid']
425 end
sms_fallback_method() click to toggle source

@return [String] The HTTP method used with sms_fallback_url

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
429 def sms_fallback_method
430   @properties['sms_fallback_method']
431 end
sms_fallback_url() click to toggle source

@return [String] The URL that we call when an error occurs while retrieving or executing the TwiML

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
435 def sms_fallback_url
436   @properties['sms_fallback_url']
437 end
sms_method() click to toggle source

@return [String] The HTTP method to use with sms_url

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
441 def sms_method
442   @properties['sms_method']
443 end
sms_status_callback() click to toggle source

@return [String] The URL to send status information to your application

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
447 def sms_status_callback
448   @properties['sms_status_callback']
449 end
sms_url() click to toggle source

@return [String] The URL we call when the phone number receives an incoming SMS message

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
453 def sms_url
454   @properties['sms_url']
455 end
status_callback() click to toggle source

@return [String] The URL to send status information to your application

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
459 def status_callback
460   @properties['status_callback']
461 end
status_callback_method() click to toggle source

@return [String] The HTTP method we use to call status_callback

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
465 def status_callback_method
466   @properties['status_callback_method']
467 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
577 def to_s
578   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
579   "<Twilio.Api.V2010.ApplicationInstance #{values}>"
580 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) click to toggle source

Update the ApplicationInstance @param [String] friendly_name A descriptive string that you create to describe

the resource. It can be up to 64 characters long.

@param [String] api_version The API version to use to start a new TwiML session.

Can be: `2010-04-01` or `2008-08-01`. The default value is your account's
default API version.

@param [String] voice_url The URL we should call when the phone number assigned

to this application receives a call.

@param [String] voice_method The HTTP method we should use to call `voice_url`.

Can be: `GET` or `POST`.

@param [String] voice_fallback_url The URL that we should call when an error

occurs retrieving or executing the TwiML requested by `url`.

@param [String] voice_fallback_method The HTTP method we should use to call

`voice_fallback_url`. Can be: `GET` or `POST`.

@param [String] status_callback The URL we should call using the

`status_callback_method` to send status information to your application.

@param [String] status_callback_method The HTTP method we should use to call

`status_callback`. Can be: `GET` or `POST`.

@param [Boolean] voice_caller_id_lookup Whether we should look up the caller's

caller-ID name from the CNAM database (additional charges apply). Can be: `true`
or `false`.

@param [String] sms_url The URL we should call when the phone number receives an

incoming SMS message.

@param [String] sms_method The HTTP method we should use to call `sms_url`. Can

be: `GET` or `POST`.

@param [String] sms_fallback_url The URL that we should call when an error

occurs while retrieving or executing the TwiML from `sms_url`.

@param [String] sms_fallback_method The HTTP method we should use to call

`sms_fallback_url`. Can be: `GET` or `POST`.

@param [String] sms_status_callback Same as message_status_callback: The URL we

should call using a POST method to send status information about SMS messages
sent by the application. Deprecated, included for backwards compatibility.

@param [String] message_status_callback The URL we should call using a POST

method to send message status information to your application.

@return [ApplicationInstance] Updated ApplicationInstance

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
555 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)
556   context.update(
557       friendly_name: friendly_name,
558       api_version: api_version,
559       voice_url: voice_url,
560       voice_method: voice_method,
561       voice_fallback_url: voice_fallback_url,
562       voice_fallback_method: voice_fallback_method,
563       status_callback: status_callback,
564       status_callback_method: status_callback_method,
565       voice_caller_id_lookup: voice_caller_id_lookup,
566       sms_url: sms_url,
567       sms_method: sms_method,
568       sms_fallback_url: sms_fallback_url,
569       sms_fallback_method: sms_fallback_method,
570       sms_status_callback: sms_status_callback,
571       message_status_callback: message_status_callback,
572   )
573 end
uri() click to toggle source

@return [String] The URI of the resource, relative to `api.twilio.com`

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
471 def uri
472   @properties['uri']
473 end
voice_caller_id_lookup() click to toggle source

@return [Boolean] Whether to lookup the caller's name

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
477 def voice_caller_id_lookup
478   @properties['voice_caller_id_lookup']
479 end
voice_fallback_method() click to toggle source

@return [String] The HTTP method used with voice_fallback_url

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
483 def voice_fallback_method
484   @properties['voice_fallback_method']
485 end
voice_fallback_url() click to toggle source

@return [String] The URL we call when a TwiML error occurs

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
489 def voice_fallback_url
490   @properties['voice_fallback_url']
491 end
voice_method() click to toggle source

@return [String] The HTTP method used with the voice_url

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
495 def voice_method
496   @properties['voice_method']
497 end
voice_url() click to toggle source

@return [String] The URL we call when the phone number receives a call

    # File lib/twilio-ruby/rest/api/v2010/account/application.rb
501 def voice_url
502   @properties['voice_url']
503 end