question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using PageStreamer For Drive V2 API throws compiler error

See original GitHub issue

I use the following code and I get the compiler error as mentioned below:

var result = new List<Google.Apis.Drive.v2.Data.File>();
            var googleDriveFolder = (Google.Apis.Drive.v2.Data.File)thirdPartyFolder;
            var service = GetDriveService();
            var request = service.Files.List();
            request.MaxResults = 1000;
            request.Q = string.Format("'{0}' in parents and trashed = false", googleDriveFolder.Id);
            
            do
            {
                try
                {
                    var pageStreamer = new PageStreamer<Google.Apis.Drive.v2.Data.File, FilesResource.ListRequest, FileList, string>(
                        request, token) => request.PageToken = token,
                        response => response.NextPageToken,
                        response => response.Items);
                }
                catch(Exception)
                {}

Compiler Error:

There is no argument given that corresponds to the required formal parameter ‘resource extractor’ of ‘PageStreamer<File, FilesResource.ListRequest, FileList, string>.PageStreamer(Action<FilesResource.ListRequest, string>, Func<FileList, string>, Func<FileList, IEnumerable<File>>)’ while initializing pageStreamer var

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
jskeetcommented, Jul 14, 2017

Your code sends a single request, and gets back a single page of results.

PageStreamer:

  • Allows you to fetch all results as a lazily-evaluated stream, fetching pages as they’re required
  • Allows you to fetch all results eagerly by making multiple requests from a single method call

It’s just convenience.

0reactions
jskeetcommented, Jul 20, 2017

@AkshitaGupta: I’m not sure what you mean. I suggest you ask a question on Stack Overflow with a short but complete example. Feel free to then leave a link here, but it would definitely be better on SO than here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolve errors | Google Drive
This guide provides instructions on how to resolve specific API errors. Resolve a 400 error: Bad request. This error can result from any...
Read more >
Pagination of files using Google Drive api client library
I would recommend using PageStreamer here is an example using the Drive API V2. var pageStreamer = new PageStreamer<Google.Apis.Drive.v2.
Read more >
pagination #632 - googleapis/google-api-dotnet-client
My point is that you just wouldn't be able to write the wrong code easily, to construct the PageStreamer . Any errors are...
Read more >
Google API going crazy in Angular : r/Angular2
So I have been implementing the google drive feature in a work project ... Angular(13) compiler is throwing me polyfills and webpack error....
Read more >
Google Drive rest api v3 file export error - Issue Tracker
export() endpoint can handle, and this error is thrown when files are larger than limit. In my testing I'm seeing the limit closer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found