Skip to content

Commit

Permalink
fix: remove default object for DTMF in MultiInputAction
Browse files Browse the repository at this point in the history
  • Loading branch information
Tr00d committed Aug 28, 2024
1 parent 8f09ff3 commit f832baf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
[
{
"action": "input",
"dtmf": {
},
"speech": {
"uuid": [
"aaaaaaaa-bbbb-cccc-dddd-0123456789ab"
]
}
"action": "input"
}
]
10 changes: 4 additions & 6 deletions Vonage.Test/MultiInputTests.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using Newtonsoft.Json;
#region
using Newtonsoft.Json;
using Vonage.Serialization;
using Vonage.Voice.EventWebhooks;
using Vonage.Voice.Nccos;
using Xunit;
#endregion

namespace Vonage.Test;

Expand Down Expand Up @@ -48,11 +50,7 @@ public void TestSerializeNccoAllPropertiesEmpty()
{
// arrange
var expected = this.GetResponseJson();
var settings = new SpeechSettings
{
Uuid = new[] {"aaaaaaaa-bbbb-cccc-dddd-0123456789ab"},
};
var inputAction = new MultiInputAction {Speech = settings};
var inputAction = new MultiInputAction();

//act
var ncco = new Ncco(inputAction);
Expand Down
15 changes: 5 additions & 10 deletions Vonage/Voice/Nccos/MultiInputAction.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
#region
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
#endregion

namespace Vonage.Voice.Nccos;

Expand All @@ -21,10 +22,9 @@ public class MultiInputAction : NccoAction
public string EventMethod { get; set; }

/// <summary>
/// DTMF settings. Should be specified to enable DTMF input. If all the DTMF input settings will have default values, it should be specified as empty object
/// NOTE: this is serialized as an empty object if not initalized by the user
/// DTMF settings. Should be specified to enable DTMF input.
/// </summary>
[JsonProperty("dtmf", DefaultValueHandling = DefaultValueHandling.Include)]
[JsonProperty("dtmf")]
public DtmfSettings Dtmf { get; set; }

/// <summary>
Expand All @@ -39,9 +39,4 @@ public class MultiInputAction : NccoAction
/// </summary>
[JsonProperty("speech")]
public SpeechSettings Speech { get; set; }

public MultiInputAction()
{
this.Dtmf = new DtmfSettings();
}
}

0 comments on commit f832baf

Please sign in to comment.