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

Make Project a subclass of ProjectInfo #572

Merged
merged 1 commit into from
Jan 30, 2016

Conversation

ajkannan
Copy link

This is an alternate proof of concept for #530. This PR introduces the following changes:

  • Project is now a subclass of ProjectInfo.
    • ResourceManager methods accept ProjectInfo objects but always return a Project
  • A new abstract builder class is added to ProjectInfo. Both ProjectInfo.BuilderImpl and Project.Builder extend this abstract Builder.
    • The methods of Project.Builder delegate to ProjectInfo.BuilderImpl to avoid setter code duplication.
    • The abstract class is for code maintenance. If there is a new field for projects, adding it to the abstract class will ensure that we add it to both ProjectInfo.BuilderImpl and Project.Builder.

A user can create a ProjectInfo (without supplying a service object) when creating or updating a project. Since Resource Manager methods will return Project objects instead of ProjectInfo objects, the user doesn't have to supply the service object any additional times for the typical use case.

@ajkannan ajkannan added do not merge Indicates a pull request not ready for merge, due to either quality or timing. api: cloudresourcemanager Issues related to the Resource Manager API. labels Jan 22, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 22, 2016
@ajkannan ajkannan force-pushed the project-extends-projectinfo branch from 21794d1 to 5a7e887 Compare January 23, 2016 00:01
@ajkannan
Copy link
Author

/cc @mziccard @mderka @aozarov

Thoughts?

@aozarov
Copy link
Contributor

aozarov commented Jan 23, 2016

I like it! 👍

@mderka
Copy link

mderka commented Jan 23, 2016

I need a bit more time to go through this. I follow up on Monday.

}
}

