Class: Plivo::Resources::CallFeedbackInterface
- Inherits:
-
Base::ResourceInterface
- Object
- Base::ResourceInterface
- Plivo::Resources::CallFeedbackInterface
- Defined in:
- lib/plivo/resources/call_feedback.rb
Constant Summary collapse
- FEEDBACK_API_PATH =
"v1/Call/%s/Feedback/"
Constants included from Utils
Instance Method Summary collapse
- #create(call_uuid, rating, issues = [], notes = "") ⇒ Object
-
#initialize(client, resource_list_json = nil) ⇒ CallFeedbackInterface
constructor
A new instance of CallFeedbackInterface.
Methods included from Utils
expected_type?, expected_value?, raise_invalid_request, valid_account?, valid_mainaccount?, valid_param?, valid_signature?, valid_subaccount?
Constructor Details
#initialize(client, resource_list_json = nil) ⇒ CallFeedbackInterface
Returns a new instance of CallFeedbackInterface.
17 18 19 20 21 |
# File 'lib/plivo/resources/call_feedback.rb', line 17 def initialize(client, resource_list_json = nil) @_name = 'Call' @_resource_type = CallFeedback super end |
Instance Method Details
#create(call_uuid, rating, issues = [], notes = "") ⇒ Object
23 24 25 26 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 |
# File 'lib/plivo/resources/call_feedback.rb', line 23 def create(call_uuid, , issues = [], notes = "") valid_param?(:call_uuid, call_uuid, String, true) valid_param?(:rating, , [Integer, Float], true) if call_uuid == "" raise_invalid_request("call_uuid cannot be empty") end if < 1 or > 5 raise_invalid_request("Rating has to be a float between 1 - 5") end params = { rating: , } if issues.length() > 0 params['issues'] = issues end if notes.length > 0 params['notes'] = notes end params['is_callinsights_request'] = true params['request_url'] = FEEDBACK_API_PATH % call_uuid return perform_post(params) end |