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

feat: add new dedupe utility method to Option classes #2063

Merged
merged 1 commit into from
Jun 16, 2023

Conversation

BenWhitehead
Copy link
Collaborator

When providing options duplicates are not allowed, however there are times when you might end up providing two options which would collide. These new utility methods encapsulate the logic necessary to deduplicate any overlap wil returing an array which can be passed directly to the respective operation method.

dedupe utility methods added to each of the following Option classes:

  • Storage.BlobGetOption.dedupe();
  • Storage.BlobListOption.dedupe();
  • Storage.BlobSourceOption.dedupe();
  • Storage.BlobTargetOption.dedupe();
  • Storage.BlobWriteOption.dedupe();
  • Storage.BucketGetOption.dedupe();
  • Storage.BucketListOption.dedupe();
  • Storage.BucketSourceOption.dedupe();
  • Storage.BucketTargetOption.dedupe();
  • Storage.CreateHmacKeyOption.dedupe();
  • Storage.DeleteHmacKeyOption.dedupe();
  • Storage.GetHmacKeyOption.dedupe();
  • Storage.ListHmacKeysOption.dedupe();
  • Storage.UpdateHmacKeyOption.dedupe();
  • Bucket.BlobTargetOption.dedupe();
  • Bucket.BlobWriteOption.dedupe();
  • Bucket.BucketSourceOption.dedupe();
  • Blob.BlobSourceOption.dedupe();

@BenWhitehead BenWhitehead added the owlbot:ignore instruct owl-bot to ignore a PR label Jun 13, 2023
@BenWhitehead BenWhitehead requested a review from a team as a code owner June 13, 2023 19:43
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: storage Issues related to the googleapis/java-storage API. labels Jun 13, 2023
Copy link
Contributor

@sydney-munro sydney-munro left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks!

@BenWhitehead BenWhitehead changed the title feat: add new dedup utility method to Option classes feat: add new dedupe utility method to Option classes Jun 13, 2023
When providing options duplicates are not allowed, however there are times when you might end up providing two options which would collide. These new utility methods encapsulate the logic necessary to deduplicate any overlap wil returing an array which can be passed directly to the respective operation method.

`dedupe` utility methods added to each of the following Option classes:
* Storage.BlobGetOption.dedupe();
* Storage.BlobListOption.dedupe();
* Storage.BlobSourceOption.dedupe();
* Storage.BlobTargetOption.dedupe();
* Storage.BlobWriteOption.dedupe();
* Storage.BucketGetOption.dedupe();
* Storage.BucketListOption.dedupe();
* Storage.BucketSourceOption.dedupe();
* Storage.BucketTargetOption.dedupe();
* Storage.CreateHmacKeyOption.dedupe();
* Storage.DeleteHmacKeyOption.dedupe();
* Storage.GetHmacKeyOption.dedupe();
* Storage.ListHmacKeysOption.dedupe();
* Storage.UpdateHmacKeyOption.dedupe();
* Bucket.BlobTargetOption.dedupe();
* Bucket.BlobWriteOption.dedupe();
* Bucket.BucketSourceOption.dedupe();
* Blob.BlobSourceOption.dedupe();

There are overloads which accept a collection or array in addition to varargs.
@BenWhitehead BenWhitehead added the automerge Merge the pull request once unit tests and other checks pass. label Jun 16, 2023
@gcf-merge-on-green
Copy link

Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, one of your required reviews was not approved, or there is a do not merge label. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot.

@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Jun 16, 2023
@BenWhitehead BenWhitehead merged commit 2ad196c into main Jun 16, 2023
@BenWhitehead BenWhitehead deleted the dedupe-options branch June 16, 2023 15:13
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. owlbot:ignore instruct owl-bot to ignore a PR size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants