How to use the google-ads-node/build/lib/fields.hasOwnProperty function in google-ads-node

To help you get started, we’ve selected a few google-ads-node examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Opteo / google-ads-api / src / services / service.ts View on Github external
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
    }