Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async mutateResources(
operations: Array,
options?: ServiceCreateOptions
): MutateResourcesResponse {
const request = new grpc.MutateGoogleAdsRequest()
request.setCustomerId(this.cid)
if (options && options.hasOwnProperty('validate_only')) {
request.setValidateOnly(options.validate_only as boolean)
}
if (options && options.hasOwnProperty('partial_failure')) {
request.setPartialFailure(options.partial_failure as boolean)
}
const ops: Array = []
for (const operation of operations) {
if (!operation.hasOwnProperty('_resource')) {
throw new Error(`Missing "_resource" key on entity`)
}