Skip to content

Commit

Permalink
Added meta data for List Profile
Browse files Browse the repository at this point in the history
  • Loading branch information
rajneeshkatkam-plivo committed Oct 3, 2023
1 parent d31d6d8 commit 250c278
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Plivo/Resource/Profile/ProfileListResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ namespace Plivo.Resource
[JsonObject]
public class ProfileListResponse<T> : BaseResponse, IEnumerable<T>
{
/// <summary>
/// Gets or sets the meta.
/// </summary>
/// <value>The meta.</value>
public ProfileMeta Meta { get; set; }
/// <summary>
/// Gets or sets the objects.
/// </summary>
Expand All @@ -29,8 +34,9 @@ public ProfileListResponse()
/// </summary>
/// <param name="meta">Meta.</param>
/// <param name="profiles">profiles.</param>
public ProfileListResponse( List<T> profiles)
public ProfileListResponse(ProfileMeta meta, List<T> profiles)
{
Meta = meta ?? throw new ArgumentNullException(nameof(meta));
Profiles = profiles ?? throw new ArgumentNullException(nameof(profiles));
}

Expand Down Expand Up @@ -59,6 +65,7 @@ public IEnumerator<T> GetEnumerator()
public override string ToString()
{
return "Api Id: " + ApiId + "\n" +
"[Meta]\n" + Meta +
"StatusCode: " + StatusCode +
"[profiles]\n" + string.Join("\n", Profiles);

Expand Down
51 changes: 51 additions & 0 deletions src/Plivo/Resource/Profile/ProfileMeta.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using System.Threading;
using Newtonsoft.Json;

namespace Plivo.Resource
{
/// <summary>
/// Profile Meta.
/// </summary>
public class ProfileMeta
{
/// <summary>
/// Gets or sets the limit.
/// </summary>
/// <value>The limit.</value>
public uint Limit { get; set; }

/// <summary>
/// Gets or sets the next.
/// </summary>
/// <value>The next.</value>
[JsonProperty("next")]
public string Next { get; set; }

/// <summary>
/// Gets or sets the offset.
/// </summary>
/// <value>The offset.</value>
[JsonProperty("offset")]
public uint Offset { get; set; }

/// <summary>
/// Gets or sets the previous.
/// </summary>
/// <value>The previous.</value>
[JsonProperty("previous")]
public string Previous { get; set; }

/// <summary>
/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:plivo.Resource.Meta"/>.
/// </summary>
/// <returns>A <see cref="T:System.String"/> that represents the current <see cref="T:plivo.Resource.Meta"/>.</returns>
public override string ToString()
{
return
"Limit: " + Limit + "\n" +
"Next: " + Next + "\n" +
"Offset: " + Offset + "\n" +
"Previous: " + Previous + "\n";
}
}
}

0 comments on commit 250c278

Please sign in to comment.