@maxim_mazurok/gapi.client.adexperiencereport-v1 0.0.20220715

Sign up to get free protection for your applications and to get access to all the features.
package/index.d.ts ADDED
@@ -0,0 +1,118 @@
1
+ /* Type definitions for non-npm package Ad Experience Report API v1 0.0 */
2
+ // Project: https://developers.google.com/ad-experience-report/
3
+ // Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
4
+ // Nick Amoscato <https://github.com/namoscato>
5
+ // Declan Vong <https://github.com/declanvong>
6
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7
+ // TypeScript Version: 2.8
8
+
9
+ // IMPORTANT
10
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
11
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
12
+ // Generated from: https://adexperiencereport.googleapis.com/$discovery/rest?version=v1
13
+ // Revision: 20220715
14
+
15
+ /// <reference types="gapi.client" />
16
+
17
+ declare namespace gapi.client {
18
+ /** Load Ad Experience Report API v1 */
19
+ function load(urlOrObject: "https://adexperiencereport.googleapis.com/$discovery/rest?version=v1"): Promise<void>;
20
+ /** @deprecated Please load APIs with discovery documents. */
21
+ function load(name: "adexperiencereport", version: "v1"): Promise<void>;
22
+ /** @deprecated Please load APIs with discovery documents. */
23
+ function load(name: "adexperiencereport", version: "v1", callback: () => any): void;
24
+
25
+ namespace adexperiencereport {
26
+ interface PlatformSummary {
27
+ /** The site's Ad Experience Report status on this platform. */
28
+ betterAdsStatus?: string;
29
+ /** The time at which [enforcement](https://support.google.com/webtools/answer/7308033) against the site began or will begin on this platform. Not set when the filter_status is OFF. */
30
+ enforcementTime?: string;
31
+ /** The site's [enforcement status](https://support.google.com/webtools/answer/7308033) on this platform. */
32
+ filterStatus?: string;
33
+ /** The time at which the site's status last changed on this platform. */
34
+ lastChangeTime?: string;
35
+ /** The site's regions on this platform. No longer populated, because there is no longer any semantic difference between sites in different regions. */
36
+ region?: string[];
37
+ /**
38
+ * A link to the full Ad Experience Report for the site on this platform.. Not set in ViolatingSitesResponse. Note that you must complete the [Search Console verification
39
+ * process](https://support.google.com/webmasters/answer/9008080) for the site before you can access the full report.
40
+ */
41
+ reportUrl?: string;
42
+ /** Whether the site is currently under review on this platform. */
43
+ underReview?: boolean;
44
+ }
45
+ interface SiteSummaryResponse {
46
+ /** The site's Ad Experience Report summary on desktop. */
47
+ desktopSummary?: PlatformSummary;
48
+ /** The site's Ad Experience Report summary on mobile. */
49
+ mobileSummary?: PlatformSummary;
50
+ /** The name of the reviewed site, e.g. `google.com`. */
51
+ reviewedSite?: string;
52
+ }
53
+ interface ViolatingSitesResponse {
54
+ /** The list of violating sites. */
55
+ violatingSites?: SiteSummaryResponse[];
56
+ }
57
+ interface SitesResource {
58
+ /** Gets a site's Ad Experience Report summary. */
59
+ get(request?: {
60
+ /** V1 error format. */
61
+ "$.xgafv"?: string;
62
+ /** OAuth access token. */
63
+ access_token?: string;
64
+ /** Data format for response. */
65
+ alt?: string;
66
+ /** JSONP */
67
+ callback?: string;
68
+ /** Selector specifying which fields to include in a partial response. */
69
+ fields?: string;
70
+ /** 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. */
71
+ key?: string;
72
+ /** Required. The name of the site whose summary to get, e.g. `sites/http%3A%2F%2Fwww.google.com%2F`. Format: `sites/{site}` */
73
+ name: string;
74
+ /** OAuth 2.0 token for the current user. */
75
+ oauth_token?: string;
76
+ /** Returns response with indentations and line breaks. */
77
+ prettyPrint?: boolean;
78
+ /** 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. */
79
+ quotaUser?: string;
80
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
81
+ upload_protocol?: string;
82
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
83
+ uploadType?: string;
84
+ }): Request<SiteSummaryResponse>;
85
+ }
86
+ interface ViolatingSitesResource {
87
+ /** Lists sites that are failing in the Ad Experience Report on at least one platform. */
88
+ list(request?: {
89
+ /** V1 error format. */
90
+ "$.xgafv"?: string;
91
+ /** OAuth access token. */
92
+ access_token?: string;
93
+ /** Data format for response. */
94
+ alt?: string;
95
+ /** JSONP */
96
+ callback?: string;
97
+ /** Selector specifying which fields to include in a partial response. */
98
+ fields?: string;
99
+ /** 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. */
100
+ key?: string;
101
+ /** OAuth 2.0 token for the current user. */
102
+ oauth_token?: string;
103
+ /** Returns response with indentations and line breaks. */
104
+ prettyPrint?: boolean;
105
+ /** 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. */
106
+ quotaUser?: string;
107
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
108
+ upload_protocol?: string;
109
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
110
+ uploadType?: string;
111
+ }): Request<ViolatingSitesResponse>;
112
+ }
113
+
114
+ const sites: SitesResource;
115
+
116
+ const violatingSites: ViolatingSitesResource;
117
+ }
118
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.adexperiencereport-v1",
3
+ "version": "0.0.20220715",
4
+ "description": "TypeScript typings for Ad Experience Report API v1",
5
+ "license": "MIT",
6
+ "author": {
7
+ "email": "maxim@mazurok.com",
8
+ "name": "Maxim Mazurok",
9
+ "url": "https://maxim.mazurok.com"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
14
+ },
15
+ "types": "index.d.ts",
16
+ "dependencies": {
17
+ "@types/gapi.client": "*",
18
+ "@types/gapi.client.discovery": "*"
19
+ }
20
+ }
package/readme.md ADDED
@@ -0,0 +1,57 @@
1
+ # TypeScript typings for Ad Experience Report API v1
2
+
3
+ Views Ad Experience Report data, and gets a list of sites that have a significant number of annoying ads.
4
+ For detailed description please check [documentation](https://developers.google.com/ad-experience-report/).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Ad Experience Report API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.adexperiencereport-v1 --save-dev
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ You need to initialize Google API client in your code:
17
+
18
+ ```typescript
19
+ gapi.load('client', () => {
20
+ // now we can use gapi.client
21
+ // ...
22
+ });
23
+ ```
24
+
25
+ Then load api client wrapper:
26
+
27
+ ```typescript
28
+ gapi.client.load('https://adexperiencereport.googleapis.com/$discovery/rest?version=v1', () => {
29
+ // now we can use:
30
+ // gapi.client.adexperiencereport
31
+ });
32
+ ```
33
+
34
+ ```typescript
35
+ // Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
36
+ gapi.client.load('adexperiencereport', 'v1', () => {
37
+ // now we can use:
38
+ // gapi.client.adexperiencereport
39
+ });
40
+ ```
41
+
42
+
43
+
44
+ After that you can use Ad Experience Report API resources: <!-- TODO: make this work for multiple namespaces -->
45
+
46
+ ```typescript
47
+
48
+ /*
49
+ Gets a site's Ad Experience Report summary.
50
+ */
51
+ await gapi.client.adexperiencereport.sites.get({ name: "name", });
52
+
53
+ /*
54
+ Lists sites that are failing in the Ad Experience Report on at least one platform.
55
+ */
56
+ await gapi.client.adexperiencereport.violatingSites.list({ });
57
+ ```
package/tests.ts ADDED
@@ -0,0 +1,25 @@
1
+ /* This is stub file for gapi.client.adexperiencereport-v1 definition tests */
2
+ // IMPORTANT
3
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
+
6
+ // Revision: 20220715
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://adexperiencereport.googleapis.com/$discovery/rest?version=v1');
12
+ /** now we can use gapi.client.adexperiencereport */
13
+
14
+ run();
15
+
16
+ async function run() {
17
+ /** Gets a site's Ad Experience Report summary. */
18
+ await gapi.client.adexperiencereport.sites.get({
19
+ name: "Test string",
20
+ });
21
+ /** Lists sites that are failing in the Ad Experience Report on at least one platform. */
22
+ await gapi.client.adexperiencereport.violatingSites.list({
23
+ });
24
+ }
25
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "lib": ["es6", "dom"],
5
+ "noImplicitAny": true,
6
+ "noImplicitThis": true,
7
+ "strictNullChecks": true,
8
+ "baseUrl": "../",
9
+ "typeRoots": [
10
+ "../"
11
+ ],
12
+ "types": [],
13
+ "noEmit": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "strictFunctionTypes": true
16
+ },
17
+ "files": ["index.d.ts", "tests.ts"]
18
+ }
package/tslint.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "dtslint/dtslint.json",
3
+ "rules": {
4
+ "no-redundant-jsdoc": false
5
+ }
6
+ }