@dmgt/google-ad-manager-api
Version:
Typed Google Ad Manager API
42 lines • 927 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.query = query;
const pql_1 = require("./pql");
/**
* Query a service wth PQL options.
*
* If a client's method matches that of a usual query statement,
* using this function will infer the query object.
*
* @deprecated Use {@link function:getByStatement}
*
* @example
* ```
* query(client, 'getLineItemsByStatementAsync', {
* where: {
* id: 123
* }
* })
* ```
* Is syntactical sugar for:
* ```
* client.getLineItemsByStatementAsync({
* filterStatement: {
* query: pql<LineItems>({
* where: {
* id: 123
* }
* })
* }
* })
* ```
*/
function query(client, methodName, query, values, ...args) {
return client[methodName]({
filterStatement: {
query: (0, pql_1.pql)(query),
values,
},
}, ...args);
}
//# sourceMappingURL=query.js.map