Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResourceNames::forTopicConstant is removed in v14 #946

Closed
minaTfn opened this issue Aug 31, 2023 · 10 comments
Closed

ResourceNames::forTopicConstant is removed in v14 #946

minaTfn opened this issue Aug 31, 2023 · 10 comments
Assignees
Labels
bug Something isn't working triage Need triage

Comments

@minaTfn
Copy link

minaTfn commented Aug 31, 2023

Hi there,
I recently upgraded my google ads API PHP package from v13 to v14.1. Right after that I got this error while creating a ResponsiveSearchAd.
Call to undefined method Google\Ads\GoogleAds\Util\V14\ResourceNames::forTopicConstant()

The error is because I’m using this piece of code:

new TopicInfo([
                'topic_constant' => Google\Ads\GoogleAds\Util\V14\ResourceNames::forTopicConstant($topic_id),
            ])

The reason for the error is that forTopicConstant method was removed from version 14.

Since it was a breaking change for me, my questions are:
why isn’t this listed in the v13 to v14 changes documentation?
How can I prevent such a problem in the future?

Thanks in advance for the response.

@minaTfn minaTfn added bug Something isn't working triage Need triage labels Aug 31, 2023
@fiboknacky
Copy link
Member

What's your error message?

@fiboknacky fiboknacky self-assigned this Aug 31, 2023
@minaTfn
Copy link
Author

minaTfn commented Aug 31, 2023

What's your error message?

Call to undefined method Google\Ads\GoogleAds\Util\V14\ResourceNames::forTopicConstant()

@fiboknacky
Copy link
Member

What client library version are you using?

@minaTfn
Copy link
Author

minaTfn commented Sep 1, 2023

What client library version are you using?

"googleads/google-ads-php": "20.1.0"

1 similar comment
@minaTfn
Copy link
Author

minaTfn commented Sep 1, 2023

What client library version are you using?

"googleads/google-ads-php": "20.1.0"

@fiboknacky
Copy link
Member

Hello,

Since it was a breaking change for me, my questions are: why isn’t this listed in the v13 to v14 changes documentation? How can I prevent such a problem in the future?

The API actually doesn't change anything about the topic_constant, so there is no unintended breaking change here.
Upon checking, it seems the ResourceNames utility was wrongly generated by our automation tool. I'm investigating the tool and will release a patch once I find a solution.

Sorry for your inconvenience.

@fiboknacky
Copy link
Member

@minaTfn

By the way, could you share a bit more details at what step did you need to use forTopicConstant to create a responsive search ad?

@minaTfn
Copy link
Author

minaTfn commented Sep 19, 2023

@minaTfn

By the way, could you share a bit more details at what step did you need to use forTopicConstant to create a responsive search ad?

I was using ResourceNames::forTopicConstant to get the Topic Constant resource name to create topic criteria for adgroup.
AdGroupCriterion -> TopicInfo -> topic_constant

@fiboknacky
Copy link
Member

Thanks a lot. I found that the definition of TopicInfo in the proto definition don't contain the annotation needed for generating the name templates, used in the ResourceNames util. It should have been like this:

optional string topic_constant = 1 [(google.api.resource_reference).type = "[googleads.googleapis.com/TopicConstant](http://googleads.googleapis.com/TopicConstant)"]

This may be due to the fact that some messages (like TopicInfo) were added a long time ago before we adopted the recent styles.

For now, I'll work on restoring the method for this resource.
In the long term, I'll coordinate with the Google Ads API team to properly add the annotation.

@fiboknacky
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Need triage
Projects
None yet
Development

No branches or pull requests

2 participants