google-api-typings-generator icon indicating copy to clipboard operation
google-api-typings-generator copied to clipboard

Allow to use resource/body object directly

Open Maxim-Mazurok opened this issue 4 years ago • 2 comments

Instead of this:

await gapi.client.analyticsreporting.reports.batchGet({
  resource: {
    reportRequests: [/*...*/],
  },
});

we want to use this:

await gapi.client.analyticsreporting.reports.batchGet({
  reportRequests: [/*...*/],
});

First, we need to investigate if this is consistent across different APIs. For example, body approach worked for Sheets API, but not for Analytics Reporting API.

Maxim-Mazurok avatar Sep 24 '20 02:09 Maxim-Mazurok

Not sure why directly specifying reportRequests for Analytics Reporting API doesn't work for you, because it works perfectly fine for me.

hakimio avatar Sep 24 '20 07:09 hakimio

You're right, direct approach also works fine for me. It's just that our current types definition does not support this direct approach. So, this issue was created so that type definitions will be changed to allow this (totally valid and working) direct approach.

Maxim-Mazurok avatar Sep 24 '20 07:09 Maxim-Mazurok