Skip to content

Remove read-only ImageAsset fields from upload_image_asset examples - #577

Open
pattersonlois wants to merge 3 commits into
googleads:mainfrom
pattersonlois:remove-read-only-image-asset-fields
Open

pattersonlois wants to merge 3 commits into
googleads:mainfrom
pattersonlois:remove-read-only-image-asset-fields

Conversation

@pattersonlois

@pattersonlois pattersonlois commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

In AssetService.MutateAssets, ImageAsset.data is the only ImageAsset field that you can set when you create an image asset. The file_size, mime_type, and full_size fields (height_pixels, width_pixels, and url) are read-only, and the API ignores any values set for them in a create operation.

The Java, PHP, and Perl upload_image_asset examples already send only name and image_asset.data. This change aligns this example with them.

  • examples/misc/upload_image_asset.rb: Removes the file_size, mime_type, and full_size assignments, and updates open(url) { |f| f.read } to URI.open(url, &:read) to download the image.

@pattersonlois
pattersonlois requested review from a team as code owners November 17, 2026 14:03
@pattersonlois
pattersonlois requested review from Raibaz and bobhancockg and removed request for a team November 17, 2026 14:03
Comment thread examples/misc/upload_image_asset.rb Resolved
@Raibaz Raibaz added the kokoro:run This label is required to run a kokoro presubmit if an external contributor sends a PR. label Nov 20, 2026
@kokoro-team kokoro-team removed the kokoro:run This label is required to run a kokoro presubmit if an external contributor sends a PR. label Nov 20, 2026
@Raibaz Raibaz added the kokoro:run This label is required to run a kokoro presubmit if an external contributor sends a PR. label Nov 20, 2026
@kokoro-team kokoro-team removed the kokoro:run This label is required to run a kokoro presubmit if an external contributor sends a PR. label Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants