GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add apiResponses by ryanseys · Pull Request #448 · googleapis/google-cloud-node

Conversation

@ryanseys

@ryanseys ryanseys commented Mar 17, 2015

Copy link
Copy Markdown
Contributor

Adding apiResponse to the callbacks of every API.

  • BigQuery
  • Datastore
  • PubSub
  • Storage
  • Unit tests
  • Regression tests (doesn't make sense)

Fixes #434

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 17, 2015
@ryanseys ryanseys added the don't merge label Mar 17, 2015
@ryanseys ryanseys self-assigned this Mar 17, 2015
@ryanseys ryanseys added the core label Mar 17, 2015
@stephenplusplus stephenplusplus mentioned this pull request Mar 23, 2015
return Total Rows #431
Closed
@stephenplusplus

stephenplusplus commented Mar 23, 2015

Copy link
Copy Markdown
Contributor

Looking clean so far 👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus stephenplusplus mentioned this pull request Mar 23, 2015
Total Rows in job.getQueryResults() #427
Closed
@ryanseys

ryanseys commented Mar 23, 2015

Copy link
Copy Markdown
Contributor Author

Thanks! Do you think this is appropriate for datastore or what approach should we take there?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Mar 23, 2015

Copy link
Copy Markdown
Contributor

We do a lot of convenience wrapping of the response (all that entityTo___ stuff), so I think the decoded response will be the closest thing to a "raw" response.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ryanseys
ryanseys reviewed Apr 7, 2015
View reviewed changes
Comment thread test/storage/index.js

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ryanseys

ryanseys commented Apr 7, 2015

Copy link
Copy Markdown
Contributor Author

TADA! 🎆 🚨

This PR should be ready for a review. This PR goes down in my books as one of the most tedious and boring PRs of all time. 😄

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ryanseys

ryanseys commented Apr 7, 2015

Copy link
Copy Markdown
Contributor Author

I plan to squash, but I figure it might be easier to review with the nice separate diffs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ryanseys

ryanseys commented Apr 7, 2015

Copy link
Copy Markdown
Contributor Author

I left out file#createReadStream and file#createWriteStream because there's many different types of responses or paths that can be taken where the apiResponses aren't really necessary. And we're dealing with responses that probably won't be any use to the end users. In your (@stephenplusplus) refactor of these methods, it might be nice to consider how the apiResponse objects could be returned with these methods.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ryanseys ryanseys removed the don't merge label Apr 7, 2015
stephenplusplus
stephenplusplus reviewed Apr 13, 2015
View reviewed changes
Comment thread lib/pubsub/topic.js

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Apr 13, 2015

Copy link
Copy Markdown
Contributor

@sindresorhus We've been designing gcloud-node to give users curated, massaged responses from their API calls. The upstream API response can be quite intimidating/non-user friendly, which is why we try to clean it up. However, we've hit a couple places where we forgot to include something and/or didn't want to include it, because it doesn't fit the majority use case. To support cases like these, we want to give users the raw API response in a "it's there if you need it, ignore it if you don't care" kind of way.

This PR is our solution, which tacks on that raw response as the final argument to their callback:

// old
bucket.upload('file.jpg', function (err, file) {});
// new
bucket.upload('file.jpg', function (err, file, apiResponse) {});

Quite a bit uglier, but we have methods that return more than just two arguments to the callback:

// old
dataset.get(key, function (err, results, nextQuery) {});
// new
dataset.get(key, function (err, results, nextQuery, apiResults) {});

I'm wondering if you've come across APIs that have solved for the same problem, and if our solution seems reasonable. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ryanseys

ryanseys commented Apr 15, 2015

Copy link
Copy Markdown
Contributor Author

Seems this has gotten out of sync with master. I'll rebase once we hear back from sindre.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sindresorhus

sindresorhus commented Apr 16, 2015

Copy link
Copy Markdown

I'm wondering if you've come across APIs that have solved for the same problem, and if our solution seems reasonable. Thanks!

I guess that makes sense. I do that in my got module too, and so does request, albeit different order.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus

stephenplusplus commented Apr 16, 2015

Copy link
Copy Markdown
Contributor

Cool, thanks!

Once the out of sync-ness is resolved, I think we're merge-ready.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ryanseys
Add apiResponse parameter to callbacks
b1af0d0
@ryanseys

ryanseys commented Apr 16, 2015

Copy link
Copy Markdown
Contributor Author

Rebased and squashed. Merge when ready!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

stephenplusplus added a commit that referenced this pull request Apr 16, 2015
@stephenplusplus
Merge pull request #448 from ryanseys/add-apiResponses
b191a22
Add apiResponses
@stephenplusplus
stephenplusplus merged commit b191a22 into googleapis:master Apr 16, 2015
@stephenplusplus

stephenplusplus commented Apr 16, 2015

Copy link
Copy Markdown
Contributor

Yay!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ryanseys

ryanseys commented Apr 16, 2015

Copy link
Copy Markdown
Contributor Author

Wewt!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ryanseys
ryanseys deleted the add-apiResponses branch April 16, 2015 21:49
@sunnychow

sunnychow commented Apr 17, 2015

Copy link
Copy Markdown

thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stephenplusplus stephenplusplus mentioned this pull request Apr 21, 2015
callback for bucket.getFiles doesn't return prefixes #491
Closed
@sofisl sofisl mentioned this pull request Sep 16, 2022
migrate code from googleapis/nodejs-os-login #3366
Closed
4 tasks
sofisl pushed a commit that referenced this pull request Sep 16, 2022
@renovate-bot
chore(deps): update dependency sinon to v11 (#448)
2300630
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^10.0.0` -> `^11.0.0`](https://renovatebot.com/diffs/npm/sinon/10.0.0/11.1.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/compatibility-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/confidence-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>sinonjs/sinon</summary>

### [`v11.1.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#&#8203;1110--2021-05-25)

[Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.0.0...31be9a5d5a4762ef01cb195f29024616dfee9ce8)

\==================

-   Add sinon.promise() implementation ([#&#8203;2369](https://togithub.com/sinonjs/sinon/issues/2369))
-   Set wrappedMethod on getters/setters ([#&#8203;2378](https://togithub.com/sinonjs/sinon/issues/2378))
-   \[Docs] Update fake-server usage & descriptions ([#&#8203;2365](https://togithub.com/sinonjs/sinon/issues/2365))
-   Fake docs improvement ([#&#8203;2360](https://togithub.com/sinonjs/sinon/issues/2360))
-   Update nise to 5.1.0 (fixed [#&#8203;2318](https://togithub.com/sinonjs/sinon/issues/2318))

### [`v11.0.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#&#8203;1100--2021-05-24)

[Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.1...v11.0.0)

\==================

-   Explicitly use samsam 6.0.2 with fix for [#&#8203;2345](https://togithub.com/sinonjs/sinon/issues/2345)
-   Update most packages ([#&#8203;2371](https://togithub.com/sinonjs/sinon/issues/2371))
-   Update compatibility docs ([#&#8203;2366](https://togithub.com/sinonjs/sinon/issues/2366))
-   Update packages (includes breaking fake-timers change, see [#&#8203;2352](https://togithub.com/sinonjs/sinon/issues/2352))
-   Warn of potential memory leaks ([#&#8203;2357](https://togithub.com/sinonjs/sinon/issues/2357))
-   Fix clock test errors

### [`v10.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#&#8203;1001--2021-04-08)

[Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.0...v10.0.1)

\==================

-   Upgrade sinon components (bumps y18n to 4.0.1)
-   Bump y18n from 4.0.0 to 4.0.1

</details>

---

### Configuration

📅 **Schedule**: "after 9am and before 3pm" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻️ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-os-login).
This was referenced Jan 30, 2026
migrate code from googleapis/cloud-profiler-nodejs #7067
Closed
migrate code from googleapis/cloud-profiler-nodejs #7068
Closed
migrate code from googleapis/cloud-profiler-nodejs #7071
Closed
GautamSharda pushed a commit that referenced this pull request Feb 2, 2026
@renovate-bot
chore(deps): update dependency @types/semver to v7 (#448)
1e713e0
@GautamSharda GautamSharda mentioned this pull request Feb 2, 2026
migrate code from googleapis/nodejs-logging-winston #7082
Closed
@sofisl sofisl mentioned this pull request Feb 3, 2026
migrate code from googleapis/cloud-profiler-nodejs #7087
Merged
4 tasks
sofisl pushed a commit that referenced this pull request Feb 3, 2026
Ace Nassri
Update dependencies + fix a few tests (#448)
85541cf
* Add semistandard as a devDependency

* Fix storage tests

* Fix language tests

* Update (some) dependencies

* Fix language slackbot tests
sofisl pushed a commit that referenced this pull request Feb 3, 2026
@yoshi-automation @callmehiphop
chore: release 4.0.0 (#448)
45e753e
@sofisl sofisl mentioned this pull request Feb 3, 2026
migrate code from googleapis/nodejs-bigquery #7111
Merged
4 tasks
GautamSharda pushed a commit that referenced this pull request Feb 3, 2026
Ace Nassri
Update dependencies + fix a few tests (#448)
760899c
* Add semistandard as a devDependency

* Fix storage tests

* Fix language tests

* Update (some) dependencies

* Fix language slackbot tests
@GautamSharda GautamSharda mentioned this pull request Feb 3, 2026
migrate code from googleapis/nodejs-logging-winston #7129
Merged
4 tasks
GautamSharda pushed a commit that referenced this pull request Feb 3, 2026
@renovate-bot
chore(deps): update dependency @types/semver to v7 (#448)
7ea2727
@sofisl sofisl mentioned this pull request Feb 5, 2026
migrate code from googleapis/nodejs-datastore #7148
Closed
4 tasks
sofisl pushed a commit that referenced this pull request Feb 5, 2026
Ace Nassri
Update dependencies + fix a few tests (#448)
7c3a201
* Add semistandard as a devDependency

* Fix storage tests

* Fix language tests

* Update (some) dependencies

* Fix language slackbot tests
GautamSharda pushed a commit that referenced this pull request Feb 5, 2026
Ace Nassri
Update dependencies + fix a few tests (#448)
0db0c94
* Add semistandard as a devDependency

* Fix storage tests

* Fix language tests

* Update (some) dependencies

* Fix language slackbot tests
GautamSharda pushed a commit that referenced this pull request Feb 5, 2026
Benjamin E. Coe
docs: mention templates in contributing section of README (#448)
bef5b1a
@GautamSharda GautamSharda mentioned this pull request Feb 5, 2026
migrate code from googleapis/nodejs-error-reporting #7169
Closed
4 tasks
GautamSharda pushed a commit that referenced this pull request Feb 23, 2026
Benjamin E. Coe
docs: mention templates in contributing section of README (#448)
fe37f99
@GautamSharda GautamSharda mentioned this pull request Feb 23, 2026
migrate code from googleapis/nodejs-error-reporting #7294
Closed
sofisl pushed a commit that referenced this pull request Feb 24, 2026
@JustinBeckwith @schmidt-sebastian
refactor: clean up unused imports (#448)
f214886
This was referenced Feb 25, 2026
migrate code from googleapis/nodejs-bigquery-storage #7306
Closed
migrate code from googleapis/nodejs-error-reporting #7308
Merged
This was referenced Feb 26, 2026
migrate code from googleapis/nodejs-firestore #7311
Closed
migrate code from googleapis/nodejs-firestore #7410
Merged
This was referenced Mar 5, 2026
migrate code from googleapis/nodejs-bigquery-storage #7496
Merged
migrate code from googleapis/nodejs-logging #7514
Merged
@meltsufin meltsufin mentioned this pull request Mar 10, 2026
chore: migrate code from googleapis/nodejs-logging #7550
Merged
This was referenced Mar 11, 2026
migrate code from googleapis/nodejs-pubsub #7592
Merged
migrate code from googleapis/nodejs-common #7597
Merged
@GautamSharda GautamSharda mentioned this pull request Mar 23, 2026
migrate code from googleapis/nodejs-bigtable #7852
Merged
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@ryanseys ryanseys

Labels

cla: yes This human has signed the Contributor License Agreement. core

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Return raw response object for all API calls

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@ryanseys @stephenplusplus @sindresorhus @sunnychow @googlebot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.