FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

samples: add samples for object contexts by nidhiii-27 · Pull Request #3329 · googleapis/java-storage · GitHub

samples: add samples for object contexts - #3329

Merged
BenWhitehead merged 7 commits into
googleapis:mainfrom
nidhiii-27:feat-object-contexts
Oct 9, 2025
Merged

samples: add samples for object contexts#3329
BenWhitehead merged 7 commits into
googleapis:mainfrom
nidhiii-27:feat-object-contexts

Conversation

Copy link
Copy Markdown
Contributor

Added samples :
storage_get_object_contexts
storage_list_object_contexts
storage_set_object_contexts

product-auto-label Bot added size: m Pull request size is medium. api: storage Issues related to the googleapis/java-storage API. samples Issues that are directly related to samples. labels Oct 6, 2025
nidhiii-27 marked this pull request as ready for review October 7, 2025 19:52

snippet-bot Bot commented Oct 7, 2025
edited
Loading

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 3 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

BenWhitehead left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Two small things to address and a few nits. Feel free to skip the nits if you so choose.

import java.util.Map;

public class GetObjectContexts {
public static void getObjectMetadata(String projectId, String bucketName, String blobName)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

nit: method is named getObjectMetadata but the contents show how to get contexts.

* List any object that does not have a context with the specified key and value attached
* String filter = "NOT contexts.\"KEY\"=\"VALUE\"";
*/
String key = "your-context-key";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

nit: making this a method parameter will probably make test authoring easier

Comment on lines +49 to +50
String key = "your-context-key";
String value = "your-context-value";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

nit: providing these as method parameters will probably make test authoring easier

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thank you for the suggestion!

BenWhitehead merged commit 9dcce11 into googleapis:main Oct 9, 2025
22 checks passed
nidhiii-27 deleted the feat-object-contexts branch October 13, 2025 06:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the googleapis/java-storage API. samples Issues that are directly related to samples. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL