forked from danielberkompas/ex_twilio
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor insights url generator and add annotation support
- Loading branch information
1 parent
c09cb58
commit 436f53f
Showing
5 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
defmodule ExTwilio.Insights.Annotation do | ||
@moduledoc """ | ||
Represents Voice Insights Annotation Resource. | ||
- [Twilio docs](https://www.twilio.com/docs/voice/voice-insights/api/call/call-annotation-resource) | ||
""" | ||
|
||
defstruct [ | ||
:call_sid, | ||
:answered_by, | ||
:connectivity_issue, | ||
:quality_issues, | ||
:spam, | ||
:call_score, | ||
:comment, | ||
:incident | ||
] | ||
|
||
use ExTwilio.Resource, import: [:find, :create] | ||
|
||
def parents, do: [%ExTwilio.Parent{module: ExTwilio.Insights.Voice, key: :call_sid}] | ||
def resource_name, do: "Annotation" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
defmodule ExTwilio.Insights.Voice do | ||
@moduledoc """ | ||
This is module only exists to add "Voice" to url before each of the Insights urls | ||
the Insights urls seem to break the pattern of the rest of the Twilio base urls | ||
""" | ||
|
||
def resource_name, do: "Voice" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters