Unable to retrieve the total_count from the request summary.
Steps/Sample code to reproduce the issue
If I make a request for the campaigns in an ad_account with summary: 'total_count', I see the total account getting logged by the Faraday Request, but I'm unable to retrieve that value. I want a count of all the campaign in an account to monitor how close we are to rate limits without having to first go through every page of campaigns and then count them in memory.
When I make this request, the logger shows the result of the API request along with this total_count that I'm looking for, but I'm unable to actually get this value from the return.
"summary":{"total_count":5012}}
Observed Results:
If you do call count or length on result, you just get the amount that has been added to @collection-- in the case of my example, it's just the first page, and thus returns 10.
Expected Results:
I would expect to be able to get this value of total_count back without having to go through every page. The data is there! What I might expect would be to be able to call total_count on my campaigns object and it would make the api call with summary: 'total_count' and then give me back that value.
Which SDK version are you using?
gem version 0.11.0.0 with api version v11.0
What's the issue?
Unable to retrieve the
total_count
from the request summary.Steps/Sample code to reproduce the issue
If I make a request for the campaigns in an ad_account with
summary: 'total_count'
, I see the total account getting logged by the Faraday Request, but I'm unable to retrieve that value. I want a count of all the campaign in an account to monitor how close we are to rate limits without having to first go through every page of campaigns and then count them in memory.When I make this request, the logger shows the result of the API request along with this
total_count
that I'm looking for, but I'm unable to actually get this value from the return.Observed Results:
If you do call
count
orlength
onresult
, you just get the amount that has been added to@collection
-- in the case of my example, it's just the first page, and thus returns10
.Expected Results:
I would expect to be able to get this value of
total_count
back without having to go through every page. The data is there! What I might expect would be to be able to calltotal_count
on mycampaigns
object and it would make the api call withsummary: 'total_count'
and then give me back that value.