/* 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('iam', 'v1', () => { /** now we can use gapi.client.iam */ /** 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 data across Google Cloud Platform services */ 'https://www.googleapis.com/auth/cloud-platform', ]; 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() { /** * Lists the permissions testable on a resource. * A permission is testable if it can be tested for an identity on a resource. */ await gapi.client.permissions.queryTestablePermissions({ }); /** Gets a Role definition. */ await gapi.client.roles.get({ name: "name", }); /** Lists the Roles defined on a resource. */ await gapi.client.roles.list({ pageSize: 1, pageToken: "pageToken", parent: "parent", showDeleted: true, view: "view", }); /** * Queries roles that can be granted on a particular resource. * A role is grantable if it can be used as the role in a binding for a policy * for that resource. */ await gapi.client.roles.queryGrantableRoles({ }); } });