// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/factchecktools.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const factchecktools = google.factchecktools('v1alpha1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/userinfo.email'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await factchecktools.pages.delete({
// The name of the resource to delete, in the form of `pages/{page_id\}`.
name: 'pages/my-page',
});
console.log(res.data);
// Example response
// {}
}
main().catch(e => {
console.error(e);
throw e;
});
const {google} = require('googleapis');
const factchecktools = google.factchecktools('v1alpha1');
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/factchecktools.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const factchecktools = google.factchecktools('v1alpha1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/userinfo.email'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await factchecktools.pages.create({
// Request body metadata
requestBody: {
// request body parameters
// {
// "claimReviewAuthor": {},
// "claimReviewMarkups": [],
// "name": "my_name",
// "pageUrl": "my_pageUrl",
// "publishDate": "my_publishDate",
// "versionId": "my_versionId"
// }
},
});
console.log(res.data);
// Example response
// {
// "claimReviewAuthor": {},
// "claimReviewMarkups": [],
// "name": "my_name",
// "pageUrl": "my_pageUrl",
// "publishDate": "my_publishDate",
// "versionId": "my_versionId"
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/factchecktools.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const factchecktools = google.factchecktools('v1alpha1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: [],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await factchecktools.claims.search({
// The BCP-47 language code, such as "en-US" or "sr-Latn". Can be used to restrict results by language, though we do not currently consider the region.
languageCode: 'placeholder-value',
// The maximum age of the returned search results, in days. Age is determined by either claim date or review date, whichever is newer.
maxAgeDays: 'placeholder-value',
// An integer that specifies the current offset (that is, starting result location) in search results. This field is only considered if `page_token` is unset. For example, 0 means to return results starting from the first matching result, and 10 means to return from the 11th result.
offset: 'placeholder-value',
// The pagination size. We will return up to that many results. Defaults to 10 if not set.
pageSize: 'placeholder-value',
// The pagination token. You may provide the `next_page_token` returned from a previous List request, if any, in order to get the next page. All other fields must have the same values as in the previous request.
pageToken: 'placeholder-value',
// Textual query string. Required unless `review_publisher_site_filter` is specified.
query: 'placeholder-value',
// The review publisher site to filter results by, e.g. nytimes.com.
reviewPublisherSiteFilter: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "claims": [],
// "nextPageToken": "my_nextPageToken"
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/books.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const books = google.books('v1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/books'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await books.volumes.list({
// Restrict to volumes by download availability.
download: 'placeholder-value',
// Filter search results.
filter: 'placeholder-value',
// Restrict results to books with this language code.
langRestrict: 'placeholder-value',
// Restrict search to this user's library.
libraryRestrict: 'placeholder-value',
// The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out.
maxAllowedMaturityRating: 'placeholder-value',
// Maximum number of results to return.
maxResults: 'placeholder-value',
// Sort search results.
orderBy: 'placeholder-value',
// Restrict and brand results for partner ID.
partner: 'placeholder-value',
// Restrict to books or magazines.
printType: 'placeholder-value',
// Restrict information returned to a set of selected fields.
projection: 'placeholder-value',
// Full-text search query string.
q: 'placeholder-value',
// Set to true to show books available for preorder. Defaults to false.
showPreorders: 'placeholder-value',
// String to identify the originator of this request.
source: 'placeholder-value',
// Index of the first result to return (starts at 0)
startIndex: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "items": [],
// "kind": "my_kind",
// "totalItems": 0
// }
}
main().catch(e => {
console.error(e);
throw e;
});