import { Customer } from "./customer" ; import { CustomerOptions } from "./types" ; import { Hooks } from "./hooks" ; import { services } from "./protos" ; import { Service } from "./service" ; export interface ClientOptions { client_id : string ; client_secret : string ; developer_token : string ; disable_parsing ? : boolean ; } export class Client { private readonly options : ClientOptions ; constructor ( options ) { this . options = options ; } public Customer ( customerOptions , hooks ? ) { const cus = new Customer ( this . options , customerOptions , hooks ) ; return cus ; } public async listAccessibleCustomers ( refreshToken ) { const service = new Service ( this . options , { customer_id : "" , refresh_token : refreshToken , } ) ; const customerService = await service . loadService < services . CustomerService > ( "CustomerServiceClient" ) ; try { const [ response ] = await customerService . listAccessibleCustomers ( { } , { otherArgs : { headers : service . callHeaders , } , } ) ; return response ; } catch ( err ) { console . log ( err ) ; throw service . getGoogleAdsError ( err ) ; } } }