Skip to content

Commit

Permalink
fixing minor bugs in voice client per spec issue
Browse files Browse the repository at this point in the history
  • Loading branch information
slorello89 committed Jun 19, 2020
1 parent 9f26e6c commit 4f0a3e0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 21 deletions.
32 changes: 16 additions & 16 deletions Nexmo.Api.Test.Unit/VoiceClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,18 @@ public void TestListCalls(bool passCreds, bool kitchenSink)
},
""uuid"": ""63f61863-4a51-4f6b-86e1-46edebcf9356"",
""conversation_uuid"": ""CON-f972836a-550f-45fa-956c-12a2ab5b7d22"",
""to"": [
""to"":
{
""type"": ""phone"",
""number"": ""447700900000""
}
],
""from"": [
,
""from"":
{
""type"": ""phone"",
""number"": ""447700900001""
}
],
,
""status"": ""started"",
""direction"": ""outbound"",
""rate"": ""0.39"",
Expand Down Expand Up @@ -163,10 +163,10 @@ public void TestListCalls(bool passCreds, bool kitchenSink)
Assert.Equal("/calls/63f61863-4a51-4f6b-86e1-46edebcf9356", callRecord.Links.Self.Href);
Assert.Equal("63f61863-4a51-4f6b-86e1-46edebcf9356", callRecord.Uuid);
Assert.Equal("CON-f972836a-550f-45fa-956c-12a2ab5b7d22", callRecord.ConversationUuid);
Assert.Equal("447700900000", callRecord.To[0].Number);
Assert.Equal("phone", callRecord.To[0].Type);
Assert.Equal("phone", callRecord.From[0].Type);
Assert.Equal("447700900001", callRecord.From[0].Number);
Assert.Equal("447700900000", callRecord.To.Number);
Assert.Equal("phone", callRecord.To.Type);
Assert.Equal("phone", callRecord.From.Type);
Assert.Equal("447700900001", callRecord.From.Number);
Assert.Equal("started", callRecord.Status);
Assert.Equal("outbound", callRecord.Direction);
Assert.Equal("0.39", callRecord.Rate);
Expand All @@ -193,18 +193,18 @@ public void TestGetSpecificCall(bool passCreds)
},
""uuid"": ""63f61863-4a51-4f6b-86e1-46edebcf9356"",
""conversation_uuid"": ""CON-f972836a-550f-45fa-956c-12a2ab5b7d22"",
""to"": [
""to"":
{
""type"": ""phone"",
""number"": ""447700900000""
}
],
""from"": [
,
""from"":
{
""type"": ""phone"",
""number"": ""447700900001""
}
],
,
""status"": ""started"",
""direction"": ""outbound"",
""rate"": ""0.39"",
Expand Down Expand Up @@ -233,10 +233,10 @@ public void TestGetSpecificCall(bool passCreds)

Assert.Equal("63f61863-4a51-4f6b-86e1-46edebcf9356", callRecord.Uuid);
Assert.Equal("CON-f972836a-550f-45fa-956c-12a2ab5b7d22", callRecord.ConversationUuid);
Assert.Equal("447700900000", callRecord.To[0].Number);
Assert.Equal("phone", callRecord.To[0].Type);
Assert.Equal("phone", callRecord.From[0].Type);
Assert.Equal("447700900001", callRecord.From[0].Number);
Assert.Equal("447700900000", callRecord.To.Number);
Assert.Equal("phone", callRecord.To.Type);
Assert.Equal("phone", callRecord.From.Type);
Assert.Equal("447700900001", callRecord.From.Number);
Assert.Equal("started", callRecord.Status);
Assert.Equal("outbound", callRecord.Direction);
Assert.Equal("0.39", callRecord.Rate);
Expand Down
2 changes: 1 addition & 1 deletion Nexmo.Api/Voice/CallEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ public class CallEndpoint
/// A JSON object containing any metadata you want.
/// </summary>
[JsonProperty("headers")]
public string Headers { get; set; }
public object Headers { get; set; }
}
}
6 changes: 3 additions & 3 deletions Nexmo.Api/Voice/CallRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public class CallRecord
/// number - the phone number to connect to in E.164 format.
/// dtmfAnswer - Set the digits that are sent to the user as soon as the Call is answered.The* and # digits are respected. You create pauses using p. Each pause is 500ms.
/// </summary>
[JsonProperty("to")]
public CallEndpoint[] To { get; set; }
[JsonProperty("to")]
public CallEndpoint To { get; set; }

/// <summary>
/// The endpoint you called from. Possible values are the same as to
/// </summary>
[JsonProperty("from")]
public CallEndpoint[] From { get; set; }
public CallEndpoint From { get; set; }

/// <summary>
/// Possible values are outbound or inbound.
Expand Down
4 changes: 3 additions & 1 deletion Nexmo.Api/Voice/CallSearchFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ public class CallSearchFilter

/// <summary>
/// Return the records that occurred after this point in time.
/// Times must be in UTC, they will not be converted.
/// </summary>
[JsonProperty("date_start")]
[JsonConverter(typeof(PageListDateTimeConverter))]
public DateTime? DateStart { get; set; }

/// <summary>
/// Return the records that occurred before this point in time.
/// Times must be in UTC, they will not be converted.
/// </summary>
[JsonProperty("date_end")]
[JsonConverter(typeof(PageListDateTimeConverter))]
Expand Down

0 comments on commit 4f0a3e0

Please sign in to comment.