Project(ResourceManager resourceManager, ProjectInfo.BuilderImpl infoBuilder) {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@mziccard
Copy link
Contributor

I added a few nit comments. Great job @ajkannan I think this makes the API more usable without being verbose and keeps the code clean and maintainable. 👍

Btw, I can implement this in either bigquery or storage or both, just let me know!

@mziccard
Copy link
Contributor

Looking a bit more into this. In bigquery we have a more complex situation where Info classes are part of a hierarchy.
For instance consider the TableInfo hierarchy where the BaseTableInfo class is extended by TableInfo, ViewInfo and ExternalTableInfo. Do you guys think this solution would still fit to the bigquery case?

@ajkannan
Copy link
Author

@mziccard I'll take Storage and Resource Manager, and if you can take BigQuery, that'd be great.

I'll remove the "don't merge" label on this PR after I add changes to docs, fix the tests, and address the comments above.

@ajkannan ajkannan removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jan 27, 2016
@ajkannan
Copy link
Author

Incorporated comments thus far and also updated README, javadoc, and tests. Ready for another pass.

@ajkannan
Copy link
Author

Fixed more documentation issues and added a commit that adds a replace method with no arguments. This replace is useful because a common use case for replace is to use toBuilder on a project, which up until now required repetition. An example of the change would be:

myProject.toBuilder().addLabel("k", "v").build().replace();

rather than

myProject.replace(myProject.toBuilder().addLabel("k", "v").build())

Thoughts @mziccard @mderka?

@mziccard
Copy link
Contributor

@ajkannan empty replace method looks good to me!

@ajkannan ajkannan force-pushed the project-extends-projectinfo branch 2 times, most recently from 34fe23c to 951be77 Compare January 29, 2016 17:58
@ajkannan
Copy link
Author

Added a commit to remove the original replace method.

@aozarov
Copy link
Contributor

aozarov commented Jan 30, 2016

LGTM, please fix the doc issues we discussed before merge.

@ajkannan ajkannan force-pushed the project-extends-projectinfo branch from 951be77 to a76e6c4 Compare January 30, 2016 00:18
@ajkannan
Copy link
Author

Fixed docs and re-tested sample in the docs.

ajkannan added a commit that referenced this pull request Jan 30, 2016
@ajkannan ajkannan merged commit d3abf25 into googleapis:master Jan 30, 2016
@ajkannan ajkannan deleted the project-extends-projectinfo branch January 30, 2016 00:45
github-actions bot pushed a commit to suztomo/google-cloud-java that referenced this pull request Jun 29, 2022
Source-Link: googleapis/synthtool@1a2878d
Post-Processor: gcr.io/repo-automation-bots/owlbot-java:latest@sha256:12cbdc4f137152a1a8b83f50ebc1a4098be0d3baff78b46efaec306f7cfafd13

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
github-actions bot pushed a commit that referenced this pull request Sep 15, 2022
* fix: Fix recommendationengine resource name configuration

PiperOrigin-RevId: 473779245

Source-Link: googleapis/googleapis@ee05df9

Source-Link: https://github.com/googleapis/googleapis-gen/commit/d151c136b7de66b7b524817360c639d011ef003d
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDE1MWMxMzZiN2RlNjZiN2I1MjQ4MTczNjBjNjM5ZDAxMWVmMDAzZCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
github-actions bot pushed a commit that referenced this pull request Oct 5, 2022
🤖 I have created a release *beep* *boop*
---


## [0.10.4](https://togithub.com/googleapis/java-recommendations-ai/compare/v0.10.3...v0.10.4) (2022-10-03)


### Bug Fixes

* Fix recommendationengine resource name configuration ([#572](https://togithub.com/googleapis/java-recommendations-ai/issues/572)) ([2beea62](https://togithub.com/googleapis/java-recommendations-ai/commit/2beea629b8bd0dc2e0b934dac0c9a7c728ef71c1))


### Dependencies

* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.3 ([#574](https://togithub.com/googleapis/java-recommendations-ai/issues/574)) ([a7266ef](https://togithub.com/googleapis/java-recommendations-ai/commit/a7266ef9f0ad3a4be8222825b44025641cea63ba))
* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 ([#601](https://togithub.com/googleapis/java-recommendations-ai/issues/601)) ([6fa10e1](https://togithub.com/googleapis/java-recommendations-ai/commit/6fa10e1206e125891b58cad6f78f1bdfeae247d4))
* Update dependency importlib-metadata to v4.12.0 ([#596](https://togithub.com/googleapis/java-recommendations-ai/issues/596)) ([cd541e7](https://togithub.com/googleapis/java-recommendations-ai/commit/cd541e72d4b0ac5a71aedf42f743ef66da7c191e))
* Update dependency jeepney to v0.8.0 ([#597](https://togithub.com/googleapis/java-recommendations-ai/issues/597)) ([32c3a1f](https://togithub.com/googleapis/java-recommendations-ai/commit/32c3a1f9e437a37fbc46981f8d0984d01d2b1785))
* Update dependency jinja2 to v3.1.2 ([#598](https://togithub.com/googleapis/java-recommendations-ai/issues/598)) ([6070770](https://togithub.com/googleapis/java-recommendations-ai/commit/6070770d7653bd1c5c33ddf717c6062926015882))
* Update dependency keyring to v23.9.3 ([#599](https://togithub.com/googleapis/java-recommendations-ai/issues/599)) ([454ca90](https://togithub.com/googleapis/java-recommendations-ai/commit/454ca90c112eb7c7da53a75ebf1cd31351af9c45))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
github-actions bot pushed a commit that referenced this pull request Oct 5, 2022
🤖 I have created a release *beep* *boop*
---


## [2.5.1](https://togithub.com/googleapis/java-retail/compare/v2.5.0...v2.5.1) (2022-10-03)


### Bug Fixes

* **samples:** Bug fix for removing buckets from bq. ([#548](https://togithub.com/googleapis/java-retail/issues/548)) ([059da48](https://togithub.com/googleapis/java-retail/commit/059da48754191311b56521a4295d677eb3a7fcef))
* **samples:** Bug fix for setup script ([#549](https://togithub.com/googleapis/java-retail/issues/549)) ([b9ba700](https://togithub.com/googleapis/java-retail/commit/b9ba7003234a39569add3294534ac5af8a02fa50))
* **samples:** Lro added out-of-order step. ([#539](https://togithub.com/googleapis/java-retail/issues/539)) ([7913182](https://togithub.com/googleapis/java-retail/commit/7913182491c75c3f1937677da21bb80804e6b26c))
* **samples:** Removed delays on LRO ([#527](https://togithub.com/googleapis/java-retail/issues/527)) ([6c39da2](https://togithub.com/googleapis/java-retail/commit/6c39da291e0d0340ebe81f3f85b79bd1dea45118))
* **samples:** Replaced your-project-id with default. ([#541](https://togithub.com/googleapis/java-retail/issues/541)) ([b09050f](https://togithub.com/googleapis/java-retail/commit/b09050fabe81b8b0b8bcfe17c952bfa0870649c9))
* **samples:** Updating both json files. ([#540](https://togithub.com/googleapis/java-retail/issues/540)) ([0bcae2a](https://togithub.com/googleapis/java-retail/commit/0bcae2afe084f6765c3c51a783174063eb09d7e3))


### Dependencies

* Update dependency cachetools to v5 ([#566](https://togithub.com/googleapis/java-retail/issues/566)) ([44d49b5](https://togithub.com/googleapis/java-retail/commit/44d49b5571eab26fe6e3bd7720e91a2587ed6502))
* Update dependency certifi to v2022.9.24 ([#568](https://togithub.com/googleapis/java-retail/issues/568)) ([cbfb804](https://togithub.com/googleapis/java-retail/commit/cbfb804e99a310eab1231813cd65b8e3d7dafc58))
* Update dependency charset-normalizer to v2.1.1 ([#556](https://togithub.com/googleapis/java-retail/issues/556)) ([0ac7723](https://togithub.com/googleapis/java-retail/commit/0ac7723fae0e65a53116ed6c5be17fc32c7bb8a7))
* Update dependency com.google.cloud:google-cloud-bigquery to v2.16.1 ([#542](https://togithub.com/googleapis/java-retail/issues/542)) ([7815252](https://togithub.com/googleapis/java-retail/commit/7815252c2eaa812fd6ed9903420ec63e027be917))
* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 ([#577](https://togithub.com/googleapis/java-retail/issues/577)) ([2d2998c](https://togithub.com/googleapis/java-retail/commit/2d2998c70f92b1c8c7558f7f4ee7576b6d8ff677))
* Update dependency com.google.cloud:google-cloud-storage to v2.12.0 ([#543](https://togithub.com/googleapis/java-retail/issues/543)) ([4f90a58](https://togithub.com/googleapis/java-retail/commit/4f90a58aeebb015ed93d2c49725085016feba97d))
* Update dependency gcp-releasetool to v1.8.8 ([#569](https://togithub.com/googleapis/java-retail/issues/569)) ([15ca79e](https://togithub.com/googleapis/java-retail/commit/15ca79eb3c1c55c977b09e01eb995fd3e1906715))
* Update dependency google-api-core to v2.10.1 ([#558](https://togithub.com/googleapis/java-retail/issues/558)) ([217a955](https://togithub.com/googleapis/java-retail/commit/217a955111832eb7a0f71fc837da894d5ef0bc46))
* Update dependency google-auth to v2.11.1 ([#570](https://togithub.com/googleapis/java-retail/issues/570)) ([5380a6e](https://togithub.com/googleapis/java-retail/commit/5380a6e2ec881a46d343ef87511a1f91e3ccaae5))
* Update dependency google-cloud-core to v2.3.2 ([#554](https://togithub.com/googleapis/java-retail/issues/554)) ([8061d2c](https://togithub.com/googleapis/java-retail/commit/8061d2c1ad6279815758852afe29db3feabb19eb))
* Update dependency google-cloud-storage to v2.5.0 ([#559](https://togithub.com/googleapis/java-retail/issues/559)) ([e5a9e2e](https://togithub.com/googleapis/java-retail/commit/e5a9e2e4504835f412800395715e06cc29279608))
* Update dependency google-crc32c to v1.5.0 ([#560](https://togithub.com/googleapis/java-retail/issues/560)) ([b1a9b7b](https://togithub.com/googleapis/java-retail/commit/b1a9b7b96148319f157692530fc2bef61535756a))
* Update dependency googleapis-common-protos to v1.56.4 ([#555](https://togithub.com/googleapis/java-retail/issues/555)) ([7ca1cc7](https://togithub.com/googleapis/java-retail/commit/7ca1cc70abccb4914af7df2f679d37a9dba81f8d))
* Update dependency importlib-metadata to v4.12.0 ([#561](https://togithub.com/googleapis/java-retail/issues/561)) ([f492330](https://togithub.com/googleapis/java-retail/commit/f492330dc8f3e4039049c8e015237248177e1d28))
* Update dependency jeepney to v0.8.0 ([#571](https://togithub.com/googleapis/java-retail/issues/571)) ([dcb7b44](https://togithub.com/googleapis/java-retail/commit/dcb7b4430f1dc8767c0bec5028ec591b3b6707b9))
* Update dependency jinja2 to v3.1.2 ([#572](https://togithub.com/googleapis/java-retail/issues/572)) ([0ebba8d](https://togithub.com/googleapis/java-retail/commit/0ebba8d2b5b5d3ced9743d12dccba83a2527dce9))
* Update dependency keyring to v23.9.3 ([#573](https://togithub.com/googleapis/java-retail/issues/573)) ([83b04aa](https://togithub.com/googleapis/java-retail/commit/83b04aa019f83456093ec488b62471d729cf34ca))
* Update dependency markupsafe to v2.1.1 ([#553](https://togithub.com/googleapis/java-retail/issues/553)) ([58570b9](https://togithub.com/googleapis/java-retail/commit/58570b9a1a1658384ac1a719e5b77d62db3f9533))
* Update dependency protobuf to v3.20.2 ([#574](https://togithub.com/googleapis/java-retail/issues/574)) ([3ef6c0c](https://togithub.com/googleapis/java-retail/commit/3ef6c0cfcf5866a661731764ad85c762bb1cb081))
* Update dependency protobuf to v4 ([#567](https://togithub.com/googleapis/java-retail/issues/567)) ([d5fa224](https://togithub.com/googleapis/java-retail/commit/d5fa224128580e2ec42852442da84684ac38852a))
* Update dependency pyjwt to v2.5.0 ([#562](https://togithub.com/googleapis/java-retail/issues/562)) ([845850c](https://togithub.com/googleapis/java-retail/commit/845850cba4cf80c459ebbea37cb61b84f31e5388))
* Update dependency requests to v2.28.1 ([#563](https://togithub.com/googleapis/java-retail/issues/563)) ([759437f](https://togithub.com/googleapis/java-retail/commit/759437f1935995e18a09f5c492cf9b7421f6f8aa))
* Update dependency typing-extensions to v4.3.0 ([#564](https://togithub.com/googleapis/java-retail/issues/564)) ([afac7b9](https://togithub.com/googleapis/java-retail/commit/afac7b95f6f8dae5878cbbc088f23341566689f7))
* Update dependency zipp to v3.8.1 ([#565](https://togithub.com/googleapis/java-retail/issues/565)) ([1456cc4](https://togithub.com/googleapis/java-retail/commit/1456cc4c4e1b49e9b58b9428415e4d4aeb63dc64))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
github-actions bot pushed a commit that referenced this pull request Oct 5, 2022
🤖 I have created a release *beep* *boop*
---


## [0.6.6](https://togithub.com/googleapis/java-securitycenter-settings/compare/v0.6.5...v0.6.6) (2022-10-05)


### Dependencies

* Update dependency certifi to v2022.9.24 ([#566](https://togithub.com/googleapis/java-securitycenter-settings/issues/566)) ([f9c5954](https://togithub.com/googleapis/java-securitycenter-settings/commit/f9c59549ce924c3d11e3e97c435981ea2e45fdf0))
* Update dependency charset-normalizer to v2.1.1 ([#570](https://togithub.com/googleapis/java-securitycenter-settings/issues/570)) ([1a67981](https://togithub.com/googleapis/java-securitycenter-settings/commit/1a67981fbc19320fbca4abc35b4e6da4a3561b0f))
* Update dependency click to v8.1.3 ([#571](https://togithub.com/googleapis/java-securitycenter-settings/issues/571)) ([a8f784e](https://togithub.com/googleapis/java-securitycenter-settings/commit/a8f784efe83cb56d8ea68a07c3aae2c6a3c7d003))
* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.0.4 ([#577](https://togithub.com/googleapis/java-securitycenter-settings/issues/577)) ([1f98eed](https://togithub.com/googleapis/java-securitycenter-settings/commit/1f98eed175c141b30b06a97e5a7834583b1b9f40))
* Update dependency gcp-releasetool to v1.8.8 ([#567](https://togithub.com/googleapis/java-securitycenter-settings/issues/567)) ([663ab9f](https://togithub.com/googleapis/java-securitycenter-settings/commit/663ab9f0f3ce00f34b5b8fcf0c21f696b0fdf455))
* Update dependency google-api-core to v2.10.1 ([#572](https://togithub.com/googleapis/java-securitycenter-settings/issues/572)) ([8dcd58c](https://togithub.com/googleapis/java-securitycenter-settings/commit/8dcd58c2c65d7d64cbb1b4502f5b53eb7b11777c))
* Update dependency google-auth to v2.12.0 ([#573](https://togithub.com/googleapis/java-securitycenter-settings/issues/573)) ([26df30b](https://togithub.com/googleapis/java-securitycenter-settings/commit/26df30bf335aecb286d92195d6ec44c5f2d52f16))
* Update dependency google-cloud-core to v2.3.2 ([#568](https://togithub.com/googleapis/java-securitycenter-settings/issues/568)) ([dd01a84](https://togithub.com/googleapis/java-securitycenter-settings/commit/dd01a84cbf89b05330ce9f05c5a786c6f40ab03f))
* Update dependency google-cloud-storage to v2.5.0 ([#574](https://togithub.com/googleapis/java-securitycenter-settings/issues/574)) ([4b2b3f5](https://togithub.com/googleapis/java-securitycenter-settings/commit/4b2b3f5625c9be96c788ebcda38093d616beb805))
* Update dependency googleapis-common-protos to v1.56.4 ([#569](https://togithub.com/googleapis/java-securitycenter-settings/issues/569)) ([248ad71](https://togithub.com/googleapis/java-securitycenter-settings/commit/248ad71bfb348cdac2e8ea2091a311a1b97eedba))
* Update dependency jinja2 to v3.1.2 ([#575](https://togithub.com/googleapis/java-securitycenter-settings/issues/575)) ([098d82a](https://togithub.com/googleapis/java-securitycenter-settings/commit/098d82ab1cdbc575c075dcde35baecc1f6778a82))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
suztomo pushed a commit that referenced this pull request Feb 1, 2023
…cp/templates/java_library/.kokoro (#1732) (#572)

build(deps): bump certifi

Bumps [certifi](https://togithub.com/certifi/python-certifi) from 2022.9.24 to 2022.12.7.
- [Release notes](https://togithub.com/certifi/python-certifi/releases)
- [Commits](https://togithub.com/certifi/python-certifi/compare/2022.09.24...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jeff Ching <[email protected]>
Source-Link: https://togithub.com/googleapis/synthtool/commit/ae0d43e5f17972981fe501ecf5a5d20055128bea
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:9de537d592b60e5eac73b374a28263969bae91ecdb29b445e894576fbf54851c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: cloudresourcemanager Issues related to the Resource Manager API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants