Skip to content

Commit

Permalink
Added meta data for Brand Profile
Browse files Browse the repository at this point in the history
  • Loading branch information
rajneeshkatkam-plivo committed Oct 3, 2023
1 parent 250c278 commit e54d55a
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/Brand/BrandListResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ namespace Plivo.Resource
[JsonObject]
public class BrandListResponse<T> : BaseResponse, IEnumerable<T>
{
/// <summary>
/// Gets or sets the meta.
/// </summary>
/// <value>The meta.</value>
public BrandMeta Meta { get; set; }
/// <summary>
/// Gets or sets the objects.
/// </summary>
Expand All @@ -29,8 +34,9 @@ public BrandListResponse()
/// </summary>
/// <param name="meta">Meta.</param>
/// <param name="brands">brands.</param>
public BrandListResponse( List<T> brands)
public BrandListResponse(BrandMeta meta, List<T> brands)
{
Meta = meta ?? throw new ArgumentNullException(nameof(meta));
Brands = brands ?? throw new ArgumentNullException(nameof(brands));
}

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 +
"[Brands]\n" + string.Join("\n", Brands);

Expand Down
51 changes: 51 additions & 0 deletions src/Plivo/Resource/Brand/BrandMeta.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>
/// Brand Meta.
/// </summary>
public class BrandMeta
{
/// <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 e54d55a

Please sign in to comment.