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

Deprecate BatchRequest constructor #1333

Merged
merged 6 commits into from
Jul 1, 2019

Conversation

chingor13
Copy link
Collaborator

Users should obtain a BatchRequest instance via their client's batch(HttpRequestInitializer) method.

  • Deprecates the public BatchRequest constructor
  • Logs a WARNING message if you try to make a request against the global batch endpoint.

@chingor13 chingor13 requested a review from a team as a code owner June 27, 2019 16:32
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 27, 2019
@chingor13 chingor13 requested a review from JesseLovelace June 27, 2019 18:15
@@ -232,6 +232,7 @@ public final BatchRequest batch() {
* @return newly created Batch request
*/
public final BatchRequest batch(HttpRequestInitializer httpRequestInitializer) {
@SuppressWarnings("deprecated")
BatchRequest batch =
Copy link

Choose a reason for hiding this comment

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

Should we migrate this to the new API?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This one is the method that users should be using that sets the batch path.

* declared by the service configuration.
*/
private static final String GLOBAL_BATCH_ENDPOINT = "https://www.googleapis.com/batch";
private static final String GLOBAL_BATCH_ENDPOINT_WARNING = "You are using the global batch "
Copy link

Choose a reason for hiding this comment

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

Maybe we can also link to javadoc or a more verbose example?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We would like to migrate the docs off of developers.google.com for these clients, so I migrated the batching and media upload/download docs to the main README in #1334. That will give us a place to target with this message.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added a link to the new docs section in the warning message.

@chingor13 chingor13 merged commit d68a51a into googleapis:master Jul 1, 2019
@chingor13 chingor13 deleted the deprecate-batch-contructor branch July 1, 2019 19:50
chingor13 added a commit that referenced this pull request Jul 1, 2019
* Deprecate the BatchRequest public constructor

* Update Javadoc sample for batch request

* Log a warning if a user is using the global batch endpoint

* Fix equality check for Strings

* Swap equals comparison to avoid possible NPE

* Add URL to visit in the warning message
chingor13 added a commit that referenced this pull request Jul 1, 2019
* Deprecate the BatchRequest public constructor

* Update Javadoc sample for batch request

* Log a warning if a user is using the global batch endpoint

* Fix equality check for Strings

* Swap equals comparison to avoid possible NPE

* Add URL to visit in the warning message
chingor13 added a commit that referenced this pull request Jul 1, 2019
* Deprecate the BatchRequest public constructor

* Update Javadoc sample for batch request

* Log a warning if a user is using the global batch endpoint

* Fix equality check for Strings

* Swap equals comparison to avoid possible NPE

* Add URL to visit in the warning message
chingor13 added a commit that referenced this pull request Jul 1, 2019
* Deprecate the BatchRequest public constructor

* Update Javadoc sample for batch request

* Log a warning if a user is using the global batch endpoint

* Fix equality check for Strings

* Swap equals comparison to avoid possible NPE

* Add URL to visit in the warning message
chingor13 added a commit that referenced this pull request Jul 1, 2019
* Deprecate the BatchRequest public constructor

* Update Javadoc sample for batch request

* Log a warning if a user is using the global batch endpoint

* Fix equality check for Strings

* Swap equals comparison to avoid possible NPE

* Add URL to visit in the warning message
chingor13 added a commit that referenced this pull request Jul 1, 2019
* Deprecate the BatchRequest public constructor

* Update Javadoc sample for batch request

* Log a warning if a user is using the global batch endpoint

* Fix equality check for Strings

* Swap equals comparison to avoid possible NPE

* Add URL to visit in the warning message
chingor13 added a commit that referenced this pull request Jul 1, 2019
* Deprecate the BatchRequest public constructor

* Update Javadoc sample for batch request

* Log a warning if a user is using the global batch endpoint

* Fix equality check for Strings

* Swap equals comparison to avoid possible NPE

* Add URL to visit in the warning message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants