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

Include count on segment #127

Merged
merged 2 commits into from
Aug 9, 2018
Merged

Include count on segment #127

merged 2 commits into from
Aug 9, 2018

Conversation

ThomasArdal
Copy link
Contributor

No description provided.

@ThomasArdal
Copy link
Contributor Author

Any ETA on getting this reviewed and merged?

@kmossco
Copy link
Contributor

kmossco commented Jun 15, 2018

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.

Copy link
Contributor

@kmossco kmossco left a 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() }
};
Copy link
Contributor

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());
            }

@ThomasArdal
Copy link
Contributor Author

@kmossco Good point. Fixed.

@kmossco
Copy link
Contributor

kmossco commented Jul 5, 2018

This closes #122

Copy link
Contributor

@kmossco kmossco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, this looks good now. 🚢 Going to wrap it with #129, #130, #131 into version 2.1.0 of this library. So will merge it soon.

@kmossco kmossco merged commit a0d0662 into intercom:master Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants