Skip to content

Commit da8f54e

Browse files
committed
refactor!: Use DtmfSettings builder
1 parent 7c15ab9 commit da8f54e

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7-
## [0.6.0] - 2024-07-31
7+
## [0.6.0] - 2024-07-30
88

99
### Added
1010
- SIM Swap API
1111
- Number Verification API
1212

13+
### Changed
14+
- `InputAction.Builder.dtmf` extension method uses `DtmfSettings` builder instead of setters
15+
1316
## [0.5.0] - 2024-07-25
1417

1518
### Added

src/main/kotlin/com/vonage/client/kt/Voice.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,8 @@ fun Call.Builder.advancedMachineDetection(amd: AdvancedMachineDetection.Builder.
8080
fun InputAction.Builder.speech(settings: SpeechSettings.Builder.() -> Unit = {}): InputAction.Builder =
8181
speech(SpeechSettings.builder().apply(settings).build())
8282

83-
fun InputAction.Builder.dtmf(timeout: Int? = null, maxDigits: Int? = null, submitOnHash: Boolean? = null): InputAction.Builder {
84-
val dtmfSettings = DtmfSettings()
85-
dtmfSettings.timeOut = timeout
86-
dtmfSettings.maxDigits = maxDigits
87-
dtmfSettings.isSubmitOnHash = submitOnHash
88-
return dtmf(dtmfSettings)
89-
}
83+
fun InputAction.Builder.dtmf(settings: DtmfSettings.Builder.() -> Unit = {}): InputAction.Builder =
84+
dtmf(DtmfSettings.builder().apply(settings).build())
9085

9186
fun ConversationAction.Builder.transcription(settings: TranscriptionSettings.Builder.() -> Unit = {}):
9287
ConversationAction.Builder = transcription(TranscriptionSettings.builder().apply(settings).build())

src/test/kotlin/com/vonage/client/kt/VoiceTest.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -918,13 +918,14 @@ class VoiceTest : AbstractTest() {
918918
inputAction {
919919
eventUrl(eventUrl); eventMethod(inputEventMethod)
920920
type(inputActionTypes); speech {
921-
uuid(speechUuid); context(speechContext)
921+
uuid(speechUuid); context(speechContext); saveAudio(saveAudio)
922922
language(SpeechSettings.Language.UKRAINIAN)
923923
endOnSilence(endOnSilenceSpeech); maxDuration(maxDuration)
924924
sensitivity(sensitivity); startTimeout(startTimeout)
925-
saveAudio(saveAudio);
926925
}
927-
dtmf(timeout = dtmfTimeout, maxDigits = maxDigits, submitOnHash = submitOnHash)
926+
dtmf {
927+
timeOut(dtmfTimeout); maxDigits(maxDigits); submitOnHash(submitOnHash)
928+
}
928929
},
929930
notifyAction(eventUrl, customHeaders, notifyEventMethod),
930931
recordAction {

0 commit comments

Comments
 (0)