Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private buildListQuery(resource: string, options?: ServiceListOptions): string {
if (!fields.hasOwnProperty(resource)) {
throw new Error(`Resource "${resource}" not found in google-ads-node compiled resources (fields.ts).`)
}
const resource_fields = (fields as any)[resource]
const config: ReportOptions = {
attributes: resource_fields,
constraints: options && options.constraints ? options.constraints : [],
limit: options && options.limit ? options.limit : undefined,
entity: resource as fields.ResourceName,
}
const query = buildReportQuery(config)
return query
}