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

docs: add docs and samples #201

Merged
merged 4 commits into from
Dec 21, 2017
Merged

docs: add docs and samples #201

merged 4 commits into from
Dec 21, 2017

Conversation

JustinBeckwith
Copy link
Contributor

@JustinBeckwith JustinBeckwith commented Dec 1, 2017

This includes a few things:

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 1, 2017
@JustinBeckwith JustinBeckwith requested review from ofrobots and a team December 1, 2017 01:23
Copy link
Contributor

@ofrobots ofrobots left a comment

Choose a reason for hiding this comment

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

Commit hygiene: this includes a fix but the abstract suggests that this is a docs-only change. The abstract would be wrong, as per conventional commit guidelines when this is landed. Secondly, even if you are not going to make separate PRs for fix vs. doc, it would be good to put these in separate commits to make reviewing easier. Ideally this should be separate PRs.

README.md Outdated
level for the application independent of the user. This is the recommended approach to authorize
calls to Cloud APIs, particularly when you're building an application that uses Google Compute
Engine.
They are best suited for cases when the call needs to have the same identity and authorization level for the application independent of the user. This is the recommended approach to authorize calls to Cloud APIs, particularly when you're building an application that uses Google Compute Engine.

This comment was marked as spam.

This comment was marked as spam.

// machine. In that case, the desired scopes must be passed in manually. When the code is
// running in GCE or a Managed VM, the scopes are pulled from the GCE metadata server.
// See https://cloud.google.com/compute/docs/authentication for more information.
if (client.createScopedRequired && client.createScopedRequired()) {

This comment was marked as spam.

This comment was marked as spam.

README.md Outdated
* Create a new OAuth2Client, and go through the OAuth2 content
* workflow. Return the full client to the callback.
*/
async function getAuthenticatedClient() {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

}
}

main();

This comment was marked as spam.

This comment was marked as spam.

return client;
}

main();

This comment was marked as spam.

This comment was marked as spam.

});
}

main();

This comment was marked as spam.

This comment was marked as spam.

@JustinBeckwith
Copy link
Contributor Author

@ofrobots yeah, I kind of started this PR without intending to make those changes, but it just kinda happened. I split the origin contents of this one out into #202 (which landed) and #203 (which could use a review). After that lands, I'll rebase this to be true docs/samples only.

@JustinBeckwith
Copy link
Contributor Author

Also, addresses #196

README.md Outdated
Before making your API call, you must be sure the API you're calling has been enabled. Go to **APIs & Auth** > **APIs** in the [Google Developers Console][devconsole] and enable the APIs you'd like to call. For the example below, you must enable the `DNS API`.


#### Choosing the correct credential type automatically

This comment was marked as spam.

This comment was marked as spam.

try {
const adc = await getADC();
const url = `https://www.googleapis.com/dns/v1/projects/${adc.projectId}`;
const res = await adc.client.request({url});

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

README.md Outdated

This client comes with an [OAuth2][oauth] client that allows you to retrieve an access token and refreshes the token and retry the request seamlessly if you also provide an `expiry_date` and the token is expired. The basics of Google's OAuth2 implementation is explained on [Google Authorization and Authentication documentation][authdocs].

In the following examples, you may need a `CLIENT_ID`, `CLIENT_SECRET` and `REDIRECT_URL`. You can find these pieces of information by going to the [Developer Console][devconsole], clicking your project --> APIs & auth --> credentials.

This comment was marked as spam.

This comment was marked as spam.

@JustinBeckwith
Copy link
Contributor Author

Note: test failures are unrelated, and fixed in #209

@JustinBeckwith JustinBeckwith merged commit 61b6747 into googleapis:next Dec 21, 2017
ofrobots pushed a commit that referenced this pull request Jan 9, 2018
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.

None yet

3 participants