/* This is stub file for gapi.client.{{=it.name}} definition tests */ /* IMPORTANT. * This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually. * In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator **/ gapi.load('client', () => { /** now we can use gapi.client */ gapi.client.load('adexchangeseller', 'v2.0', () => { /** now we can use gapi.client.adexchangeseller */ /** don't forget to authenticate your client before sending any request to resources: */ /** declare client_id registered in Google Developers Console */ const client_id = '<>'; const scope = [ /** View and manage your Ad Exchange data */ 'https://www.googleapis.com/auth/adexchange.seller', /** View your Ad Exchange data */ 'https://www.googleapis.com/auth/adexchange.seller.readonly', ]; const immediate = true; gapi.auth.authorize({ client_id, scope, immediate }, authResult => { if (authResult && !authResult.error) { /** handle succesfull authorization */ run(); } else { /** handle authorization error */ } }); run(); }); async function run() { /** Get information about the selected Ad Exchange account. */ await gapi.client.accounts.get({ accountId: "accountId", }); /** List all accounts available to this Ad Exchange account. */ await gapi.client.accounts.list({ maxResults: 1, pageToken: "pageToken", }); } });