-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #277 from plivo/VT-7513
Vt 7513
- Loading branch information
Showing
15 changed files
with
734 additions
and
9 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
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
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,75 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
|
||
namespace Plivo.Resource | ||
{ | ||
/// <summary> | ||
/// List response. | ||
/// </summary> | ||
[JsonObject] | ||
public class ListMaskingSessionResponse<T> : BaseResponse, IEnumerable<T> | ||
{ | ||
/// <summary> | ||
/// Gets or sets the meta. | ||
/// </summary> | ||
/// <value>The meta.</value> | ||
public Meta Meta { get; set; } | ||
/// <summary> | ||
/// Gets or sets the objects. | ||
/// </summary> | ||
/// <value>The objects.</value> | ||
public List<T> Objects { get; set; } | ||
|
||
public NestedResponse Response; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="T:plivo.Resource.ListResponse`1"/> class. | ||
/// </summary> | ||
public ListMaskingSessionResponse() | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="T:plivo.Resource.ListResponse`1"/> class. | ||
/// </summary> | ||
/// <param name="meta">Meta.</param> | ||
/// <param name="objects">Objects.</param> | ||
public ListMaskingSessionResponse(Meta meta, List<T> objects) | ||
{ | ||
Meta = meta ?? throw new ArgumentNullException(nameof(meta)); | ||
Objects = objects ?? throw new ArgumentNullException(nameof(objects)); | ||
} | ||
|
||
/// <summary> | ||
/// System.s the collections. IE numerable. get enumerator. | ||
/// </summary> | ||
/// <returns>The collections. IE numerable. get enumerator.</returns> | ||
IEnumerator IEnumerable.GetEnumerator() | ||
{ | ||
return GetEnumerator(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the enumerator. | ||
/// </summary> | ||
/// <returns>The enumerator.</returns> | ||
public IEnumerator<T> GetEnumerator() | ||
{ | ||
return ((IEnumerable<T>)Objects).GetEnumerator(); | ||
} | ||
|
||
/// <summary> | ||
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:plivo.Resource.ListResponse`1"/>. | ||
/// </summary> | ||
/// <returns>A <see cref="T:System.String"/> that represents the current <see cref="T:plivo.Resource.ListResponse`1"/>.</returns> | ||
public override string ToString() | ||
{ | ||
return "Api Id: " + ApiId + "\n" + | ||
"[Meta]\n" + Meta + | ||
"[Response]\n" + Response + "\n" + | ||
"StatusCode:" + StatusCode; | ||
} | ||
} | ||
} |
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,6 @@ | ||
namespace Plivo.Resource.MaskingSession | ||
{ | ||
public class AsyncResponse : BaseResponse | ||
{ | ||
} | ||
} |
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,63 @@ | ||
|
||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace Plivo.Resource.MaskingSession | ||
{ | ||
public class MaskingSession : Resource | ||
{ | ||
public new string Id => SessionUuid; | ||
public string SessionUuid { get; set; } | ||
public object Response { get; set; } | ||
|
||
public override string ToString() | ||
{ | ||
return "ApiId: " + ApiId + "\n"+ | ||
"Response: " + Response + "\n"; | ||
} | ||
|
||
#region Delete | ||
public DeleteResponse<MaskingSession> Delete() | ||
{ | ||
return ((MaskingSessionInterface) Interface).Delete(Id); | ||
} | ||
public async Task<AsyncResponse> DeleteAsync(string Id) | ||
{ | ||
return await ((MaskingSessionInterface)Interface).DeleteAsync(Id); | ||
} | ||
#endregion | ||
|
||
|
||
#region Update | ||
public MaskingSessionUpdateResponse<MaskingSession> Update(string sessionUuid, uint? session_expiry = null, uint? call_time_limit = null, | ||
bool? record = null, string record_file_format = null, string recording_callback_url = null, string callback_url = null, | ||
string callback_method = null, uint? ring_timeout = null, string first_party_play_url = null, string second_party_play_url = null, | ||
string recording_callback_method = null, string subaccount = null, bool? geomatch = null | ||
) | ||
{ | ||
var updateResponse = | ||
((MaskingSessionInterface) Interface) | ||
.Update(Id, session_expiry, call_time_limit, record, record_file_format, recording_callback_url, callback_url, | ||
callback_method, ring_timeout, first_party_play_url, second_party_play_url, recording_callback_method, | ||
subaccount, geomatch); | ||
return updateResponse; | ||
} | ||
|
||
public async Task<AsyncResponse> UpdateAsync(string sessionUuid, uint? session_expiry = null, uint? call_time_limit = null, | ||
bool? record = null, string record_file_format = null, string recording_callback_url = null, string callback_url = null, | ||
string callback_method = null, uint? ring_timeout = null, string first_party_play_url = null, string second_party_play_url = null, | ||
string recording_callback_method = null, string subaccount = null, bool? geomatch = null | ||
) | ||
{ | ||
var updateResponse = await | ||
((MaskingSessionInterface)Interface) | ||
.UpdateAsync(Id, session_expiry, call_time_limit, record, record_file_format, recording_callback_url, callback_url, | ||
callback_method, ring_timeout, first_party_play_url, second_party_play_url, recording_callback_method, | ||
subaccount, geomatch); | ||
|
||
return updateResponse; | ||
} | ||
#endregion | ||
|
||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Plivo/Resource/MaskingSession/MaskingSessionCreateResponse.cs
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,18 @@ | ||
|
||
namespace Plivo.Resource.MaskingSession | ||
{ | ||
public class MaskingSessionCreateResponse : CreateResponse | ||
{ | ||
public string SessionUuid { get; set; } | ||
public string VirtualNumber { get; set; } | ||
public object Session { get; set; } | ||
|
||
public override string ToString() | ||
{ | ||
return base.ToString() + | ||
"Session Uuid: " + SessionUuid + "\n" + | ||
"VirtualNumber: " + VirtualNumber + "\n" + | ||
"Session: " + Session + "\n"; | ||
} | ||
} | ||
} |
Oops, something went wrong.