-
Notifications
You must be signed in to change notification settings - Fork 53
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
Include count on segment #127
Conversation
Any ETA on getting this reviewed and merged? |
Hey @ThomasArdal! So sorry for the delay in getting back to you here, and thank you so much for taking the time to help us! Right now we are blocked in releasing a new version due to a problem with our MyGet releases: #115 (comment) I am hoping to get this sorted asap so we can resume merging and as soon as we do that your PR will be reviewed and merged right away. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small change request and we will be good to go! 🚀
Dictionary<String, String> parameters = new Dictionary<String, String> | ||
{ | ||
{ "include_count", includeCount.ToString() } | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this locally and the problem with this approach is that we will always send the attribute even if it's false. So the params we get in the server when this is sent like this: Segment segments = segmentsClient.View("58c67482ac0f91a20446037e");
are:
"params":{"include_count":"False","id":"58c67482ac0f91a20446037e"}
So this will return the count anyway. Can we instead of defining it as false, actually define as null? Maybe something like this:
public Segment View(String id, bool? includeCount = null)
{
if (String.IsNullOrEmpty(id))
{
throw new ArgumentNullException(nameof(id));
}
Dictionary<String, String> parameters = new Dictionary<String, String>();
if (includeCount != null && includeCount.HasValue)
{
parameters.Add("include_count", includeCount.ToString());
}
@kmossco Good point. Fixed. |
This closes #122 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.