From 14d3d46fc40b352ef5e4368500bc6cc382a24439 Mon Sep 17 00:00:00 2001 From: Viacheslav Rostovtsev Date: Tue, 10 Nov 2026 22:04:15 +0000 Subject: [PATCH] fix: fall back to resumable upload method allowlist when getMediaUpload is unset Un-nest the hardcoded RPC/package allowlist in MethodDetails::maybeCreateResumableUpload from the else block so it runs whenever $isMediaUpload evaluates to false. Otherwise, once google/common-protos exposes HttpRule::getMediaUpload(), allowlisted RPCs whose protos do not yet set the media_upload option return null from getMediaUpload() and skip the allowlist fallback. --- src/Generation/MethodDetails.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Generation/MethodDetails.php b/src/Generation/MethodDetails.php index 14e514353..57b6f8b78 100644 --- a/src/Generation/MethodDetails.php +++ b/src/Generation/MethodDetails.php @@ -84,9 +84,12 @@ private static function maybeCreateResumableUpload(ServiceDetails $svc, MethodDe return null; } + $isMediaUpload = false; if (method_exists($httpRule, 'getMediaUpload')) { $isMediaUpload = (bool) $httpRule->getMediaUpload()?->getEnabled(); - } else { + } + + if (!$isMediaUpload) { // @TODO: Remove hardcoded RPC names once getMediaUpload annotation is available in common-protos $isMediaUpload = match ($desc->getName()) { 'CreateYouTubeVideoUpload' => str_starts_with($svc->package, 'google.ads.googleads.')