@XamDev
Let's say I have a folder "test" on my google drive. I would like to find this folder by giving Google drive API, the name of the folder and restrict the results only to folders. This is how you can do it (It's working in my case):
FilesResource.ListRequest listRequest = service.Files.List();
listRequest.PageSize = 10;
listRequest.Q = "mimeType = 'application/vnd.google-apps.folder' and name = 'test'";
listRequest.Fields = "nextPageToken, files(id, name)";
IList<Google.Apis.Drive.v3.Data.File> files = listRequest.Execute()
.Files;
if (files != null && files.Count > 0)
{
foreach (var file in files)
{ //My TextBlock(WPF)
ListedFiles.Text = $"{file.Name}, {file.Id} \n";
}
}
The part of the source code comes from: https://developers.google.com/drive/api/v3/quickstart/dotnet and the parameters that you can search for: https://developers.google.com/drive/api/v3/search-parameters