Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMS-6099: Added meta data for List Profile, Brand and Campaign #261

Merged
merged 6 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
59 changes: 59 additions & 0 deletions src/Plivo/Resource/Brand/BrandMeta.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
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>
/// Gets or sets the total_count.
/// </summary>
/// <value>The total_count.</value>
[JsonProperty("total_count")]
public uint TotalCount { 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" +
"TotalCount: " + TotalCount + "\n";
}
}
}
10 changes: 9 additions & 1 deletion src/Plivo/Resource/Campaign/CampaignListResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ namespace Plivo.Resource
[JsonObject]
public class CampaignListResponse<T> : BaseResponse, IEnumerable<T>
{

/// <summary>
/// Gets or sets the meta.
/// </summary>
/// <value>The meta.</value>
public CampaignMeta Meta { get; set; }
/// <summary>
/// Gets or sets the objects.
/// </summary>
Expand All @@ -29,8 +35,9 @@ public CampaignListResponse()
/// </summary>
/// <param name="meta">Meta.</param>
/// <param name="Campaigns">Campaigns.</param>
public CampaignListResponse( List<T> campaigns)
public CampaignListResponse(CampaignMeta meta, List<T> campaigns)
{
Meta = meta ?? throw new ArgumentNullException(nameof(meta));
Campaigns = campaigns ?? throw new ArgumentNullException(nameof(campaigns));
}

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

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

namespace Plivo.Resource
{
/// <summary>
/// Campaign Meta.
/// </summary>
public class CampaignMeta
{
/// <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>
/// Gets or sets the total_count.
/// </summary>
/// <value>The total_count.</value>
[JsonProperty("total_count")]
public uint TotalCount { 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" +
"TotalCount: " + TotalCount + "\n";
}
}
}
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";
rajneeshkatkam-plivo marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Loading