Class: Plivo::Resources::Application
- Inherits:
-
Base::Resource
- Object
- Base::Resource
- Plivo::Resources::Application
- Defined in:
- lib/plivo/resources/applications.rb
Constant Summary
Constants included from Utils
Instance Attribute Summary
Attributes inherited from Base::Resource
Instance Method Summary collapse
- #delete(options = nil) ⇒ Object
-
#initialize(client, options = nil) ⇒ Application
constructor
A new instance of Application.
- #to_s ⇒ Object
-
#update(options = nil) ⇒ Application
Application.
Methods included from Utils
GetSortedQueryParamString?, compute_signatureV3?, expected_type?, expected_value?, generate_url?, getMapFromQueryString?, raise_invalid_request, valid_account?, valid_mainaccount?, valid_param?, valid_signature?, valid_signatureV3?, valid_subaccount?
Constructor Details
#initialize(client, options = nil) ⇒ Application
Returns a new instance of Application.
7 8 9 10 11 |
# File 'lib/plivo/resources/applications.rb', line 7 def initialize(client, = nil) @_name = 'Application' @_identifier_string = 'app_id' super end |
Instance Method Details
#delete(options = nil) ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/plivo/resources/applications.rb', line 63 def delete( = nil) return perform_delete if .nil? params = {} if .key?(:cascade) && valid_param?(:cascade, [:cascade], [TrueClass, FalseClass], false, [true, false]) params[:cascade] = [:cascade] end if .key?(:new_endpoint_application) && valid_param?(:new_endpoint_application, [:new_endpoint_application], [String, Symbol]) params[:new_endpoint_application] = [:new_endpoint_application] end perform_delete(params) end |
#to_s ⇒ Object
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/plivo/resources/applications.rb', line 78 def to_s { answer_method: @answer_method, answer_url: @answer_url, app_id: @app_id, api_id: @api_id, app_name: @app_name, default_app: @default_app, default_endpoint_app: @default_endpoint_app, enabled: @enabled, fallback_answer_url: @fallback_answer_url, fallback_method: @fallback_method, hangup_method: @hangup_method, hangup_url: @hangup_url, message_method: , message_url: , public_uri: @public_uri, resource_uri: @resource_uri, sip_uri: @sip_uri, sub_account: @sub_account, log_incoming_messages: }.to_s end |
#update(options = nil) ⇒ Application
Returns Application.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/plivo/resources/applications.rb', line 27 def update( = nil) return perform_update({}) if .nil? valid_param?(:options, , Hash, true) params = {} i[answer_url hangup_url fallback_answer_url subaccount] .each do |param| if .key?(param) && valid_param?(param, [param], [String, Symbol], true) params[param] = [param] end end i[answer_method hangup_method fallback_method ] .each do |param| if .key?(param) && valid_param?(param, [param], [String, Symbol], true, %w[GET POST]) params[param] = [param] end end i[default_number_app default_endpoint_app ].each do |param| if .key?(param) && valid_param?(param, [param], [TrueClass, FalseClass], true) params[param] = [param] end end perform_update(params) end |