如需详细了解此服务,请参阅 Admin SDK Google Workspace Reseller API 的参考文档。与 Apps 脚本中的所有高级服务一样,Admin SDK Google Workspace Reseller 服务使用的对象、方法和参数均与公共 API 相同。如需了解详情,请参阅方法签名是如何确定的。
/** * Logs the list of subscriptions, including the customer ID, date created, plan * name, and the sku ID. Notice the use of page tokens to access the full list * of results. * @see https://developers.google.com/admin-sdk/reseller/reference/rest/v1/subscriptions/list */functiongetSubscriptions(){letresult;letpageToken;do{result=AdminReseller.Subscriptions.list({pageToken:pageToken,});for(constsubofresult.subscriptions){constcreationDate=newDate();creationDate.setUTCSeconds(sub.creationTime);console.log("customer ID: %s, date created: %s, plan name: %s, sku id: %s",sub.customerId,creationDate.toDateString(),sub.plan.planName,sub.skuId,);}pageToken=result.nextPageToken;}while(pageToken);}