googleads / google-ads-php

Google Ads API Client Library for PHP
https://developers.google.com/google-ads/api/docs/client-libs/php
Apache License 2.0
280 stars 260 forks source link

UnexpectedValueException - CriterionType has no name defined for value 41 #1019

Closed chiragvels closed 3 months ago

chiragvels commented 3 months ago

[DO NOT INCLUDE ANY PERSONAL OR SENSITIVE DATA - MAKE SURE TO REDACT CONTENT WHEN NECESSARY]

Your client library and Google Ads API versions:

Your environment:

Description of the bug: LIFE_EVENT is missing under criteria type ENUM list Steps to reproduce: Enum Google\Ads\GoogleAds\V16\Enums\CriterionTypeEnum\CriterionType has no name defined for value 41 Expected behavior: LIFE_EVENT should be added as ENUM Request/Response Logs:

Anything else we should know about your project / environment: Google/Ads/GoogleAds/V16/Enums/CriterionTypeEnum/CriterionType.php Line Number: 310

fiboknacky commented 3 months ago

Thanks for reporting. Working on it.

fiboknacky commented 3 months ago

Fixed in https://github.com/googleads/google-ads-php/releases/tag/v23.0.1.

chiragvels commented 3 months ago

Hi @fiboknacky ,

Still same error for v22.1.0

Thanks,

fiboknacky commented 3 months ago

Could you please upgrade to v23.0.1?

chiragvels commented 3 months ago

Hi @fiboknacky ,

Yes, But that is only option as of now.

June 5, 2024 is sunset date for v14 of the API.

At some places I am still using v14 of the API, so not able to upgrade immediately.

But it should be there for all library version which still in use till sunset date?

Thanks,

fiboknacky commented 3 months ago

But it should be there for all library version which still in use till sunset date?

Not sure I get what you mean accurately, but yes, all the versions should work until they get sunset on the announced sunset date. Please let me know if I misunderstood your question.

chiragvels commented 3 months ago

Yes @fiboknacky ,

I mean to say under 23.0.1 v14 version is removed. So I cannot upgrade it as of now, I still not tested all the changes yet.

That is what i mean to say, after upgrade from 22.1.0 to 23.0.1 I still not able to access v14 of the API.

fiboknacky commented 3 months ago

Thanks for your explanation.

I think we found a case when adding a new enum value (in v16_1) results in a breaking change in the PHP client library. Usually adding a new value to enum shouldn't break the client libraries. I'll discuss this with my colleagues. In the meantime, I'll try to update this file for v22.1.0 soon next week.

chiragvels commented 3 months ago

Ok @fiboknacky

fiboknacky commented 3 months ago

I'm sorry that this took so long. I was swamped with other works. It looks like the enum utility methods themselves generated by the source generator behave incorrectly. However, the deserialization of the protobuf messages itself should still behave correctly.

I know that it's quite late now, so could you please confirm if you still need the fix for the util methods for now? Or did you already migrate to the latest client library?

chiragvels commented 3 months ago

No still not migrated. Planned to finish migration soon. if you still need the fix for the util methods for now? Yes, If you can.

fiboknacky commented 3 months ago

Could you try v22.1.1? Thanks.

chiragvels commented 3 months ago

Thank You.

Yes, working now.