mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add Google APIs typings (#19083)
* Add Google APIs typings * [gapi.cliebt.* ] Add version as part of typings name and fix gapi.client tslint errors * versions should not get their own folders fixing a few typos using /** syntax so comments show up in editors export only actual (last) version for now * export only actual (last) version for now * merge namespaces and remove unnecessary namespace qualifiers * remove namespace qualifier for gapi.client.Request from nested namespaces and change Request base interface to Promise * disable await-promise rule * fix collision between gapi.client.Request and Request from nested namespace disable no-irregular-whitespace rule * sort properties and namespace resources * remove empty comments sort resources amd methods in tests and readme.md * update 'this is autogenerated file' banner to remove this text from gapi.client namespace hint use multiline comments when comment has several lines * implement no-trailing-whitespace, no-padding, max-line-length, await-promise, no-irregular-whitespace rules * add strictFunctionTypes to tsconfig * fix "Whitespace within parentheses is not allowed" rule * fix ts-lint rules * fixes * remove deprecated replicapool and replicapoolupdater api * fix no-irregular-whitespace * fix no-irregular-whitespace
This commit is contained in:
parent
c7a368b276
commit
4f8a3d571b
@ -0,0 +1,22 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('acceleratedmobilepageurl', 'v1', () => {
|
||||
/** now we can use gapi.client.acceleratedmobilepageurl */
|
||||
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/**
|
||||
* Returns AMP URL(s) and equivalent
|
||||
* [AMP Cache URL(s)](/amp/cache/overview#amp-cache-url-format).
|
||||
*/
|
||||
await gapi.client.ampUrls.batchGet({
|
||||
});
|
||||
}
|
||||
});
|
||||
97
types/gapi.client.acceleratedmobilepageurl/index.d.ts
vendored
Normal file
97
types/gapi.client.acceleratedmobilepageurl/index.d.ts
vendored
Normal file
@ -0,0 +1,97 @@
|
||||
// Type definitions for Google Accelerated Mobile Pages (AMP) URL API v1 1.0
|
||||
// Project: https://developers.google.com/amp/cache/
|
||||
// Definitions by: Bolisov Alexey <https://github.com/Bolisov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// IMPORTANT
|
||||
// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
// Generated from: https://acceleratedmobilepageurl.googleapis.com/$discovery/rest?version=v1
|
||||
|
||||
/// <reference types="gapi.client" />
|
||||
|
||||
declare namespace gapi.client {
|
||||
/** Load Accelerated Mobile Pages (AMP) URL API v1 */
|
||||
function load(name: "acceleratedmobilepageurl", version: "v1"): PromiseLike<void>;
|
||||
function load(name: "acceleratedmobilepageurl", version: "v1", callback: () => any): void;
|
||||
|
||||
const ampUrls: acceleratedmobilepageurl.AmpUrlsResource;
|
||||
|
||||
namespace acceleratedmobilepageurl {
|
||||
interface AmpUrl {
|
||||
/** The AMP URL pointing to the publisher's web server. */
|
||||
ampUrl?: string;
|
||||
/**
|
||||
* The [AMP Cache URL](/amp/cache/overview#amp-cache-url-format) pointing to
|
||||
* the cached document in the Google AMP Cache.
|
||||
*/
|
||||
cdnAmpUrl?: string;
|
||||
/** The original non-AMP URL. */
|
||||
originalUrl?: string;
|
||||
}
|
||||
interface AmpUrlError {
|
||||
/** The error code of an API call. */
|
||||
errorCode?: string;
|
||||
/** An optional descriptive error message. */
|
||||
errorMessage?: string;
|
||||
/** The original non-AMP URL. */
|
||||
originalUrl?: string;
|
||||
}
|
||||
interface BatchGetAmpUrlsRequest {
|
||||
/** The lookup_strategy being requested. */
|
||||
lookupStrategy?: string;
|
||||
/**
|
||||
* List of URLs to look up for the paired AMP URLs.
|
||||
* The URLs are case-sensitive. Up to 50 URLs per lookup
|
||||
* (see [Usage Limits](/amp/cache/reference/limits)).
|
||||
*/
|
||||
urls?: string[];
|
||||
}
|
||||
interface BatchGetAmpUrlsResponse {
|
||||
/**
|
||||
* For each URL in BatchAmpUrlsRequest, the URL response. The response might
|
||||
* not be in the same order as URLs in the batch request.
|
||||
* If BatchAmpUrlsRequest contains duplicate URLs, AmpUrl is generated
|
||||
* only once.
|
||||
*/
|
||||
ampUrls?: AmpUrl[];
|
||||
/** The errors for requested URLs that have no AMP URL. */
|
||||
urlErrors?: AmpUrlError[];
|
||||
}
|
||||
interface AmpUrlsResource {
|
||||
/**
|
||||
* Returns AMP URL(s) and equivalent
|
||||
* [AMP Cache URL(s)](/amp/cache/overview#amp-cache-url-format).
|
||||
*/
|
||||
batchGet(request: {
|
||||
/** V1 error format. */
|
||||
"$.xgafv"?: string;
|
||||
/** OAuth access token. */
|
||||
access_token?: string;
|
||||
/** Data format for response. */
|
||||
alt?: string;
|
||||
/** OAuth bearer token. */
|
||||
bearer_token?: string;
|
||||
/** JSONP */
|
||||
callback?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Pretty-print response. */
|
||||
pp?: boolean;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
||||
uploadType?: string;
|
||||
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
||||
upload_protocol?: string;
|
||||
}): Request<BatchGetAmpUrlsResponse>;
|
||||
}
|
||||
}
|
||||
}
|
||||
42
types/gapi.client.acceleratedmobilepageurl/readme.md
Normal file
42
types/gapi.client.acceleratedmobilepageurl/readme.md
Normal file
@ -0,0 +1,42 @@
|
||||
# TypeScript typings for Accelerated Mobile Pages (AMP) URL API v1
|
||||
Retrieves the list of AMP URLs (and equivalent AMP Cache URLs) for a given list of public URL(s).
|
||||
|
||||
For detailed description please check [documentation](https://developers.google.com/amp/cache/).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for Accelerated Mobile Pages (AMP) URL API:
|
||||
```
|
||||
npm install @types/gapi.client.acceleratedmobilepageurl@v1 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('acceleratedmobilepageurl', 'v1', () => {
|
||||
// now we can use gapi.client.acceleratedmobilepageurl
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
|
||||
After that you can use Accelerated Mobile Pages (AMP) URL API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Returns AMP URL(s) and equivalent
|
||||
[AMP Cache URL(s)](/amp/cache/overview#amp-cache-url-format).
|
||||
*/
|
||||
await gapi.client.ampUrls.batchGet({ });
|
||||
```
|
||||
24
types/gapi.client.acceleratedmobilepageurl/tsconfig.json
Normal file
24
types/gapi.client.acceleratedmobilepageurl/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.acceleratedmobilepageurl-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.acceleratedmobilepageurl/tslint.json
Normal file
8
types/gapi.client.acceleratedmobilepageurl/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,213 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('adexchangebuyer', 'v1.4', () => {
|
||||
/** now we can use gapi.client.adexchangebuyer */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** Manage your Ad Exchange buyer account configuration */
|
||||
'https://www.googleapis.com/auth/adexchange.buyer',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/** Gets one account by ID. */
|
||||
await gapi.client.accounts.get({
|
||||
id: 1,
|
||||
});
|
||||
/** Retrieves the authenticated user's list of accounts. */
|
||||
await gapi.client.accounts.list({
|
||||
});
|
||||
/** Updates an existing account. This method supports patch semantics. */
|
||||
await gapi.client.accounts.patch({
|
||||
confirmUnsafeAccountChange: true,
|
||||
id: 2,
|
||||
});
|
||||
/** Updates an existing account. */
|
||||
await gapi.client.accounts.update({
|
||||
confirmUnsafeAccountChange: true,
|
||||
id: 2,
|
||||
});
|
||||
/** Returns the billing information for one account specified by account ID. */
|
||||
await gapi.client.billingInfo.get({
|
||||
accountId: 1,
|
||||
});
|
||||
/** Retrieves a list of billing information for all accounts of the authenticated user. */
|
||||
await gapi.client.billingInfo.list({
|
||||
});
|
||||
/** Returns the budget information for the adgroup specified by the accountId and billingId. */
|
||||
await gapi.client.budget.get({
|
||||
accountId: "accountId",
|
||||
billingId: "billingId",
|
||||
});
|
||||
/**
|
||||
* Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. This method
|
||||
* supports patch semantics.
|
||||
*/
|
||||
await gapi.client.budget.patch({
|
||||
accountId: "accountId",
|
||||
billingId: "billingId",
|
||||
});
|
||||
/** Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. */
|
||||
await gapi.client.budget.update({
|
||||
accountId: "accountId",
|
||||
billingId: "billingId",
|
||||
});
|
||||
/** Add a deal id association for the creative. */
|
||||
await gapi.client.creatives.addDeal({
|
||||
accountId: 1,
|
||||
buyerCreativeId: "buyerCreativeId",
|
||||
dealId: "dealId",
|
||||
});
|
||||
/** Gets the status for a single creative. A creative will be available 30-40 minutes after submission. */
|
||||
await gapi.client.creatives.get({
|
||||
accountId: 1,
|
||||
buyerCreativeId: "buyerCreativeId",
|
||||
});
|
||||
/** Submit a new creative. */
|
||||
await gapi.client.creatives.insert({
|
||||
});
|
||||
/** Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission. */
|
||||
await gapi.client.creatives.list({
|
||||
accountId: 1,
|
||||
buyerCreativeId: "buyerCreativeId",
|
||||
dealsStatusFilter: "dealsStatusFilter",
|
||||
maxResults: 4,
|
||||
openAuctionStatusFilter: "openAuctionStatusFilter",
|
||||
pageToken: "pageToken",
|
||||
});
|
||||
/** Lists the external deal ids associated with the creative. */
|
||||
await gapi.client.creatives.listDeals({
|
||||
accountId: 1,
|
||||
buyerCreativeId: "buyerCreativeId",
|
||||
});
|
||||
/** Remove a deal id associated with the creative. */
|
||||
await gapi.client.creatives.removeDeal({
|
||||
accountId: 1,
|
||||
buyerCreativeId: "buyerCreativeId",
|
||||
dealId: "dealId",
|
||||
});
|
||||
/** Delete the specified deals from the proposal */
|
||||
await gapi.client.marketplacedeals.delete({
|
||||
proposalId: "proposalId",
|
||||
});
|
||||
/** Add new deals for the specified proposal */
|
||||
await gapi.client.marketplacedeals.insert({
|
||||
proposalId: "proposalId",
|
||||
});
|
||||
/** List all the deals for a given proposal */
|
||||
await gapi.client.marketplacedeals.list({
|
||||
pqlQuery: "pqlQuery",
|
||||
proposalId: "proposalId",
|
||||
});
|
||||
/** Replaces all the deals in the proposal with the passed in deals */
|
||||
await gapi.client.marketplacedeals.update({
|
||||
proposalId: "proposalId",
|
||||
});
|
||||
/** Add notes to the proposal */
|
||||
await gapi.client.marketplacenotes.insert({
|
||||
proposalId: "proposalId",
|
||||
});
|
||||
/** Get all the notes associated with a proposal */
|
||||
await gapi.client.marketplacenotes.list({
|
||||
pqlQuery: "pqlQuery",
|
||||
proposalId: "proposalId",
|
||||
});
|
||||
/** Update a given private auction proposal */
|
||||
await gapi.client.marketplaceprivateauction.updateproposal({
|
||||
privateAuctionId: "privateAuctionId",
|
||||
});
|
||||
/** Retrieves the authenticated user's list of performance metrics. */
|
||||
await gapi.client.performanceReport.list({
|
||||
accountId: "accountId",
|
||||
endDateTime: "endDateTime",
|
||||
maxResults: 3,
|
||||
pageToken: "pageToken",
|
||||
startDateTime: "startDateTime",
|
||||
});
|
||||
/** Deletes an existing pretargeting config. */
|
||||
await gapi.client.pretargetingConfig.delete({
|
||||
accountId: "accountId",
|
||||
configId: "configId",
|
||||
});
|
||||
/** Gets a specific pretargeting configuration */
|
||||
await gapi.client.pretargetingConfig.get({
|
||||
accountId: "accountId",
|
||||
configId: "configId",
|
||||
});
|
||||
/** Inserts a new pretargeting configuration. */
|
||||
await gapi.client.pretargetingConfig.insert({
|
||||
accountId: "accountId",
|
||||
});
|
||||
/** Retrieves a list of the authenticated user's pretargeting configurations. */
|
||||
await gapi.client.pretargetingConfig.list({
|
||||
accountId: "accountId",
|
||||
});
|
||||
/** Updates an existing pretargeting config. This method supports patch semantics. */
|
||||
await gapi.client.pretargetingConfig.patch({
|
||||
accountId: "accountId",
|
||||
configId: "configId",
|
||||
});
|
||||
/** Updates an existing pretargeting config. */
|
||||
await gapi.client.pretargetingConfig.update({
|
||||
accountId: "accountId",
|
||||
configId: "configId",
|
||||
});
|
||||
/** Gets the requested product by id. */
|
||||
await gapi.client.products.get({
|
||||
productId: "productId",
|
||||
});
|
||||
/** Gets the requested product. */
|
||||
await gapi.client.products.search({
|
||||
pqlQuery: "pqlQuery",
|
||||
});
|
||||
/** Get a proposal given its id */
|
||||
await gapi.client.proposals.get({
|
||||
proposalId: "proposalId",
|
||||
});
|
||||
/** Create the given list of proposals */
|
||||
await gapi.client.proposals.insert({
|
||||
});
|
||||
/** Update the given proposal. This method supports patch semantics. */
|
||||
await gapi.client.proposals.patch({
|
||||
proposalId: "proposalId",
|
||||
revisionNumber: "revisionNumber",
|
||||
updateAction: "updateAction",
|
||||
});
|
||||
/** Search for proposals using pql query */
|
||||
await gapi.client.proposals.search({
|
||||
pqlQuery: "pqlQuery",
|
||||
});
|
||||
/** Update the given proposal to indicate that setup has been completed. */
|
||||
await gapi.client.proposals.setupcomplete({
|
||||
proposalId: "proposalId",
|
||||
});
|
||||
/** Update the given proposal */
|
||||
await gapi.client.proposals.update({
|
||||
proposalId: "proposalId",
|
||||
revisionNumber: "revisionNumber",
|
||||
updateAction: "updateAction",
|
||||
});
|
||||
/** Gets the requested publisher profile(s) by publisher accountId. */
|
||||
await gapi.client.pubprofiles.list({
|
||||
accountId: 1,
|
||||
});
|
||||
}
|
||||
});
|
||||
1989
types/gapi.client.adexchangebuyer/index.d.ts
vendored
Normal file
1989
types/gapi.client.adexchangebuyer/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
244
types/gapi.client.adexchangebuyer/readme.md
Normal file
244
types/gapi.client.adexchangebuyer/readme.md
Normal file
@ -0,0 +1,244 @@
|
||||
# TypeScript typings for Ad Exchange Buyer API v1.4
|
||||
Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports.
|
||||
For detailed description please check [documentation](https://developers.google.com/ad-exchange/buyer-rest).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for Ad Exchange Buyer API:
|
||||
```
|
||||
npm install @types/gapi.client.adexchangebuyer@v1.4 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('adexchangebuyer', 'v1.4', () => {
|
||||
// now we can use gapi.client.adexchangebuyer
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// Manage your Ad Exchange buyer account configuration
|
||||
'https://www.googleapis.com/auth/adexchange.buyer',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use Ad Exchange Buyer API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Gets one account by ID.
|
||||
*/
|
||||
await gapi.client.accounts.get({ id: 1, });
|
||||
|
||||
/*
|
||||
Retrieves the authenticated user's list of accounts.
|
||||
*/
|
||||
await gapi.client.accounts.list({ });
|
||||
|
||||
/*
|
||||
Updates an existing account. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.accounts.patch({ id: 1, });
|
||||
|
||||
/*
|
||||
Updates an existing account.
|
||||
*/
|
||||
await gapi.client.accounts.update({ id: 1, });
|
||||
|
||||
/*
|
||||
Returns the billing information for one account specified by account ID.
|
||||
*/
|
||||
await gapi.client.billingInfo.get({ accountId: 1, });
|
||||
|
||||
/*
|
||||
Retrieves a list of billing information for all accounts of the authenticated user.
|
||||
*/
|
||||
await gapi.client.billingInfo.list({ });
|
||||
|
||||
/*
|
||||
Returns the budget information for the adgroup specified by the accountId and billingId.
|
||||
*/
|
||||
await gapi.client.budget.get({ accountId: "accountId", billingId: "billingId", });
|
||||
|
||||
/*
|
||||
Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.budget.patch({ accountId: "accountId", billingId: "billingId", });
|
||||
|
||||
/*
|
||||
Updates the budget amount for the budget of the adgroup specified by the accountId and billingId, with the budget amount in the request.
|
||||
*/
|
||||
await gapi.client.budget.update({ accountId: "accountId", billingId: "billingId", });
|
||||
|
||||
/*
|
||||
Add a deal id association for the creative.
|
||||
*/
|
||||
await gapi.client.creatives.addDeal({ accountId: 1, buyerCreativeId: "buyerCreativeId", dealId: "dealId", });
|
||||
|
||||
/*
|
||||
Gets the status for a single creative. A creative will be available 30-40 minutes after submission.
|
||||
*/
|
||||
await gapi.client.creatives.get({ accountId: 1, buyerCreativeId: "buyerCreativeId", });
|
||||
|
||||
/*
|
||||
Submit a new creative.
|
||||
*/
|
||||
await gapi.client.creatives.insert({ });
|
||||
|
||||
/*
|
||||
Retrieves a list of the authenticated user's active creatives. A creative will be available 30-40 minutes after submission.
|
||||
*/
|
||||
await gapi.client.creatives.list({ });
|
||||
|
||||
/*
|
||||
Lists the external deal ids associated with the creative.
|
||||
*/
|
||||
await gapi.client.creatives.listDeals({ accountId: 1, buyerCreativeId: "buyerCreativeId", });
|
||||
|
||||
/*
|
||||
Remove a deal id associated with the creative.
|
||||
*/
|
||||
await gapi.client.creatives.removeDeal({ accountId: 1, buyerCreativeId: "buyerCreativeId", dealId: "dealId", });
|
||||
|
||||
/*
|
||||
Delete the specified deals from the proposal
|
||||
*/
|
||||
await gapi.client.marketplacedeals.delete({ proposalId: "proposalId", });
|
||||
|
||||
/*
|
||||
Add new deals for the specified proposal
|
||||
*/
|
||||
await gapi.client.marketplacedeals.insert({ proposalId: "proposalId", });
|
||||
|
||||
/*
|
||||
List all the deals for a given proposal
|
||||
*/
|
||||
await gapi.client.marketplacedeals.list({ proposalId: "proposalId", });
|
||||
|
||||
/*
|
||||
Replaces all the deals in the proposal with the passed in deals
|
||||
*/
|
||||
await gapi.client.marketplacedeals.update({ proposalId: "proposalId", });
|
||||
|
||||
/*
|
||||
Add notes to the proposal
|
||||
*/
|
||||
await gapi.client.marketplacenotes.insert({ proposalId: "proposalId", });
|
||||
|
||||
/*
|
||||
Get all the notes associated with a proposal
|
||||
*/
|
||||
await gapi.client.marketplacenotes.list({ proposalId: "proposalId", });
|
||||
|
||||
/*
|
||||
Update a given private auction proposal
|
||||
*/
|
||||
await gapi.client.marketplaceprivateauction.updateproposal({ privateAuctionId: "privateAuctionId", });
|
||||
|
||||
/*
|
||||
Retrieves the authenticated user's list of performance metrics.
|
||||
*/
|
||||
await gapi.client.performanceReport.list({ accountId: "accountId", endDateTime: "endDateTime", startDateTime: "startDateTime", });
|
||||
|
||||
/*
|
||||
Deletes an existing pretargeting config.
|
||||
*/
|
||||
await gapi.client.pretargetingConfig.delete({ accountId: "accountId", configId: "configId", });
|
||||
|
||||
/*
|
||||
Gets a specific pretargeting configuration
|
||||
*/
|
||||
await gapi.client.pretargetingConfig.get({ accountId: "accountId", configId: "configId", });
|
||||
|
||||
/*
|
||||
Inserts a new pretargeting configuration.
|
||||
*/
|
||||
await gapi.client.pretargetingConfig.insert({ accountId: "accountId", });
|
||||
|
||||
/*
|
||||
Retrieves a list of the authenticated user's pretargeting configurations.
|
||||
*/
|
||||
await gapi.client.pretargetingConfig.list({ accountId: "accountId", });
|
||||
|
||||
/*
|
||||
Updates an existing pretargeting config. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.pretargetingConfig.patch({ accountId: "accountId", configId: "configId", });
|
||||
|
||||
/*
|
||||
Updates an existing pretargeting config.
|
||||
*/
|
||||
await gapi.client.pretargetingConfig.update({ accountId: "accountId", configId: "configId", });
|
||||
|
||||
/*
|
||||
Gets the requested product by id.
|
||||
*/
|
||||
await gapi.client.products.get({ productId: "productId", });
|
||||
|
||||
/*
|
||||
Gets the requested product.
|
||||
*/
|
||||
await gapi.client.products.search({ });
|
||||
|
||||
/*
|
||||
Get a proposal given its id
|
||||
*/
|
||||
await gapi.client.proposals.get({ proposalId: "proposalId", });
|
||||
|
||||
/*
|
||||
Create the given list of proposals
|
||||
*/
|
||||
await gapi.client.proposals.insert({ });
|
||||
|
||||
/*
|
||||
Update the given proposal. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.proposals.patch({ proposalId: "proposalId", revisionNumber: "revisionNumber", updateAction: "updateAction", });
|
||||
|
||||
/*
|
||||
Search for proposals using pql query
|
||||
*/
|
||||
await gapi.client.proposals.search({ });
|
||||
|
||||
/*
|
||||
Update the given proposal to indicate that setup has been completed.
|
||||
*/
|
||||
await gapi.client.proposals.setupcomplete({ proposalId: "proposalId", });
|
||||
|
||||
/*
|
||||
Update the given proposal
|
||||
*/
|
||||
await gapi.client.proposals.update({ proposalId: "proposalId", revisionNumber: "revisionNumber", updateAction: "updateAction", });
|
||||
|
||||
/*
|
||||
Gets the requested publisher profile(s) by publisher accountId.
|
||||
*/
|
||||
await gapi.client.pubprofiles.list({ accountId: 1, });
|
||||
```
|
||||
24
types/gapi.client.adexchangebuyer/tsconfig.json
Normal file
24
types/gapi.client.adexchangebuyer/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.adexchangebuyer-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.adexchangebuyer/tslint.json
Normal file
8
types/gapi.client.adexchangebuyer/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('adexchangebuyer2', 'v2beta1', () => {
|
||||
/** now we can use gapi.client.adexchangebuyer2 */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** Manage your Ad Exchange buyer account configuration */
|
||||
'https://www.googleapis.com/auth/adexchange.buyer',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
}
|
||||
});
|
||||
2400
types/gapi.client.adexchangebuyer2/index.d.ts
vendored
Normal file
2400
types/gapi.client.adexchangebuyer2/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
54
types/gapi.client.adexchangebuyer2/readme.md
Normal file
54
types/gapi.client.adexchangebuyer2/readme.md
Normal file
@ -0,0 +1,54 @@
|
||||
# TypeScript typings for Ad Exchange Buyer API II v2beta1
|
||||
Accesses the latest features for managing Ad Exchange accounts, Real-Time Bidding configurations and auction metrics, and Marketplace programmatic deals.
|
||||
For detailed description please check [documentation](https://developers.google.com/ad-exchange/buyer-rest/reference/rest/).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for Ad Exchange Buyer API II:
|
||||
```
|
||||
npm install @types/gapi.client.adexchangebuyer2@v2beta1 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('adexchangebuyer2', 'v2beta1', () => {
|
||||
// now we can use gapi.client.adexchangebuyer2
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// Manage your Ad Exchange buyer account configuration
|
||||
'https://www.googleapis.com/auth/adexchange.buyer',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use Ad Exchange Buyer API II resources:
|
||||
|
||||
```typescript
|
||||
```
|
||||
24
types/gapi.client.adexchangebuyer2/tsconfig.json
Normal file
24
types/gapi.client.adexchangebuyer2/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.adexchangebuyer2-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.adexchangebuyer2/tslint.json
Normal file
8
types/gapi.client.adexchangebuyer2/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('adexchangeseller', 'v2.0', () => {
|
||||
/** now we can use gapi.client.adexchangeseller */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** View and manage your Ad Exchange data */
|
||||
'https://www.googleapis.com/auth/adexchange.seller',
|
||||
/** View your Ad Exchange data */
|
||||
'https://www.googleapis.com/auth/adexchange.seller.readonly',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/** Get information about the selected Ad Exchange account. */
|
||||
await gapi.client.accounts.get({
|
||||
accountId: "accountId",
|
||||
});
|
||||
/** List all accounts available to this Ad Exchange account. */
|
||||
await gapi.client.accounts.list({
|
||||
maxResults: 1,
|
||||
pageToken: "pageToken",
|
||||
});
|
||||
}
|
||||
});
|
||||
664
types/gapi.client.adexchangeseller/index.d.ts
vendored
Normal file
664
types/gapi.client.adexchangeseller/index.d.ts
vendored
Normal file
@ -0,0 +1,664 @@
|
||||
// Type definitions for Google Ad Exchange Seller API v2.0 2.0
|
||||
// Project: https://developers.google.com/ad-exchange/seller-rest/
|
||||
// Definitions by: Bolisov Alexey <https://github.com/Bolisov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// IMPORTANT
|
||||
// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
// Generated from: https://www.googleapis.com/discovery/v1/apis/adexchangeseller/v2.0/rest
|
||||
|
||||
/// <reference types="gapi.client" />
|
||||
|
||||
declare namespace gapi.client {
|
||||
/** Load Ad Exchange Seller API v2.0 */
|
||||
function load(name: "adexchangeseller", version: "v2.0"): PromiseLike<void>;
|
||||
function load(name: "adexchangeseller", version: "v2.0", callback: () => any): void;
|
||||
|
||||
const accounts: adexchangeseller.AccountsResource;
|
||||
|
||||
namespace adexchangeseller {
|
||||
interface Account {
|
||||
/** Unique identifier of this account. */
|
||||
id?: string;
|
||||
/** Kind of resource this is, in this case adexchangeseller#account. */
|
||||
kind?: string;
|
||||
/** Name of this account. */
|
||||
name?: string;
|
||||
}
|
||||
interface Accounts {
|
||||
/** ETag of this response for caching purposes. */
|
||||
etag?: string;
|
||||
/** The accounts returned in this list response. */
|
||||
items?: Account[];
|
||||
/** Kind of list this is, in this case adexchangeseller#accounts. */
|
||||
kind?: string;
|
||||
/** Continuation token used to page through accounts. To retrieve the next page of results, set the next request's "pageToken" value to this. */
|
||||
nextPageToken?: string;
|
||||
}
|
||||
interface AdClient {
|
||||
/** Whether this ad client is opted in to ARC. */
|
||||
arcOptIn?: boolean;
|
||||
/** Unique identifier of this ad client. */
|
||||
id?: string;
|
||||
/** Kind of resource this is, in this case adexchangeseller#adClient. */
|
||||
kind?: string;
|
||||
/** This ad client's product code, which corresponds to the PRODUCT_CODE report dimension. */
|
||||
productCode?: string;
|
||||
/** Whether this ad client supports being reported on. */
|
||||
supportsReporting?: boolean;
|
||||
}
|
||||
interface AdClients {
|
||||
/** ETag of this response for caching purposes. */
|
||||
etag?: string;
|
||||
/** The ad clients returned in this list response. */
|
||||
items?: AdClient[];
|
||||
/** Kind of list this is, in this case adexchangeseller#adClients. */
|
||||
kind?: string;
|
||||
/** Continuation token used to page through ad clients. To retrieve the next page of results, set the next request's "pageToken" value to this. */
|
||||
nextPageToken?: string;
|
||||
}
|
||||
interface Alert {
|
||||
/** Unique identifier of this alert. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */
|
||||
id?: string;
|
||||
/** Kind of resource this is, in this case adexchangeseller#alert. */
|
||||
kind?: string;
|
||||
/** The localized alert message. */
|
||||
message?: string;
|
||||
/** Severity of this alert. Possible values: INFO, WARNING, SEVERE. */
|
||||
severity?: string;
|
||||
/**
|
||||
* Type of this alert. Possible values: SELF_HOLD, MIGRATED_TO_BILLING3, ADDRESS_PIN_VERIFICATION, PHONE_PIN_VERIFICATION, CORPORATE_ENTITY,
|
||||
* GRAYLISTED_PUBLISHER, API_HOLD.
|
||||
*/
|
||||
type?: string;
|
||||
}
|
||||
interface Alerts {
|
||||
/** The alerts returned in this list response. */
|
||||
items?: Alert[];
|
||||
/** Kind of list this is, in this case adexchangeseller#alerts. */
|
||||
kind?: string;
|
||||
}
|
||||
interface CustomChannel {
|
||||
/** Code of this custom channel, not necessarily unique across ad clients. */
|
||||
code?: string;
|
||||
/** Unique identifier of this custom channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */
|
||||
id?: string;
|
||||
/** Kind of resource this is, in this case adexchangeseller#customChannel. */
|
||||
kind?: string;
|
||||
/** Name of this custom channel. */
|
||||
name?: string;
|
||||
/** The targeting information of this custom channel, if activated. */
|
||||
targetingInfo?: {
|
||||
/** The name used to describe this channel externally. */
|
||||
adsAppearOn?: string;
|
||||
/** The external description of the channel. */
|
||||
description?: string;
|
||||
/**
|
||||
* The locations in which ads appear. (Only valid for content and mobile content ads). Acceptable values for content ads are: TOP_LEFT, TOP_CENTER,
|
||||
* TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT, MULTIPLE_LOCATIONS. Acceptable values for mobile content
|
||||
* ads are: TOP, MIDDLE, BOTTOM, MULTIPLE_LOCATIONS.
|
||||
*/
|
||||
location?: string;
|
||||
/** The language of the sites ads will be displayed on. */
|
||||
siteLanguage?: string;
|
||||
};
|
||||
}
|
||||
interface CustomChannels {
|
||||
/** ETag of this response for caching purposes. */
|
||||
etag?: string;
|
||||
/** The custom channels returned in this list response. */
|
||||
items?: CustomChannel[];
|
||||
/** Kind of list this is, in this case adexchangeseller#customChannels. */
|
||||
kind?: string;
|
||||
/** Continuation token used to page through custom channels. To retrieve the next page of results, set the next request's "pageToken" value to this. */
|
||||
nextPageToken?: string;
|
||||
}
|
||||
interface Metadata {
|
||||
items?: ReportingMetadataEntry[];
|
||||
/** Kind of list this is, in this case adexchangeseller#metadata. */
|
||||
kind?: string;
|
||||
}
|
||||
interface PreferredDeal {
|
||||
/** The name of the advertiser this deal is for. */
|
||||
advertiserName?: string;
|
||||
/** The name of the buyer network this deal is for. */
|
||||
buyerNetworkName?: string;
|
||||
/** The currency code that applies to the fixed_cpm value. If not set then assumed to be USD. */
|
||||
currencyCode?: string;
|
||||
/** Time when this deal stops being active in seconds since the epoch (GMT). If not set then this deal is valid until manually disabled by the publisher. */
|
||||
endTime?: string;
|
||||
/**
|
||||
* The fixed price for this preferred deal. In cpm micros of currency according to currencyCode. If set, then this preferred deal is eligible for the
|
||||
* fixed price tier of buying (highest priority, pay exactly the configured fixed price).
|
||||
*/
|
||||
fixedCpm?: string;
|
||||
/** Unique identifier of this preferred deal. */
|
||||
id?: string;
|
||||
/** Kind of resource this is, in this case adexchangeseller#preferredDeal. */
|
||||
kind?: string;
|
||||
/** Time when this deal becomes active in seconds since the epoch (GMT). If not set then this deal is active immediately upon creation. */
|
||||
startTime?: string;
|
||||
}
|
||||
interface PreferredDeals {
|
||||
/** The preferred deals returned in this list response. */
|
||||
items?: PreferredDeal[];
|
||||
/** Kind of list this is, in this case adexchangeseller#preferredDeals. */
|
||||
kind?: string;
|
||||
}
|
||||
interface Report {
|
||||
/** The averages of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty. */
|
||||
averages?: string[];
|
||||
/**
|
||||
* The header information of the columns requested in the report. This is a list of headers; one for each dimension in the request, followed by one for
|
||||
* each metric in the request.
|
||||
*/
|
||||
headers?: Array<{
|
||||
/** The currency of this column. Only present if the header type is METRIC_CURRENCY. */
|
||||
currency?: string;
|
||||
/** The name of the header. */
|
||||
name?: string;
|
||||
/** The type of the header; one of DIMENSION, METRIC_TALLY, METRIC_RATIO, or METRIC_CURRENCY. */
|
||||
type?: string;
|
||||
}>;
|
||||
/** Kind this is, in this case adexchangeseller#report. */
|
||||
kind?: string;
|
||||
/**
|
||||
* The output rows of the report. Each row is a list of cells; one for each dimension in the request, followed by one for each metric in the request. The
|
||||
* dimension cells contain strings, and the metric cells contain numbers.
|
||||
*/
|
||||
rows?: string[][];
|
||||
/**
|
||||
* The total number of rows matched by the report request. Fewer rows may be returned in the response due to being limited by the row count requested or
|
||||
* the report row limit.
|
||||
*/
|
||||
totalMatchedRows?: string;
|
||||
/** The totals of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty. */
|
||||
totals?: string[];
|
||||
/** Any warnings associated with generation of the report. */
|
||||
warnings?: string[];
|
||||
}
|
||||
interface ReportingMetadataEntry {
|
||||
/**
|
||||
* For metrics this is a list of dimension IDs which the metric is compatible with, for dimensions it is a list of compatibility groups the dimension
|
||||
* belongs to.
|
||||
*/
|
||||
compatibleDimensions?: string[];
|
||||
/** The names of the metrics the dimension or metric this reporting metadata entry describes is compatible with. */
|
||||
compatibleMetrics?: string[];
|
||||
/** Unique identifier of this reporting metadata entry, corresponding to the name of the appropriate dimension or metric. */
|
||||
id?: string;
|
||||
/** Kind of resource this is, in this case adexchangeseller#reportingMetadataEntry. */
|
||||
kind?: string;
|
||||
/**
|
||||
* The names of the dimensions which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report
|
||||
* to be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted.
|
||||
*/
|
||||
requiredDimensions?: string[];
|
||||
/**
|
||||
* The names of the metrics which the dimension or metric this reporting metadata entry describes requires to also be present in order for the report to
|
||||
* be valid. Omitting these will not cause an error or warning, but may result in data which cannot be correctly interpreted.
|
||||
*/
|
||||
requiredMetrics?: string[];
|
||||
/** The codes of the projects supported by the dimension or metric this reporting metadata entry describes. */
|
||||
supportedProducts?: string[];
|
||||
}
|
||||
interface SavedReport {
|
||||
/** Unique identifier of this saved report. */
|
||||
id?: string;
|
||||
/** Kind of resource this is, in this case adexchangeseller#savedReport. */
|
||||
kind?: string;
|
||||
/** This saved report's name. */
|
||||
name?: string;
|
||||
}
|
||||
interface SavedReports {
|
||||
/** ETag of this response for caching purposes. */
|
||||
etag?: string;
|
||||
/** The saved reports returned in this list response. */
|
||||
items?: SavedReport[];
|
||||
/** Kind of list this is, in this case adexchangeseller#savedReports. */
|
||||
kind?: string;
|
||||
/** Continuation token used to page through saved reports. To retrieve the next page of results, set the next request's "pageToken" value to this. */
|
||||
nextPageToken?: string;
|
||||
}
|
||||
interface UrlChannel {
|
||||
/** Unique identifier of this URL channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */
|
||||
id?: string;
|
||||
/** Kind of resource this is, in this case adexchangeseller#urlChannel. */
|
||||
kind?: string;
|
||||
/** URL Pattern of this URL channel. Does not include "http://" or "https://". Example: www.example.com/home */
|
||||
urlPattern?: string;
|
||||
}
|
||||
interface UrlChannels {
|
||||
/** ETag of this response for caching purposes. */
|
||||
etag?: string;
|
||||
/** The URL channels returned in this list response. */
|
||||
items?: UrlChannel[];
|
||||
/** Kind of list this is, in this case adexchangeseller#urlChannels. */
|
||||
kind?: string;
|
||||
/** Continuation token used to page through URL channels. To retrieve the next page of results, set the next request's "pageToken" value to this. */
|
||||
nextPageToken?: string;
|
||||
}
|
||||
interface AdclientsResource {
|
||||
/** List all ad clients in this Ad Exchange account. */
|
||||
list(request: {
|
||||
/** Account to which the ad client belongs. */
|
||||
accountId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** The maximum number of ad clients to include in the response, used for paging. */
|
||||
maxResults?: number;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/**
|
||||
* A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous
|
||||
* response.
|
||||
*/
|
||||
pageToken?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<AdClients>;
|
||||
}
|
||||
interface AlertsResource {
|
||||
/** List the alerts for this Ad Exchange account. */
|
||||
list(request: {
|
||||
/** Account owning the alerts. */
|
||||
accountId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/**
|
||||
* The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used
|
||||
* if the supplied locale is invalid or unsupported.
|
||||
*/
|
||||
locale?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<Alerts>;
|
||||
}
|
||||
interface CustomchannelsResource {
|
||||
/** Get the specified custom channel from the specified ad client. */
|
||||
get(request: {
|
||||
/** Account to which the ad client belongs. */
|
||||
accountId: string;
|
||||
/** Ad client which contains the custom channel. */
|
||||
adClientId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Custom channel to retrieve. */
|
||||
customChannelId: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<CustomChannel>;
|
||||
/** List all custom channels in the specified ad client for this Ad Exchange account. */
|
||||
list(request: {
|
||||
/** Account to which the ad client belongs. */
|
||||
accountId: string;
|
||||
/** Ad client for which to list custom channels. */
|
||||
adClientId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** The maximum number of custom channels to include in the response, used for paging. */
|
||||
maxResults?: number;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/**
|
||||
* A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the
|
||||
* previous response.
|
||||
*/
|
||||
pageToken?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<CustomChannels>;
|
||||
}
|
||||
interface DimensionsResource {
|
||||
/** List the metadata for the dimensions available to this AdExchange account. */
|
||||
list(request: {
|
||||
/** Account with visibility to the dimensions. */
|
||||
accountId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<Metadata>;
|
||||
}
|
||||
interface MetricsResource {
|
||||
/** List the metadata for the metrics available to this AdExchange account. */
|
||||
list(request: {
|
||||
/** Account with visibility to the metrics. */
|
||||
accountId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<Metadata>;
|
||||
}
|
||||
interface MetadataResource {
|
||||
dimensions: DimensionsResource;
|
||||
metrics: MetricsResource;
|
||||
}
|
||||
interface PreferreddealsResource {
|
||||
/** Get information about the selected Ad Exchange Preferred Deal. */
|
||||
get(request: {
|
||||
/** Account owning the deal. */
|
||||
accountId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Preferred deal to get information about. */
|
||||
dealId: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<PreferredDeal>;
|
||||
/** List the preferred deals for this Ad Exchange account. */
|
||||
list(request: {
|
||||
/** Account owning the deals. */
|
||||
accountId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<PreferredDeals>;
|
||||
}
|
||||
interface SavedResource {
|
||||
/** Generate an Ad Exchange report based on the saved report ID sent in the query parameters. */
|
||||
generate(request: {
|
||||
/** Account owning the saved report. */
|
||||
accountId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */
|
||||
locale?: string;
|
||||
/** The maximum number of rows of report data to return. */
|
||||
maxResults?: number;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** The saved report to retrieve. */
|
||||
savedReportId: string;
|
||||
/** Index of the first row of report data to return. */
|
||||
startIndex?: number;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<Report>;
|
||||
/** List all saved reports in this Ad Exchange account. */
|
||||
list(request: {
|
||||
/** Account owning the saved reports. */
|
||||
accountId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** The maximum number of saved reports to include in the response, used for paging. */
|
||||
maxResults?: number;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/**
|
||||
* A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the
|
||||
* previous response.
|
||||
*/
|
||||
pageToken?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<SavedReports>;
|
||||
}
|
||||
interface ReportsResource {
|
||||
/**
|
||||
* Generate an Ad Exchange report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format
|
||||
* specify "alt=csv" as a query parameter.
|
||||
*/
|
||||
generate(request: {
|
||||
/** Account which owns the generated report. */
|
||||
accountId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Dimensions to base the report on. */
|
||||
dimension?: string;
|
||||
/** End of the date range to report on in "YYYY-MM-DD" format, inclusive. */
|
||||
endDate: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** Filters to be run on the report. */
|
||||
filter?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */
|
||||
locale?: string;
|
||||
/** The maximum number of rows of report data to return. */
|
||||
maxResults?: number;
|
||||
/** Numeric columns to include in the report. */
|
||||
metric?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/**
|
||||
* The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no
|
||||
* prefix is specified, the column is sorted ascending.
|
||||
*/
|
||||
sort?: string;
|
||||
/** Start of the date range to report on in "YYYY-MM-DD" format, inclusive. */
|
||||
startDate: string;
|
||||
/** Index of the first row of report data to return. */
|
||||
startIndex?: number;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<Report>;
|
||||
saved: SavedResource;
|
||||
}
|
||||
interface UrlchannelsResource {
|
||||
/** List all URL channels in the specified ad client for this Ad Exchange account. */
|
||||
list(request: {
|
||||
/** Account to which the ad client belongs. */
|
||||
accountId: string;
|
||||
/** Ad client for which to list URL channels. */
|
||||
adClientId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** The maximum number of URL channels to include in the response, used for paging. */
|
||||
maxResults?: number;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/**
|
||||
* A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the
|
||||
* previous response.
|
||||
*/
|
||||
pageToken?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<UrlChannels>;
|
||||
}
|
||||
interface AccountsResource {
|
||||
/** Get information about the selected Ad Exchange account. */
|
||||
get(request: {
|
||||
/** Account to get information about. Tip: 'myaccount' is a valid ID. */
|
||||
accountId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<Account>;
|
||||
/** List all accounts available to this Ad Exchange account. */
|
||||
list(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** The maximum number of accounts to include in the response, used for paging. */
|
||||
maxResults?: number;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/**
|
||||
* A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous
|
||||
* response.
|
||||
*/
|
||||
pageToken?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<Accounts>;
|
||||
adclients: AdclientsResource;
|
||||
alerts: AlertsResource;
|
||||
customchannels: CustomchannelsResource;
|
||||
metadata: MetadataResource;
|
||||
preferreddeals: PreferreddealsResource;
|
||||
reports: ReportsResource;
|
||||
urlchannels: UrlchannelsResource;
|
||||
}
|
||||
}
|
||||
}
|
||||
67
types/gapi.client.adexchangeseller/readme.md
Normal file
67
types/gapi.client.adexchangeseller/readme.md
Normal file
@ -0,0 +1,67 @@
|
||||
# TypeScript typings for Ad Exchange Seller API v2.0
|
||||
Accesses the inventory of Ad Exchange seller users and generates reports.
|
||||
For detailed description please check [documentation](https://developers.google.com/ad-exchange/seller-rest/).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for Ad Exchange Seller API:
|
||||
```
|
||||
npm install @types/gapi.client.adexchangeseller@v2.0 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('adexchangeseller', 'v2.0', () => {
|
||||
// now we can use gapi.client.adexchangeseller
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// View and manage your Ad Exchange data
|
||||
'https://www.googleapis.com/auth/adexchange.seller',
|
||||
|
||||
// View your Ad Exchange data
|
||||
'https://www.googleapis.com/auth/adexchange.seller.readonly',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use Ad Exchange Seller API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Get information about the selected Ad Exchange account.
|
||||
*/
|
||||
await gapi.client.accounts.get({ accountId: "accountId", });
|
||||
|
||||
/*
|
||||
List all accounts available to this Ad Exchange account.
|
||||
*/
|
||||
await gapi.client.accounts.list({ });
|
||||
```
|
||||
24
types/gapi.client.adexchangeseller/tsconfig.json
Normal file
24
types/gapi.client.adexchangeseller/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.adexchangeseller-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.adexchangeseller/tslint.json
Normal file
8
types/gapi.client.adexchangeseller/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('adexperiencereport', 'v1', () => {
|
||||
/** now we can use gapi.client.adexperiencereport */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** Test scope for access to the Zoo service */
|
||||
'https://www.googleapis.com/auth/xapi.zoo',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/** Gets a summary of the ad experience rating of a site. */
|
||||
await gapi.client.sites.get({
|
||||
name: "name",
|
||||
});
|
||||
/** Lists sites with Ad Experience Report statuses of "Failing" or "Warning". */
|
||||
await gapi.client.violatingSites.list({
|
||||
});
|
||||
}
|
||||
});
|
||||
125
types/gapi.client.adexperiencereport/index.d.ts
vendored
Normal file
125
types/gapi.client.adexperiencereport/index.d.ts
vendored
Normal file
@ -0,0 +1,125 @@
|
||||
// Type definitions for Google Google Ad Experience Report API v1 1.0
|
||||
// Project: https://developers.google.com/ad-experience-report/
|
||||
// Definitions by: Bolisov Alexey <https://github.com/Bolisov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// IMPORTANT
|
||||
// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
// Generated from: https://adexperiencereport.googleapis.com/$discovery/rest?version=v1
|
||||
|
||||
/// <reference types="gapi.client" />
|
||||
|
||||
declare namespace gapi.client {
|
||||
/** Load Google Ad Experience Report API v1 */
|
||||
function load(name: "adexperiencereport", version: "v1"): PromiseLike<void>;
|
||||
function load(name: "adexperiencereport", version: "v1", callback: () => any): void;
|
||||
|
||||
const sites: adexperiencereport.SitesResource;
|
||||
|
||||
const violatingSites: adexperiencereport.ViolatingSitesResource;
|
||||
|
||||
namespace adexperiencereport {
|
||||
interface PlatformSummary {
|
||||
/** The status of the site reviewed for the Better Ads Standards. */
|
||||
betterAdsStatus?: string;
|
||||
/** The date on which ad filtering begins. */
|
||||
enforcementTime?: string;
|
||||
/** The ad filtering status of the site. */
|
||||
filterStatus?: string;
|
||||
/** The last time that the site changed status. */
|
||||
lastChangeTime?: string;
|
||||
/** The assigned regions for the site and platform. */
|
||||
region?: string[];
|
||||
/** A link that leads to a full ad experience report. */
|
||||
reportUrl?: string;
|
||||
/** Whether the site is currently under review. */
|
||||
underReview?: boolean;
|
||||
}
|
||||
interface SiteSummaryResponse {
|
||||
/** Summary for the desktop review of the site. */
|
||||
desktopSummary?: PlatformSummary;
|
||||
/** Summary for the mobile review of the site. */
|
||||
mobileSummary?: PlatformSummary;
|
||||
/** The name of the site reviewed. */
|
||||
reviewedSite?: string;
|
||||
}
|
||||
interface ViolatingSitesResponse {
|
||||
/** A list of summaries of violating sites. */
|
||||
violatingSites?: SiteSummaryResponse[];
|
||||
}
|
||||
interface SitesResource {
|
||||
/** Gets a summary of the ad experience rating of a site. */
|
||||
get(request: {
|
||||
/** V1 error format. */
|
||||
"$.xgafv"?: string;
|
||||
/** OAuth access token. */
|
||||
access_token?: string;
|
||||
/** Data format for response. */
|
||||
alt?: string;
|
||||
/** OAuth bearer token. */
|
||||
bearer_token?: string;
|
||||
/** JSONP */
|
||||
callback?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/**
|
||||
* The required site name. It should be the site property whose ad experiences
|
||||
* may have been reviewed, and it should be URL-encoded. For example,
|
||||
* sites/https%3A%2F%2Fwww.google.com. The server will return an error of
|
||||
* BAD_REQUEST if this field is not filled in. Note that if the site property
|
||||
* is not yet verified in Search Console, the reportUrl field returned by the
|
||||
* API will lead to the verification page, prompting the user to go through
|
||||
* that process before they can gain access to the Ad Experience Report.
|
||||
*/
|
||||
name: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Pretty-print response. */
|
||||
pp?: boolean;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
||||
uploadType?: string;
|
||||
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
||||
upload_protocol?: string;
|
||||
}): Request<SiteSummaryResponse>;
|
||||
}
|
||||
interface ViolatingSitesResource {
|
||||
/** Lists sites with Ad Experience Report statuses of "Failing" or "Warning". */
|
||||
list(request: {
|
||||
/** V1 error format. */
|
||||
"$.xgafv"?: string;
|
||||
/** OAuth access token. */
|
||||
access_token?: string;
|
||||
/** Data format for response. */
|
||||
alt?: string;
|
||||
/** OAuth bearer token. */
|
||||
bearer_token?: string;
|
||||
/** JSONP */
|
||||
callback?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Pretty-print response. */
|
||||
pp?: boolean;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
||||
uploadType?: string;
|
||||
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
||||
upload_protocol?: string;
|
||||
}): Request<ViolatingSitesResponse>;
|
||||
}
|
||||
}
|
||||
}
|
||||
64
types/gapi.client.adexperiencereport/readme.md
Normal file
64
types/gapi.client.adexperiencereport/readme.md
Normal file
@ -0,0 +1,64 @@
|
||||
# TypeScript typings for Google Ad Experience Report API v1
|
||||
View Ad Experience Report data, and get a list of sites that have a significant number of annoying ads.
|
||||
For detailed description please check [documentation](https://developers.google.com/ad-experience-report/).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for Google Ad Experience Report API:
|
||||
```
|
||||
npm install @types/gapi.client.adexperiencereport@v1 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('adexperiencereport', 'v1', () => {
|
||||
// now we can use gapi.client.adexperiencereport
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// Test scope for access to the Zoo service
|
||||
'https://www.googleapis.com/auth/xapi.zoo',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use Google Ad Experience Report API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Gets a summary of the ad experience rating of a site.
|
||||
*/
|
||||
await gapi.client.sites.get({ name: "name", });
|
||||
|
||||
/*
|
||||
Lists sites with Ad Experience Report statuses of "Failing" or "Warning".
|
||||
*/
|
||||
await gapi.client.violatingSites.list({ });
|
||||
```
|
||||
24
types/gapi.client.adexperiencereport/tsconfig.json
Normal file
24
types/gapi.client.adexperiencereport/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.adexperiencereport-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.adexperiencereport/tslint.json
Normal file
8
types/gapi.client.adexperiencereport/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
80
types/gapi.client.admin/gapi.client.admin-tests.ts
Normal file
80
types/gapi.client.admin/gapi.client.admin-tests.ts
Normal file
@ -0,0 +1,80 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('admin', 'reports_v1', () => {
|
||||
/** now we can use gapi.client.admin */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** View audit reports for your G Suite domain */
|
||||
'https://www.googleapis.com/auth/admin.reports.audit.readonly',
|
||||
/** View usage reports for your G Suite domain */
|
||||
'https://www.googleapis.com/auth/admin.reports.usage.readonly',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/** Retrieves a list of activities for a specific customer and application. */
|
||||
await gapi.client.activities.list({
|
||||
actorIpAddress: "actorIpAddress",
|
||||
applicationName: "applicationName",
|
||||
customerId: "customerId",
|
||||
endTime: "endTime",
|
||||
eventName: "eventName",
|
||||
filters: "filters",
|
||||
maxResults: 7,
|
||||
pageToken: "pageToken",
|
||||
startTime: "startTime",
|
||||
userKey: "userKey",
|
||||
});
|
||||
/** Push changes to activities */
|
||||
await gapi.client.activities.watch({
|
||||
actorIpAddress: "actorIpAddress",
|
||||
applicationName: "applicationName",
|
||||
customerId: "customerId",
|
||||
endTime: "endTime",
|
||||
eventName: "eventName",
|
||||
filters: "filters",
|
||||
maxResults: 7,
|
||||
pageToken: "pageToken",
|
||||
startTime: "startTime",
|
||||
userKey: "userKey",
|
||||
});
|
||||
/** Stop watching resources through this channel */
|
||||
await gapi.client.channels.stop({
|
||||
});
|
||||
/** Retrieves a report which is a collection of properties / statistics for a specific customer. */
|
||||
await gapi.client.customerUsageReports.get({
|
||||
customerId: "customerId",
|
||||
date: "date",
|
||||
pageToken: "pageToken",
|
||||
parameters: "parameters",
|
||||
});
|
||||
/** Retrieves a report which is a collection of properties / statistics for a set of users. */
|
||||
await gapi.client.userUsageReport.get({
|
||||
customerId: "customerId",
|
||||
date: "date",
|
||||
filters: "filters",
|
||||
maxResults: 4,
|
||||
pageToken: "pageToken",
|
||||
parameters: "parameters",
|
||||
userKey: "userKey",
|
||||
});
|
||||
}
|
||||
});
|
||||
349
types/gapi.client.admin/index.d.ts
vendored
Normal file
349
types/gapi.client.admin/index.d.ts
vendored
Normal file
@ -0,0 +1,349 @@
|
||||
// Type definitions for Google Admin Reports API reports_v1 1.0
|
||||
// Project: https://developers.google.com/admin-sdk/reports/
|
||||
// Definitions by: Bolisov Alexey <https://github.com/Bolisov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// IMPORTANT
|
||||
// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
// Generated from: https://www.googleapis.com/discovery/v1/apis/admin/reports_v1/rest
|
||||
|
||||
/// <reference types="gapi.client" />
|
||||
|
||||
declare namespace gapi.client {
|
||||
/** Load Admin Reports API reports_v1 */
|
||||
function load(name: "admin", version: "reports_v1"): PromiseLike<void>;
|
||||
function load(name: "admin", version: "reports_v1", callback: () => any): void;
|
||||
|
||||
const activities: admin.ActivitiesResource;
|
||||
|
||||
const channels: admin.ChannelsResource;
|
||||
|
||||
const customerUsageReports: admin.CustomerUsageReportsResource;
|
||||
|
||||
const userUsageReport: admin.UserUsageReportResource;
|
||||
|
||||
namespace admin {
|
||||
interface Activities {
|
||||
/** ETag of the resource. */
|
||||
etag?: string;
|
||||
/** Each record in read response. */
|
||||
items?: Activity[];
|
||||
/** Kind of list response this is. */
|
||||
kind?: string;
|
||||
/** Token for retrieving the next page */
|
||||
nextPageToken?: string;
|
||||
}
|
||||
interface Activity {
|
||||
/** User doing the action. */
|
||||
actor?: {
|
||||
/** User or OAuth 2LO request. */
|
||||
callerType?: string;
|
||||
/** Email address of the user. */
|
||||
email?: string;
|
||||
/** For OAuth 2LO API requests, consumer_key of the requestor. */
|
||||
key?: string;
|
||||
/** Obfuscated user id of the user. */
|
||||
profileId?: string;
|
||||
};
|
||||
/** ETag of the entry. */
|
||||
etag?: string;
|
||||
/** Activity events. */
|
||||
events?: Array<{
|
||||
/** Name of event. */
|
||||
name?: string;
|
||||
/** Parameter value pairs for various applications. */
|
||||
parameters?: Array<{
|
||||
/** Boolean value of the parameter. */
|
||||
boolValue?: boolean;
|
||||
/** Integral value of the parameter. */
|
||||
intValue?: string;
|
||||
/** Multi-int value of the parameter. */
|
||||
multiIntValue?: string[];
|
||||
/** Multi-string value of the parameter. */
|
||||
multiValue?: string[];
|
||||
/** The name of the parameter. */
|
||||
name?: string;
|
||||
/** String value of the parameter. */
|
||||
value?: string;
|
||||
}>;
|
||||
/** Type of event. */
|
||||
type?: string;
|
||||
}>;
|
||||
/** Unique identifier for each activity record. */
|
||||
id?: {
|
||||
/** Application name to which the event belongs. */
|
||||
applicationName?: string;
|
||||
/** Obfuscated customer ID of the source customer. */
|
||||
customerId?: string;
|
||||
/** Time of occurrence of the activity. */
|
||||
time?: string;
|
||||
/** Unique qualifier if multiple events have the same time. */
|
||||
uniqueQualifier?: string;
|
||||
};
|
||||
/** IP Address of the user doing the action. */
|
||||
ipAddress?: string;
|
||||
/** Kind of resource this is. */
|
||||
kind?: string;
|
||||
/** Domain of source customer. */
|
||||
ownerDomain?: string;
|
||||
}
|
||||
interface Channel {
|
||||
/** The address where notifications are delivered for this channel. */
|
||||
address?: string;
|
||||
/** Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. */
|
||||
expiration?: string;
|
||||
/** A UUID or similar unique string that identifies this channel. */
|
||||
id?: string;
|
||||
/** Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel". */
|
||||
kind?: string;
|
||||
/** Additional parameters controlling delivery channel behavior. Optional. */
|
||||
params?: Record<string, string>;
|
||||
/** A Boolean value to indicate whether payload is wanted. Optional. */
|
||||
payload?: boolean;
|
||||
/** An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. */
|
||||
resourceId?: string;
|
||||
/** A version-specific identifier for the watched resource. */
|
||||
resourceUri?: string;
|
||||
/** An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. */
|
||||
token?: string;
|
||||
/** The type of delivery mechanism used for this channel. */
|
||||
type?: string;
|
||||
}
|
||||
interface UsageReport {
|
||||
/** The date to which the record belongs. */
|
||||
date?: string;
|
||||
/** Information about the type of the item. */
|
||||
entity?: {
|
||||
/** Obfuscated customer id for the record. */
|
||||
customerId?: string;
|
||||
/** Obfuscated user id for the record. */
|
||||
profileId?: string;
|
||||
/** The type of item, can be a customer or user. */
|
||||
type?: string;
|
||||
/** user's email. */
|
||||
userEmail?: string;
|
||||
};
|
||||
/** ETag of the resource. */
|
||||
etag?: string;
|
||||
/** The kind of object. */
|
||||
kind?: string;
|
||||
/** Parameter value pairs for various applications. */
|
||||
parameters?: Array<{
|
||||
/** Boolean value of the parameter. */
|
||||
boolValue?: boolean;
|
||||
/** RFC 3339 formatted value of the parameter. */
|
||||
datetimeValue?: string;
|
||||
/** Integral value of the parameter. */
|
||||
intValue?: string;
|
||||
/** Nested message value of the parameter. */
|
||||
msgValue?: Array<Record<string, any>>;
|
||||
/** The name of the parameter. */
|
||||
name?: string;
|
||||
/** String value of the parameter. */
|
||||
stringValue?: string;
|
||||
}>;
|
||||
}
|
||||
interface UsageReports {
|
||||
/** ETag of the resource. */
|
||||
etag?: string;
|
||||
/** The kind of object. */
|
||||
kind?: string;
|
||||
/** Token for retrieving the next page */
|
||||
nextPageToken?: string;
|
||||
/** Various application parameter records. */
|
||||
usageReports?: UsageReport[];
|
||||
/** Warnings if any. */
|
||||
warnings?: Array<{
|
||||
/** Machine readable code / warning type. */
|
||||
code?: string;
|
||||
/** Key-Value pairs to give detailed information on the warning. */
|
||||
data?: Array<{
|
||||
/** Key associated with a key-value pair to give detailed information on the warning. */
|
||||
key?: string;
|
||||
/** Value associated with a key-value pair to give detailed information on the warning. */
|
||||
value?: string;
|
||||
}>;
|
||||
/** Human readable message for the warning. */
|
||||
message?: string;
|
||||
}>;
|
||||
}
|
||||
interface ActivitiesResource {
|
||||
/** Retrieves a list of activities for a specific customer and application. */
|
||||
list(request: {
|
||||
/** IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. */
|
||||
actorIpAddress?: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Application name for which the events are to be retrieved. */
|
||||
applicationName: string;
|
||||
/** Represents the customer for which the data is to be fetched. */
|
||||
customerId?: string;
|
||||
/** Return events which occurred at or before this time. */
|
||||
endTime?: string;
|
||||
/** Name of the event being queried. */
|
||||
eventName?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... */
|
||||
filters?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** Number of activity records to be shown in each page. */
|
||||
maxResults?: number;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Token to specify next page. */
|
||||
pageToken?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** Return events which occurred at or after this time. */
|
||||
startTime?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
/**
|
||||
* Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for
|
||||
* all users.
|
||||
*/
|
||||
userKey: string;
|
||||
}): Request<Activities>;
|
||||
/** Push changes to activities */
|
||||
watch(request: {
|
||||
/** IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. */
|
||||
actorIpAddress?: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Application name for which the events are to be retrieved. */
|
||||
applicationName: string;
|
||||
/** Represents the customer for which the data is to be fetched. */
|
||||
customerId?: string;
|
||||
/** Return events which occurred at or before this time. */
|
||||
endTime?: string;
|
||||
/** Name of the event being queried. */
|
||||
eventName?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... */
|
||||
filters?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** Number of activity records to be shown in each page. */
|
||||
maxResults?: number;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Token to specify next page. */
|
||||
pageToken?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** Return events which occurred at or after this time. */
|
||||
startTime?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
/**
|
||||
* Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for
|
||||
* all users.
|
||||
*/
|
||||
userKey: string;
|
||||
}): Request<Channel>;
|
||||
}
|
||||
interface ChannelsResource {
|
||||
/** Stop watching resources through this channel */
|
||||
stop(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<void>;
|
||||
}
|
||||
interface CustomerUsageReportsResource {
|
||||
/** Retrieves a report which is a collection of properties / statistics for a specific customer. */
|
||||
get(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Represents the customer for which the data is to be fetched. */
|
||||
customerId?: string;
|
||||
/** Represents the date in yyyy-mm-dd format for which the data is to be fetched. */
|
||||
date: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Token to specify next page. */
|
||||
pageToken?: string;
|
||||
/** Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. */
|
||||
parameters?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<UsageReports>;
|
||||
}
|
||||
interface UserUsageReportResource {
|
||||
/** Retrieves a report which is a collection of properties / statistics for a set of users. */
|
||||
get(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Represents the customer for which the data is to be fetched. */
|
||||
customerId?: string;
|
||||
/** Represents the date in yyyy-mm-dd format for which the data is to be fetched. */
|
||||
date: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** Represents the set of filters including parameter operator value. */
|
||||
filters?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** Maximum number of results to return. Maximum allowed is 1000 */
|
||||
maxResults?: number;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Token to specify next page. */
|
||||
pageToken?: string;
|
||||
/** Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. */
|
||||
parameters?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
/** Represents the profile id or the user email for which the data should be filtered. */
|
||||
userKey: string;
|
||||
}): Request<UsageReports>;
|
||||
}
|
||||
}
|
||||
}
|
||||
82
types/gapi.client.admin/readme.md
Normal file
82
types/gapi.client.admin/readme.md
Normal file
@ -0,0 +1,82 @@
|
||||
# TypeScript typings for Admin Reports API reports_v1
|
||||
Fetches reports for the administrators of G Suite customers about the usage, collaboration, security, and risk for their users.
|
||||
For detailed description please check [documentation](https://developers.google.com/admin-sdk/reports/).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for Admin Reports API:
|
||||
```
|
||||
npm install @types/gapi.client.admin@reports_v1 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('admin', 'reports_v1', () => {
|
||||
// now we can use gapi.client.admin
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// View audit reports for your G Suite domain
|
||||
'https://www.googleapis.com/auth/admin.reports.audit.readonly',
|
||||
|
||||
// View usage reports for your G Suite domain
|
||||
'https://www.googleapis.com/auth/admin.reports.usage.readonly',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use Admin Reports API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Retrieves a list of activities for a specific customer and application.
|
||||
*/
|
||||
await gapi.client.activities.list({ applicationName: "applicationName", userKey: "userKey", });
|
||||
|
||||
/*
|
||||
Push changes to activities
|
||||
*/
|
||||
await gapi.client.activities.watch({ applicationName: "applicationName", userKey: "userKey", });
|
||||
|
||||
/*
|
||||
Stop watching resources through this channel
|
||||
*/
|
||||
await gapi.client.channels.stop({ });
|
||||
|
||||
/*
|
||||
Retrieves a report which is a collection of properties / statistics for a specific customer.
|
||||
*/
|
||||
await gapi.client.customerUsageReports.get({ date: "date", });
|
||||
|
||||
/*
|
||||
Retrieves a report which is a collection of properties / statistics for a set of users.
|
||||
*/
|
||||
await gapi.client.userUsageReport.get({ date: "date", userKey: "userKey", });
|
||||
```
|
||||
24
types/gapi.client.admin/tsconfig.json
Normal file
24
types/gapi.client.admin/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.admin-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.admin/tslint.json
Normal file
8
types/gapi.client.admin/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
121
types/gapi.client.adsense/gapi.client.adsense-tests.ts
Normal file
121
types/gapi.client.adsense/gapi.client.adsense-tests.ts
Normal file
@ -0,0 +1,121 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('adsense', 'v1.4', () => {
|
||||
/** now we can use gapi.client.adsense */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** View and manage your AdSense data */
|
||||
'https://www.googleapis.com/auth/adsense',
|
||||
/** View your AdSense data */
|
||||
'https://www.googleapis.com/auth/adsense.readonly',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/** Get information about the selected AdSense account. */
|
||||
await gapi.client.accounts.get({
|
||||
accountId: "accountId",
|
||||
tree: true,
|
||||
});
|
||||
/** List all accounts available to this AdSense account. */
|
||||
await gapi.client.accounts.list({
|
||||
maxResults: 1,
|
||||
pageToken: "pageToken",
|
||||
});
|
||||
/** List all ad clients in this AdSense account. */
|
||||
await gapi.client.adclients.list({
|
||||
maxResults: 1,
|
||||
pageToken: "pageToken",
|
||||
});
|
||||
/** Gets the specified ad unit in the specified ad client. */
|
||||
await gapi.client.adunits.get({
|
||||
adClientId: "adClientId",
|
||||
adUnitId: "adUnitId",
|
||||
});
|
||||
/** Get ad code for the specified ad unit. */
|
||||
await gapi.client.adunits.getAdCode({
|
||||
adClientId: "adClientId",
|
||||
adUnitId: "adUnitId",
|
||||
});
|
||||
/** List all ad units in the specified ad client for this AdSense account. */
|
||||
await gapi.client.adunits.list({
|
||||
adClientId: "adClientId",
|
||||
includeInactive: true,
|
||||
maxResults: 3,
|
||||
pageToken: "pageToken",
|
||||
});
|
||||
/** Dismiss (delete) the specified alert from the publisher's AdSense account. */
|
||||
await gapi.client.alerts.delete({
|
||||
alertId: "alertId",
|
||||
});
|
||||
/** List the alerts for this AdSense account. */
|
||||
await gapi.client.alerts.list({
|
||||
locale: "locale",
|
||||
});
|
||||
/** Get the specified custom channel from the specified ad client. */
|
||||
await gapi.client.customchannels.get({
|
||||
adClientId: "adClientId",
|
||||
customChannelId: "customChannelId",
|
||||
});
|
||||
/** List all custom channels in the specified ad client for this AdSense account. */
|
||||
await gapi.client.customchannels.list({
|
||||
adClientId: "adClientId",
|
||||
maxResults: 2,
|
||||
pageToken: "pageToken",
|
||||
});
|
||||
/** List the payments for this AdSense account. */
|
||||
await gapi.client.payments.list({
|
||||
});
|
||||
/**
|
||||
* Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format
|
||||
* specify "alt=csv" as a query parameter.
|
||||
*/
|
||||
await gapi.client.reports.generate({
|
||||
accountId: "accountId",
|
||||
currency: "currency",
|
||||
dimension: "dimension",
|
||||
endDate: "endDate",
|
||||
filter: "filter",
|
||||
locale: "locale",
|
||||
maxResults: 7,
|
||||
metric: "metric",
|
||||
sort: "sort",
|
||||
startDate: "startDate",
|
||||
startIndex: 11,
|
||||
useTimezoneReporting: true,
|
||||
});
|
||||
/** Get a specific saved ad style from the user's account. */
|
||||
await gapi.client.savedadstyles.get({
|
||||
savedAdStyleId: "savedAdStyleId",
|
||||
});
|
||||
/** List all saved ad styles in the user's account. */
|
||||
await gapi.client.savedadstyles.list({
|
||||
maxResults: 1,
|
||||
pageToken: "pageToken",
|
||||
});
|
||||
/** List all URL channels in the specified ad client for this AdSense account. */
|
||||
await gapi.client.urlchannels.list({
|
||||
adClientId: "adClientId",
|
||||
maxResults: 2,
|
||||
pageToken: "pageToken",
|
||||
});
|
||||
}
|
||||
});
|
||||
1529
types/gapi.client.adsense/index.d.ts
vendored
Normal file
1529
types/gapi.client.adsense/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
132
types/gapi.client.adsense/readme.md
Normal file
132
types/gapi.client.adsense/readme.md
Normal file
@ -0,0 +1,132 @@
|
||||
# TypeScript typings for AdSense Management API v1.4
|
||||
Accesses AdSense publishers' inventory and generates performance reports.
|
||||
For detailed description please check [documentation](https://developers.google.com/adsense/management/).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for AdSense Management API:
|
||||
```
|
||||
npm install @types/gapi.client.adsense@v1.4 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('adsense', 'v1.4', () => {
|
||||
// now we can use gapi.client.adsense
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// View and manage your AdSense data
|
||||
'https://www.googleapis.com/auth/adsense',
|
||||
|
||||
// View your AdSense data
|
||||
'https://www.googleapis.com/auth/adsense.readonly',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use AdSense Management API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Get information about the selected AdSense account.
|
||||
*/
|
||||
await gapi.client.accounts.get({ accountId: "accountId", });
|
||||
|
||||
/*
|
||||
List all accounts available to this AdSense account.
|
||||
*/
|
||||
await gapi.client.accounts.list({ });
|
||||
|
||||
/*
|
||||
List all ad clients in this AdSense account.
|
||||
*/
|
||||
await gapi.client.adclients.list({ });
|
||||
|
||||
/*
|
||||
Gets the specified ad unit in the specified ad client.
|
||||
*/
|
||||
await gapi.client.adunits.get({ adClientId: "adClientId", adUnitId: "adUnitId", });
|
||||
|
||||
/*
|
||||
Get ad code for the specified ad unit.
|
||||
*/
|
||||
await gapi.client.adunits.getAdCode({ adClientId: "adClientId", adUnitId: "adUnitId", });
|
||||
|
||||
/*
|
||||
List all ad units in the specified ad client for this AdSense account.
|
||||
*/
|
||||
await gapi.client.adunits.list({ adClientId: "adClientId", });
|
||||
|
||||
/*
|
||||
Dismiss (delete) the specified alert from the publisher's AdSense account.
|
||||
*/
|
||||
await gapi.client.alerts.delete({ alertId: "alertId", });
|
||||
|
||||
/*
|
||||
List the alerts for this AdSense account.
|
||||
*/
|
||||
await gapi.client.alerts.list({ });
|
||||
|
||||
/*
|
||||
Get the specified custom channel from the specified ad client.
|
||||
*/
|
||||
await gapi.client.customchannels.get({ adClientId: "adClientId", customChannelId: "customChannelId", });
|
||||
|
||||
/*
|
||||
List all custom channels in the specified ad client for this AdSense account.
|
||||
*/
|
||||
await gapi.client.customchannels.list({ adClientId: "adClientId", });
|
||||
|
||||
/*
|
||||
List the payments for this AdSense account.
|
||||
*/
|
||||
await gapi.client.payments.list({ });
|
||||
|
||||
/*
|
||||
Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
|
||||
*/
|
||||
await gapi.client.reports.generate({ endDate: "endDate", startDate: "startDate", });
|
||||
|
||||
/*
|
||||
Get a specific saved ad style from the user's account.
|
||||
*/
|
||||
await gapi.client.savedadstyles.get({ savedAdStyleId: "savedAdStyleId", });
|
||||
|
||||
/*
|
||||
List all saved ad styles in the user's account.
|
||||
*/
|
||||
await gapi.client.savedadstyles.list({ });
|
||||
|
||||
/*
|
||||
List all URL channels in the specified ad client for this AdSense account.
|
||||
*/
|
||||
await gapi.client.urlchannels.list({ adClientId: "adClientId", });
|
||||
```
|
||||
24
types/gapi.client.adsense/tsconfig.json
Normal file
24
types/gapi.client.adsense/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.adsense-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.adsense/tslint.json
Normal file
8
types/gapi.client.adsense/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
119
types/gapi.client.adsensehost/gapi.client.adsensehost-tests.ts
Normal file
119
types/gapi.client.adsensehost/gapi.client.adsensehost-tests.ts
Normal file
@ -0,0 +1,119 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('adsensehost', 'v4.1', () => {
|
||||
/** now we can use gapi.client.adsensehost */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** View and manage your AdSense host data and associated accounts */
|
||||
'https://www.googleapis.com/auth/adsensehost',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/** Get information about the selected associated AdSense account. */
|
||||
await gapi.client.accounts.get({
|
||||
accountId: "accountId",
|
||||
});
|
||||
/** List hosted accounts associated with this AdSense account by ad client id. */
|
||||
await gapi.client.accounts.list({
|
||||
filterAdClientId: "filterAdClientId",
|
||||
});
|
||||
/** Get information about one of the ad clients in the Host AdSense account. */
|
||||
await gapi.client.adclients.get({
|
||||
adClientId: "adClientId",
|
||||
});
|
||||
/** List all host ad clients in this AdSense account. */
|
||||
await gapi.client.adclients.list({
|
||||
maxResults: 1,
|
||||
pageToken: "pageToken",
|
||||
});
|
||||
/** Create an association session for initiating an association with an AdSense user. */
|
||||
await gapi.client.associationsessions.start({
|
||||
productCode: "productCode",
|
||||
userLocale: "userLocale",
|
||||
websiteLocale: "websiteLocale",
|
||||
websiteUrl: "websiteUrl",
|
||||
});
|
||||
/** Verify an association session after the association callback returns from AdSense signup. */
|
||||
await gapi.client.associationsessions.verify({
|
||||
token: "token",
|
||||
});
|
||||
/** Delete a specific custom channel from the host AdSense account. */
|
||||
await gapi.client.customchannels.delete({
|
||||
adClientId: "adClientId",
|
||||
customChannelId: "customChannelId",
|
||||
});
|
||||
/** Get a specific custom channel from the host AdSense account. */
|
||||
await gapi.client.customchannels.get({
|
||||
adClientId: "adClientId",
|
||||
customChannelId: "customChannelId",
|
||||
});
|
||||
/** Add a new custom channel to the host AdSense account. */
|
||||
await gapi.client.customchannels.insert({
|
||||
adClientId: "adClientId",
|
||||
});
|
||||
/** List all host custom channels in this AdSense account. */
|
||||
await gapi.client.customchannels.list({
|
||||
adClientId: "adClientId",
|
||||
maxResults: 2,
|
||||
pageToken: "pageToken",
|
||||
});
|
||||
/** Update a custom channel in the host AdSense account. This method supports patch semantics. */
|
||||
await gapi.client.customchannels.patch({
|
||||
adClientId: "adClientId",
|
||||
customChannelId: "customChannelId",
|
||||
});
|
||||
/** Update a custom channel in the host AdSense account. */
|
||||
await gapi.client.customchannels.update({
|
||||
adClientId: "adClientId",
|
||||
});
|
||||
/**
|
||||
* Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format
|
||||
* specify "alt=csv" as a query parameter.
|
||||
*/
|
||||
await gapi.client.reports.generate({
|
||||
dimension: "dimension",
|
||||
endDate: "endDate",
|
||||
filter: "filter",
|
||||
locale: "locale",
|
||||
maxResults: 5,
|
||||
metric: "metric",
|
||||
sort: "sort",
|
||||
startDate: "startDate",
|
||||
startIndex: 9,
|
||||
});
|
||||
/** Delete a URL channel from the host AdSense account. */
|
||||
await gapi.client.urlchannels.delete({
|
||||
adClientId: "adClientId",
|
||||
urlChannelId: "urlChannelId",
|
||||
});
|
||||
/** Add a new URL channel to the host AdSense account. */
|
||||
await gapi.client.urlchannels.insert({
|
||||
adClientId: "adClientId",
|
||||
});
|
||||
/** List all host URL channels in the host AdSense account. */
|
||||
await gapi.client.urlchannels.list({
|
||||
adClientId: "adClientId",
|
||||
maxResults: 2,
|
||||
pageToken: "pageToken",
|
||||
});
|
||||
}
|
||||
});
|
||||
967
types/gapi.client.adsensehost/index.d.ts
vendored
Normal file
967
types/gapi.client.adsensehost/index.d.ts
vendored
Normal file
@ -0,0 +1,967 @@
|
||||
// Type definitions for Google AdSense Host API v4.1 4.1
|
||||
// Project: https://developers.google.com/adsense/host/
|
||||
// Definitions by: Bolisov Alexey <https://github.com/Bolisov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// IMPORTANT
|
||||
// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
// Generated from: https://www.googleapis.com/discovery/v1/apis/adsensehost/v4.1/rest
|
||||
|
||||
/// <reference types="gapi.client" />
|
||||
|
||||
declare namespace gapi.client {
|
||||
/** Load AdSense Host API v4.1 */
|
||||
function load(name: "adsensehost", version: "v4.1"): PromiseLike<void>;
|
||||
function load(name: "adsensehost", version: "v4.1", callback: () => any): void;
|
||||
|
||||
const accounts: adsensehost.AccountsResource;
|
||||
|
||||
const adclients: adsensehost.AdclientsResource;
|
||||
|
||||
const associationsessions: adsensehost.AssociationsessionsResource;
|
||||
|
||||
const customchannels: adsensehost.CustomchannelsResource;
|
||||
|
||||
const reports: adsensehost.ReportsResource;
|
||||
|
||||
const urlchannels: adsensehost.UrlchannelsResource;
|
||||
|
||||
namespace adsensehost {
|
||||
interface Account {
|
||||
/** Unique identifier of this account. */
|
||||
id?: string;
|
||||
/** Kind of resource this is, in this case adsensehost#account. */
|
||||
kind?: string;
|
||||
/** Name of this account. */
|
||||
name?: string;
|
||||
/** Approval status of this account. One of: PENDING, APPROVED, DISABLED. */
|
||||
status?: string;
|
||||
}
|
||||
interface Accounts {
|
||||
/** ETag of this response for caching purposes. */
|
||||
etag?: string;
|
||||
/** The accounts returned in this list response. */
|
||||
items?: Account[];
|
||||
/** Kind of list this is, in this case adsensehost#accounts. */
|
||||
kind?: string;
|
||||
}
|
||||
interface AdClient {
|
||||
/** Whether this ad client is opted in to ARC. */
|
||||
arcOptIn?: boolean;
|
||||
/** Unique identifier of this ad client. */
|
||||
id?: string;
|
||||
/** Kind of resource this is, in this case adsensehost#adClient. */
|
||||
kind?: string;
|
||||
/** This ad client's product code, which corresponds to the PRODUCT_CODE report dimension. */
|
||||
productCode?: string;
|
||||
/** Whether this ad client supports being reported on. */
|
||||
supportsReporting?: boolean;
|
||||
}
|
||||
interface AdClients {
|
||||
/** ETag of this response for caching purposes. */
|
||||
etag?: string;
|
||||
/** The ad clients returned in this list response. */
|
||||
items?: AdClient[];
|
||||
/** Kind of list this is, in this case adsensehost#adClients. */
|
||||
kind?: string;
|
||||
/** Continuation token used to page through ad clients. To retrieve the next page of results, set the next request's "pageToken" value to this. */
|
||||
nextPageToken?: string;
|
||||
}
|
||||
interface AdCode {
|
||||
/** The ad code snippet. */
|
||||
adCode?: string;
|
||||
/** Kind this is, in this case adsensehost#adCode. */
|
||||
kind?: string;
|
||||
}
|
||||
interface AdStyle {
|
||||
/** The colors included in the style. These are represented as six hexadecimal characters, similar to HTML color codes, but without the leading hash. */
|
||||
colors?: {
|
||||
/** The color of the ad background. */
|
||||
background?: string;
|
||||
/** The color of the ad border. */
|
||||
border?: string;
|
||||
/** The color of the ad text. */
|
||||
text?: string;
|
||||
/** The color of the ad title. */
|
||||
title?: string;
|
||||
/** The color of the ad url. */
|
||||
url?: string;
|
||||
};
|
||||
/** The style of the corners in the ad (deprecated: never populated, ignored). */
|
||||
corners?: string;
|
||||
/** The font which is included in the style. */
|
||||
font?: {
|
||||
/** The family of the font. Possible values are: ACCOUNT_DEFAULT_FAMILY, ADSENSE_DEFAULT_FAMILY, ARIAL, TIMES and VERDANA. */
|
||||
family?: string;
|
||||
/** The size of the font. Possible values are: ACCOUNT_DEFAULT_SIZE, ADSENSE_DEFAULT_SIZE, SMALL, MEDIUM and LARGE. */
|
||||
size?: string;
|
||||
};
|
||||
/** Kind this is, in this case adsensehost#adStyle. */
|
||||
kind?: string;
|
||||
}
|
||||
interface AdUnit {
|
||||
/** Identity code of this ad unit, not necessarily unique across ad clients. */
|
||||
code?: string;
|
||||
/** Settings specific to content ads (AFC) and highend mobile content ads (AFMC - deprecated). */
|
||||
contentAdsSettings?: {
|
||||
/** The backup option to be used in instances where no ad is available. */
|
||||
backupOption?: {
|
||||
/** Color to use when type is set to COLOR. These are represented as six hexadecimal characters, similar to HTML color codes, but without the leading hash. */
|
||||
color?: string;
|
||||
/** Type of the backup option. Possible values are BLANK, COLOR and URL. */
|
||||
type?: string;
|
||||
/** URL to use when type is set to URL. */
|
||||
url?: string;
|
||||
};
|
||||
/** Size of this ad unit. Size values are in the form SIZE_{width}_{height}. */
|
||||
size?: string;
|
||||
/** Type of this ad unit. Possible values are TEXT, TEXT_IMAGE, IMAGE and LINK. */
|
||||
type?: string;
|
||||
};
|
||||
/** Custom style information specific to this ad unit. */
|
||||
customStyle?: AdStyle;
|
||||
/** Unique identifier of this ad unit. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */
|
||||
id?: string;
|
||||
/** Kind of resource this is, in this case adsensehost#adUnit. */
|
||||
kind?: string;
|
||||
/** Settings specific to WAP mobile content ads (AFMC - deprecated). */
|
||||
mobileContentAdsSettings?: {
|
||||
/** The markup language to use for this ad unit. */
|
||||
markupLanguage?: string;
|
||||
/** The scripting language to use for this ad unit. */
|
||||
scriptingLanguage?: string;
|
||||
/** Size of this ad unit. */
|
||||
size?: string;
|
||||
/** Type of this ad unit. */
|
||||
type?: string;
|
||||
};
|
||||
/** Name of this ad unit. */
|
||||
name?: string;
|
||||
/**
|
||||
* Status of this ad unit. Possible values are:
|
||||
* NEW: Indicates that the ad unit was created within the last seven days and does not yet have any activity associated with it.
|
||||
*
|
||||
* ACTIVE: Indicates that there has been activity on this ad unit in the last seven days.
|
||||
*
|
||||
* INACTIVE: Indicates that there has been no activity on this ad unit in the last seven days.
|
||||
*/
|
||||
status?: string;
|
||||
}
|
||||
interface AdUnits {
|
||||
/** ETag of this response for caching purposes. */
|
||||
etag?: string;
|
||||
/** The ad units returned in this list response. */
|
||||
items?: AdUnit[];
|
||||
/** Kind of list this is, in this case adsensehost#adUnits. */
|
||||
kind?: string;
|
||||
/** Continuation token used to page through ad units. To retrieve the next page of results, set the next request's "pageToken" value to this. */
|
||||
nextPageToken?: string;
|
||||
}
|
||||
interface AssociationSession {
|
||||
/** Hosted account id of the associated publisher after association. Present if status is ACCEPTED. */
|
||||
accountId?: string;
|
||||
/** Unique identifier of this association session. */
|
||||
id?: string;
|
||||
/** Kind of resource this is, in this case adsensehost#associationSession. */
|
||||
kind?: string;
|
||||
/** The products to associate with the user. Options: AFC, AFG, AFV, AFS (deprecated), AFMC (deprecated) */
|
||||
productCodes?: string[];
|
||||
/** Redirect URL of this association session. Used to redirect users into the AdSense association flow. */
|
||||
redirectUrl?: string;
|
||||
/** Status of the completed association, available once the association callback token has been verified. One of ACCEPTED, REJECTED, or ERROR. */
|
||||
status?: string;
|
||||
/** The preferred locale of the user themselves when going through the AdSense association flow. */
|
||||
userLocale?: string;
|
||||
/** The locale of the user's hosted website. */
|
||||
websiteLocale?: string;
|
||||
/** The URL of the user's hosted website. */
|
||||
websiteUrl?: string;
|
||||
}
|
||||
interface CustomChannel {
|
||||
/** Code of this custom channel, not necessarily unique across ad clients. */
|
||||
code?: string;
|
||||
/** Unique identifier of this custom channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */
|
||||
id?: string;
|
||||
/** Kind of resource this is, in this case adsensehost#customChannel. */
|
||||
kind?: string;
|
||||
/** Name of this custom channel. */
|
||||
name?: string;
|
||||
}
|
||||
interface CustomChannels {
|
||||
/** ETag of this response for caching purposes. */
|
||||
etag?: string;
|
||||
/** The custom channels returned in this list response. */
|
||||
items?: CustomChannel[];
|
||||
/** Kind of list this is, in this case adsensehost#customChannels. */
|
||||
kind?: string;
|
||||
/** Continuation token used to page through custom channels. To retrieve the next page of results, set the next request's "pageToken" value to this. */
|
||||
nextPageToken?: string;
|
||||
}
|
||||
interface Report {
|
||||
/** The averages of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty. */
|
||||
averages?: string[];
|
||||
/**
|
||||
* The header information of the columns requested in the report. This is a list of headers; one for each dimension in the request, followed by one for
|
||||
* each metric in the request.
|
||||
*/
|
||||
headers?: Array<{
|
||||
/** The currency of this column. Only present if the header type is METRIC_CURRENCY. */
|
||||
currency?: string;
|
||||
/** The name of the header. */
|
||||
name?: string;
|
||||
/** The type of the header; one of DIMENSION, METRIC_TALLY, METRIC_RATIO, or METRIC_CURRENCY. */
|
||||
type?: string;
|
||||
}>;
|
||||
/** Kind this is, in this case adsensehost#report. */
|
||||
kind?: string;
|
||||
/**
|
||||
* The output rows of the report. Each row is a list of cells; one for each dimension in the request, followed by one for each metric in the request. The
|
||||
* dimension cells contain strings, and the metric cells contain numbers.
|
||||
*/
|
||||
rows?: string[][];
|
||||
/**
|
||||
* The total number of rows matched by the report request. Fewer rows may be returned in the response due to being limited by the row count requested or
|
||||
* the report row limit.
|
||||
*/
|
||||
totalMatchedRows?: string;
|
||||
/** The totals of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty. */
|
||||
totals?: string[];
|
||||
/** Any warnings associated with generation of the report. */
|
||||
warnings?: string[];
|
||||
}
|
||||
interface UrlChannel {
|
||||
/** Unique identifier of this URL channel. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format. */
|
||||
id?: string;
|
||||
/** Kind of resource this is, in this case adsensehost#urlChannel. */
|
||||
kind?: string;
|
||||
/** URL Pattern of this URL channel. Does not include "http://" or "https://". Example: www.example.com/home */
|
||||
urlPattern?: string;
|
||||
}
|
||||
interface UrlChannels {
|
||||
/** ETag of this response for caching purposes. */
|
||||
etag?: string;
|
||||
/** The URL channels returned in this list response. */
|
||||
items?: UrlChannel[];
|
||||
/** Kind of list this is, in this case adsensehost#urlChannels. */
|
||||
kind?: string;
|
||||
/** Continuation token used to page through URL channels. To retrieve the next page of results, set the next request's "pageToken" value to this. */
|
||||
nextPageToken?: string;
|
||||
}
|
||||
interface AdclientsResource {
|
||||
/** Get information about one of the ad clients in the specified publisher's AdSense account. */
|
||||
get(request: {
|
||||
/** Account which contains the ad client. */
|
||||
accountId: string;
|
||||
/** Ad client to get. */
|
||||
adClientId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<AdClient>;
|
||||
/** List all hosted ad clients in the specified hosted account. */
|
||||
list(request: {
|
||||
/** Account for which to list ad clients. */
|
||||
accountId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** The maximum number of ad clients to include in the response, used for paging. */
|
||||
maxResults?: number;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/**
|
||||
* A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous
|
||||
* response.
|
||||
*/
|
||||
pageToken?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<AdClients>;
|
||||
}
|
||||
interface AdunitsResource {
|
||||
/** Delete the specified ad unit from the specified publisher AdSense account. */
|
||||
delete(request: {
|
||||
/** Account which contains the ad unit. */
|
||||
accountId: string;
|
||||
/** Ad client for which to get ad unit. */
|
||||
adClientId: string;
|
||||
/** Ad unit to delete. */
|
||||
adUnitId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<AdUnit>;
|
||||
/** Get the specified host ad unit in this AdSense account. */
|
||||
get(request: {
|
||||
/** Account which contains the ad unit. */
|
||||
accountId: string;
|
||||
/** Ad client for which to get ad unit. */
|
||||
adClientId: string;
|
||||
/** Ad unit to get. */
|
||||
adUnitId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<AdUnit>;
|
||||
/** Get ad code for the specified ad unit, attaching the specified host custom channels. */
|
||||
getAdCode(request: {
|
||||
/** Account which contains the ad client. */
|
||||
accountId: string;
|
||||
/** Ad client with contains the ad unit. */
|
||||
adClientId: string;
|
||||
/** Ad unit to get the code for. */
|
||||
adUnitId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** Host custom channel to attach to the ad code. */
|
||||
hostCustomChannelId?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<AdCode>;
|
||||
/** Insert the supplied ad unit into the specified publisher AdSense account. */
|
||||
insert(request: {
|
||||
/** Account which will contain the ad unit. */
|
||||
accountId: string;
|
||||
/** Ad client into which to insert the ad unit. */
|
||||
adClientId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<AdUnit>;
|
||||
/** List all ad units in the specified publisher's AdSense account. */
|
||||
list(request: {
|
||||
/** Account which contains the ad client. */
|
||||
accountId: string;
|
||||
/** Ad client for which to list ad units. */
|
||||
adClientId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** Whether to include inactive ad units. Default: true. */
|
||||
includeInactive?: boolean;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** The maximum number of ad units to include in the response, used for paging. */
|
||||
maxResults?: number;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/**
|
||||
* A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous
|
||||
* response.
|
||||
*/
|
||||
pageToken?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<AdUnits>;
|
||||
/** Update the supplied ad unit in the specified publisher AdSense account. This method supports patch semantics. */
|
||||
patch(request: {
|
||||
/** Account which contains the ad client. */
|
||||
accountId: string;
|
||||
/** Ad client which contains the ad unit. */
|
||||
adClientId: string;
|
||||
/** Ad unit to get. */
|
||||
adUnitId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<AdUnit>;
|
||||
/** Update the supplied ad unit in the specified publisher AdSense account. */
|
||||
update(request: {
|
||||
/** Account which contains the ad client. */
|
||||
accountId: string;
|
||||
/** Ad client which contains the ad unit. */
|
||||
adClientId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<AdUnit>;
|
||||
}
|
||||
interface ReportsResource {
|
||||
/**
|
||||
* Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format
|
||||
* specify "alt=csv" as a query parameter.
|
||||
*/
|
||||
generate(request: {
|
||||
/** Hosted account upon which to report. */
|
||||
accountId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Dimensions to base the report on. */
|
||||
dimension?: string;
|
||||
/** End of the date range to report on in "YYYY-MM-DD" format, inclusive. */
|
||||
endDate: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** Filters to be run on the report. */
|
||||
filter?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */
|
||||
locale?: string;
|
||||
/** The maximum number of rows of report data to return. */
|
||||
maxResults?: number;
|
||||
/** Numeric columns to include in the report. */
|
||||
metric?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/**
|
||||
* The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no
|
||||
* prefix is specified, the column is sorted ascending.
|
||||
*/
|
||||
sort?: string;
|
||||
/** Start of the date range to report on in "YYYY-MM-DD" format, inclusive. */
|
||||
startDate: string;
|
||||
/** Index of the first row of report data to return. */
|
||||
startIndex?: number;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<Report>;
|
||||
}
|
||||
interface AccountsResource {
|
||||
/** Get information about the selected associated AdSense account. */
|
||||
get(request: {
|
||||
/** Account to get information about. */
|
||||
accountId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<Account>;
|
||||
/** List hosted accounts associated with this AdSense account by ad client id. */
|
||||
list(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** Ad clients to list accounts for. */
|
||||
filterAdClientId: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<Accounts>;
|
||||
adclients: AdclientsResource;
|
||||
adunits: AdunitsResource;
|
||||
reports: ReportsResource;
|
||||
}
|
||||
interface AdclientsResource {
|
||||
/** Get information about one of the ad clients in the Host AdSense account. */
|
||||
get(request: {
|
||||
/** Ad client to get. */
|
||||
adClientId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<AdClient>;
|
||||
/** List all host ad clients in this AdSense account. */
|
||||
list(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** The maximum number of ad clients to include in the response, used for paging. */
|
||||
maxResults?: number;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/**
|
||||
* A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous
|
||||
* response.
|
||||
*/
|
||||
pageToken?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<AdClients>;
|
||||
}
|
||||
interface AssociationsessionsResource {
|
||||
/** Create an association session for initiating an association with an AdSense user. */
|
||||
start(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Products to associate with the user. */
|
||||
productCode: string;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
/** The preferred locale of the user. */
|
||||
userLocale?: string;
|
||||
/** The locale of the user's hosted website. */
|
||||
websiteLocale?: string;
|
||||
/** The URL of the user's hosted website. */
|
||||
websiteUrl: string;
|
||||
}): Request<AssociationSession>;
|
||||
/** Verify an association session after the association callback returns from AdSense signup. */
|
||||
verify(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** The token returned to the association callback URL. */
|
||||
token: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<AssociationSession>;
|
||||
}
|
||||
interface CustomchannelsResource {
|
||||
/** Delete a specific custom channel from the host AdSense account. */
|
||||
delete(request: {
|
||||
/** Ad client from which to delete the custom channel. */
|
||||
adClientId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Custom channel to delete. */
|
||||
customChannelId: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<CustomChannel>;
|
||||
/** Get a specific custom channel from the host AdSense account. */
|
||||
get(request: {
|
||||
/** Ad client from which to get the custom channel. */
|
||||
adClientId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Custom channel to get. */
|
||||
customChannelId: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<CustomChannel>;
|
||||
/** Add a new custom channel to the host AdSense account. */
|
||||
insert(request: {
|
||||
/** Ad client to which the new custom channel will be added. */
|
||||
adClientId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<CustomChannel>;
|
||||
/** List all host custom channels in this AdSense account. */
|
||||
list(request: {
|
||||
/** Ad client for which to list custom channels. */
|
||||
adClientId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** The maximum number of custom channels to include in the response, used for paging. */
|
||||
maxResults?: number;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/**
|
||||
* A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the
|
||||
* previous response.
|
||||
*/
|
||||
pageToken?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<CustomChannels>;
|
||||
/** Update a custom channel in the host AdSense account. This method supports patch semantics. */
|
||||
patch(request: {
|
||||
/** Ad client in which the custom channel will be updated. */
|
||||
adClientId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Custom channel to get. */
|
||||
customChannelId: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<CustomChannel>;
|
||||
/** Update a custom channel in the host AdSense account. */
|
||||
update(request: {
|
||||
/** Ad client in which the custom channel will be updated. */
|
||||
adClientId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<CustomChannel>;
|
||||
}
|
||||
interface ReportsResource {
|
||||
/**
|
||||
* Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format
|
||||
* specify "alt=csv" as a query parameter.
|
||||
*/
|
||||
generate(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Dimensions to base the report on. */
|
||||
dimension?: string;
|
||||
/** End of the date range to report on in "YYYY-MM-DD" format, inclusive. */
|
||||
endDate: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** Filters to be run on the report. */
|
||||
filter?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. */
|
||||
locale?: string;
|
||||
/** The maximum number of rows of report data to return. */
|
||||
maxResults?: number;
|
||||
/** Numeric columns to include in the report. */
|
||||
metric?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/**
|
||||
* The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no
|
||||
* prefix is specified, the column is sorted ascending.
|
||||
*/
|
||||
sort?: string;
|
||||
/** Start of the date range to report on in "YYYY-MM-DD" format, inclusive. */
|
||||
startDate: string;
|
||||
/** Index of the first row of report data to return. */
|
||||
startIndex?: number;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<Report>;
|
||||
}
|
||||
interface UrlchannelsResource {
|
||||
/** Delete a URL channel from the host AdSense account. */
|
||||
delete(request: {
|
||||
/** Ad client from which to delete the URL channel. */
|
||||
adClientId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** URL channel to delete. */
|
||||
urlChannelId: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<UrlChannel>;
|
||||
/** Add a new URL channel to the host AdSense account. */
|
||||
insert(request: {
|
||||
/** Ad client to which the new URL channel will be added. */
|
||||
adClientId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<UrlChannel>;
|
||||
/** List all host URL channels in the host AdSense account. */
|
||||
list(request: {
|
||||
/** Ad client for which to list URL channels. */
|
||||
adClientId: string;
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** The maximum number of URL channels to include in the response, used for paging. */
|
||||
maxResults?: number;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/**
|
||||
* A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the
|
||||
* previous response.
|
||||
*/
|
||||
pageToken?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<UrlChannels>;
|
||||
}
|
||||
}
|
||||
}
|
||||
134
types/gapi.client.adsensehost/readme.md
Normal file
134
types/gapi.client.adsensehost/readme.md
Normal file
@ -0,0 +1,134 @@
|
||||
# TypeScript typings for AdSense Host API v4.1
|
||||
Generates performance reports, generates ad codes, and provides publisher management capabilities for AdSense Hosts.
|
||||
For detailed description please check [documentation](https://developers.google.com/adsense/host/).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for AdSense Host API:
|
||||
```
|
||||
npm install @types/gapi.client.adsensehost@v4.1 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('adsensehost', 'v4.1', () => {
|
||||
// now we can use gapi.client.adsensehost
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// View and manage your AdSense host data and associated accounts
|
||||
'https://www.googleapis.com/auth/adsensehost',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use AdSense Host API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Get information about the selected associated AdSense account.
|
||||
*/
|
||||
await gapi.client.accounts.get({ accountId: "accountId", });
|
||||
|
||||
/*
|
||||
List hosted accounts associated with this AdSense account by ad client id.
|
||||
*/
|
||||
await gapi.client.accounts.list({ filterAdClientId: "filterAdClientId", });
|
||||
|
||||
/*
|
||||
Get information about one of the ad clients in the Host AdSense account.
|
||||
*/
|
||||
await gapi.client.adclients.get({ adClientId: "adClientId", });
|
||||
|
||||
/*
|
||||
List all host ad clients in this AdSense account.
|
||||
*/
|
||||
await gapi.client.adclients.list({ });
|
||||
|
||||
/*
|
||||
Create an association session for initiating an association with an AdSense user.
|
||||
*/
|
||||
await gapi.client.associationsessions.start({ productCode: "productCode", websiteUrl: "websiteUrl", });
|
||||
|
||||
/*
|
||||
Verify an association session after the association callback returns from AdSense signup.
|
||||
*/
|
||||
await gapi.client.associationsessions.verify({ token: "token", });
|
||||
|
||||
/*
|
||||
Delete a specific custom channel from the host AdSense account.
|
||||
*/
|
||||
await gapi.client.customchannels.delete({ adClientId: "adClientId", customChannelId: "customChannelId", });
|
||||
|
||||
/*
|
||||
Get a specific custom channel from the host AdSense account.
|
||||
*/
|
||||
await gapi.client.customchannels.get({ adClientId: "adClientId", customChannelId: "customChannelId", });
|
||||
|
||||
/*
|
||||
Add a new custom channel to the host AdSense account.
|
||||
*/
|
||||
await gapi.client.customchannels.insert({ adClientId: "adClientId", });
|
||||
|
||||
/*
|
||||
List all host custom channels in this AdSense account.
|
||||
*/
|
||||
await gapi.client.customchannels.list({ adClientId: "adClientId", });
|
||||
|
||||
/*
|
||||
Update a custom channel in the host AdSense account. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.customchannels.patch({ adClientId: "adClientId", customChannelId: "customChannelId", });
|
||||
|
||||
/*
|
||||
Update a custom channel in the host AdSense account.
|
||||
*/
|
||||
await gapi.client.customchannels.update({ adClientId: "adClientId", });
|
||||
|
||||
/*
|
||||
Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
|
||||
*/
|
||||
await gapi.client.reports.generate({ endDate: "endDate", startDate: "startDate", });
|
||||
|
||||
/*
|
||||
Delete a URL channel from the host AdSense account.
|
||||
*/
|
||||
await gapi.client.urlchannels.delete({ adClientId: "adClientId", urlChannelId: "urlChannelId", });
|
||||
|
||||
/*
|
||||
Add a new URL channel to the host AdSense account.
|
||||
*/
|
||||
await gapi.client.urlchannels.insert({ adClientId: "adClientId", });
|
||||
|
||||
/*
|
||||
List all host URL channels in the host AdSense account.
|
||||
*/
|
||||
await gapi.client.urlchannels.list({ adClientId: "adClientId", });
|
||||
```
|
||||
24
types/gapi.client.adsensehost/tsconfig.json
Normal file
24
types/gapi.client.adsensehost/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.adsensehost-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.adsensehost/tslint.json
Normal file
8
types/gapi.client.adsensehost/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
45
types/gapi.client.analytics/gapi.client.analytics-tests.ts
Normal file
45
types/gapi.client.analytics/gapi.client.analytics-tests.ts
Normal file
@ -0,0 +1,45 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('analytics', 'v3', () => {
|
||||
/** now we can use gapi.client.analytics */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** View and manage your Google Analytics data */
|
||||
'https://www.googleapis.com/auth/analytics',
|
||||
/** Edit Google Analytics management entities */
|
||||
'https://www.googleapis.com/auth/analytics.edit',
|
||||
/** Manage Google Analytics Account users by email address */
|
||||
'https://www.googleapis.com/auth/analytics.manage.users',
|
||||
/** View Google Analytics user permissions */
|
||||
'https://www.googleapis.com/auth/analytics.manage.users.readonly',
|
||||
/** Create a new Google Analytics account along with its default property and view */
|
||||
'https://www.googleapis.com/auth/analytics.provision',
|
||||
/** View your Google Analytics data */
|
||||
'https://www.googleapis.com/auth/analytics.readonly',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/** Creates an account ticket. */
|
||||
await gapi.client.provisioning.createAccountTicket({
|
||||
});
|
||||
}
|
||||
});
|
||||
4071
types/gapi.client.analytics/index.d.ts
vendored
Normal file
4071
types/gapi.client.analytics/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
74
types/gapi.client.analytics/readme.md
Normal file
74
types/gapi.client.analytics/readme.md
Normal file
@ -0,0 +1,74 @@
|
||||
# TypeScript typings for Google Analytics API v3
|
||||
Views and manages your Google Analytics data.
|
||||
For detailed description please check [documentation](https://developers.google.com/analytics/).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for Google Analytics API:
|
||||
```
|
||||
npm install @types/gapi.client.analytics@v3 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('analytics', 'v3', () => {
|
||||
// now we can use gapi.client.analytics
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// View and manage your Google Analytics data
|
||||
'https://www.googleapis.com/auth/analytics',
|
||||
|
||||
// Edit Google Analytics management entities
|
||||
'https://www.googleapis.com/auth/analytics.edit',
|
||||
|
||||
// Manage Google Analytics Account users by email address
|
||||
'https://www.googleapis.com/auth/analytics.manage.users',
|
||||
|
||||
// View Google Analytics user permissions
|
||||
'https://www.googleapis.com/auth/analytics.manage.users.readonly',
|
||||
|
||||
// Create a new Google Analytics account along with its default property and view
|
||||
'https://www.googleapis.com/auth/analytics.provision',
|
||||
|
||||
// View your Google Analytics data
|
||||
'https://www.googleapis.com/auth/analytics.readonly',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use Google Analytics API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Creates an account ticket.
|
||||
*/
|
||||
await gapi.client.provisioning.createAccountTicket({ });
|
||||
```
|
||||
24
types/gapi.client.analytics/tsconfig.json
Normal file
24
types/gapi.client.analytics/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.analytics-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.analytics/tslint.json
Normal file
8
types/gapi.client.analytics/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('analyticsreporting', 'v4', () => {
|
||||
/** now we can use gapi.client.analyticsreporting */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** View and manage your Google Analytics data */
|
||||
'https://www.googleapis.com/auth/analytics',
|
||||
/** View your Google Analytics data */
|
||||
'https://www.googleapis.com/auth/analytics.readonly',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/** Returns the Analytics data. */
|
||||
await gapi.client.reports.batchGet({
|
||||
});
|
||||
}
|
||||
});
|
||||
698
types/gapi.client.analyticsreporting/index.d.ts
vendored
Normal file
698
types/gapi.client.analyticsreporting/index.d.ts
vendored
Normal file
@ -0,0 +1,698 @@
|
||||
// Type definitions for Google Google Analytics Reporting API v4 4.0
|
||||
// Project: https://developers.google.com/analytics/devguides/reporting/core/v4/
|
||||
// Definitions by: Bolisov Alexey <https://github.com/Bolisov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// IMPORTANT
|
||||
// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
// Generated from: https://analyticsreporting.googleapis.com/$discovery/rest?version=v4
|
||||
|
||||
/// <reference types="gapi.client" />
|
||||
|
||||
declare namespace gapi.client {
|
||||
/** Load Google Analytics Reporting API v4 */
|
||||
function load(name: "analyticsreporting", version: "v4"): PromiseLike<void>;
|
||||
function load(name: "analyticsreporting", version: "v4", callback: () => any): void;
|
||||
|
||||
const reports: analyticsreporting.ReportsResource;
|
||||
|
||||
namespace analyticsreporting {
|
||||
interface Cohort {
|
||||
/**
|
||||
* This is used for `FIRST_VISIT_DATE` cohort, the cohort selects users
|
||||
* whose first visit date is between start date and end date defined in the
|
||||
* DateRange. The date ranges should be aligned for cohort requests. If the
|
||||
* request contains `ga:cohortNthDay` it should be exactly one day long,
|
||||
* if `ga:cohortNthWeek` it should be aligned to the week boundary (starting
|
||||
* at Sunday and ending Saturday), and for `ga:cohortNthMonth` the date range
|
||||
* should be aligned to the month (starting at the first and ending on the
|
||||
* last day of the month).
|
||||
* For LTV requests there are no such restrictions.
|
||||
* You do not need to supply a date range for the
|
||||
* `reportsRequest.dateRanges` field.
|
||||
*/
|
||||
dateRange?: DateRange;
|
||||
/**
|
||||
* A unique name for the cohort. If not defined name will be auto-generated
|
||||
* with values cohort_[1234...].
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Type of the cohort. The only supported type as of now is
|
||||
* `FIRST_VISIT_DATE`. If this field is unspecified the cohort is treated
|
||||
* as `FIRST_VISIT_DATE` type cohort.
|
||||
*/
|
||||
type?: string;
|
||||
}
|
||||
interface CohortGroup {
|
||||
/** The definition for the cohort. */
|
||||
cohorts?: Cohort[];
|
||||
/**
|
||||
* Enable Life Time Value (LTV). LTV measures lifetime value for users
|
||||
* acquired through different channels.
|
||||
* Please see:
|
||||
* [Cohort Analysis](https://support.google.com/analytics/answer/6074676) and
|
||||
* [Lifetime Value](https://support.google.com/analytics/answer/6182550)
|
||||
* If the value of lifetimeValue is false:
|
||||
*
|
||||
* - The metric values are similar to the values in the web interface cohort
|
||||
* report.
|
||||
* - The cohort definition date ranges must be aligned to the calendar week
|
||||
* and month. i.e. while requesting `ga:cohortNthWeek` the `startDate` in
|
||||
* the cohort definition should be a Sunday and the `endDate` should be the
|
||||
* following Saturday, and for `ga:cohortNthMonth`, the `startDate`
|
||||
* should be the 1st of the month and `endDate` should be the last day
|
||||
* of the month.
|
||||
*
|
||||
* When the lifetimeValue is true:
|
||||
*
|
||||
* - The metric values will correspond to the values in the web interface
|
||||
* LifeTime value report.
|
||||
* - The Lifetime Value report shows you how user value (Revenue) and
|
||||
* engagement (Appviews, Goal Completions, Sessions, and Session Duration)
|
||||
* grow during the 90 days after a user is acquired.
|
||||
* - The metrics are calculated as a cumulative average per user per the time
|
||||
* increment.
|
||||
* - The cohort definition date ranges need not be aligned to the calendar
|
||||
* week and month boundaries.
|
||||
* - The `viewId` must be an
|
||||
* [app view ID](https://support.google.com/analytics/answer/2649553#WebVersusAppViews)
|
||||
*/
|
||||
lifetimeValue?: boolean;
|
||||
}
|
||||
interface ColumnHeader {
|
||||
/** The dimension names in the response. */
|
||||
dimensions?: string[];
|
||||
/** Metric headers for the metrics in the response. */
|
||||
metricHeader?: MetricHeader;
|
||||
}
|
||||
interface DateRange {
|
||||
/** The end date for the query in the format `YYYY-MM-DD`. */
|
||||
endDate?: string;
|
||||
/** The start date for the query in the format `YYYY-MM-DD`. */
|
||||
startDate?: string;
|
||||
}
|
||||
interface DateRangeValues {
|
||||
/** The values of each pivot region. */
|
||||
pivotValueRegions?: PivotValueRegion[];
|
||||
/** Each value corresponds to each Metric in the request. */
|
||||
values?: string[];
|
||||
}
|
||||
interface Dimension {
|
||||
/**
|
||||
* If non-empty, we place dimension values into buckets after string to
|
||||
* int64. Dimension values that are not the string representation of an
|
||||
* integral value will be converted to zero. The bucket values have to be in
|
||||
* increasing order. Each bucket is closed on the lower end, and open on the
|
||||
* upper end. The "first" bucket includes all values less than the first
|
||||
* boundary, the "last" bucket includes all values up to infinity. Dimension
|
||||
* values that fall in a bucket get transformed to a new dimension value. For
|
||||
* example, if one gives a list of "0, 1, 3, 4, 7", then we return the
|
||||
* following buckets:
|
||||
*
|
||||
* - bucket #1: values < 0, dimension value "<0"
|
||||
* - bucket #2: values in [0,1), dimension value "0"
|
||||
* - bucket #3: values in [1,3), dimension value "1-2"
|
||||
* - bucket #4: values in [3,4), dimension value "3"
|
||||
* - bucket #5: values in [4,7), dimension value "4-6"
|
||||
* - bucket #6: values >= 7, dimension value "7+"
|
||||
*
|
||||
* NOTE: If you are applying histogram mutation on any dimension, and using
|
||||
* that dimension in sort, you will want to use the sort type
|
||||
* `HISTOGRAM_BUCKET` for that purpose. Without that the dimension values
|
||||
* will be sorted according to dictionary
|
||||
* (lexicographic) order. For example the ascending dictionary order is:
|
||||
*
|
||||
* "<50", "1001+", "121-1000", "50-120"
|
||||
*
|
||||
* And the ascending `HISTOGRAM_BUCKET` order is:
|
||||
*
|
||||
* "<50", "50-120", "121-1000", "1001+"
|
||||
*
|
||||
* The client has to explicitly request `"orderType": "HISTOGRAM_BUCKET"`
|
||||
* for a histogram-mutated dimension.
|
||||
*/
|
||||
histogramBuckets?: string[];
|
||||
/** Name of the dimension to fetch, for example `ga:browser`. */
|
||||
name?: string;
|
||||
}
|
||||
interface DimensionFilter {
|
||||
/** Should the match be case sensitive? Default is false. */
|
||||
caseSensitive?: boolean;
|
||||
/** The dimension to filter on. A DimensionFilter must contain a dimension. */
|
||||
dimensionName?: string;
|
||||
/**
|
||||
* Strings or regular expression to match against. Only the first value of
|
||||
* the list is used for comparison unless the operator is `IN_LIST`.
|
||||
* If `IN_LIST` operator, then the entire list is used to filter the
|
||||
* dimensions as explained in the description of the `IN_LIST` operator.
|
||||
*/
|
||||
expressions?: string[];
|
||||
/**
|
||||
* Logical `NOT` operator. If this boolean is set to true, then the matching
|
||||
* dimension values will be excluded in the report. The default is false.
|
||||
*/
|
||||
not?: boolean;
|
||||
/** How to match the dimension to the expression. The default is REGEXP. */
|
||||
operator?: string;
|
||||
}
|
||||
interface DimensionFilterClause {
|
||||
/**
|
||||
* The repeated set of filters. They are logically combined based on the
|
||||
* operator specified.
|
||||
*/
|
||||
filters?: DimensionFilter[];
|
||||
/**
|
||||
* The operator for combining multiple dimension filters. If unspecified, it
|
||||
* is treated as an `OR`.
|
||||
*/
|
||||
operator?: string;
|
||||
}
|
||||
interface DynamicSegment {
|
||||
/** The name of the dynamic segment. */
|
||||
name?: string;
|
||||
/** Session Segment to select sessions to include in the segment. */
|
||||
sessionSegment?: SegmentDefinition;
|
||||
/** User Segment to select users to include in the segment. */
|
||||
userSegment?: SegmentDefinition;
|
||||
}
|
||||
interface GetReportsRequest {
|
||||
/**
|
||||
* Requests, each request will have a separate response.
|
||||
* There can be a maximum of 5 requests. All requests should have the same
|
||||
* `dateRanges`, `viewId`, `segments`, `samplingLevel`, and `cohortGroup`.
|
||||
*/
|
||||
reportRequests?: ReportRequest[];
|
||||
}
|
||||
interface GetReportsResponse {
|
||||
/** Responses corresponding to each of the request. */
|
||||
reports?: Report[];
|
||||
}
|
||||
interface Metric {
|
||||
/**
|
||||
* An alias for the metric expression is an alternate name for the
|
||||
* expression. The alias can be used for filtering and sorting. This field
|
||||
* is optional and is useful if the expression is not a single metric but
|
||||
* a complex expression which cannot be used in filtering and sorting.
|
||||
* The alias is also used in the response column header.
|
||||
*/
|
||||
alias?: string;
|
||||
/**
|
||||
* A metric expression in the request. An expression is constructed from one
|
||||
* or more metrics and numbers. Accepted operators include: Plus (+), Minus
|
||||
* (-), Negation (Unary -), Divided by (/), Multiplied by (*), Parenthesis,
|
||||
* Positive cardinal numbers (0-9), can include decimals and is limited to
|
||||
* 1024 characters. Example `ga:totalRefunds/ga:users`, in most cases the
|
||||
* metric expression is just a single metric name like `ga:users`.
|
||||
* Adding mixed `MetricType` (E.g., `CURRENCY` + `PERCENTAGE`) metrics
|
||||
* will result in unexpected results.
|
||||
*/
|
||||
expression?: string;
|
||||
/**
|
||||
* Specifies how the metric expression should be formatted, for example
|
||||
* `INTEGER`.
|
||||
*/
|
||||
formattingType?: string;
|
||||
}
|
||||
interface MetricFilter {
|
||||
/** The value to compare against. */
|
||||
comparisonValue?: string;
|
||||
/**
|
||||
* The metric that will be filtered on. A metricFilter must contain a metric
|
||||
* name. A metric name can be an alias earlier defined as a metric or it can
|
||||
* also be a metric expression.
|
||||
*/
|
||||
metricName?: string;
|
||||
/**
|
||||
* Logical `NOT` operator. If this boolean is set to true, then the matching
|
||||
* metric values will be excluded in the report. The default is false.
|
||||
*/
|
||||
not?: boolean;
|
||||
/**
|
||||
* Is the metric `EQUAL`, `LESS_THAN` or `GREATER_THAN` the
|
||||
* comparisonValue, the default is `EQUAL`. If the operator is
|
||||
* `IS_MISSING`, checks if the metric is missing and would ignore the
|
||||
* comparisonValue.
|
||||
*/
|
||||
operator?: string;
|
||||
}
|
||||
interface MetricFilterClause {
|
||||
/**
|
||||
* The repeated set of filters. They are logically combined based on the
|
||||
* operator specified.
|
||||
*/
|
||||
filters?: MetricFilter[];
|
||||
/**
|
||||
* The operator for combining multiple metric filters. If unspecified, it is
|
||||
* treated as an `OR`.
|
||||
*/
|
||||
operator?: string;
|
||||
}
|
||||
interface MetricHeader {
|
||||
/** Headers for the metrics in the response. */
|
||||
metricHeaderEntries?: MetricHeaderEntry[];
|
||||
/** Headers for the pivots in the response. */
|
||||
pivotHeaders?: PivotHeader[];
|
||||
}
|
||||
interface MetricHeaderEntry {
|
||||
/** The name of the header. */
|
||||
name?: string;
|
||||
/** The type of the metric, for example `INTEGER`. */
|
||||
type?: string;
|
||||
}
|
||||
interface OrFiltersForSegment {
|
||||
/** List of segment filters to be combined with a `OR` operator. */
|
||||
segmentFilterClauses?: SegmentFilterClause[];
|
||||
}
|
||||
interface OrderBy {
|
||||
/**
|
||||
* The field which to sort by. The default sort order is ascending. Example:
|
||||
* `ga:browser`.
|
||||
* Note, that you can only specify one field for sort here. For example,
|
||||
* `ga:browser, ga:city` is not valid.
|
||||
*/
|
||||
fieldName?: string;
|
||||
/** The order type. The default orderType is `VALUE`. */
|
||||
orderType?: string;
|
||||
/** The sorting order for the field. */
|
||||
sortOrder?: string;
|
||||
}
|
||||
interface Pivot {
|
||||
/**
|
||||
* DimensionFilterClauses are logically combined with an `AND` operator: only
|
||||
* data that is included by all these DimensionFilterClauses contributes to
|
||||
* the values in this pivot region. Dimension filters can be used to restrict
|
||||
* the columns shown in the pivot region. For example if you have
|
||||
* `ga:browser` as the requested dimension in the pivot region, and you
|
||||
* specify key filters to restrict `ga:browser` to only "IE" or "Firefox",
|
||||
* then only those two browsers would show up as columns.
|
||||
*/
|
||||
dimensionFilterClauses?: DimensionFilterClause[];
|
||||
/**
|
||||
* A list of dimensions to show as pivot columns. A Pivot can have a maximum
|
||||
* of 4 dimensions. Pivot dimensions are part of the restriction on the
|
||||
* total number of dimensions allowed in the request.
|
||||
*/
|
||||
dimensions?: Dimension[];
|
||||
/**
|
||||
* Specifies the maximum number of groups to return.
|
||||
* The default value is 10, also the maximum value is 1,000.
|
||||
*/
|
||||
maxGroupCount?: number;
|
||||
/**
|
||||
* The pivot metrics. Pivot metrics are part of the
|
||||
* restriction on total number of metrics allowed in the request.
|
||||
*/
|
||||
metrics?: Metric[];
|
||||
/**
|
||||
* If k metrics were requested, then the response will contain some
|
||||
* data-dependent multiple of k columns in the report. E.g., if you pivoted
|
||||
* on the dimension `ga:browser` then you'd get k columns for "Firefox", k
|
||||
* columns for "IE", k columns for "Chrome", etc. The ordering of the groups
|
||||
* of columns is determined by descending order of "total" for the first of
|
||||
* the k values. Ties are broken by lexicographic ordering of the first
|
||||
* pivot dimension, then lexicographic ordering of the second pivot
|
||||
* dimension, and so on. E.g., if the totals for the first value for
|
||||
* Firefox, IE, and Chrome were 8, 2, 8, respectively, the order of columns
|
||||
* would be Chrome, Firefox, IE.
|
||||
*
|
||||
* The following let you choose which of the groups of k columns are
|
||||
* included in the response.
|
||||
*/
|
||||
startGroup?: number;
|
||||
}
|
||||
interface PivotHeader {
|
||||
/** A single pivot section header. */
|
||||
pivotHeaderEntries?: PivotHeaderEntry[];
|
||||
/** The total number of groups for this pivot. */
|
||||
totalPivotGroupsCount?: number;
|
||||
}
|
||||
interface PivotHeaderEntry {
|
||||
/** The name of the dimensions in the pivot response. */
|
||||
dimensionNames?: string[];
|
||||
/** The values for the dimensions in the pivot. */
|
||||
dimensionValues?: string[];
|
||||
/** The metric header for the metric in the pivot. */
|
||||
metric?: MetricHeaderEntry;
|
||||
}
|
||||
interface PivotValueRegion {
|
||||
/** The values of the metrics in each of the pivot regions. */
|
||||
values?: string[];
|
||||
}
|
||||
interface Report {
|
||||
/** The column headers. */
|
||||
columnHeader?: ColumnHeader;
|
||||
/** Response data. */
|
||||
data?: ReportData;
|
||||
/** Page token to retrieve the next page of results in the list. */
|
||||
nextPageToken?: string;
|
||||
}
|
||||
interface ReportData {
|
||||
/**
|
||||
* The last time the data in the report was refreshed. All the hits received
|
||||
* before this timestamp are included in the calculation of the report.
|
||||
*/
|
||||
dataLastRefreshed?: string;
|
||||
/**
|
||||
* Indicates if response to this request is golden or not. Data is
|
||||
* golden when the exact same request will not produce any new results if
|
||||
* asked at a later point in time.
|
||||
*/
|
||||
isDataGolden?: boolean;
|
||||
/**
|
||||
* Minimum and maximum values seen over all matching rows. These are both
|
||||
* empty when `hideValueRanges` in the request is false, or when
|
||||
* rowCount is zero.
|
||||
*/
|
||||
maximums?: DateRangeValues[];
|
||||
/**
|
||||
* Minimum and maximum values seen over all matching rows. These are both
|
||||
* empty when `hideValueRanges` in the request is false, or when
|
||||
* rowCount is zero.
|
||||
*/
|
||||
minimums?: DateRangeValues[];
|
||||
/** Total number of matching rows for this query. */
|
||||
rowCount?: number;
|
||||
/** There's one ReportRow for every unique combination of dimensions. */
|
||||
rows?: ReportRow[];
|
||||
/**
|
||||
* If the results are
|
||||
* [sampled](https://support.google.com/analytics/answer/2637192),
|
||||
* this returns the total number of samples read, one entry per date range.
|
||||
* If the results are not sampled this field will not be defined. See
|
||||
* [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling)
|
||||
* for details.
|
||||
*/
|
||||
samplesReadCounts?: string[];
|
||||
/**
|
||||
* If the results are
|
||||
* [sampled](https://support.google.com/analytics/answer/2637192),
|
||||
* this returns the total number of
|
||||
* samples present, one entry per date range. If the results are not sampled
|
||||
* this field will not be defined. See
|
||||
* [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling)
|
||||
* for details.
|
||||
*/
|
||||
samplingSpaceSizes?: string[];
|
||||
/**
|
||||
* For each requested date range, for the set of all rows that match
|
||||
* the query, every requested value format gets a total. The total
|
||||
* for a value format is computed by first totaling the metrics
|
||||
* mentioned in the value format and then evaluating the value
|
||||
* format as a scalar expression. E.g., The "totals" for
|
||||
* `3 / (ga:sessions + 2)` we compute
|
||||
* `3 / ((sum of all relevant ga:sessions) + 2)`.
|
||||
* Totals are computed before pagination.
|
||||
*/
|
||||
totals?: DateRangeValues[];
|
||||
}
|
||||
interface ReportRequest {
|
||||
/**
|
||||
* Cohort group associated with this request. If there is a cohort group
|
||||
* in the request the `ga:cohort` dimension must be present.
|
||||
* Every [ReportRequest](#ReportRequest) within a `batchGet` method must
|
||||
* contain the same `cohortGroup` definition.
|
||||
*/
|
||||
cohortGroup?: CohortGroup;
|
||||
/**
|
||||
* Date ranges in the request. The request can have a maximum of 2 date
|
||||
* ranges. The response will contain a set of metric values for each
|
||||
* combination of the dimensions for each date range in the request. So, if
|
||||
* there are two date ranges, there will be two set of metric values, one for
|
||||
* the original date range and one for the second date range.
|
||||
* The `reportRequest.dateRanges` field should not be specified for cohorts
|
||||
* or Lifetime value requests.
|
||||
* If a date range is not provided, the default date range is (startDate:
|
||||
* current date - 7 days, endDate: current date - 1 day). Every
|
||||
* [ReportRequest](#ReportRequest) within a `batchGet` method must
|
||||
* contain the same `dateRanges` definition.
|
||||
*/
|
||||
dateRanges?: DateRange[];
|
||||
/**
|
||||
* The dimension filter clauses for filtering Dimension Values. They are
|
||||
* logically combined with the `AND` operator. Note that filtering occurs
|
||||
* before any dimensions are aggregated, so that the returned metrics
|
||||
* represent the total for only the relevant dimensions.
|
||||
*/
|
||||
dimensionFilterClauses?: DimensionFilterClause[];
|
||||
/**
|
||||
* The dimensions requested.
|
||||
* Requests can have a total of 7 dimensions.
|
||||
*/
|
||||
dimensions?: Dimension[];
|
||||
/**
|
||||
* Dimension or metric filters that restrict the data returned for your
|
||||
* request. To use the `filtersExpression`, supply a dimension or metric on
|
||||
* which to filter, followed by the filter expression. For example, the
|
||||
* following expression selects `ga:browser` dimension which starts with
|
||||
* Firefox; `ga:browser=~^Firefox`. For more information on dimensions
|
||||
* and metric filters, see
|
||||
* [Filters reference](https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters).
|
||||
*/
|
||||
filtersExpression?: string;
|
||||
/**
|
||||
* If set to true, hides the total of all metrics for all the matching rows,
|
||||
* for every date range. The default false and will return the totals.
|
||||
*/
|
||||
hideTotals?: boolean;
|
||||
/**
|
||||
* If set to true, hides the minimum and maximum across all matching rows.
|
||||
* The default is false and the value ranges are returned.
|
||||
*/
|
||||
hideValueRanges?: boolean;
|
||||
/**
|
||||
* If set to false, the response does not include rows if all the retrieved
|
||||
* metrics are equal to zero. The default is false which will exclude these
|
||||
* rows.
|
||||
*/
|
||||
includeEmptyRows?: boolean;
|
||||
/**
|
||||
* The metric filter clauses. They are logically combined with the `AND`
|
||||
* operator. Metric filters look at only the first date range and not the
|
||||
* comparing date range. Note that filtering on metrics occurs after the
|
||||
* metrics are aggregated.
|
||||
*/
|
||||
metricFilterClauses?: MetricFilterClause[];
|
||||
/**
|
||||
* The metrics requested.
|
||||
* Requests must specify at least one metric. Requests can have a
|
||||
* total of 10 metrics.
|
||||
*/
|
||||
metrics?: Metric[];
|
||||
/**
|
||||
* Sort order on output rows. To compare two rows, the elements of the
|
||||
* following are applied in order until a difference is found. All date
|
||||
* ranges in the output get the same row order.
|
||||
*/
|
||||
orderBys?: OrderBy[];
|
||||
/**
|
||||
* Page size is for paging and specifies the maximum number of returned rows.
|
||||
* Page size should be >= 0. A query returns the default of 1,000 rows.
|
||||
* The Analytics Core Reporting API returns a maximum of 10,000 rows per
|
||||
* request, no matter how many you ask for. It can also return fewer rows
|
||||
* than requested, if there aren't as many dimension segments as you expect.
|
||||
* For instance, there are fewer than 300 possible values for `ga:country`,
|
||||
* so when segmenting only by country, you can't get more than 300 rows,
|
||||
* even if you set `pageSize` to a higher value.
|
||||
*/
|
||||
pageSize?: number;
|
||||
/**
|
||||
* A continuation token to get the next page of the results. Adding this to
|
||||
* the request will return the rows after the pageToken. The pageToken should
|
||||
* be the value returned in the nextPageToken parameter in the response to
|
||||
* the GetReports request.
|
||||
*/
|
||||
pageToken?: string;
|
||||
/** The pivot definitions. Requests can have a maximum of 2 pivots. */
|
||||
pivots?: Pivot[];
|
||||
/**
|
||||
* The desired report
|
||||
* [sample](https://support.google.com/analytics/answer/2637192) size.
|
||||
* If the the `samplingLevel` field is unspecified the `DEFAULT` sampling
|
||||
* level is used. Every [ReportRequest](#ReportRequest) within a
|
||||
* `batchGet` method must contain the same `samplingLevel` definition. See
|
||||
* [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling)
|
||||
* for details.
|
||||
*/
|
||||
samplingLevel?: string;
|
||||
/**
|
||||
* Segment the data returned for the request. A segment definition helps look
|
||||
* at a subset of the segment request. A request can contain up to four
|
||||
* segments. Every [ReportRequest](#ReportRequest) within a
|
||||
* `batchGet` method must contain the same `segments` definition. Requests
|
||||
* with segments must have the `ga:segment` dimension.
|
||||
*/
|
||||
segments?: Segment[];
|
||||
/**
|
||||
* The Analytics
|
||||
* [view ID](https://support.google.com/analytics/answer/1009618)
|
||||
* from which to retrieve data. Every [ReportRequest](#ReportRequest)
|
||||
* within a `batchGet` method must contain the same `viewId`.
|
||||
*/
|
||||
viewId?: string;
|
||||
}
|
||||
interface ReportRow {
|
||||
/** List of requested dimensions. */
|
||||
dimensions?: string[];
|
||||
/** List of metrics for each requested DateRange. */
|
||||
metrics?: DateRangeValues[];
|
||||
}
|
||||
interface Segment {
|
||||
/** A dynamic segment definition in the request. */
|
||||
dynamicSegment?: DynamicSegment;
|
||||
/** The segment ID of a built-in or custom segment, for example `gaid::-3`. */
|
||||
segmentId?: string;
|
||||
}
|
||||
interface SegmentDefinition {
|
||||
/**
|
||||
* A segment is defined by a set of segment filters which are combined
|
||||
* together with a logical `AND` operation.
|
||||
*/
|
||||
segmentFilters?: SegmentFilter[];
|
||||
}
|
||||
interface SegmentDimensionFilter {
|
||||
/** Should the match be case sensitive, ignored for `IN_LIST` operator. */
|
||||
caseSensitive?: boolean;
|
||||
/** Name of the dimension for which the filter is being applied. */
|
||||
dimensionName?: string;
|
||||
/** The list of expressions, only the first element is used for all operators */
|
||||
expressions?: string[];
|
||||
/** Maximum comparison values for `BETWEEN` match type. */
|
||||
maxComparisonValue?: string;
|
||||
/** Minimum comparison values for `BETWEEN` match type. */
|
||||
minComparisonValue?: string;
|
||||
/** The operator to use to match the dimension with the expressions. */
|
||||
operator?: string;
|
||||
}
|
||||
interface SegmentFilter {
|
||||
/**
|
||||
* If true, match the complement of simple or sequence segment.
|
||||
* For example, to match all visits not from "New York", we can define the
|
||||
* segment as follows:
|
||||
*
|
||||
* "sessionSegment": {
|
||||
* "segmentFilters": [{
|
||||
* "simpleSegment" :{
|
||||
* "orFiltersForSegment": [{
|
||||
* "segmentFilterClauses":[{
|
||||
* "dimensionFilter": {
|
||||
* "dimensionName": "ga:city",
|
||||
* "expressions": ["New York"]
|
||||
* }
|
||||
* }]
|
||||
* }]
|
||||
* },
|
||||
* "not": "True"
|
||||
* }]
|
||||
* },
|
||||
*/
|
||||
not?: boolean;
|
||||
/**
|
||||
* Sequence conditions consist of one or more steps, where each step is
|
||||
* defined by one or more dimension/metric conditions. Multiple steps can
|
||||
* be combined with special sequence operators.
|
||||
*/
|
||||
sequenceSegment?: SequenceSegment;
|
||||
/**
|
||||
* A Simple segment conditions consist of one or more dimension/metric
|
||||
* conditions that can be combined
|
||||
*/
|
||||
simpleSegment?: SimpleSegment;
|
||||
}
|
||||
interface SegmentFilterClause {
|
||||
/** Dimension Filter for the segment definition. */
|
||||
dimensionFilter?: SegmentDimensionFilter;
|
||||
/** Metric Filter for the segment definition. */
|
||||
metricFilter?: SegmentMetricFilter;
|
||||
/** Matches the complement (`!`) of the filter. */
|
||||
not?: boolean;
|
||||
}
|
||||
interface SegmentMetricFilter {
|
||||
/**
|
||||
* The value to compare against. If the operator is `BETWEEN`, this value is
|
||||
* treated as minimum comparison value.
|
||||
*/
|
||||
comparisonValue?: string;
|
||||
/** Max comparison value is only used for `BETWEEN` operator. */
|
||||
maxComparisonValue?: string;
|
||||
/**
|
||||
* The metric that will be filtered on. A `metricFilter` must contain a
|
||||
* metric name.
|
||||
*/
|
||||
metricName?: string;
|
||||
/**
|
||||
* Specifies is the operation to perform to compare the metric. The default
|
||||
* is `EQUAL`.
|
||||
*/
|
||||
operator?: string;
|
||||
/**
|
||||
* Scope for a metric defines the level at which that metric is defined. The
|
||||
* specified metric scope must be equal to or greater than its primary scope
|
||||
* as defined in the data model. The primary scope is defined by if the
|
||||
* segment is selecting users or sessions.
|
||||
*/
|
||||
scope?: string;
|
||||
}
|
||||
interface SegmentSequenceStep {
|
||||
/**
|
||||
* Specifies if the step immediately precedes or can be any time before the
|
||||
* next step.
|
||||
*/
|
||||
matchType?: string;
|
||||
/**
|
||||
* A sequence is specified with a list of Or grouped filters which are
|
||||
* combined with `AND` operator.
|
||||
*/
|
||||
orFiltersForSegment?: OrFiltersForSegment[];
|
||||
}
|
||||
interface SequenceSegment {
|
||||
/**
|
||||
* If set, first step condition must match the first hit of the visitor (in
|
||||
* the date range).
|
||||
*/
|
||||
firstStepShouldMatchFirstHit?: boolean;
|
||||
/** The list of steps in the sequence. */
|
||||
segmentSequenceSteps?: SegmentSequenceStep[];
|
||||
}
|
||||
interface SimpleSegment {
|
||||
/**
|
||||
* A list of segment filters groups which are combined with logical `AND`
|
||||
* operator.
|
||||
*/
|
||||
orFiltersForSegment?: OrFiltersForSegment[];
|
||||
}
|
||||
interface ReportsResource {
|
||||
/** Returns the Analytics data. */
|
||||
batchGet(request: {
|
||||
/** V1 error format. */
|
||||
"$.xgafv"?: string;
|
||||
/** OAuth access token. */
|
||||
access_token?: string;
|
||||
/** Data format for response. */
|
||||
alt?: string;
|
||||
/** OAuth bearer token. */
|
||||
bearer_token?: string;
|
||||
/** JSONP */
|
||||
callback?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Pretty-print response. */
|
||||
pp?: boolean;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
||||
uploadType?: string;
|
||||
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
||||
upload_protocol?: string;
|
||||
}): Request<GetReportsResponse>;
|
||||
}
|
||||
}
|
||||
}
|
||||
62
types/gapi.client.analyticsreporting/readme.md
Normal file
62
types/gapi.client.analyticsreporting/readme.md
Normal file
@ -0,0 +1,62 @@
|
||||
# TypeScript typings for Google Analytics Reporting API v4
|
||||
Accesses Analytics report data.
|
||||
For detailed description please check [documentation](https://developers.google.com/analytics/devguides/reporting/core/v4/).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for Google Analytics Reporting API:
|
||||
```
|
||||
npm install @types/gapi.client.analyticsreporting@v4 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('analyticsreporting', 'v4', () => {
|
||||
// now we can use gapi.client.analyticsreporting
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// View and manage your Google Analytics data
|
||||
'https://www.googleapis.com/auth/analytics',
|
||||
|
||||
// View your Google Analytics data
|
||||
'https://www.googleapis.com/auth/analytics.readonly',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use Google Analytics Reporting API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Returns the Analytics data.
|
||||
*/
|
||||
await gapi.client.reports.batchGet({ });
|
||||
```
|
||||
24
types/gapi.client.analyticsreporting/tsconfig.json
Normal file
24
types/gapi.client.analyticsreporting/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.analyticsreporting-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.analyticsreporting/tslint.json
Normal file
8
types/gapi.client.analyticsreporting/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('androiddeviceprovisioning', 'v1', () => {
|
||||
/** now we can use gapi.client.androiddeviceprovisioning */
|
||||
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/**
|
||||
* Gets the latest state of a long-running operation. Clients can use this
|
||||
* method to poll the operation result at intervals as recommended by the API
|
||||
* service.
|
||||
*/
|
||||
await gapi.client.operations.get({
|
||||
name: "name",
|
||||
});
|
||||
}
|
||||
});
|
||||
683
types/gapi.client.androiddeviceprovisioning/index.d.ts
vendored
Normal file
683
types/gapi.client.androiddeviceprovisioning/index.d.ts
vendored
Normal file
@ -0,0 +1,683 @@
|
||||
// Type definitions for Google Android Device Provisioning Partner API v1 1.0
|
||||
// Project: https://developers.google.com/zero-touch/
|
||||
// Definitions by: Bolisov Alexey <https://github.com/Bolisov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// IMPORTANT
|
||||
// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
// Generated from: https://androiddeviceprovisioning.googleapis.com/$discovery/rest?version=v1
|
||||
|
||||
/// <reference types="gapi.client" />
|
||||
|
||||
declare namespace gapi.client {
|
||||
/** Load Android Device Provisioning Partner API v1 */
|
||||
function load(name: "androiddeviceprovisioning", version: "v1"): PromiseLike<void>;
|
||||
function load(name: "androiddeviceprovisioning", version: "v1", callback: () => any): void;
|
||||
|
||||
const operations: androiddeviceprovisioning.OperationsResource;
|
||||
|
||||
const partners: androiddeviceprovisioning.PartnersResource;
|
||||
|
||||
namespace androiddeviceprovisioning {
|
||||
interface ClaimDeviceRequest {
|
||||
/** The customer to claim for. */
|
||||
customerId?: string;
|
||||
/** The device identifier of the device to claim. */
|
||||
deviceIdentifier?: DeviceIdentifier;
|
||||
/** The section to claim. */
|
||||
sectionType?: string;
|
||||
}
|
||||
interface ClaimDeviceResponse {
|
||||
/** The device ID of the claimed device. */
|
||||
deviceId?: string;
|
||||
/**
|
||||
* The resource name of the device in the format
|
||||
* `partners/[PARTNER_ID]/devices/[DEVICE_ID]`.
|
||||
*/
|
||||
deviceName?: string;
|
||||
}
|
||||
interface ClaimDevicesRequest {
|
||||
/** List of claims. */
|
||||
claims?: PartnerClaim[];
|
||||
}
|
||||
interface Company {
|
||||
/**
|
||||
* Input only. Optional. Email address of customer's users in the admin role.
|
||||
* Each email address must be associated with a Google Account.
|
||||
*/
|
||||
adminEmails?: string[];
|
||||
/** Output only. The ID of the company. Assigned by the server. */
|
||||
companyId?: string;
|
||||
/**
|
||||
* Required. The name of the company. For example _XYZ Corp_. Characters
|
||||
* allowed are: Latin letters, numerals, hyphens, and spaces. Displayed to the
|
||||
* customer's employees in the zero-touch enrollment portal.
|
||||
*/
|
||||
companyName?: string;
|
||||
/**
|
||||
* Output only. The API resource name of the company in the format
|
||||
* `partners/[PARTNER_ID]/customers/[CUSTOMER_ID]`. Assigned by the server.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Input only. Email address of customer's users in the owner role. At least
|
||||
* one `owner_email` is required. Each email address must be associated with a
|
||||
* Google Account. Owners share the same access as admins but can also add,
|
||||
* delete, and edit your organization's portal users.
|
||||
*/
|
||||
ownerEmails?: string[];
|
||||
}
|
||||
interface CreateCustomerRequest {
|
||||
/**
|
||||
* Required. The company data to populate the new customer. Must contain a
|
||||
* value for `companyName` and at least one `owner_email` that's associated
|
||||
* with a Google Account. The values for `companyId` and `name` must be empty.
|
||||
*/
|
||||
customer?: Company;
|
||||
}
|
||||
interface Device {
|
||||
/** Claims. */
|
||||
claims?: DeviceClaim[];
|
||||
/**
|
||||
* The resource name of the configuration.
|
||||
* Only set for customers.
|
||||
*/
|
||||
configuration?: string;
|
||||
/** Device ID. */
|
||||
deviceId?: string;
|
||||
/** Device identifier. */
|
||||
deviceIdentifier?: DeviceIdentifier;
|
||||
/** Device metadata. */
|
||||
deviceMetadata?: DeviceMetadata;
|
||||
/** Resource name in `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. */
|
||||
name?: string;
|
||||
}
|
||||
interface DeviceClaim {
|
||||
/** Owner ID. */
|
||||
ownerCompanyId?: string;
|
||||
/** Section type of the device claim. */
|
||||
sectionType?: string;
|
||||
}
|
||||
interface DeviceIdentifier {
|
||||
/** IMEI number. */
|
||||
imei?: string;
|
||||
/**
|
||||
* Manufacturer name to match `android.os.Build.MANUFACTURER` (required).
|
||||
* Allowed values listed in
|
||||
* [manufacturer names](/zero-touch/resources/manufacturer-names).
|
||||
*/
|
||||
manufacturer?: string;
|
||||
/** MEID number. */
|
||||
meid?: string;
|
||||
/** Serial number (optional). */
|
||||
serialNumber?: string;
|
||||
}
|
||||
interface DeviceMetadata {
|
||||
/** Metadata entries */
|
||||
entries?: Record<string, string>;
|
||||
}
|
||||
interface DevicesLongRunningOperationMetadata {
|
||||
/** Number of devices parsed in your requests. */
|
||||
devicesCount?: number;
|
||||
/** The overall processing status. */
|
||||
processingStatus?: string;
|
||||
/** Processing progress from 0 to 100. */
|
||||
progress?: number;
|
||||
}
|
||||
interface DevicesLongRunningOperationResponse {
|
||||
/**
|
||||
* Processing status for each device.
|
||||
* One `PerDeviceStatus` per device. The order is the same as in your requests.
|
||||
*/
|
||||
perDeviceStatus?: OperationPerDevice[];
|
||||
/** Number of succeesfully processed ones. */
|
||||
successCount?: number;
|
||||
}
|
||||
interface FindDevicesByDeviceIdentifierRequest {
|
||||
/** The device identifier to search. */
|
||||
deviceIdentifier?: DeviceIdentifier;
|
||||
/** Number of devices to show. */
|
||||
limit?: string;
|
||||
/** Page token. */
|
||||
pageToken?: string;
|
||||
}
|
||||
interface FindDevicesByDeviceIdentifierResponse {
|
||||
/** Found devices. */
|
||||
devices?: Device[];
|
||||
/** Page token of the next page. */
|
||||
nextPageToken?: string;
|
||||
}
|
||||
interface FindDevicesByOwnerRequest {
|
||||
/** List of customer IDs to search for. */
|
||||
customerId?: string[];
|
||||
/** The number of devices to show in the result. */
|
||||
limit?: string;
|
||||
/** Page token. */
|
||||
pageToken?: string;
|
||||
/** The section type. */
|
||||
sectionType?: string;
|
||||
}
|
||||
interface FindDevicesByOwnerResponse {
|
||||
/** Devices found. */
|
||||
devices?: Device[];
|
||||
/** Page token of the next page. */
|
||||
nextPageToken?: string;
|
||||
}
|
||||
interface ListCustomersResponse {
|
||||
/** List of customers related to this partner. */
|
||||
customers?: Company[];
|
||||
}
|
||||
interface Operation {
|
||||
/**
|
||||
* If the value is `false`, it means the operation is still in progress.
|
||||
* If `true`, the operation is completed, and either `error` or `response` is
|
||||
* available.
|
||||
*/
|
||||
done?: boolean;
|
||||
/**
|
||||
* This field will always be not set if the operation is created by `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`. In this case, error
|
||||
* information for each device is set in `response.perDeviceStatus.result.status`.
|
||||
*/
|
||||
error?: Status;
|
||||
/**
|
||||
* This field will contain a `DevicesLongRunningOperationMetadata` object if the operation is created by `claimAsync`, `unclaimAsync`, or
|
||||
* `updateMetadataAsync`.
|
||||
*/
|
||||
metadata?: Record<string, any>;
|
||||
/**
|
||||
* The server-assigned name, which is only unique within the same service that
|
||||
* originally returns it. If you use the default HTTP mapping, the
|
||||
* `name` should have the format of `operations/some/unique/name`.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* This field will contain a `DevicesLongRunningOperationResponse` object if the operation is created by `claimAsync`, `unclaimAsync`, or
|
||||
* `updateMetadataAsync`.
|
||||
*/
|
||||
response?: Record<string, any>;
|
||||
}
|
||||
interface OperationPerDevice {
|
||||
/** Request to claim a device. */
|
||||
claim?: PartnerClaim;
|
||||
/** Processing result for every device. */
|
||||
result?: PerDeviceStatusInBatch;
|
||||
/** Request to unclaim a device. */
|
||||
unclaim?: PartnerUnclaim;
|
||||
/** Request to set metadata for a device. */
|
||||
updateMetadata?: UpdateMetadataArguments;
|
||||
}
|
||||
interface PartnerClaim {
|
||||
/** Customer ID to claim for. */
|
||||
customerId?: string;
|
||||
/** Device identifier of the device. */
|
||||
deviceIdentifier?: DeviceIdentifier;
|
||||
/** Metadata to set at claim. */
|
||||
deviceMetadata?: DeviceMetadata;
|
||||
/** Section type to claim. */
|
||||
sectionType?: string;
|
||||
}
|
||||
interface PartnerUnclaim {
|
||||
/** Device ID of the device. */
|
||||
deviceId?: string;
|
||||
/** Device identifier of the device. */
|
||||
deviceIdentifier?: DeviceIdentifier;
|
||||
/** Section type to unclaim. */
|
||||
sectionType?: string;
|
||||
}
|
||||
interface PerDeviceStatusInBatch {
|
||||
/** Device ID of the device if process succeeds. */
|
||||
deviceId?: string;
|
||||
/** Error identifier. */
|
||||
errorIdentifier?: string;
|
||||
/** Error message. */
|
||||
errorMessage?: string;
|
||||
/** Process result. */
|
||||
status?: string;
|
||||
}
|
||||
interface Status {
|
||||
/** The status code, which should be an enum value of google.rpc.Code. */
|
||||
code?: number;
|
||||
/**
|
||||
* A list of messages that carry the error details. There is a common set of
|
||||
* message types for APIs to use.
|
||||
*/
|
||||
details?: Array<Record<string, any>>;
|
||||
/**
|
||||
* A developer-facing error message, which should be in English. Any
|
||||
* user-facing error message should be localized and sent in the
|
||||
* google.rpc.Status.details field, or localized by the client.
|
||||
*/
|
||||
message?: string;
|
||||
}
|
||||
interface UnclaimDeviceRequest {
|
||||
/** The device ID returned by `ClaimDevice`. */
|
||||
deviceId?: string;
|
||||
/** The device identifier you used when you claimed this device. */
|
||||
deviceIdentifier?: DeviceIdentifier;
|
||||
/** The section type to unclaim for. */
|
||||
sectionType?: string;
|
||||
}
|
||||
interface UnclaimDevicesRequest {
|
||||
/** List of devices to unclaim. */
|
||||
unclaims?: PartnerUnclaim[];
|
||||
}
|
||||
interface UpdateDeviceMetadataInBatchRequest {
|
||||
/** List of metadata updates. */
|
||||
updates?: UpdateMetadataArguments[];
|
||||
}
|
||||
interface UpdateDeviceMetadataRequest {
|
||||
/** The metdata to set. */
|
||||
deviceMetadata?: DeviceMetadata;
|
||||
}
|
||||
interface UpdateMetadataArguments {
|
||||
/** Device ID of the device. */
|
||||
deviceId?: string;
|
||||
/** Device identifier. */
|
||||
deviceIdentifier?: DeviceIdentifier;
|
||||
/** The metadata to update. */
|
||||
deviceMetadata?: DeviceMetadata;
|
||||
}
|
||||
interface OperationsResource {
|
||||
/**
|
||||
* Gets the latest state of a long-running operation. Clients can use this
|
||||
* method to poll the operation result at intervals as recommended by the API
|
||||
* service.
|
||||
*/
|
||||
get(request: {
|
||||
/** V1 error format. */
|
||||
"$.xgafv"?: string;
|
||||
/** OAuth access token. */
|
||||
access_token?: string;
|
||||
/** Data format for response. */
|
||||
alt?: string;
|
||||
/** OAuth bearer token. */
|
||||
bearer_token?: string;
|
||||
/** JSONP */
|
||||
callback?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** The name of the operation resource. */
|
||||
name: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Pretty-print response. */
|
||||
pp?: boolean;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
||||
uploadType?: string;
|
||||
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
||||
upload_protocol?: string;
|
||||
}): Request<Operation>;
|
||||
}
|
||||
interface CustomersResource {
|
||||
/**
|
||||
* Creates a customer for zero-touch enrollment. After the method returns
|
||||
* successfully, admin and owner roles can manage devices and EMM configs
|
||||
* by calling API methods or using their zero-touch enrollment portal. The API
|
||||
* doesn't notify the customer that they have access.
|
||||
*/
|
||||
create(request: {
|
||||
/** V1 error format. */
|
||||
"$.xgafv"?: string;
|
||||
/** OAuth access token. */
|
||||
access_token?: string;
|
||||
/** Data format for response. */
|
||||
alt?: string;
|
||||
/** OAuth bearer token. */
|
||||
bearer_token?: string;
|
||||
/** JSONP */
|
||||
callback?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/**
|
||||
* Required. The parent resource ID in format `partners/[PARTNER_ID]` that
|
||||
* identifies the reseller.
|
||||
*/
|
||||
parent: string;
|
||||
/** Pretty-print response. */
|
||||
pp?: boolean;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
||||
uploadType?: string;
|
||||
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
||||
upload_protocol?: string;
|
||||
}): Request<Company>;
|
||||
/**
|
||||
* Lists the customers that are enrolled to the reseller identified by the
|
||||
* `partnerId` argument. This list includes customers that the reseller
|
||||
* created and customers that enrolled themselves using the portal.
|
||||
*/
|
||||
list(request: {
|
||||
/** V1 error format. */
|
||||
"$.xgafv"?: string;
|
||||
/** OAuth access token. */
|
||||
access_token?: string;
|
||||
/** Data format for response. */
|
||||
alt?: string;
|
||||
/** OAuth bearer token. */
|
||||
bearer_token?: string;
|
||||
/** JSONP */
|
||||
callback?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** The ID of the partner. */
|
||||
partnerId: string;
|
||||
/** Pretty-print response. */
|
||||
pp?: boolean;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
||||
uploadType?: string;
|
||||
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
||||
upload_protocol?: string;
|
||||
}): Request<ListCustomersResponse>;
|
||||
}
|
||||
interface DevicesResource {
|
||||
/** Claim the device identified by device identifier. */
|
||||
claim(request: {
|
||||
/** V1 error format. */
|
||||
"$.xgafv"?: string;
|
||||
/** OAuth access token. */
|
||||
access_token?: string;
|
||||
/** Data format for response. */
|
||||
alt?: string;
|
||||
/** OAuth bearer token. */
|
||||
bearer_token?: string;
|
||||
/** JSONP */
|
||||
callback?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** ID of the partner. */
|
||||
partnerId: string;
|
||||
/** Pretty-print response. */
|
||||
pp?: boolean;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
||||
uploadType?: string;
|
||||
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
||||
upload_protocol?: string;
|
||||
}): Request<ClaimDeviceResponse>;
|
||||
/** Claim devices asynchronously. */
|
||||
claimAsync(request: {
|
||||
/** V1 error format. */
|
||||
"$.xgafv"?: string;
|
||||
/** OAuth access token. */
|
||||
access_token?: string;
|
||||
/** Data format for response. */
|
||||
alt?: string;
|
||||
/** OAuth bearer token. */
|
||||
bearer_token?: string;
|
||||
/** JSONP */
|
||||
callback?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Partner ID. */
|
||||
partnerId: string;
|
||||
/** Pretty-print response. */
|
||||
pp?: boolean;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
||||
uploadType?: string;
|
||||
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
||||
upload_protocol?: string;
|
||||
}): Request<Operation>;
|
||||
/** Find devices by device identifier. */
|
||||
findByIdentifier(request: {
|
||||
/** V1 error format. */
|
||||
"$.xgafv"?: string;
|
||||
/** OAuth access token. */
|
||||
access_token?: string;
|
||||
/** Data format for response. */
|
||||
alt?: string;
|
||||
/** OAuth bearer token. */
|
||||
bearer_token?: string;
|
||||
/** JSONP */
|
||||
callback?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** ID of the partner. */
|
||||
partnerId: string;
|
||||
/** Pretty-print response. */
|
||||
pp?: boolean;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
||||
uploadType?: string;
|
||||
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
||||
upload_protocol?: string;
|
||||
}): Request<FindDevicesByDeviceIdentifierResponse>;
|
||||
/** Find devices by ownership. */
|
||||
findByOwner(request: {
|
||||
/** V1 error format. */
|
||||
"$.xgafv"?: string;
|
||||
/** OAuth access token. */
|
||||
access_token?: string;
|
||||
/** Data format for response. */
|
||||
alt?: string;
|
||||
/** OAuth bearer token. */
|
||||
bearer_token?: string;
|
||||
/** JSONP */
|
||||
callback?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** ID of the partner. */
|
||||
partnerId: string;
|
||||
/** Pretty-print response. */
|
||||
pp?: boolean;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
||||
uploadType?: string;
|
||||
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
||||
upload_protocol?: string;
|
||||
}): Request<FindDevicesByOwnerResponse>;
|
||||
/** Get a device. */
|
||||
get(request: {
|
||||
/** V1 error format. */
|
||||
"$.xgafv"?: string;
|
||||
/** OAuth access token. */
|
||||
access_token?: string;
|
||||
/** Data format for response. */
|
||||
alt?: string;
|
||||
/** OAuth bearer token. */
|
||||
bearer_token?: string;
|
||||
/** JSONP */
|
||||
callback?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** Resource name in `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. */
|
||||
name: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Pretty-print response. */
|
||||
pp?: boolean;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
||||
uploadType?: string;
|
||||
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
||||
upload_protocol?: string;
|
||||
}): Request<Device>;
|
||||
/** Update the metadata. */
|
||||
metadata(request: {
|
||||
/** V1 error format. */
|
||||
"$.xgafv"?: string;
|
||||
/** OAuth access token. */
|
||||
access_token?: string;
|
||||
/** Data format for response. */
|
||||
alt?: string;
|
||||
/** OAuth bearer token. */
|
||||
bearer_token?: string;
|
||||
/** JSONP */
|
||||
callback?: string;
|
||||
/** ID of the partner. */
|
||||
deviceId: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** The owner of the newly set metadata. Set this to the partner ID. */
|
||||
metadataOwnerId: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Pretty-print response. */
|
||||
pp?: boolean;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
||||
uploadType?: string;
|
||||
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
||||
upload_protocol?: string;
|
||||
}): Request<DeviceMetadata>;
|
||||
/** Unclaim the device identified by the `device_id` or the `deviceIdentifier`. */
|
||||
unclaim(request: {
|
||||
/** V1 error format. */
|
||||
"$.xgafv"?: string;
|
||||
/** OAuth access token. */
|
||||
access_token?: string;
|
||||
/** Data format for response. */
|
||||
alt?: string;
|
||||
/** OAuth bearer token. */
|
||||
bearer_token?: string;
|
||||
/** JSONP */
|
||||
callback?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** ID of the partner. */
|
||||
partnerId: string;
|
||||
/** Pretty-print response. */
|
||||
pp?: boolean;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
||||
uploadType?: string;
|
||||
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
||||
upload_protocol?: string;
|
||||
}): Request<{}>;
|
||||
/** Unclaim devices asynchronously. */
|
||||
unclaimAsync(request: {
|
||||
/** V1 error format. */
|
||||
"$.xgafv"?: string;
|
||||
/** OAuth access token. */
|
||||
access_token?: string;
|
||||
/** Data format for response. */
|
||||
alt?: string;
|
||||
/** OAuth bearer token. */
|
||||
bearer_token?: string;
|
||||
/** JSONP */
|
||||
callback?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Partner ID. */
|
||||
partnerId: string;
|
||||
/** Pretty-print response. */
|
||||
pp?: boolean;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
||||
uploadType?: string;
|
||||
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
||||
upload_protocol?: string;
|
||||
}): Request<Operation>;
|
||||
/** Set metadata in batch asynchronously. */
|
||||
updateMetadataAsync(request: {
|
||||
/** V1 error format. */
|
||||
"$.xgafv"?: string;
|
||||
/** OAuth access token. */
|
||||
access_token?: string;
|
||||
/** Data format for response. */
|
||||
alt?: string;
|
||||
/** OAuth bearer token. */
|
||||
bearer_token?: string;
|
||||
/** JSONP */
|
||||
callback?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Partner ID. */
|
||||
partnerId: string;
|
||||
/** Pretty-print response. */
|
||||
pp?: boolean;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
||||
quotaUser?: string;
|
||||
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
||||
uploadType?: string;
|
||||
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
||||
upload_protocol?: string;
|
||||
}): Request<Operation>;
|
||||
}
|
||||
interface PartnersResource {
|
||||
customers: CustomersResource;
|
||||
devices: DevicesResource;
|
||||
}
|
||||
}
|
||||
}
|
||||
42
types/gapi.client.androiddeviceprovisioning/readme.md
Normal file
42
types/gapi.client.androiddeviceprovisioning/readme.md
Normal file
@ -0,0 +1,42 @@
|
||||
# TypeScript typings for Android Device Provisioning Partner API v1
|
||||
Automates reseller integration into zero-touch enrollment by assigning devices to customers and creating device reports.
|
||||
For detailed description please check [documentation](https://developers.google.com/zero-touch/).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for Android Device Provisioning Partner API:
|
||||
```
|
||||
npm install @types/gapi.client.androiddeviceprovisioning@v1 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('androiddeviceprovisioning', 'v1', () => {
|
||||
// now we can use gapi.client.androiddeviceprovisioning
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
|
||||
After that you can use Android Device Provisioning Partner API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Gets the latest state of a long-running operation. Clients can use this
|
||||
method to poll the operation result at intervals as recommended by the API
|
||||
service.
|
||||
*/
|
||||
await gapi.client.operations.get({ name: "name", });
|
||||
```
|
||||
24
types/gapi.client.androiddeviceprovisioning/tsconfig.json
Normal file
24
types/gapi.client.androiddeviceprovisioning/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.androiddeviceprovisioning-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.androiddeviceprovisioning/tslint.json
Normal file
8
types/gapi.client.androiddeviceprovisioning/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,559 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('androidenterprise', 'v1', () => {
|
||||
/** now we can use gapi.client.androidenterprise */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** Manage corporate Android devices */
|
||||
'https://www.googleapis.com/auth/androidenterprise',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/** Retrieves the details of a device. */
|
||||
await gapi.client.devices.get({
|
||||
deviceId: "deviceId",
|
||||
enterpriseId: "enterpriseId",
|
||||
userId: "userId",
|
||||
});
|
||||
/**
|
||||
* Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android
|
||||
* devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is
|
||||
* only supported for Google-managed users.
|
||||
*/
|
||||
await gapi.client.devices.getState({
|
||||
deviceId: "deviceId",
|
||||
enterpriseId: "enterpriseId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Retrieves the IDs of all of a user's devices. */
|
||||
await gapi.client.devices.list({
|
||||
enterpriseId: "enterpriseId",
|
||||
userId: "userId",
|
||||
});
|
||||
/**
|
||||
* Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android
|
||||
* devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is
|
||||
* only supported for Google-managed users.
|
||||
*/
|
||||
await gapi.client.devices.setState({
|
||||
deviceId: "deviceId",
|
||||
enterpriseId: "enterpriseId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications. */
|
||||
await gapi.client.enterprises.acknowledgeNotificationSet({
|
||||
notificationSetId: "notificationSetId",
|
||||
});
|
||||
/**
|
||||
* Completes the signup flow, by specifying the Completion token and Enterprise token. This request must not be called multiple times for a given
|
||||
* Enterprise Token.
|
||||
*/
|
||||
await gapi.client.enterprises.completeSignup({
|
||||
completionToken: "completionToken",
|
||||
enterpriseToken: "enterpriseToken",
|
||||
});
|
||||
/**
|
||||
* Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each
|
||||
* token may only be used to start one UI session. See the javascript API documentation for further information.
|
||||
*/
|
||||
await gapi.client.enterprises.createWebToken({
|
||||
enterpriseId: "enterpriseId",
|
||||
});
|
||||
/**
|
||||
* Deletes the binding between the EMM and enterprise. This is now deprecated. Use this method only to unenroll customers that were previously enrolled
|
||||
* with the insert call, then enroll them again with the enroll call.
|
||||
*/
|
||||
await gapi.client.enterprises.delete({
|
||||
enterpriseId: "enterpriseId",
|
||||
});
|
||||
/** Enrolls an enterprise with the calling EMM. */
|
||||
await gapi.client.enterprises.enroll({
|
||||
token: "token",
|
||||
});
|
||||
/** Generates a sign-up URL. */
|
||||
await gapi.client.enterprises.generateSignupUrl({
|
||||
callbackUrl: "callbackUrl",
|
||||
});
|
||||
/** Retrieves the name and domain of an enterprise. */
|
||||
await gapi.client.enterprises.get({
|
||||
enterpriseId: "enterpriseId",
|
||||
});
|
||||
/** Returns the Android Device Policy config resource. */
|
||||
await gapi.client.enterprises.getAndroidDevicePolicyConfig({
|
||||
enterpriseId: "enterpriseId",
|
||||
});
|
||||
/**
|
||||
* Returns a service account and credentials. The service account can be bound to the enterprise by calling setAccount. The service account is unique to
|
||||
* this enterprise and EMM, and will be deleted if the enterprise is unbound. The credentials contain private key data and are not stored server-side.
|
||||
*
|
||||
* This method can only be called after calling Enterprises.Enroll or Enterprises.CompleteSignup, and before Enterprises.SetAccount; at other times it
|
||||
* will return an error.
|
||||
*
|
||||
* Subsequent calls after the first will generate a new, unique set of credentials, and invalidate the previously generated credentials.
|
||||
*
|
||||
* Once the service account is bound to the enterprise, it can be managed using the serviceAccountKeys resource.
|
||||
*/
|
||||
await gapi.client.enterprises.getServiceAccount({
|
||||
enterpriseId: "enterpriseId",
|
||||
keyType: "keyType",
|
||||
});
|
||||
/** Returns the store layout for the enterprise. If the store layout has not been set, returns "basic" as the store layout type and no homepage. */
|
||||
await gapi.client.enterprises.getStoreLayout({
|
||||
enterpriseId: "enterpriseId",
|
||||
});
|
||||
/** Establishes the binding between the EMM and an enterprise. This is now deprecated; use enroll instead. */
|
||||
await gapi.client.enterprises.insert({
|
||||
token: "token",
|
||||
});
|
||||
/**
|
||||
* Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not
|
||||
* needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the
|
||||
* Enterprises.generateSignupUrl call.
|
||||
*/
|
||||
await gapi.client.enterprises.list({
|
||||
domain: "domain",
|
||||
});
|
||||
/**
|
||||
* Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be
|
||||
* empty if no notification are pending.
|
||||
* A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set
|
||||
* is empty.
|
||||
* Notifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request,
|
||||
* and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy.
|
||||
* Multiple requests might be performed concurrently to retrieve notifications, in which case the pending notifications (if any) will be split among each
|
||||
* caller, if any are pending.
|
||||
* If no notifications are present, an empty notification list is returned. Subsequent requests may return more notifications once they become available.
|
||||
*/
|
||||
await gapi.client.enterprises.pullNotificationSet({
|
||||
requestMode: "requestMode",
|
||||
});
|
||||
/** Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. */
|
||||
await gapi.client.enterprises.sendTestPushNotification({
|
||||
enterpriseId: "enterpriseId",
|
||||
});
|
||||
/** Sets the account that will be used to authenticate to the API as the enterprise. */
|
||||
await gapi.client.enterprises.setAccount({
|
||||
enterpriseId: "enterpriseId",
|
||||
});
|
||||
/**
|
||||
* Sets the Android Device Policy config resource. EMM may use this method to enable or disable Android Device Policy support for the specified
|
||||
* enterprise. To learn more about managing devices and apps with Android Device Policy, see the Android Management API.
|
||||
*/
|
||||
await gapi.client.enterprises.setAndroidDevicePolicyConfig({
|
||||
enterpriseId: "enterpriseId",
|
||||
});
|
||||
/**
|
||||
* Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only
|
||||
* contains apps approved by the admin, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on
|
||||
* the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom" and setting a
|
||||
* homepage), the basic store layout is disabled.
|
||||
*/
|
||||
await gapi.client.enterprises.setStoreLayout({
|
||||
enterpriseId: "enterpriseId",
|
||||
});
|
||||
/** Unenrolls an enterprise from the calling EMM. */
|
||||
await gapi.client.enterprises.unenroll({
|
||||
enterpriseId: "enterpriseId",
|
||||
});
|
||||
/** Removes an entitlement to an app for a user. */
|
||||
await gapi.client.entitlements.delete({
|
||||
enterpriseId: "enterpriseId",
|
||||
entitlementId: "entitlementId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Retrieves details of an entitlement. */
|
||||
await gapi.client.entitlements.get({
|
||||
enterpriseId: "enterpriseId",
|
||||
entitlementId: "entitlementId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Lists all entitlements for the specified user. Only the ID is set. */
|
||||
await gapi.client.entitlements.list({
|
||||
enterpriseId: "enterpriseId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Adds or updates an entitlement to an app for a user. This method supports patch semantics. */
|
||||
await gapi.client.entitlements.patch({
|
||||
enterpriseId: "enterpriseId",
|
||||
entitlementId: "entitlementId",
|
||||
install: true,
|
||||
userId: "userId",
|
||||
});
|
||||
/** Adds or updates an entitlement to an app for a user. */
|
||||
await gapi.client.entitlements.update({
|
||||
enterpriseId: "enterpriseId",
|
||||
entitlementId: "entitlementId",
|
||||
install: true,
|
||||
userId: "userId",
|
||||
});
|
||||
/** Retrieves details of an enterprise's group license for a product. */
|
||||
await gapi.client.grouplicenses.get({
|
||||
enterpriseId: "enterpriseId",
|
||||
groupLicenseId: "groupLicenseId",
|
||||
});
|
||||
/** Retrieves IDs of all products for which the enterprise has a group license. */
|
||||
await gapi.client.grouplicenses.list({
|
||||
enterpriseId: "enterpriseId",
|
||||
});
|
||||
/** Retrieves the IDs of the users who have been granted entitlements under the license. */
|
||||
await gapi.client.grouplicenseusers.list({
|
||||
enterpriseId: "enterpriseId",
|
||||
groupLicenseId: "groupLicenseId",
|
||||
});
|
||||
/** Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed. */
|
||||
await gapi.client.installs.delete({
|
||||
deviceId: "deviceId",
|
||||
enterpriseId: "enterpriseId",
|
||||
installId: "installId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Retrieves details of an installation of an app on a device. */
|
||||
await gapi.client.installs.get({
|
||||
deviceId: "deviceId",
|
||||
enterpriseId: "enterpriseId",
|
||||
installId: "installId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Retrieves the details of all apps installed on the specified device. */
|
||||
await gapi.client.installs.list({
|
||||
deviceId: "deviceId",
|
||||
enterpriseId: "enterpriseId",
|
||||
userId: "userId",
|
||||
});
|
||||
/**
|
||||
* Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary.
|
||||
* This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.installs.patch({
|
||||
deviceId: "deviceId",
|
||||
enterpriseId: "enterpriseId",
|
||||
installId: "installId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. */
|
||||
await gapi.client.installs.update({
|
||||
deviceId: "deviceId",
|
||||
enterpriseId: "enterpriseId",
|
||||
installId: "installId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Removes a per-device managed configuration for an app for the specified device. */
|
||||
await gapi.client.managedconfigurationsfordevice.delete({
|
||||
deviceId: "deviceId",
|
||||
enterpriseId: "enterpriseId",
|
||||
managedConfigurationForDeviceId: "managedConfigurationForDeviceId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Retrieves details of a per-device managed configuration. */
|
||||
await gapi.client.managedconfigurationsfordevice.get({
|
||||
deviceId: "deviceId",
|
||||
enterpriseId: "enterpriseId",
|
||||
managedConfigurationForDeviceId: "managedConfigurationForDeviceId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Lists all the per-device managed configurations for the specified device. Only the ID is set. */
|
||||
await gapi.client.managedconfigurationsfordevice.list({
|
||||
deviceId: "deviceId",
|
||||
enterpriseId: "enterpriseId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Adds or updates a per-device managed configuration for an app for the specified device. This method supports patch semantics. */
|
||||
await gapi.client.managedconfigurationsfordevice.patch({
|
||||
deviceId: "deviceId",
|
||||
enterpriseId: "enterpriseId",
|
||||
managedConfigurationForDeviceId: "managedConfigurationForDeviceId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Adds or updates a per-device managed configuration for an app for the specified device. */
|
||||
await gapi.client.managedconfigurationsfordevice.update({
|
||||
deviceId: "deviceId",
|
||||
enterpriseId: "enterpriseId",
|
||||
managedConfigurationForDeviceId: "managedConfigurationForDeviceId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Removes a per-user managed configuration for an app for the specified user. */
|
||||
await gapi.client.managedconfigurationsforuser.delete({
|
||||
enterpriseId: "enterpriseId",
|
||||
managedConfigurationForUserId: "managedConfigurationForUserId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Retrieves details of a per-user managed configuration for an app for the specified user. */
|
||||
await gapi.client.managedconfigurationsforuser.get({
|
||||
enterpriseId: "enterpriseId",
|
||||
managedConfigurationForUserId: "managedConfigurationForUserId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Lists all the per-user managed configurations for the specified user. Only the ID is set. */
|
||||
await gapi.client.managedconfigurationsforuser.list({
|
||||
enterpriseId: "enterpriseId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Adds or updates a per-user managed configuration for an app for the specified user. This method supports patch semantics. */
|
||||
await gapi.client.managedconfigurationsforuser.patch({
|
||||
enterpriseId: "enterpriseId",
|
||||
managedConfigurationForUserId: "managedConfigurationForUserId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Adds or updates a per-user managed configuration for an app for the specified user. */
|
||||
await gapi.client.managedconfigurationsforuser.update({
|
||||
enterpriseId: "enterpriseId",
|
||||
managedConfigurationForUserId: "managedConfigurationForUserId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Retrieves details of an Android app permission for display to an enterprise admin. */
|
||||
await gapi.client.permissions.get({
|
||||
language: "language",
|
||||
permissionId: "permissionId",
|
||||
});
|
||||
/**
|
||||
* Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is
|
||||
* 1,000.
|
||||
*
|
||||
* To learn how to use managed Google Play to design and create a store layout to display approved products to your users, see Store Layout Design.
|
||||
*/
|
||||
await gapi.client.products.approve({
|
||||
enterpriseId: "enterpriseId",
|
||||
productId: "productId",
|
||||
});
|
||||
/**
|
||||
* Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and
|
||||
* accept them on behalf of their organization in order to approve that product.
|
||||
*
|
||||
* Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of
|
||||
* this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display
|
||||
* permissions for up to 1 day.
|
||||
*/
|
||||
await gapi.client.products.generateApprovalUrl({
|
||||
enterpriseId: "enterpriseId",
|
||||
languageCode: "languageCode",
|
||||
productId: "productId",
|
||||
});
|
||||
/** Retrieves details of a product for display to an enterprise admin. */
|
||||
await gapi.client.products.get({
|
||||
enterpriseId: "enterpriseId",
|
||||
language: "language",
|
||||
productId: "productId",
|
||||
});
|
||||
/**
|
||||
* Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed
|
||||
* configurations have been defined. This schema can be used to populate a UI that allows an admin to configure the product. To apply a managed
|
||||
* configuration based on the schema obtained using this API, see Managed Configurations through Play.
|
||||
*/
|
||||
await gapi.client.products.getAppRestrictionsSchema({
|
||||
enterpriseId: "enterpriseId",
|
||||
language: "language",
|
||||
productId: "productId",
|
||||
});
|
||||
/** Retrieves the Android app permissions required by this app. */
|
||||
await gapi.client.products.getPermissions({
|
||||
enterpriseId: "enterpriseId",
|
||||
productId: "productId",
|
||||
});
|
||||
/** Finds approved products that match a query, or all approved products if there is no query. */
|
||||
await gapi.client.products.list({
|
||||
approved: true,
|
||||
enterpriseId: "enterpriseId",
|
||||
language: "language",
|
||||
maxResults: 4,
|
||||
query: "query",
|
||||
token: "token",
|
||||
});
|
||||
/** Unapproves the specified product (and the relevant app permissions, if any) */
|
||||
await gapi.client.products.unapprove({
|
||||
enterpriseId: "enterpriseId",
|
||||
productId: "productId",
|
||||
});
|
||||
/**
|
||||
* Removes and invalidates the specified credentials for the service account associated with this enterprise. The calling service account must have been
|
||||
* retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount.
|
||||
*/
|
||||
await gapi.client.serviceaccountkeys.delete({
|
||||
enterpriseId: "enterpriseId",
|
||||
keyId: "keyId",
|
||||
});
|
||||
/**
|
||||
* Generates new credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling
|
||||
* Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount.
|
||||
*
|
||||
* Only the type of the key should be populated in the resource to be inserted.
|
||||
*/
|
||||
await gapi.client.serviceaccountkeys.insert({
|
||||
enterpriseId: "enterpriseId",
|
||||
});
|
||||
/**
|
||||
* Lists all active credentials for the service account associated with this enterprise. Only the ID and key type are returned. The calling service
|
||||
* account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling
|
||||
* Enterprises.SetAccount.
|
||||
*/
|
||||
await gapi.client.serviceaccountkeys.list({
|
||||
enterpriseId: "enterpriseId",
|
||||
});
|
||||
/** Deletes a cluster. */
|
||||
await gapi.client.storelayoutclusters.delete({
|
||||
clusterId: "clusterId",
|
||||
enterpriseId: "enterpriseId",
|
||||
pageId: "pageId",
|
||||
});
|
||||
/** Retrieves details of a cluster. */
|
||||
await gapi.client.storelayoutclusters.get({
|
||||
clusterId: "clusterId",
|
||||
enterpriseId: "enterpriseId",
|
||||
pageId: "pageId",
|
||||
});
|
||||
/** Inserts a new cluster in a page. */
|
||||
await gapi.client.storelayoutclusters.insert({
|
||||
enterpriseId: "enterpriseId",
|
||||
pageId: "pageId",
|
||||
});
|
||||
/** Retrieves the details of all clusters on the specified page. */
|
||||
await gapi.client.storelayoutclusters.list({
|
||||
enterpriseId: "enterpriseId",
|
||||
pageId: "pageId",
|
||||
});
|
||||
/** Updates a cluster. This method supports patch semantics. */
|
||||
await gapi.client.storelayoutclusters.patch({
|
||||
clusterId: "clusterId",
|
||||
enterpriseId: "enterpriseId",
|
||||
pageId: "pageId",
|
||||
});
|
||||
/** Updates a cluster. */
|
||||
await gapi.client.storelayoutclusters.update({
|
||||
clusterId: "clusterId",
|
||||
enterpriseId: "enterpriseId",
|
||||
pageId: "pageId",
|
||||
});
|
||||
/** Deletes a store page. */
|
||||
await gapi.client.storelayoutpages.delete({
|
||||
enterpriseId: "enterpriseId",
|
||||
pageId: "pageId",
|
||||
});
|
||||
/** Retrieves details of a store page. */
|
||||
await gapi.client.storelayoutpages.get({
|
||||
enterpriseId: "enterpriseId",
|
||||
pageId: "pageId",
|
||||
});
|
||||
/** Inserts a new store page. */
|
||||
await gapi.client.storelayoutpages.insert({
|
||||
enterpriseId: "enterpriseId",
|
||||
});
|
||||
/** Retrieves the details of all pages in the store. */
|
||||
await gapi.client.storelayoutpages.list({
|
||||
enterpriseId: "enterpriseId",
|
||||
});
|
||||
/** Updates the content of a store page. This method supports patch semantics. */
|
||||
await gapi.client.storelayoutpages.patch({
|
||||
enterpriseId: "enterpriseId",
|
||||
pageId: "pageId",
|
||||
});
|
||||
/** Updates the content of a store page. */
|
||||
await gapi.client.storelayoutpages.update({
|
||||
enterpriseId: "enterpriseId",
|
||||
pageId: "pageId",
|
||||
});
|
||||
/** Deleted an EMM-managed user. */
|
||||
await gapi.client.users.delete({
|
||||
enterpriseId: "enterpriseId",
|
||||
userId: "userId",
|
||||
});
|
||||
/**
|
||||
* Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated
|
||||
* token is single-use and expires after a few minutes.
|
||||
*
|
||||
* This call only works with EMM-managed accounts.
|
||||
*/
|
||||
await gapi.client.users.generateAuthenticationToken({
|
||||
enterpriseId: "enterpriseId",
|
||||
userId: "userId",
|
||||
});
|
||||
/**
|
||||
* Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated
|
||||
* token.
|
||||
*
|
||||
* This call only works with Google managed accounts.
|
||||
*/
|
||||
await gapi.client.users.generateToken({
|
||||
enterpriseId: "enterpriseId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Retrieves a user's details. */
|
||||
await gapi.client.users.get({
|
||||
enterpriseId: "enterpriseId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Retrieves the set of products a user is entitled to access. */
|
||||
await gapi.client.users.getAvailableProductSet({
|
||||
enterpriseId: "enterpriseId",
|
||||
userId: "userId",
|
||||
});
|
||||
/**
|
||||
* Creates a new EMM-managed user.
|
||||
*
|
||||
* The Users resource passed in the body of the request should include an accountIdentifier and an accountType.
|
||||
* If a corresponding user already exists with the same account identifier, the user will be updated with the resource. In this case only the displayName
|
||||
* field can be changed.
|
||||
*/
|
||||
await gapi.client.users.insert({
|
||||
enterpriseId: "enterpriseId",
|
||||
});
|
||||
/**
|
||||
* Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because
|
||||
* the id is already returned in the result of the Users.insert call.
|
||||
*/
|
||||
await gapi.client.users.list({
|
||||
email: "email",
|
||||
enterpriseId: "enterpriseId",
|
||||
});
|
||||
/**
|
||||
* Updates the details of an EMM-managed user.
|
||||
*
|
||||
* Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the
|
||||
* displayName field can be changed. Other fields must either be unset or have the currently active value. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.users.patch({
|
||||
enterpriseId: "enterpriseId",
|
||||
userId: "userId",
|
||||
});
|
||||
/** Revokes a previously generated token (activation code) for the user. */
|
||||
await gapi.client.users.revokeToken({
|
||||
enterpriseId: "enterpriseId",
|
||||
userId: "userId",
|
||||
});
|
||||
/**
|
||||
* Modifies the set of products that a user is entitled to access (referred to as whitelisted products). Only products that are approved or products that
|
||||
* were previously approved (products with revoked approval) can be whitelisted.
|
||||
*/
|
||||
await gapi.client.users.setAvailableProductSet({
|
||||
enterpriseId: "enterpriseId",
|
||||
userId: "userId",
|
||||
});
|
||||
/**
|
||||
* Updates the details of an EMM-managed user.
|
||||
*
|
||||
* Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the
|
||||
* displayName field can be changed. Other fields must either be unset or have the currently active value.
|
||||
*/
|
||||
await gapi.client.users.update({
|
||||
enterpriseId: "enterpriseId",
|
||||
userId: "userId",
|
||||
});
|
||||
}
|
||||
});
|
||||
2830
types/gapi.client.androidenterprise/index.d.ts
vendored
Normal file
2830
types/gapi.client.androidenterprise/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
476
types/gapi.client.androidenterprise/readme.md
Normal file
476
types/gapi.client.androidenterprise/readme.md
Normal file
@ -0,0 +1,476 @@
|
||||
# TypeScript typings for Google Play EMM API v1
|
||||
Manages the deployment of apps to Android for Work users.
|
||||
For detailed description please check [documentation](https://developers.google.com/android/work/play/emm-api).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for Google Play EMM API:
|
||||
```
|
||||
npm install @types/gapi.client.androidenterprise@v1 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('androidenterprise', 'v1', () => {
|
||||
// now we can use gapi.client.androidenterprise
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// Manage corporate Android devices
|
||||
'https://www.googleapis.com/auth/androidenterprise',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use Google Play EMM API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Retrieves the details of a device.
|
||||
*/
|
||||
await gapi.client.devices.get({ deviceId: "deviceId", enterpriseId: "enterpriseId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users.
|
||||
*/
|
||||
await gapi.client.devices.getState({ deviceId: "deviceId", enterpriseId: "enterpriseId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Retrieves the IDs of all of a user's devices.
|
||||
*/
|
||||
await gapi.client.devices.list({ enterpriseId: "enterpriseId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users.
|
||||
*/
|
||||
await gapi.client.devices.setState({ deviceId: "deviceId", enterpriseId: "enterpriseId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications.
|
||||
*/
|
||||
await gapi.client.enterprises.acknowledgeNotificationSet({ });
|
||||
|
||||
/*
|
||||
Completes the signup flow, by specifying the Completion token and Enterprise token. This request must not be called multiple times for a given Enterprise Token.
|
||||
*/
|
||||
await gapi.client.enterprises.completeSignup({ });
|
||||
|
||||
/*
|
||||
Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the managed Google Play javascript API. Each token may only be used to start one UI session. See the javascript API documentation for further information.
|
||||
*/
|
||||
await gapi.client.enterprises.createWebToken({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Deletes the binding between the EMM and enterprise. This is now deprecated. Use this method only to unenroll customers that were previously enrolled with the insert call, then enroll them again with the enroll call.
|
||||
*/
|
||||
await gapi.client.enterprises.delete({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Enrolls an enterprise with the calling EMM.
|
||||
*/
|
||||
await gapi.client.enterprises.enroll({ token: "token", });
|
||||
|
||||
/*
|
||||
Generates a sign-up URL.
|
||||
*/
|
||||
await gapi.client.enterprises.generateSignupUrl({ });
|
||||
|
||||
/*
|
||||
Retrieves the name and domain of an enterprise.
|
||||
*/
|
||||
await gapi.client.enterprises.get({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Returns the Android Device Policy config resource.
|
||||
*/
|
||||
await gapi.client.enterprises.getAndroidDevicePolicyConfig({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Returns a service account and credentials. The service account can be bound to the enterprise by calling setAccount. The service account is unique to this enterprise and EMM, and will be deleted if the enterprise is unbound. The credentials contain private key data and are not stored server-side.
|
||||
|
||||
This method can only be called after calling Enterprises.Enroll or Enterprises.CompleteSignup, and before Enterprises.SetAccount; at other times it will return an error.
|
||||
|
||||
Subsequent calls after the first will generate a new, unique set of credentials, and invalidate the previously generated credentials.
|
||||
|
||||
Once the service account is bound to the enterprise, it can be managed using the serviceAccountKeys resource.
|
||||
*/
|
||||
await gapi.client.enterprises.getServiceAccount({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Returns the store layout for the enterprise. If the store layout has not been set, returns "basic" as the store layout type and no homepage.
|
||||
*/
|
||||
await gapi.client.enterprises.getStoreLayout({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Establishes the binding between the EMM and an enterprise. This is now deprecated; use enroll instead.
|
||||
*/
|
||||
await gapi.client.enterprises.insert({ token: "token", });
|
||||
|
||||
/*
|
||||
Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the Enterprises.generateSignupUrl call.
|
||||
*/
|
||||
await gapi.client.enterprises.list({ domain: "domain", });
|
||||
|
||||
/*
|
||||
Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be empty if no notification are pending.
|
||||
A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set is empty.
|
||||
Notifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request, and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy.
|
||||
Multiple requests might be performed concurrently to retrieve notifications, in which case the pending notifications (if any) will be split among each caller, if any are pending.
|
||||
If no notifications are present, an empty notification list is returned. Subsequent requests may return more notifications once they become available.
|
||||
*/
|
||||
await gapi.client.enterprises.pullNotificationSet({ });
|
||||
|
||||
/*
|
||||
Sends a test notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise.
|
||||
*/
|
||||
await gapi.client.enterprises.sendTestPushNotification({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Sets the account that will be used to authenticate to the API as the enterprise.
|
||||
*/
|
||||
await gapi.client.enterprises.setAccount({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Sets the Android Device Policy config resource. EMM may use this method to enable or disable Android Device Policy support for the specified enterprise. To learn more about managing devices and apps with Android Device Policy, see the Android Management API.
|
||||
*/
|
||||
await gapi.client.enterprises.setAndroidDevicePolicyConfig({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only contains apps approved by the admin, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom" and setting a homepage), the basic store layout is disabled.
|
||||
*/
|
||||
await gapi.client.enterprises.setStoreLayout({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Unenrolls an enterprise from the calling EMM.
|
||||
*/
|
||||
await gapi.client.enterprises.unenroll({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Removes an entitlement to an app for a user.
|
||||
*/
|
||||
await gapi.client.entitlements.delete({ enterpriseId: "enterpriseId", entitlementId: "entitlementId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Retrieves details of an entitlement.
|
||||
*/
|
||||
await gapi.client.entitlements.get({ enterpriseId: "enterpriseId", entitlementId: "entitlementId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Lists all entitlements for the specified user. Only the ID is set.
|
||||
*/
|
||||
await gapi.client.entitlements.list({ enterpriseId: "enterpriseId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Adds or updates an entitlement to an app for a user. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.entitlements.patch({ enterpriseId: "enterpriseId", entitlementId: "entitlementId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Adds or updates an entitlement to an app for a user.
|
||||
*/
|
||||
await gapi.client.entitlements.update({ enterpriseId: "enterpriseId", entitlementId: "entitlementId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Retrieves details of an enterprise's group license for a product.
|
||||
*/
|
||||
await gapi.client.grouplicenses.get({ enterpriseId: "enterpriseId", groupLicenseId: "groupLicenseId", });
|
||||
|
||||
/*
|
||||
Retrieves IDs of all products for which the enterprise has a group license.
|
||||
*/
|
||||
await gapi.client.grouplicenses.list({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Retrieves the IDs of the users who have been granted entitlements under the license.
|
||||
*/
|
||||
await gapi.client.grouplicenseusers.list({ enterpriseId: "enterpriseId", groupLicenseId: "groupLicenseId", });
|
||||
|
||||
/*
|
||||
Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed.
|
||||
*/
|
||||
await gapi.client.installs.delete({ deviceId: "deviceId", enterpriseId: "enterpriseId", installId: "installId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Retrieves details of an installation of an app on a device.
|
||||
*/
|
||||
await gapi.client.installs.get({ deviceId: "deviceId", enterpriseId: "enterpriseId", installId: "installId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Retrieves the details of all apps installed on the specified device.
|
||||
*/
|
||||
await gapi.client.installs.list({ deviceId: "deviceId", enterpriseId: "enterpriseId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.installs.patch({ deviceId: "deviceId", enterpriseId: "enterpriseId", installId: "installId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary.
|
||||
*/
|
||||
await gapi.client.installs.update({ deviceId: "deviceId", enterpriseId: "enterpriseId", installId: "installId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Removes a per-device managed configuration for an app for the specified device.
|
||||
*/
|
||||
await gapi.client.managedconfigurationsfordevice.delete({ deviceId: "deviceId", enterpriseId: "enterpriseId", managedConfigurationForDeviceId: "managedConfigurationForDeviceId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Retrieves details of a per-device managed configuration.
|
||||
*/
|
||||
await gapi.client.managedconfigurationsfordevice.get({ deviceId: "deviceId", enterpriseId: "enterpriseId", managedConfigurationForDeviceId: "managedConfigurationForDeviceId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Lists all the per-device managed configurations for the specified device. Only the ID is set.
|
||||
*/
|
||||
await gapi.client.managedconfigurationsfordevice.list({ deviceId: "deviceId", enterpriseId: "enterpriseId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Adds or updates a per-device managed configuration for an app for the specified device. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.managedconfigurationsfordevice.patch({ deviceId: "deviceId", enterpriseId: "enterpriseId", managedConfigurationForDeviceId: "managedConfigurationForDeviceId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Adds or updates a per-device managed configuration for an app for the specified device.
|
||||
*/
|
||||
await gapi.client.managedconfigurationsfordevice.update({ deviceId: "deviceId", enterpriseId: "enterpriseId", managedConfigurationForDeviceId: "managedConfigurationForDeviceId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Removes a per-user managed configuration for an app for the specified user.
|
||||
*/
|
||||
await gapi.client.managedconfigurationsforuser.delete({ enterpriseId: "enterpriseId", managedConfigurationForUserId: "managedConfigurationForUserId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Retrieves details of a per-user managed configuration for an app for the specified user.
|
||||
*/
|
||||
await gapi.client.managedconfigurationsforuser.get({ enterpriseId: "enterpriseId", managedConfigurationForUserId: "managedConfigurationForUserId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Lists all the per-user managed configurations for the specified user. Only the ID is set.
|
||||
*/
|
||||
await gapi.client.managedconfigurationsforuser.list({ enterpriseId: "enterpriseId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Adds or updates a per-user managed configuration for an app for the specified user. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.managedconfigurationsforuser.patch({ enterpriseId: "enterpriseId", managedConfigurationForUserId: "managedConfigurationForUserId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Adds or updates a per-user managed configuration for an app for the specified user.
|
||||
*/
|
||||
await gapi.client.managedconfigurationsforuser.update({ enterpriseId: "enterpriseId", managedConfigurationForUserId: "managedConfigurationForUserId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Retrieves details of an Android app permission for display to an enterprise admin.
|
||||
*/
|
||||
await gapi.client.permissions.get({ permissionId: "permissionId", });
|
||||
|
||||
/*
|
||||
Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is 1,000.
|
||||
|
||||
To learn how to use managed Google Play to design and create a store layout to display approved products to your users, see Store Layout Design.
|
||||
*/
|
||||
await gapi.client.products.approve({ enterpriseId: "enterpriseId", productId: "productId", });
|
||||
|
||||
/*
|
||||
Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product.
|
||||
|
||||
Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day.
|
||||
*/
|
||||
await gapi.client.products.generateApprovalUrl({ enterpriseId: "enterpriseId", productId: "productId", });
|
||||
|
||||
/*
|
||||
Retrieves details of a product for display to an enterprise admin.
|
||||
*/
|
||||
await gapi.client.products.get({ enterpriseId: "enterpriseId", productId: "productId", });
|
||||
|
||||
/*
|
||||
Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed configurations have been defined. This schema can be used to populate a UI that allows an admin to configure the product. To apply a managed configuration based on the schema obtained using this API, see Managed Configurations through Play.
|
||||
*/
|
||||
await gapi.client.products.getAppRestrictionsSchema({ enterpriseId: "enterpriseId", productId: "productId", });
|
||||
|
||||
/*
|
||||
Retrieves the Android app permissions required by this app.
|
||||
*/
|
||||
await gapi.client.products.getPermissions({ enterpriseId: "enterpriseId", productId: "productId", });
|
||||
|
||||
/*
|
||||
Finds approved products that match a query, or all approved products if there is no query.
|
||||
*/
|
||||
await gapi.client.products.list({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Unapproves the specified product (and the relevant app permissions, if any)
|
||||
*/
|
||||
await gapi.client.products.unapprove({ enterpriseId: "enterpriseId", productId: "productId", });
|
||||
|
||||
/*
|
||||
Removes and invalidates the specified credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount.
|
||||
*/
|
||||
await gapi.client.serviceaccountkeys.delete({ enterpriseId: "enterpriseId", keyId: "keyId", });
|
||||
|
||||
/*
|
||||
Generates new credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount.
|
||||
|
||||
Only the type of the key should be populated in the resource to be inserted.
|
||||
*/
|
||||
await gapi.client.serviceaccountkeys.insert({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Lists all active credentials for the service account associated with this enterprise. Only the ID and key type are returned. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount.
|
||||
*/
|
||||
await gapi.client.serviceaccountkeys.list({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Deletes a cluster.
|
||||
*/
|
||||
await gapi.client.storelayoutclusters.delete({ clusterId: "clusterId", enterpriseId: "enterpriseId", pageId: "pageId", });
|
||||
|
||||
/*
|
||||
Retrieves details of a cluster.
|
||||
*/
|
||||
await gapi.client.storelayoutclusters.get({ clusterId: "clusterId", enterpriseId: "enterpriseId", pageId: "pageId", });
|
||||
|
||||
/*
|
||||
Inserts a new cluster in a page.
|
||||
*/
|
||||
await gapi.client.storelayoutclusters.insert({ enterpriseId: "enterpriseId", pageId: "pageId", });
|
||||
|
||||
/*
|
||||
Retrieves the details of all clusters on the specified page.
|
||||
*/
|
||||
await gapi.client.storelayoutclusters.list({ enterpriseId: "enterpriseId", pageId: "pageId", });
|
||||
|
||||
/*
|
||||
Updates a cluster. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.storelayoutclusters.patch({ clusterId: "clusterId", enterpriseId: "enterpriseId", pageId: "pageId", });
|
||||
|
||||
/*
|
||||
Updates a cluster.
|
||||
*/
|
||||
await gapi.client.storelayoutclusters.update({ clusterId: "clusterId", enterpriseId: "enterpriseId", pageId: "pageId", });
|
||||
|
||||
/*
|
||||
Deletes a store page.
|
||||
*/
|
||||
await gapi.client.storelayoutpages.delete({ enterpriseId: "enterpriseId", pageId: "pageId", });
|
||||
|
||||
/*
|
||||
Retrieves details of a store page.
|
||||
*/
|
||||
await gapi.client.storelayoutpages.get({ enterpriseId: "enterpriseId", pageId: "pageId", });
|
||||
|
||||
/*
|
||||
Inserts a new store page.
|
||||
*/
|
||||
await gapi.client.storelayoutpages.insert({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Retrieves the details of all pages in the store.
|
||||
*/
|
||||
await gapi.client.storelayoutpages.list({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Updates the content of a store page. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.storelayoutpages.patch({ enterpriseId: "enterpriseId", pageId: "pageId", });
|
||||
|
||||
/*
|
||||
Updates the content of a store page.
|
||||
*/
|
||||
await gapi.client.storelayoutpages.update({ enterpriseId: "enterpriseId", pageId: "pageId", });
|
||||
|
||||
/*
|
||||
Deleted an EMM-managed user.
|
||||
*/
|
||||
await gapi.client.users.delete({ enterpriseId: "enterpriseId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated token is single-use and expires after a few minutes.
|
||||
|
||||
This call only works with EMM-managed accounts.
|
||||
*/
|
||||
await gapi.client.users.generateAuthenticationToken({ enterpriseId: "enterpriseId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated token.
|
||||
|
||||
This call only works with Google managed accounts.
|
||||
*/
|
||||
await gapi.client.users.generateToken({ enterpriseId: "enterpriseId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Retrieves a user's details.
|
||||
*/
|
||||
await gapi.client.users.get({ enterpriseId: "enterpriseId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Retrieves the set of products a user is entitled to access.
|
||||
*/
|
||||
await gapi.client.users.getAvailableProductSet({ enterpriseId: "enterpriseId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Creates a new EMM-managed user.
|
||||
|
||||
The Users resource passed in the body of the request should include an accountIdentifier and an accountType.
|
||||
If a corresponding user already exists with the same account identifier, the user will be updated with the resource. In this case only the displayName field can be changed.
|
||||
*/
|
||||
await gapi.client.users.insert({ enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because the id is already returned in the result of the Users.insert call.
|
||||
*/
|
||||
await gapi.client.users.list({ email: "email", enterpriseId: "enterpriseId", });
|
||||
|
||||
/*
|
||||
Updates the details of an EMM-managed user.
|
||||
|
||||
Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the displayName field can be changed. Other fields must either be unset or have the currently active value. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.users.patch({ enterpriseId: "enterpriseId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Revokes a previously generated token (activation code) for the user.
|
||||
*/
|
||||
await gapi.client.users.revokeToken({ enterpriseId: "enterpriseId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Modifies the set of products that a user is entitled to access (referred to as whitelisted products). Only products that are approved or products that were previously approved (products with revoked approval) can be whitelisted.
|
||||
*/
|
||||
await gapi.client.users.setAvailableProductSet({ enterpriseId: "enterpriseId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Updates the details of an EMM-managed user.
|
||||
|
||||
Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the displayName field can be changed. Other fields must either be unset or have the currently active value.
|
||||
*/
|
||||
await gapi.client.users.update({ enterpriseId: "enterpriseId", userId: "userId", });
|
||||
```
|
||||
24
types/gapi.client.androidenterprise/tsconfig.json
Normal file
24
types/gapi.client.androidenterprise/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.androidenterprise-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.androidenterprise/tslint.json
Normal file
8
types/gapi.client.androidenterprise/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('androidmanagement', 'v1', () => {
|
||||
/** now we can use gapi.client.androidmanagement */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** Manage Android devices and apps for your customers */
|
||||
'https://www.googleapis.com/auth/androidmanagement',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/** Creates an enterprise by completing the enterprise signup flow. */
|
||||
await gapi.client.enterprises.create({
|
||||
enterpriseToken: "enterpriseToken",
|
||||
projectId: "projectId",
|
||||
signupUrlName: "signupUrlName",
|
||||
});
|
||||
/** Gets an enterprise. */
|
||||
await gapi.client.enterprises.get({
|
||||
name: "name",
|
||||
});
|
||||
/** Updates an enterprise. */
|
||||
await gapi.client.enterprises.patch({
|
||||
name: "name",
|
||||
updateMask: "updateMask",
|
||||
});
|
||||
/** Creates an enterprise signup URL. */
|
||||
await gapi.client.signupUrls.create({
|
||||
callbackUrl: "callbackUrl",
|
||||
projectId: "projectId",
|
||||
});
|
||||
}
|
||||
});
|
||||
1385
types/gapi.client.androidmanagement/index.d.ts
vendored
Normal file
1385
types/gapi.client.androidmanagement/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
74
types/gapi.client.androidmanagement/readme.md
Normal file
74
types/gapi.client.androidmanagement/readme.md
Normal file
@ -0,0 +1,74 @@
|
||||
# TypeScript typings for Android Management API v1
|
||||
The Android Management API provides remote enterprise management of Android devices and apps.
|
||||
For detailed description please check [documentation](https://developers.google.com/android/management).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for Android Management API:
|
||||
```
|
||||
npm install @types/gapi.client.androidmanagement@v1 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('androidmanagement', 'v1', () => {
|
||||
// now we can use gapi.client.androidmanagement
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// Manage Android devices and apps for your customers
|
||||
'https://www.googleapis.com/auth/androidmanagement',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use Android Management API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Creates an enterprise by completing the enterprise signup flow.
|
||||
*/
|
||||
await gapi.client.enterprises.create({ });
|
||||
|
||||
/*
|
||||
Gets an enterprise.
|
||||
*/
|
||||
await gapi.client.enterprises.get({ name: "name", });
|
||||
|
||||
/*
|
||||
Updates an enterprise.
|
||||
*/
|
||||
await gapi.client.enterprises.patch({ name: "name", });
|
||||
|
||||
/*
|
||||
Creates an enterprise signup URL.
|
||||
*/
|
||||
await gapi.client.signupUrls.create({ });
|
||||
```
|
||||
24
types/gapi.client.androidmanagement/tsconfig.json
Normal file
24
types/gapi.client.androidmanagement/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.androidmanagement-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.androidmanagement/tslint.json
Normal file
8
types/gapi.client.androidmanagement/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,122 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('androidpublisher', 'v2', () => {
|
||||
/** now we can use gapi.client.androidpublisher */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** View and manage your Google Play Developer account */
|
||||
'https://www.googleapis.com/auth/androidpublisher',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/** Commits/applies the changes made in this edit back to the app. */
|
||||
await gapi.client.edits.commit({
|
||||
editId: "editId",
|
||||
packageName: "packageName",
|
||||
});
|
||||
/**
|
||||
* Deletes an edit for an app. Creating a new edit will automatically delete any of your previous edits so this method need only be called if you want to
|
||||
* preemptively abandon an edit.
|
||||
*/
|
||||
await gapi.client.edits.delete({
|
||||
editId: "editId",
|
||||
packageName: "packageName",
|
||||
});
|
||||
/** Returns information about the edit specified. Calls will fail if the edit is no long active (e.g. has been deleted, superseded or expired). */
|
||||
await gapi.client.edits.get({
|
||||
editId: "editId",
|
||||
packageName: "packageName",
|
||||
});
|
||||
/** Creates a new edit for an app, populated with the app's current state. */
|
||||
await gapi.client.edits.insert({
|
||||
packageName: "packageName",
|
||||
});
|
||||
/** Checks that the edit can be successfully committed. The edit's changes are not applied to the live app. */
|
||||
await gapi.client.edits.validate({
|
||||
editId: "editId",
|
||||
packageName: "packageName",
|
||||
});
|
||||
/** Lists the user's current inapp item or subscription entitlements */
|
||||
await gapi.client.entitlements.list({
|
||||
maxResults: 1,
|
||||
packageName: "packageName",
|
||||
productId: "productId",
|
||||
startIndex: 4,
|
||||
token: "token",
|
||||
});
|
||||
await gapi.client.inappproducts.batch({
|
||||
});
|
||||
/** Delete an in-app product for an app. */
|
||||
await gapi.client.inappproducts.delete({
|
||||
packageName: "packageName",
|
||||
sku: "sku",
|
||||
});
|
||||
/** Returns information about the in-app product specified. */
|
||||
await gapi.client.inappproducts.get({
|
||||
packageName: "packageName",
|
||||
sku: "sku",
|
||||
});
|
||||
/** Creates a new in-app product for an app. */
|
||||
await gapi.client.inappproducts.insert({
|
||||
autoConvertMissingPrices: true,
|
||||
packageName: "packageName",
|
||||
});
|
||||
/** List all the in-app products for an Android app, both subscriptions and managed in-app products.. */
|
||||
await gapi.client.inappproducts.list({
|
||||
maxResults: 1,
|
||||
packageName: "packageName",
|
||||
startIndex: 3,
|
||||
token: "token",
|
||||
});
|
||||
/** Updates the details of an in-app product. This method supports patch semantics. */
|
||||
await gapi.client.inappproducts.patch({
|
||||
autoConvertMissingPrices: true,
|
||||
packageName: "packageName",
|
||||
sku: "sku",
|
||||
});
|
||||
/** Updates the details of an in-app product. */
|
||||
await gapi.client.inappproducts.update({
|
||||
autoConvertMissingPrices: true,
|
||||
packageName: "packageName",
|
||||
sku: "sku",
|
||||
});
|
||||
/** Returns a single review. */
|
||||
await gapi.client.reviews.get({
|
||||
packageName: "packageName",
|
||||
reviewId: "reviewId",
|
||||
translationLanguage: "translationLanguage",
|
||||
});
|
||||
/** Returns a list of reviews. Only reviews from last week will be returned. */
|
||||
await gapi.client.reviews.list({
|
||||
maxResults: 1,
|
||||
packageName: "packageName",
|
||||
startIndex: 3,
|
||||
token: "token",
|
||||
translationLanguage: "translationLanguage",
|
||||
});
|
||||
/** Reply to a single review, or update an existing reply. */
|
||||
await gapi.client.reviews.reply({
|
||||
packageName: "packageName",
|
||||
reviewId: "reviewId",
|
||||
});
|
||||
}
|
||||
});
|
||||
2062
types/gapi.client.androidpublisher/index.d.ts
vendored
Normal file
2062
types/gapi.client.androidpublisher/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
134
types/gapi.client.androidpublisher/readme.md
Normal file
134
types/gapi.client.androidpublisher/readme.md
Normal file
@ -0,0 +1,134 @@
|
||||
# TypeScript typings for Google Play Developer API v2
|
||||
Lets Android application developers access their Google Play accounts.
|
||||
For detailed description please check [documentation](https://developers.google.com/android-publisher).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for Google Play Developer API:
|
||||
```
|
||||
npm install @types/gapi.client.androidpublisher@v2 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('androidpublisher', 'v2', () => {
|
||||
// now we can use gapi.client.androidpublisher
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// View and manage your Google Play Developer account
|
||||
'https://www.googleapis.com/auth/androidpublisher',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use Google Play Developer API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Commits/applies the changes made in this edit back to the app.
|
||||
*/
|
||||
await gapi.client.edits.commit({ editId: "editId", packageName: "packageName", });
|
||||
|
||||
/*
|
||||
Deletes an edit for an app. Creating a new edit will automatically delete any of your previous edits so this method need only be called if you want to preemptively abandon an edit.
|
||||
*/
|
||||
await gapi.client.edits.delete({ editId: "editId", packageName: "packageName", });
|
||||
|
||||
/*
|
||||
Returns information about the edit specified. Calls will fail if the edit is no long active (e.g. has been deleted, superseded or expired).
|
||||
*/
|
||||
await gapi.client.edits.get({ editId: "editId", packageName: "packageName", });
|
||||
|
||||
/*
|
||||
Creates a new edit for an app, populated with the app's current state.
|
||||
*/
|
||||
await gapi.client.edits.insert({ packageName: "packageName", });
|
||||
|
||||
/*
|
||||
Checks that the edit can be successfully committed. The edit's changes are not applied to the live app.
|
||||
*/
|
||||
await gapi.client.edits.validate({ editId: "editId", packageName: "packageName", });
|
||||
|
||||
/*
|
||||
Lists the user's current inapp item or subscription entitlements
|
||||
*/
|
||||
await gapi.client.entitlements.list({ packageName: "packageName", });
|
||||
|
||||
/*
|
||||
undefined
|
||||
*/
|
||||
await gapi.client.inappproducts.batch({ });
|
||||
|
||||
/*
|
||||
Delete an in-app product for an app.
|
||||
*/
|
||||
await gapi.client.inappproducts.delete({ packageName: "packageName", sku: "sku", });
|
||||
|
||||
/*
|
||||
Returns information about the in-app product specified.
|
||||
*/
|
||||
await gapi.client.inappproducts.get({ packageName: "packageName", sku: "sku", });
|
||||
|
||||
/*
|
||||
Creates a new in-app product for an app.
|
||||
*/
|
||||
await gapi.client.inappproducts.insert({ packageName: "packageName", });
|
||||
|
||||
/*
|
||||
List all the in-app products for an Android app, both subscriptions and managed in-app products..
|
||||
*/
|
||||
await gapi.client.inappproducts.list({ packageName: "packageName", });
|
||||
|
||||
/*
|
||||
Updates the details of an in-app product. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.inappproducts.patch({ packageName: "packageName", sku: "sku", });
|
||||
|
||||
/*
|
||||
Updates the details of an in-app product.
|
||||
*/
|
||||
await gapi.client.inappproducts.update({ packageName: "packageName", sku: "sku", });
|
||||
|
||||
/*
|
||||
Returns a single review.
|
||||
*/
|
||||
await gapi.client.reviews.get({ packageName: "packageName", reviewId: "reviewId", });
|
||||
|
||||
/*
|
||||
Returns a list of reviews. Only reviews from last week will be returned.
|
||||
*/
|
||||
await gapi.client.reviews.list({ packageName: "packageName", });
|
||||
|
||||
/*
|
||||
Reply to a single review, or update an existing reply.
|
||||
*/
|
||||
await gapi.client.reviews.reply({ packageName: "packageName", reviewId: "reviewId", });
|
||||
```
|
||||
24
types/gapi.client.androidpublisher/tsconfig.json
Normal file
24
types/gapi.client.androidpublisher/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.androidpublisher-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.androidpublisher/tslint.json
Normal file
8
types/gapi.client.androidpublisher/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
64
types/gapi.client.appengine/gapi.client.appengine-tests.ts
Normal file
64
types/gapi.client.appengine/gapi.client.appengine-tests.ts
Normal file
@ -0,0 +1,64 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('appengine', 'v1', () => {
|
||||
/** now we can use gapi.client.appengine */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** View and manage your applications deployed on Google App Engine */
|
||||
'https://www.googleapis.com/auth/appengine.admin',
|
||||
/** View and manage your data across Google Cloud Platform services */
|
||||
'https://www.googleapis.com/auth/cloud-platform',
|
||||
/** View your data across Google Cloud Platform services */
|
||||
'https://www.googleapis.com/auth/cloud-platform.read-only',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/**
|
||||
* Creates an App Engine application for a Google Cloud Platform project. Required fields:
|
||||
* id - The ID of the target Cloud Platform project.
|
||||
* location - The region (https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.For more information about
|
||||
* App Engine applications, see Managing Projects, Applications, and Billing (https://cloud.google.com/appengine/docs/python/console/).
|
||||
*/
|
||||
await gapi.client.apps.create({
|
||||
});
|
||||
/** Gets information about an application. */
|
||||
await gapi.client.apps.get({
|
||||
appsId: "appsId",
|
||||
});
|
||||
/**
|
||||
* Updates the specified Application resource. You can update the following fields:
|
||||
* auth_domain - Google authentication domain for controlling user access to the application.
|
||||
* default_cookie_expiration - Cookie expiration policy for the application.
|
||||
*/
|
||||
await gapi.client.apps.patch({
|
||||
appsId: "appsId",
|
||||
updateMask: "updateMask",
|
||||
});
|
||||
/**
|
||||
* Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account.
|
||||
* Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account.
|
||||
*/
|
||||
await gapi.client.apps.repair({
|
||||
appsId: "appsId",
|
||||
});
|
||||
}
|
||||
});
|
||||
2263
types/gapi.client.appengine/index.d.ts
vendored
Normal file
2263
types/gapi.client.appengine/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
84
types/gapi.client.appengine/readme.md
Normal file
84
types/gapi.client.appengine/readme.md
Normal file
@ -0,0 +1,84 @@
|
||||
# TypeScript typings for Google App Engine Admin API v1
|
||||
The App Engine Admin API enables developers to provision and manage their App Engine applications.
|
||||
For detailed description please check [documentation](https://cloud.google.com/appengine/docs/admin-api/).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for Google App Engine Admin API:
|
||||
```
|
||||
npm install @types/gapi.client.appengine@v1 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('appengine', 'v1', () => {
|
||||
// now we can use gapi.client.appengine
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// View and manage your applications deployed on Google App Engine
|
||||
'https://www.googleapis.com/auth/appengine.admin',
|
||||
|
||||
// View and manage your data across Google Cloud Platform services
|
||||
'https://www.googleapis.com/auth/cloud-platform',
|
||||
|
||||
// View your data across Google Cloud Platform services
|
||||
'https://www.googleapis.com/auth/cloud-platform.read-only',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use Google App Engine Admin API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Creates an App Engine application for a Google Cloud Platform project. Required fields:
|
||||
id - The ID of the target Cloud Platform project.
|
||||
location - The region (https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.For more information about App Engine applications, see Managing Projects, Applications, and Billing (https://cloud.google.com/appengine/docs/python/console/).
|
||||
*/
|
||||
await gapi.client.apps.create({ });
|
||||
|
||||
/*
|
||||
Gets information about an application.
|
||||
*/
|
||||
await gapi.client.apps.get({ appsId: "appsId", });
|
||||
|
||||
/*
|
||||
Updates the specified Application resource. You can update the following fields:
|
||||
auth_domain - Google authentication domain for controlling user access to the application.
|
||||
default_cookie_expiration - Cookie expiration policy for the application.
|
||||
*/
|
||||
await gapi.client.apps.patch({ appsId: "appsId", });
|
||||
|
||||
/*
|
||||
Recreates the required App Engine features for the specified App Engine application, for example a Cloud Storage bucket or App Engine service account. Use this method if you receive an error message about a missing feature, for example, Error retrieving the App Engine service account.
|
||||
*/
|
||||
await gapi.client.apps.repair({ appsId: "appsId", });
|
||||
```
|
||||
24
types/gapi.client.appengine/tsconfig.json
Normal file
24
types/gapi.client.appengine/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.appengine-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.appengine/tslint.json
Normal file
8
types/gapi.client.appengine/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('appsactivity', 'v1', () => {
|
||||
/** now we can use gapi.client.appsactivity */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** View the activity history of your Google apps */
|
||||
'https://www.googleapis.com/auth/activity',
|
||||
/** View and manage the files in your Google Drive */
|
||||
'https://www.googleapis.com/auth/drive',
|
||||
/** View and manage metadata of files in your Google Drive */
|
||||
'https://www.googleapis.com/auth/drive.metadata',
|
||||
/** View metadata for files in your Google Drive */
|
||||
'https://www.googleapis.com/auth/drive.metadata.readonly',
|
||||
/** View the files in your Google Drive */
|
||||
'https://www.googleapis.com/auth/drive.readonly',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/**
|
||||
* Returns a list of activities visible to the current logged in user. Visible activities are determined by the visiblity settings of the object that was
|
||||
* acted on, e.g. Drive files a user can see. An activity is a record of past events. Multiple events may be merged if they are similar. A request is
|
||||
* scoped to activities from a given Google service using the source parameter.
|
||||
*/
|
||||
await gapi.client.activities.list({
|
||||
"drive.ancestorId": "drive.ancestorId",
|
||||
"drive.fileId": "drive.fileId",
|
||||
groupingStrategy: "groupingStrategy",
|
||||
pageSize: 4,
|
||||
pageToken: "pageToken",
|
||||
source: "source",
|
||||
userId: "userId",
|
||||
});
|
||||
}
|
||||
});
|
||||
168
types/gapi.client.appsactivity/index.d.ts
vendored
Normal file
168
types/gapi.client.appsactivity/index.d.ts
vendored
Normal file
@ -0,0 +1,168 @@
|
||||
// Type definitions for Google G Suite Activity API v1 1.0
|
||||
// Project: https://developers.google.com/google-apps/activity/
|
||||
// Definitions by: Bolisov Alexey <https://github.com/Bolisov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// IMPORTANT
|
||||
// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
// Generated from: https://www.googleapis.com/discovery/v1/apis/appsactivity/v1/rest
|
||||
|
||||
/// <reference types="gapi.client" />
|
||||
|
||||
declare namespace gapi.client {
|
||||
/** Load G Suite Activity API v1 */
|
||||
function load(name: "appsactivity", version: "v1"): PromiseLike<void>;
|
||||
function load(name: "appsactivity", version: "v1", callback: () => any): void;
|
||||
|
||||
const activities: appsactivity.ActivitiesResource;
|
||||
|
||||
namespace appsactivity {
|
||||
interface Activity {
|
||||
/** The fields common to all of the singleEvents that make up the Activity. */
|
||||
combinedEvent?: Event;
|
||||
/** A list of all the Events that make up the Activity. */
|
||||
singleEvents?: Event[];
|
||||
}
|
||||
interface Event {
|
||||
/**
|
||||
* Additional event types. Some events may have multiple types when multiple actions are part of a single event. For example, creating a document,
|
||||
* renaming it, and sharing it may be part of a single file-creation event.
|
||||
*/
|
||||
additionalEventTypes?: string[];
|
||||
/** The time at which the event occurred formatted as Unix time in milliseconds. */
|
||||
eventTimeMillis?: string;
|
||||
/** Whether this event is caused by a user being deleted. */
|
||||
fromUserDeletion?: boolean;
|
||||
/** Extra information for move type events, such as changes in an object's parents. */
|
||||
move?: Move;
|
||||
/** Extra information for permissionChange type events, such as the user or group the new permission applies to. */
|
||||
permissionChanges?: PermissionChange[];
|
||||
/** The main type of event that occurred. */
|
||||
primaryEventType?: string;
|
||||
/** Extra information for rename type events, such as the old and new names. */
|
||||
rename?: Rename;
|
||||
/** Information specific to the Target object modified by the event. */
|
||||
target?: Target;
|
||||
/** Represents the user responsible for the event. */
|
||||
user?: User;
|
||||
}
|
||||
interface ListActivitiesResponse {
|
||||
/** List of activities. */
|
||||
activities?: Activity[];
|
||||
/** Token for the next page of results. */
|
||||
nextPageToken?: string;
|
||||
}
|
||||
interface Move {
|
||||
/** The added parent(s). */
|
||||
addedParents?: Parent[];
|
||||
/** The removed parent(s). */
|
||||
removedParents?: Parent[];
|
||||
}
|
||||
interface Parent {
|
||||
/** The parent's ID. */
|
||||
id?: string;
|
||||
/** Whether this is the root folder. */
|
||||
isRoot?: boolean;
|
||||
/** The parent's title. */
|
||||
title?: string;
|
||||
}
|
||||
interface Permission {
|
||||
/** The name of the user or group the permission applies to. */
|
||||
name?: string;
|
||||
/** The ID for this permission. Corresponds to the Drive API's permission ID returned as part of the Drive Permissions resource. */
|
||||
permissionId?: string;
|
||||
/** Indicates the Google Drive permissions role. The role determines a user's ability to read, write, or comment on the file. */
|
||||
role?: string;
|
||||
/** Indicates how widely permissions are granted. */
|
||||
type?: string;
|
||||
/** The user's information if the type is USER. */
|
||||
user?: User;
|
||||
/** Whether the permission requires a link to the file. */
|
||||
withLink?: boolean;
|
||||
}
|
||||
interface PermissionChange {
|
||||
/** Lists all Permission objects added. */
|
||||
addedPermissions?: Permission[];
|
||||
/** Lists all Permission objects removed. */
|
||||
removedPermissions?: Permission[];
|
||||
}
|
||||
interface Photo {
|
||||
/** The URL of the photo. */
|
||||
url?: string;
|
||||
}
|
||||
interface Rename {
|
||||
/** The new title. */
|
||||
newTitle?: string;
|
||||
/** The old title. */
|
||||
oldTitle?: string;
|
||||
}
|
||||
interface Target {
|
||||
/** The ID of the target. For example, in Google Drive, this is the file or folder ID. */
|
||||
id?: string;
|
||||
/** The MIME type of the target. */
|
||||
mimeType?: string;
|
||||
/** The name of the target. For example, in Google Drive, this is the title of the file. */
|
||||
name?: string;
|
||||
}
|
||||
interface User {
|
||||
/** A boolean which indicates whether the specified User was deleted. If true, name, photo and permission_id will be omitted. */
|
||||
isDeleted?: boolean;
|
||||
/** Whether the user is the authenticated user. */
|
||||
isMe?: boolean;
|
||||
/** The displayable name of the user. */
|
||||
name?: string;
|
||||
/**
|
||||
* The permission ID associated with this user. Equivalent to the Drive API's permission ID for this user, returned as part of the Drive Permissions
|
||||
* resource.
|
||||
*/
|
||||
permissionId?: string;
|
||||
/** The profile photo of the user. Not present if the user has no profile photo. */
|
||||
photo?: Photo;
|
||||
}
|
||||
interface ActivitiesResource {
|
||||
/**
|
||||
* Returns a list of activities visible to the current logged in user. Visible activities are determined by the visiblity settings of the object that was
|
||||
* acted on, e.g. Drive files a user can see. An activity is a record of past events. Multiple events may be merged if they are similar. A request is
|
||||
* scoped to activities from a given Google service using the source parameter.
|
||||
*/
|
||||
list(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Identifies the Drive folder containing the items for which to return activities. */
|
||||
"drive.ancestorId"?: string;
|
||||
/** Identifies the Drive item to return activities for. */
|
||||
"drive.fileId"?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** Indicates the strategy to use when grouping singleEvents items in the associated combinedEvent object. */
|
||||
groupingStrategy?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** The maximum number of events to return on a page. The response includes a continuation token if there are more events. */
|
||||
pageSize?: number;
|
||||
/** A token to retrieve a specific page of results. */
|
||||
pageToken?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/**
|
||||
* The Google service from which to return activities. Possible values of source are:
|
||||
* - drive.google.com
|
||||
*/
|
||||
source?: string;
|
||||
/** Indicates the user to return activity for. Use the special value me to indicate the currently authenticated user. */
|
||||
userId?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<ListActivitiesResponse>;
|
||||
}
|
||||
}
|
||||
}
|
||||
71
types/gapi.client.appsactivity/readme.md
Normal file
71
types/gapi.client.appsactivity/readme.md
Normal file
@ -0,0 +1,71 @@
|
||||
# TypeScript typings for G Suite Activity API v1
|
||||
Provides a historical view of activity.
|
||||
For detailed description please check [documentation](https://developers.google.com/google-apps/activity/).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for G Suite Activity API:
|
||||
```
|
||||
npm install @types/gapi.client.appsactivity@v1 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('appsactivity', 'v1', () => {
|
||||
// now we can use gapi.client.appsactivity
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// View the activity history of your Google apps
|
||||
'https://www.googleapis.com/auth/activity',
|
||||
|
||||
// View and manage the files in your Google Drive
|
||||
'https://www.googleapis.com/auth/drive',
|
||||
|
||||
// View and manage metadata of files in your Google Drive
|
||||
'https://www.googleapis.com/auth/drive.metadata',
|
||||
|
||||
// View metadata for files in your Google Drive
|
||||
'https://www.googleapis.com/auth/drive.metadata.readonly',
|
||||
|
||||
// View the files in your Google Drive
|
||||
'https://www.googleapis.com/auth/drive.readonly',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use G Suite Activity API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Returns a list of activities visible to the current logged in user. Visible activities are determined by the visiblity settings of the object that was acted on, e.g. Drive files a user can see. An activity is a record of past events. Multiple events may be merged if they are similar. A request is scoped to activities from a given Google service using the source parameter.
|
||||
*/
|
||||
await gapi.client.activities.list({ });
|
||||
```
|
||||
24
types/gapi.client.appsactivity/tsconfig.json
Normal file
24
types/gapi.client.appsactivity/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.appsactivity-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.appsactivity/tslint.json
Normal file
8
types/gapi.client.appsactivity/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
64
types/gapi.client.appstate/gapi.client.appstate-tests.ts
Normal file
64
types/gapi.client.appstate/gapi.client.appstate-tests.ts
Normal file
@ -0,0 +1,64 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('appstate', 'v1', () => {
|
||||
/** now we can use gapi.client.appstate */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** View and manage your data for this application */
|
||||
'https://www.googleapis.com/auth/appstate',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/**
|
||||
* Clears (sets to empty) the data for the passed key if and only if the passed version matches the currently stored version. This method results in a
|
||||
* conflict error on version mismatch.
|
||||
*/
|
||||
await gapi.client.states.clear({
|
||||
currentDataVersion: "currentDataVersion",
|
||||
stateKey: 2,
|
||||
});
|
||||
/**
|
||||
* Deletes a key and the data associated with it. The key is removed and no longer counts against the key quota. Note that since this method is not safe
|
||||
* in the face of concurrent modifications, it should only be used for development and testing purposes. Invoking this method in shipping code can result
|
||||
* in data loss and data corruption.
|
||||
*/
|
||||
await gapi.client.states.delete({
|
||||
stateKey: 1,
|
||||
});
|
||||
/** Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned. */
|
||||
await gapi.client.states.get({
|
||||
stateKey: 1,
|
||||
});
|
||||
/** Lists all the states keys, and optionally the state data. */
|
||||
await gapi.client.states.list({
|
||||
includeData: true,
|
||||
});
|
||||
/**
|
||||
* Update the data associated with the input key if and only if the passed version matches the currently stored version. This method is safe in the face
|
||||
* of concurrent writes. Maximum per-key size is 128KB.
|
||||
*/
|
||||
await gapi.client.states.update({
|
||||
currentStateVersion: "currentStateVersion",
|
||||
stateKey: 2,
|
||||
});
|
||||
}
|
||||
});
|
||||
184
types/gapi.client.appstate/index.d.ts
vendored
Normal file
184
types/gapi.client.appstate/index.d.ts
vendored
Normal file
@ -0,0 +1,184 @@
|
||||
// Type definitions for Google Google App State API v1 1.0
|
||||
// Project: https://developers.google.com/games/services/web/api/states
|
||||
// Definitions by: Bolisov Alexey <https://github.com/Bolisov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// IMPORTANT
|
||||
// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
// Generated from: https://www.googleapis.com/discovery/v1/apis/appstate/v1/rest
|
||||
|
||||
/// <reference types="gapi.client" />
|
||||
|
||||
declare namespace gapi.client {
|
||||
/** Load Google App State API v1 */
|
||||
function load(name: "appstate", version: "v1"): PromiseLike<void>;
|
||||
function load(name: "appstate", version: "v1", callback: () => any): void;
|
||||
|
||||
const states: appstate.StatesResource;
|
||||
|
||||
namespace appstate {
|
||||
interface GetResponse {
|
||||
/** The current app state version. */
|
||||
currentStateVersion?: string;
|
||||
/** The requested data. */
|
||||
data?: string;
|
||||
/** Uniquely identifies the type of this resource. Value is always the fixed string appstate#getResponse. */
|
||||
kind?: string;
|
||||
/** The key for the data. */
|
||||
stateKey?: number;
|
||||
}
|
||||
interface ListResponse {
|
||||
/** The app state data. */
|
||||
items?: GetResponse[];
|
||||
/** Uniquely identifies the type of this resource. Value is always the fixed string appstate#listResponse. */
|
||||
kind?: string;
|
||||
/** The maximum number of keys allowed for this user. */
|
||||
maximumKeyCount?: number;
|
||||
}
|
||||
interface UpdateRequest {
|
||||
/** The new app state data that your application is trying to update with. */
|
||||
data?: string;
|
||||
/** Uniquely identifies the type of this resource. Value is always the fixed string appstate#updateRequest. */
|
||||
kind?: string;
|
||||
}
|
||||
interface WriteResult {
|
||||
/** The version of the data for this key on the server. */
|
||||
currentStateVersion?: string;
|
||||
/** Uniquely identifies the type of this resource. Value is always the fixed string appstate#writeResult. */
|
||||
kind?: string;
|
||||
/** The written key. */
|
||||
stateKey?: number;
|
||||
}
|
||||
interface StatesResource {
|
||||
/**
|
||||
* Clears (sets to empty) the data for the passed key if and only if the passed version matches the currently stored version. This method results in a
|
||||
* conflict error on version mismatch.
|
||||
*/
|
||||
clear(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** The version of the data to be cleared. Version strings are returned by the server. */
|
||||
currentDataVersion?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** The key for the data to be retrieved. */
|
||||
stateKey: number;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<WriteResult>;
|
||||
/**
|
||||
* Deletes a key and the data associated with it. The key is removed and no longer counts against the key quota. Note that since this method is not safe
|
||||
* in the face of concurrent modifications, it should only be used for development and testing purposes. Invoking this method in shipping code can result
|
||||
* in data loss and data corruption.
|
||||
*/
|
||||
delete(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** The key for the data to be retrieved. */
|
||||
stateKey: number;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<void>;
|
||||
/** Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned. */
|
||||
get(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** The key for the data to be retrieved. */
|
||||
stateKey: number;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<GetResponse>;
|
||||
/** Lists all the states keys, and optionally the state data. */
|
||||
list(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** Whether to include the full data in addition to the version number */
|
||||
includeData?: boolean;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<ListResponse>;
|
||||
/**
|
||||
* Update the data associated with the input key if and only if the passed version matches the currently stored version. This method is safe in the face
|
||||
* of concurrent writes. Maximum per-key size is 128KB.
|
||||
*/
|
||||
update(request: {
|
||||
/** Data format for the response. */
|
||||
alt?: string;
|
||||
/**
|
||||
* The version of the app state your application is attempting to update. If this does not match the current version, this method will return a conflict
|
||||
* error. If there is no data stored on the server for this key, the update will succeed irrespective of the value of this parameter.
|
||||
*/
|
||||
currentStateVersion?: string;
|
||||
/** Selector specifying which fields to include in a partial response. */
|
||||
fields?: string;
|
||||
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
||||
key?: string;
|
||||
/** OAuth 2.0 token for the current user. */
|
||||
oauth_token?: string;
|
||||
/** Returns response with indentations and line breaks. */
|
||||
prettyPrint?: boolean;
|
||||
/**
|
||||
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
* Overrides userIp if both are provided.
|
||||
*/
|
||||
quotaUser?: string;
|
||||
/** The key for the data to be retrieved. */
|
||||
stateKey: number;
|
||||
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
||||
userIp?: string;
|
||||
}): Request<WriteResult>;
|
||||
}
|
||||
}
|
||||
}
|
||||
79
types/gapi.client.appstate/readme.md
Normal file
79
types/gapi.client.appstate/readme.md
Normal file
@ -0,0 +1,79 @@
|
||||
# TypeScript typings for Google App State API v1
|
||||
The Google App State API.
|
||||
For detailed description please check [documentation](https://developers.google.com/games/services/web/api/states).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for Google App State API:
|
||||
```
|
||||
npm install @types/gapi.client.appstate@v1 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('appstate', 'v1', () => {
|
||||
// now we can use gapi.client.appstate
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// View and manage your data for this application
|
||||
'https://www.googleapis.com/auth/appstate',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use Google App State API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Clears (sets to empty) the data for the passed key if and only if the passed version matches the currently stored version. This method results in a conflict error on version mismatch.
|
||||
*/
|
||||
await gapi.client.states.clear({ stateKey: 1, });
|
||||
|
||||
/*
|
||||
Deletes a key and the data associated with it. The key is removed and no longer counts against the key quota. Note that since this method is not safe in the face of concurrent modifications, it should only be used for development and testing purposes. Invoking this method in shipping code can result in data loss and data corruption.
|
||||
*/
|
||||
await gapi.client.states.delete({ stateKey: 1, });
|
||||
|
||||
/*
|
||||
Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned.
|
||||
*/
|
||||
await gapi.client.states.get({ stateKey: 1, });
|
||||
|
||||
/*
|
||||
Lists all the states keys, and optionally the state data.
|
||||
*/
|
||||
await gapi.client.states.list({ });
|
||||
|
||||
/*
|
||||
Update the data associated with the input key if and only if the passed version matches the currently stored version. This method is safe in the face of concurrent writes. Maximum per-key size is 128KB.
|
||||
*/
|
||||
await gapi.client.states.update({ stateKey: 1, });
|
||||
```
|
||||
24
types/gapi.client.appstate/tsconfig.json
Normal file
24
types/gapi.client.appstate/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.appstate-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.appstate/tslint.json
Normal file
8
types/gapi.client.appstate/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
202
types/gapi.client.bigquery/gapi.client.bigquery-tests.ts
Normal file
202
types/gapi.client.bigquery/gapi.client.bigquery-tests.ts
Normal file
@ -0,0 +1,202 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('bigquery', 'v2', () => {
|
||||
/** now we can use gapi.client.bigquery */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** View and manage your data in Google BigQuery */
|
||||
'https://www.googleapis.com/auth/bigquery',
|
||||
/** Insert data into Google BigQuery */
|
||||
'https://www.googleapis.com/auth/bigquery.insertdata',
|
||||
/** View and manage your data across Google Cloud Platform services */
|
||||
'https://www.googleapis.com/auth/cloud-platform',
|
||||
/** View your data across Google Cloud Platform services */
|
||||
'https://www.googleapis.com/auth/cloud-platform.read-only',
|
||||
/** Manage your data and permissions in Google Cloud Storage */
|
||||
'https://www.googleapis.com/auth/devstorage.full_control',
|
||||
/** View your data in Google Cloud Storage */
|
||||
'https://www.googleapis.com/auth/devstorage.read_only',
|
||||
/** Manage your data in Google Cloud Storage */
|
||||
'https://www.googleapis.com/auth/devstorage.read_write',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/**
|
||||
* Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying
|
||||
* deleteContents. Immediately after deletion, you can create another dataset with the same name.
|
||||
*/
|
||||
await gapi.client.datasets.delete({
|
||||
datasetId: "datasetId",
|
||||
deleteContents: true,
|
||||
projectId: "projectId",
|
||||
});
|
||||
/** Returns the dataset specified by datasetID. */
|
||||
await gapi.client.datasets.get({
|
||||
datasetId: "datasetId",
|
||||
projectId: "projectId",
|
||||
});
|
||||
/** Creates a new empty dataset. */
|
||||
await gapi.client.datasets.insert({
|
||||
projectId: "projectId",
|
||||
});
|
||||
/** Lists all datasets in the specified project to which you have been granted the READER dataset role. */
|
||||
await gapi.client.datasets.list({
|
||||
all: true,
|
||||
filter: "filter",
|
||||
maxResults: 3,
|
||||
pageToken: "pageToken",
|
||||
projectId: "projectId",
|
||||
});
|
||||
/**
|
||||
* Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that
|
||||
* are provided in the submitted dataset resource. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.datasets.patch({
|
||||
datasetId: "datasetId",
|
||||
projectId: "projectId",
|
||||
});
|
||||
/**
|
||||
* Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that
|
||||
* are provided in the submitted dataset resource.
|
||||
*/
|
||||
await gapi.client.datasets.update({
|
||||
datasetId: "datasetId",
|
||||
projectId: "projectId",
|
||||
});
|
||||
/**
|
||||
* Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed
|
||||
* successfully. Cancelled jobs may still incur costs.
|
||||
*/
|
||||
await gapi.client.jobs.cancel({
|
||||
jobId: "jobId",
|
||||
projectId: "projectId",
|
||||
});
|
||||
/**
|
||||
* Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran
|
||||
* the job, or have the Is Owner project role.
|
||||
*/
|
||||
await gapi.client.jobs.get({
|
||||
jobId: "jobId",
|
||||
projectId: "projectId",
|
||||
});
|
||||
/** Retrieves the results of a query job. */
|
||||
await gapi.client.jobs.getQueryResults({
|
||||
jobId: "jobId",
|
||||
maxResults: 2,
|
||||
pageToken: "pageToken",
|
||||
projectId: "projectId",
|
||||
startIndex: "startIndex",
|
||||
timeoutMs: 6,
|
||||
});
|
||||
/** Starts a new asynchronous job. Requires the Can View project role. */
|
||||
await gapi.client.jobs.insert({
|
||||
projectId: "projectId",
|
||||
});
|
||||
/**
|
||||
* Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in
|
||||
* reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.
|
||||
*/
|
||||
await gapi.client.jobs.list({
|
||||
allUsers: true,
|
||||
maxResults: 2,
|
||||
pageToken: "pageToken",
|
||||
projectId: "projectId",
|
||||
projection: "projection",
|
||||
stateFilter: "stateFilter",
|
||||
});
|
||||
/** Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout. */
|
||||
await gapi.client.jobs.query({
|
||||
projectId: "projectId",
|
||||
});
|
||||
/** Returns the email address of the service account for your project used for interactions with Google Cloud KMS. */
|
||||
await gapi.client.projects.getServiceAccount({
|
||||
projectId: "projectId",
|
||||
});
|
||||
/** Lists all projects to which you have been granted any project role. */
|
||||
await gapi.client.projects.list({
|
||||
maxResults: 1,
|
||||
pageToken: "pageToken",
|
||||
});
|
||||
/** Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role. */
|
||||
await gapi.client.tabledata.insertAll({
|
||||
datasetId: "datasetId",
|
||||
projectId: "projectId",
|
||||
tableId: "tableId",
|
||||
});
|
||||
/** Retrieves table data from a specified set of rows. Requires the READER dataset role. */
|
||||
await gapi.client.tabledata.list({
|
||||
datasetId: "datasetId",
|
||||
maxResults: 2,
|
||||
pageToken: "pageToken",
|
||||
projectId: "projectId",
|
||||
selectedFields: "selectedFields",
|
||||
startIndex: "startIndex",
|
||||
tableId: "tableId",
|
||||
});
|
||||
/** Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted. */
|
||||
await gapi.client.tables.delete({
|
||||
datasetId: "datasetId",
|
||||
projectId: "projectId",
|
||||
tableId: "tableId",
|
||||
});
|
||||
/**
|
||||
* Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes
|
||||
* the structure of this table.
|
||||
*/
|
||||
await gapi.client.tables.get({
|
||||
datasetId: "datasetId",
|
||||
projectId: "projectId",
|
||||
selectedFields: "selectedFields",
|
||||
tableId: "tableId",
|
||||
});
|
||||
/** Creates a new, empty table in the dataset. */
|
||||
await gapi.client.tables.insert({
|
||||
datasetId: "datasetId",
|
||||
projectId: "projectId",
|
||||
});
|
||||
/** Lists all tables in the specified dataset. Requires the READER dataset role. */
|
||||
await gapi.client.tables.list({
|
||||
datasetId: "datasetId",
|
||||
maxResults: 2,
|
||||
pageToken: "pageToken",
|
||||
projectId: "projectId",
|
||||
});
|
||||
/**
|
||||
* Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are
|
||||
* provided in the submitted table resource. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.tables.patch({
|
||||
datasetId: "datasetId",
|
||||
projectId: "projectId",
|
||||
tableId: "tableId",
|
||||
});
|
||||
/**
|
||||
* Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are
|
||||
* provided in the submitted table resource.
|
||||
*/
|
||||
await gapi.client.tables.update({
|
||||
datasetId: "datasetId",
|
||||
projectId: "projectId",
|
||||
tableId: "tableId",
|
||||
});
|
||||
}
|
||||
});
|
||||
1810
types/gapi.client.bigquery/index.d.ts
vendored
Normal file
1810
types/gapi.client.bigquery/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
182
types/gapi.client.bigquery/readme.md
Normal file
182
types/gapi.client.bigquery/readme.md
Normal file
@ -0,0 +1,182 @@
|
||||
# TypeScript typings for BigQuery API v2
|
||||
A data platform for customers to create, manage, share and query data.
|
||||
For detailed description please check [documentation](https://cloud.google.com/bigquery/).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for BigQuery API:
|
||||
```
|
||||
npm install @types/gapi.client.bigquery@v2 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('bigquery', 'v2', () => {
|
||||
// now we can use gapi.client.bigquery
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// View and manage your data in Google BigQuery
|
||||
'https://www.googleapis.com/auth/bigquery',
|
||||
|
||||
// Insert data into Google BigQuery
|
||||
'https://www.googleapis.com/auth/bigquery.insertdata',
|
||||
|
||||
// View and manage your data across Google Cloud Platform services
|
||||
'https://www.googleapis.com/auth/cloud-platform',
|
||||
|
||||
// View your data across Google Cloud Platform services
|
||||
'https://www.googleapis.com/auth/cloud-platform.read-only',
|
||||
|
||||
// Manage your data and permissions in Google Cloud Storage
|
||||
'https://www.googleapis.com/auth/devstorage.full_control',
|
||||
|
||||
// View your data in Google Cloud Storage
|
||||
'https://www.googleapis.com/auth/devstorage.read_only',
|
||||
|
||||
// Manage your data in Google Cloud Storage
|
||||
'https://www.googleapis.com/auth/devstorage.read_write',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use BigQuery API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.
|
||||
*/
|
||||
await gapi.client.datasets.delete({ datasetId: "datasetId", projectId: "projectId", });
|
||||
|
||||
/*
|
||||
Returns the dataset specified by datasetID.
|
||||
*/
|
||||
await gapi.client.datasets.get({ datasetId: "datasetId", projectId: "projectId", });
|
||||
|
||||
/*
|
||||
Creates a new empty dataset.
|
||||
*/
|
||||
await gapi.client.datasets.insert({ projectId: "projectId", });
|
||||
|
||||
/*
|
||||
Lists all datasets in the specified project to which you have been granted the READER dataset role.
|
||||
*/
|
||||
await gapi.client.datasets.list({ projectId: "projectId", });
|
||||
|
||||
/*
|
||||
Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.datasets.patch({ datasetId: "datasetId", projectId: "projectId", });
|
||||
|
||||
/*
|
||||
Updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource.
|
||||
*/
|
||||
await gapi.client.datasets.update({ datasetId: "datasetId", projectId: "projectId", });
|
||||
|
||||
/*
|
||||
Requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs.
|
||||
*/
|
||||
await gapi.client.jobs.cancel({ jobId: "jobId", projectId: "projectId", });
|
||||
|
||||
/*
|
||||
Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role.
|
||||
*/
|
||||
await gapi.client.jobs.get({ jobId: "jobId", projectId: "projectId", });
|
||||
|
||||
/*
|
||||
Retrieves the results of a query job.
|
||||
*/
|
||||
await gapi.client.jobs.getQueryResults({ jobId: "jobId", projectId: "projectId", });
|
||||
|
||||
/*
|
||||
Starts a new asynchronous job. Requires the Can View project role.
|
||||
*/
|
||||
await gapi.client.jobs.insert({ projectId: "projectId", });
|
||||
|
||||
/*
|
||||
Lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.
|
||||
*/
|
||||
await gapi.client.jobs.list({ projectId: "projectId", });
|
||||
|
||||
/*
|
||||
Runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout.
|
||||
*/
|
||||
await gapi.client.jobs.query({ projectId: "projectId", });
|
||||
|
||||
/*
|
||||
Returns the email address of the service account for your project used for interactions with Google Cloud KMS.
|
||||
*/
|
||||
await gapi.client.projects.getServiceAccount({ projectId: "projectId", });
|
||||
|
||||
/*
|
||||
Lists all projects to which you have been granted any project role.
|
||||
*/
|
||||
await gapi.client.projects.list({ });
|
||||
|
||||
/*
|
||||
Streams data into BigQuery one record at a time without needing to run a load job. Requires the WRITER dataset role.
|
||||
*/
|
||||
await gapi.client.tabledata.insertAll({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", });
|
||||
|
||||
/*
|
||||
Retrieves table data from a specified set of rows. Requires the READER dataset role.
|
||||
*/
|
||||
await gapi.client.tabledata.list({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", });
|
||||
|
||||
/*
|
||||
Deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.
|
||||
*/
|
||||
await gapi.client.tables.delete({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", });
|
||||
|
||||
/*
|
||||
Gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.
|
||||
*/
|
||||
await gapi.client.tables.get({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", });
|
||||
|
||||
/*
|
||||
Creates a new, empty table in the dataset.
|
||||
*/
|
||||
await gapi.client.tables.insert({ datasetId: "datasetId", projectId: "projectId", });
|
||||
|
||||
/*
|
||||
Lists all tables in the specified dataset. Requires the READER dataset role.
|
||||
*/
|
||||
await gapi.client.tables.list({ datasetId: "datasetId", projectId: "projectId", });
|
||||
|
||||
/*
|
||||
Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.tables.patch({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", });
|
||||
|
||||
/*
|
||||
Updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource.
|
||||
*/
|
||||
await gapi.client.tables.update({ datasetId: "datasetId", projectId: "projectId", tableId: "tableId", });
|
||||
```
|
||||
24
types/gapi.client.bigquery/tsconfig.json
Normal file
24
types/gapi.client.bigquery/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.bigquery-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.bigquery/tslint.json
Normal file
8
types/gapi.client.bigquery/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('bigquerydatatransfer', 'v1', () => {
|
||||
/** now we can use gapi.client.bigquerydatatransfer */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** View and manage your data in Google BigQuery */
|
||||
'https://www.googleapis.com/auth/bigquery',
|
||||
/** View and manage your data across Google Cloud Platform services */
|
||||
'https://www.googleapis.com/auth/cloud-platform',
|
||||
/** View your data across Google Cloud Platform services */
|
||||
'https://www.googleapis.com/auth/cloud-platform.read-only',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
}
|
||||
});
|
||||
1579
types/gapi.client.bigquerydatatransfer/index.d.ts
vendored
Normal file
1579
types/gapi.client.bigquerydatatransfer/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
60
types/gapi.client.bigquerydatatransfer/readme.md
Normal file
60
types/gapi.client.bigquerydatatransfer/readme.md
Normal file
@ -0,0 +1,60 @@
|
||||
# TypeScript typings for BigQuery Data Transfer API v1
|
||||
Transfers data from partner SaaS applications to Google BigQuery on a scheduled, managed basis.
|
||||
For detailed description please check [documentation](https://cloud.google.com/bigquery/).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for BigQuery Data Transfer API:
|
||||
```
|
||||
npm install @types/gapi.client.bigquerydatatransfer@v1 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('bigquerydatatransfer', 'v1', () => {
|
||||
// now we can use gapi.client.bigquerydatatransfer
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// View and manage your data in Google BigQuery
|
||||
'https://www.googleapis.com/auth/bigquery',
|
||||
|
||||
// View and manage your data across Google Cloud Platform services
|
||||
'https://www.googleapis.com/auth/cloud-platform',
|
||||
|
||||
// View your data across Google Cloud Platform services
|
||||
'https://www.googleapis.com/auth/cloud-platform.read-only',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use BigQuery Data Transfer API resources:
|
||||
|
||||
```typescript
|
||||
```
|
||||
24
types/gapi.client.bigquerydatatransfer/tsconfig.json
Normal file
24
types/gapi.client.bigquerydatatransfer/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.bigquerydatatransfer-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.bigquerydatatransfer/tslint.json
Normal file
8
types/gapi.client.bigquerydatatransfer/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
277
types/gapi.client.blogger/gapi.client.blogger-tests.ts
Normal file
277
types/gapi.client.blogger/gapi.client.blogger-tests.ts
Normal file
@ -0,0 +1,277 @@
|
||||
/* This is stub file for gapi.client.{{=it.name}} definition tests */
|
||||
/* IMPORTANT.
|
||||
* This file was automatically generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
||||
* In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
||||
**/
|
||||
gapi.load('client', () => {
|
||||
/** now we can use gapi.client */
|
||||
gapi.client.load('blogger', 'v3', () => {
|
||||
/** now we can use gapi.client.blogger */
|
||||
|
||||
/** don't forget to authenticate your client before sending any request to resources: */
|
||||
/** declare client_id registered in Google Developers Console */
|
||||
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
||||
const scope = [
|
||||
/** Manage your Blogger account */
|
||||
'https://www.googleapis.com/auth/blogger',
|
||||
/** View your Blogger account */
|
||||
'https://www.googleapis.com/auth/blogger.readonly',
|
||||
];
|
||||
const immediate = true;
|
||||
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/** handle succesfull authorization */
|
||||
run();
|
||||
} else {
|
||||
/** handle authorization error */
|
||||
}
|
||||
});
|
||||
run();
|
||||
});
|
||||
|
||||
async function run() {
|
||||
/** Gets one blog and user info pair by blogId and userId. */
|
||||
await gapi.client.blogUserInfos.get({
|
||||
blogId: "blogId",
|
||||
maxPosts: 2,
|
||||
userId: "userId",
|
||||
});
|
||||
/** Gets one blog by ID. */
|
||||
await gapi.client.blogs.get({
|
||||
blogId: "blogId",
|
||||
maxPosts: 2,
|
||||
view: "view",
|
||||
});
|
||||
/** Retrieve a Blog by URL. */
|
||||
await gapi.client.blogs.getByUrl({
|
||||
url: "url",
|
||||
view: "view",
|
||||
});
|
||||
/** Retrieves a list of blogs, possibly filtered. */
|
||||
await gapi.client.blogs.listByUser({
|
||||
fetchUserInfo: true,
|
||||
role: "role",
|
||||
status: "status",
|
||||
userId: "userId",
|
||||
view: "view",
|
||||
});
|
||||
/** Marks a comment as not spam. */
|
||||
await gapi.client.comments.approve({
|
||||
blogId: "blogId",
|
||||
commentId: "commentId",
|
||||
postId: "postId",
|
||||
});
|
||||
/** Delete a comment by ID. */
|
||||
await gapi.client.comments.delete({
|
||||
blogId: "blogId",
|
||||
commentId: "commentId",
|
||||
postId: "postId",
|
||||
});
|
||||
/** Gets one comment by ID. */
|
||||
await gapi.client.comments.get({
|
||||
blogId: "blogId",
|
||||
commentId: "commentId",
|
||||
postId: "postId",
|
||||
view: "view",
|
||||
});
|
||||
/** Retrieves the comments for a post, possibly filtered. */
|
||||
await gapi.client.comments.list({
|
||||
blogId: "blogId",
|
||||
endDate: "endDate",
|
||||
fetchBodies: true,
|
||||
maxResults: 4,
|
||||
pageToken: "pageToken",
|
||||
postId: "postId",
|
||||
startDate: "startDate",
|
||||
status: "status",
|
||||
view: "view",
|
||||
});
|
||||
/** Retrieves the comments for a blog, across all posts, possibly filtered. */
|
||||
await gapi.client.comments.listByBlog({
|
||||
blogId: "blogId",
|
||||
endDate: "endDate",
|
||||
fetchBodies: true,
|
||||
maxResults: 4,
|
||||
pageToken: "pageToken",
|
||||
startDate: "startDate",
|
||||
status: "status",
|
||||
});
|
||||
/** Marks a comment as spam. */
|
||||
await gapi.client.comments.markAsSpam({
|
||||
blogId: "blogId",
|
||||
commentId: "commentId",
|
||||
postId: "postId",
|
||||
});
|
||||
/** Removes the content of a comment. */
|
||||
await gapi.client.comments.removeContent({
|
||||
blogId: "blogId",
|
||||
commentId: "commentId",
|
||||
postId: "postId",
|
||||
});
|
||||
/** Retrieve pageview stats for a Blog. */
|
||||
await gapi.client.pageViews.get({
|
||||
blogId: "blogId",
|
||||
range: "range",
|
||||
});
|
||||
/** Delete a page by ID. */
|
||||
await gapi.client.pages.delete({
|
||||
blogId: "blogId",
|
||||
pageId: "pageId",
|
||||
});
|
||||
/** Gets one blog page by ID. */
|
||||
await gapi.client.pages.get({
|
||||
blogId: "blogId",
|
||||
pageId: "pageId",
|
||||
view: "view",
|
||||
});
|
||||
/** Add a page. */
|
||||
await gapi.client.pages.insert({
|
||||
blogId: "blogId",
|
||||
isDraft: true,
|
||||
});
|
||||
/** Retrieves the pages for a blog, optionally including non-LIVE statuses. */
|
||||
await gapi.client.pages.list({
|
||||
blogId: "blogId",
|
||||
fetchBodies: true,
|
||||
maxResults: 3,
|
||||
pageToken: "pageToken",
|
||||
status: "status",
|
||||
view: "view",
|
||||
});
|
||||
/** Update a page. This method supports patch semantics. */
|
||||
await gapi.client.pages.patch({
|
||||
blogId: "blogId",
|
||||
pageId: "pageId",
|
||||
publish: true,
|
||||
revert: true,
|
||||
});
|
||||
/** Publishes a draft page. */
|
||||
await gapi.client.pages.publish({
|
||||
blogId: "blogId",
|
||||
pageId: "pageId",
|
||||
});
|
||||
/** Revert a published or scheduled page to draft state. */
|
||||
await gapi.client.pages.revert({
|
||||
blogId: "blogId",
|
||||
pageId: "pageId",
|
||||
});
|
||||
/** Update a page. */
|
||||
await gapi.client.pages.update({
|
||||
blogId: "blogId",
|
||||
pageId: "pageId",
|
||||
publish: true,
|
||||
revert: true,
|
||||
});
|
||||
/**
|
||||
* Gets one post and user info pair, by post ID and user ID. The post user info contains per-user information about the post, such as access rights,
|
||||
* specific to the user.
|
||||
*/
|
||||
await gapi.client.postUserInfos.get({
|
||||
blogId: "blogId",
|
||||
maxComments: 2,
|
||||
postId: "postId",
|
||||
userId: "userId",
|
||||
});
|
||||
/**
|
||||
* Retrieves a list of post and post user info pairs, possibly filtered. The post user info contains per-user information about the post, such as access
|
||||
* rights, specific to the user.
|
||||
*/
|
||||
await gapi.client.postUserInfos.list({
|
||||
blogId: "blogId",
|
||||
endDate: "endDate",
|
||||
fetchBodies: true,
|
||||
labels: "labels",
|
||||
maxResults: 5,
|
||||
orderBy: "orderBy",
|
||||
pageToken: "pageToken",
|
||||
startDate: "startDate",
|
||||
status: "status",
|
||||
userId: "userId",
|
||||
view: "view",
|
||||
});
|
||||
/** Delete a post by ID. */
|
||||
await gapi.client.posts.delete({
|
||||
blogId: "blogId",
|
||||
postId: "postId",
|
||||
});
|
||||
/** Get a post by ID. */
|
||||
await gapi.client.posts.get({
|
||||
blogId: "blogId",
|
||||
fetchBody: true,
|
||||
fetchImages: true,
|
||||
maxComments: 4,
|
||||
postId: "postId",
|
||||
view: "view",
|
||||
});
|
||||
/** Retrieve a Post by Path. */
|
||||
await gapi.client.posts.getByPath({
|
||||
blogId: "blogId",
|
||||
maxComments: 2,
|
||||
path: "path",
|
||||
view: "view",
|
||||
});
|
||||
/** Add a post. */
|
||||
await gapi.client.posts.insert({
|
||||
blogId: "blogId",
|
||||
fetchBody: true,
|
||||
fetchImages: true,
|
||||
isDraft: true,
|
||||
});
|
||||
/** Retrieves a list of posts, possibly filtered. */
|
||||
await gapi.client.posts.list({
|
||||
blogId: "blogId",
|
||||
endDate: "endDate",
|
||||
fetchBodies: true,
|
||||
fetchImages: true,
|
||||
labels: "labels",
|
||||
maxResults: 6,
|
||||
orderBy: "orderBy",
|
||||
pageToken: "pageToken",
|
||||
startDate: "startDate",
|
||||
status: "status",
|
||||
view: "view",
|
||||
});
|
||||
/** Update a post. This method supports patch semantics. */
|
||||
await gapi.client.posts.patch({
|
||||
blogId: "blogId",
|
||||
fetchBody: true,
|
||||
fetchImages: true,
|
||||
maxComments: 4,
|
||||
postId: "postId",
|
||||
publish: true,
|
||||
revert: true,
|
||||
});
|
||||
/** Publishes a draft post, optionally at the specific time of the given publishDate parameter. */
|
||||
await gapi.client.posts.publish({
|
||||
blogId: "blogId",
|
||||
postId: "postId",
|
||||
publishDate: "publishDate",
|
||||
});
|
||||
/** Revert a published or scheduled post to draft state. */
|
||||
await gapi.client.posts.revert({
|
||||
blogId: "blogId",
|
||||
postId: "postId",
|
||||
});
|
||||
/** Search for a post. */
|
||||
await gapi.client.posts.search({
|
||||
blogId: "blogId",
|
||||
fetchBodies: true,
|
||||
orderBy: "orderBy",
|
||||
q: "q",
|
||||
});
|
||||
/** Update a post. */
|
||||
await gapi.client.posts.update({
|
||||
blogId: "blogId",
|
||||
fetchBody: true,
|
||||
fetchImages: true,
|
||||
maxComments: 4,
|
||||
postId: "postId",
|
||||
publish: true,
|
||||
revert: true,
|
||||
});
|
||||
/** Gets one user by ID. */
|
||||
await gapi.client.users.get({
|
||||
userId: "userId",
|
||||
});
|
||||
}
|
||||
});
|
||||
1346
types/gapi.client.blogger/index.d.ts
vendored
Normal file
1346
types/gapi.client.blogger/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
222
types/gapi.client.blogger/readme.md
Normal file
222
types/gapi.client.blogger/readme.md
Normal file
@ -0,0 +1,222 @@
|
||||
# TypeScript typings for Blogger API v3
|
||||
API for access to the data within Blogger.
|
||||
For detailed description please check [documentation](https://developers.google.com/blogger/docs/3.0/getting_started).
|
||||
|
||||
## Installing
|
||||
|
||||
Install typings for Blogger API:
|
||||
```
|
||||
npm install @types/gapi.client.blogger@v3 --save-dev
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You need to initialize Google API client in your code:
|
||||
```typescript
|
||||
gapi.load("client", () => {
|
||||
// now we can use gapi.client
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Then load api client wrapper:
|
||||
```typescript
|
||||
gapi.client.load('blogger', 'v3', () => {
|
||||
// now we can use gapi.client.blogger
|
||||
// ...
|
||||
});
|
||||
```
|
||||
|
||||
Don't forget to authenticate your client before sending any request to resources:
|
||||
```typescript
|
||||
|
||||
// declare client_id registered in Google Developers Console
|
||||
var client_id = '',
|
||||
scope = [
|
||||
// Manage your Blogger account
|
||||
'https://www.googleapis.com/auth/blogger',
|
||||
|
||||
// View your Blogger account
|
||||
'https://www.googleapis.com/auth/blogger.readonly',
|
||||
],
|
||||
immediate = true;
|
||||
// ...
|
||||
|
||||
gapi.auth.authorize({ client_id: client_id, scope: scope, immediate: immediate }, authResult => {
|
||||
if (authResult && !authResult.error) {
|
||||
/* handle succesfull authorization */
|
||||
} else {
|
||||
/* handle authorization error */
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
After that you can use Blogger API resources:
|
||||
|
||||
```typescript
|
||||
|
||||
/*
|
||||
Gets one blog and user info pair by blogId and userId.
|
||||
*/
|
||||
await gapi.client.blogUserInfos.get({ blogId: "blogId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Gets one blog by ID.
|
||||
*/
|
||||
await gapi.client.blogs.get({ blogId: "blogId", });
|
||||
|
||||
/*
|
||||
Retrieve a Blog by URL.
|
||||
*/
|
||||
await gapi.client.blogs.getByUrl({ url: "url", });
|
||||
|
||||
/*
|
||||
Retrieves a list of blogs, possibly filtered.
|
||||
*/
|
||||
await gapi.client.blogs.listByUser({ userId: "userId", });
|
||||
|
||||
/*
|
||||
Marks a comment as not spam.
|
||||
*/
|
||||
await gapi.client.comments.approve({ blogId: "blogId", commentId: "commentId", postId: "postId", });
|
||||
|
||||
/*
|
||||
Delete a comment by ID.
|
||||
*/
|
||||
await gapi.client.comments.delete({ blogId: "blogId", commentId: "commentId", postId: "postId", });
|
||||
|
||||
/*
|
||||
Gets one comment by ID.
|
||||
*/
|
||||
await gapi.client.comments.get({ blogId: "blogId", commentId: "commentId", postId: "postId", });
|
||||
|
||||
/*
|
||||
Retrieves the comments for a post, possibly filtered.
|
||||
*/
|
||||
await gapi.client.comments.list({ blogId: "blogId", postId: "postId", });
|
||||
|
||||
/*
|
||||
Retrieves the comments for a blog, across all posts, possibly filtered.
|
||||
*/
|
||||
await gapi.client.comments.listByBlog({ blogId: "blogId", });
|
||||
|
||||
/*
|
||||
Marks a comment as spam.
|
||||
*/
|
||||
await gapi.client.comments.markAsSpam({ blogId: "blogId", commentId: "commentId", postId: "postId", });
|
||||
|
||||
/*
|
||||
Removes the content of a comment.
|
||||
*/
|
||||
await gapi.client.comments.removeContent({ blogId: "blogId", commentId: "commentId", postId: "postId", });
|
||||
|
||||
/*
|
||||
Retrieve pageview stats for a Blog.
|
||||
*/
|
||||
await gapi.client.pageViews.get({ blogId: "blogId", });
|
||||
|
||||
/*
|
||||
Delete a page by ID.
|
||||
*/
|
||||
await gapi.client.pages.delete({ blogId: "blogId", pageId: "pageId", });
|
||||
|
||||
/*
|
||||
Gets one blog page by ID.
|
||||
*/
|
||||
await gapi.client.pages.get({ blogId: "blogId", pageId: "pageId", });
|
||||
|
||||
/*
|
||||
Add a page.
|
||||
*/
|
||||
await gapi.client.pages.insert({ blogId: "blogId", });
|
||||
|
||||
/*
|
||||
Retrieves the pages for a blog, optionally including non-LIVE statuses.
|
||||
*/
|
||||
await gapi.client.pages.list({ blogId: "blogId", });
|
||||
|
||||
/*
|
||||
Update a page. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.pages.patch({ blogId: "blogId", pageId: "pageId", });
|
||||
|
||||
/*
|
||||
Publishes a draft page.
|
||||
*/
|
||||
await gapi.client.pages.publish({ blogId: "blogId", pageId: "pageId", });
|
||||
|
||||
/*
|
||||
Revert a published or scheduled page to draft state.
|
||||
*/
|
||||
await gapi.client.pages.revert({ blogId: "blogId", pageId: "pageId", });
|
||||
|
||||
/*
|
||||
Update a page.
|
||||
*/
|
||||
await gapi.client.pages.update({ blogId: "blogId", pageId: "pageId", });
|
||||
|
||||
/*
|
||||
Gets one post and user info pair, by post ID and user ID. The post user info contains per-user information about the post, such as access rights, specific to the user.
|
||||
*/
|
||||
await gapi.client.postUserInfos.get({ blogId: "blogId", postId: "postId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Retrieves a list of post and post user info pairs, possibly filtered. The post user info contains per-user information about the post, such as access rights, specific to the user.
|
||||
*/
|
||||
await gapi.client.postUserInfos.list({ blogId: "blogId", userId: "userId", });
|
||||
|
||||
/*
|
||||
Delete a post by ID.
|
||||
*/
|
||||
await gapi.client.posts.delete({ blogId: "blogId", postId: "postId", });
|
||||
|
||||
/*
|
||||
Get a post by ID.
|
||||
*/
|
||||
await gapi.client.posts.get({ blogId: "blogId", postId: "postId", });
|
||||
|
||||
/*
|
||||
Retrieve a Post by Path.
|
||||
*/
|
||||
await gapi.client.posts.getByPath({ blogId: "blogId", path: "path", });
|
||||
|
||||
/*
|
||||
Add a post.
|
||||
*/
|
||||
await gapi.client.posts.insert({ blogId: "blogId", });
|
||||
|
||||
/*
|
||||
Retrieves a list of posts, possibly filtered.
|
||||
*/
|
||||
await gapi.client.posts.list({ blogId: "blogId", });
|
||||
|
||||
/*
|
||||
Update a post. This method supports patch semantics.
|
||||
*/
|
||||
await gapi.client.posts.patch({ blogId: "blogId", postId: "postId", });
|
||||
|
||||
/*
|
||||
Publishes a draft post, optionally at the specific time of the given publishDate parameter.
|
||||
*/
|
||||
await gapi.client.posts.publish({ blogId: "blogId", postId: "postId", });
|
||||
|
||||
/*
|
||||
Revert a published or scheduled post to draft state.
|
||||
*/
|
||||
await gapi.client.posts.revert({ blogId: "blogId", postId: "postId", });
|
||||
|
||||
/*
|
||||
Search for a post.
|
||||
*/
|
||||
await gapi.client.posts.search({ blogId: "blogId", q: "q", });
|
||||
|
||||
/*
|
||||
Update a post.
|
||||
*/
|
||||
await gapi.client.posts.update({ blogId: "blogId", postId: "postId", });
|
||||
|
||||
/*
|
||||
Gets one user by ID.
|
||||
*/
|
||||
await gapi.client.users.get({ userId: "userId", });
|
||||
```
|
||||
24
types/gapi.client.blogger/tsconfig.json
Normal file
24
types/gapi.client.blogger/tsconfig.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strictFunctionTypes": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"gapi.client.blogger-tests.ts"
|
||||
]
|
||||
}
|
||||
8
types/gapi.client.blogger/tslint.json
Normal file
8
types/gapi.client.blogger/tslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"interface-name": [false],
|
||||
"ban-types": [false],
|
||||
"await-promise": [true, "Request"]
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user