Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Reimplement webhooks for Voice API #506

Merged
merged 3 commits into from
Jan 9, 2024
Merged

feat: Reimplement webhooks for Voice API #506

merged 3 commits into from
Jan 9, 2024

Conversation

SMadani
Copy link
Contributor

@SMadani SMadani commented Jan 5, 2024

The current implementation of webhooks for Voice in the com.vonage.client.incoming.* package is incomplete as described in #475. Furthermore, it requires a priori knowledge of the event type, which further devalues the classes since some form of parsing is needed to determine the correct class to map the JSON payload to. This PR aims to follow the same approach as the implementations for Messages and Verify v2: use a single class for each inbound URL. That way, the user can simply call the fromJson method on a single class based on which URL is hit, and obtain the relevant fields based on the event type.

@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2024

Codecov Report

Merging #506 (3854fcf) into main (8b34038) will decrease coverage by 0.03%.
The diff coverage is 92.92%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #506      +/-   ##
============================================
- Coverage     94.22%   94.19%   -0.03%     
- Complexity     2797     2854      +57     
============================================
  Files           405      413       +8     
  Lines          6748     6842      +94     
  Branches        444      445       +1     
============================================
+ Hits           6358     6445      +87     
- Misses          203      204       +1     
- Partials        187      193       +6     
Files Coverage Δ
...java/com/vonage/client/incoming/CallDirection.java 100.00% <100.00%> (ø)
...ain/java/com/vonage/client/incoming/CallEvent.java 100.00% <ø> (ø)
...in/java/com/vonage/client/incoming/CallStatus.java 100.00% <100.00%> (ø)
...a/com/vonage/client/incoming/CallStatusDetail.java 100.00% <100.00%> (ø)
...in/java/com/vonage/client/incoming/DtmfResult.java 100.00% <ø> (ø)
...in/java/com/vonage/client/incoming/InputEvent.java 100.00% <ø> (ø)
...n/java/com/vonage/client/incoming/RecordEvent.java 100.00% <ø> (ø)
...c/main/java/com/vonage/client/incoming/Result.java 100.00% <ø> (ø)
.../vonage/client/voice/AdvancedMachineDetection.java 100.00% <100.00%> (ø)
.../main/java/com/vonage/client/voice/CallStatus.java 100.00% <100.00%> (ø)
... and 10 more

@SMadani SMadani force-pushed the voice-webhooks branch 5 times, most recently from 40dc5d3 to 91e6769 Compare January 8, 2024 18:35
@SMadani SMadani marked this pull request as ready for review January 9, 2024 12:47
@SMadani SMadani merged commit 80ab245 into main Jan 9, 2024
12 checks passed
@SMadani SMadani deleted the voice-webhooks branch January 9, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants