Opteo/google-ads-node

Cannot create Label due to failiure in utils.ts:202

p0mvn opened this issue · 0 comments

p0mvn commented

I'm submitting a ...

  • bug report
  • feature request
  • question about the decisions made in the repository
  • question about how to use this project

Summary

Hello!

Here's the error I am getting:

Error: Attempted to set value "001" on invalid path "name" in resource
    at toProtoValueFormat (c:\Users\ackht\projects\add3-be\node_modules\google-ads-node\src\lib\utils.ts:202:11)
    at unroll (c:\Users\ackht\projects\add3-be\node_modules\google-ads-node\src\lib\utils.ts:192:11)
    at Object.convertToProtoFormat (c:\Users\ackht\projects\add3-be\node_modules\google-ads-node\src\lib\utils.ts:187:22)
    at GoogleAdsClient.buildResource (c:\Users\ackht\projects\add3-be\node_modules\google-ads-node\src\lib\client.ts:138:29)
    at GrpcClient.buildResource (c:\Users\ackht\projects\add3-be\node_modules\google-ads-api\build\grpc.js:134:28)
    at LabelService.buildResource (c:\Users\ackht\projects\add3-be\node_modules\google-ads-api\build\services\service.js:212:32)
    at LabelService.<anonymous> (c:\Users\ackht\projects\add3-be\node_modules\google-ads-api\build\services\service.js:103:33)
    at Generator.next (<anonymous>)
    at c:\Users\ackht\projects\add3-be\node_modules\google-ads-api\build\services\service.js:8:71
    at new Promise (<anonymous>) {stack: 'Error: Attempted to set value "001" on invali…vice.js:8:71
    at new Promise (<anonymous>)', message: 'Attempted to set value "001" on invalid path "name" in resource'}

Here's what I am doing:

                const label = {
                    name: `00${result.label}`,
                    text_label: { 
                        background_color: '#e993eb', 
                        description: `Label ${result.label}`
                    },
                }
                const genLabelResult = await customer.labels.create(label);

The name seems to be a part of the labels API as per https://opteo.com/dev/google-ads-api/#label

So I was wondering if this is a bug?
Thank you!