Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
resource_operation.setUpdate(pb)
const update_mask = getFieldMask(operation)
resource_operation.setUpdateMask(update_mask)
}
if (operation_mode === 'delete') {
// @ts-ignore Types are no use here
if (!pb.toObject().hasOwnProperty('resourceName') || !pb.toObject().resourceName) {
throw new Error(`Must specify "resource_name" to remove when using "delete"`)
}
// @ts-ignore Types are no use here
resource_operation.setRemove(pb.toObject().resourceName)
}
/* Add operation of resource type to global mutate operation e.g. "MutateOperation.setCampaignBudgetOperation" */
const op = new grpc.MutateOperation()
const operation_set_method = `set${operation_resource_name}Operation`
// @ts-ignore Types are no use here
op[operation_set_method](resource_operation)
/* Push operation to MutateOperationsList */
ops.push(op)
}
request.setMutateOperationsList(ops)
const response = await this.globalMutate(request)
return response
}
}