@maxim_mazurok/gapi.client.displayvideo-v4 0.0.20240118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +175 -0
- package/package.json +20 -0
- package/readme.md +84 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/* Type definitions for non-npm package Display & Video 360 API v4 0.0 */
|
|
2
|
+
// Project: https://developers.google.com/display-video/
|
|
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
|
+
|
|
8
|
+
// IMPORTANT
|
|
9
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
10
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
11
|
+
// Generated from: https://displayvideo.googleapis.com/$discovery/rest?version=v4
|
|
12
|
+
// Revision: 20240118
|
|
13
|
+
|
|
14
|
+
/// <reference types="gapi.client" />
|
|
15
|
+
|
|
16
|
+
declare namespace gapi.client {
|
|
17
|
+
/** Load Display & Video 360 API v4 */
|
|
18
|
+
function load(
|
|
19
|
+
urlOrObject: 'https://displayvideo.googleapis.com/$discovery/rest?version=v4'
|
|
20
|
+
): Promise<void>;
|
|
21
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
22
|
+
function load(name: 'displayvideo', version: 'v4'): Promise<void>;
|
|
23
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
24
|
+
function load(name: 'displayvideo', version: 'v4', callback: () => any): void;
|
|
25
|
+
|
|
26
|
+
namespace displayvideo {
|
|
27
|
+
interface GoogleBytestreamMedia {
|
|
28
|
+
/** Name of the media resource. */
|
|
29
|
+
resourceName?: string;
|
|
30
|
+
}
|
|
31
|
+
interface Operation {
|
|
32
|
+
/** 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. */
|
|
33
|
+
done?: boolean;
|
|
34
|
+
/** The error result of the operation in case of failure or cancellation. */
|
|
35
|
+
error?: Status;
|
|
36
|
+
/** Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */
|
|
37
|
+
metadata?: {[P in string]: any};
|
|
38
|
+
/** 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 be a resource name ending with `operations/{unique_id}`. */
|
|
39
|
+
name?: string;
|
|
40
|
+
/** The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. */
|
|
41
|
+
response?: {[P in string]: any};
|
|
42
|
+
}
|
|
43
|
+
interface Status {
|
|
44
|
+
/** The status code, which should be an enum value of google.rpc.Code. */
|
|
45
|
+
code?: number;
|
|
46
|
+
/** A list of messages that carry the error details. There is a common set of message types for APIs to use. */
|
|
47
|
+
details?: Array<{[P in string]: any}>;
|
|
48
|
+
/** 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. */
|
|
49
|
+
message?: string;
|
|
50
|
+
}
|
|
51
|
+
interface MediaResource {
|
|
52
|
+
/** Downloads media. Download is supported on the URI `/download/{resource_name=**}?alt=media.` **Note**: Download requests will not be successful without including `alt=media` query string. */
|
|
53
|
+
download(request?: {
|
|
54
|
+
/** V1 error format. */
|
|
55
|
+
'$.xgafv'?: string;
|
|
56
|
+
/** OAuth access token. */
|
|
57
|
+
access_token?: string;
|
|
58
|
+
/** Data format for response. */
|
|
59
|
+
alt?: string;
|
|
60
|
+
/** JSONP */
|
|
61
|
+
callback?: string;
|
|
62
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
63
|
+
fields?: string;
|
|
64
|
+
/** 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. */
|
|
65
|
+
key?: string;
|
|
66
|
+
/** OAuth 2.0 token for the current user. */
|
|
67
|
+
oauth_token?: string;
|
|
68
|
+
/** Returns response with indentations and line breaks. */
|
|
69
|
+
prettyPrint?: boolean;
|
|
70
|
+
/** 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. */
|
|
71
|
+
quotaUser?: string;
|
|
72
|
+
/** Name of the media that is being downloaded. See ReadRequest.resource_name. */
|
|
73
|
+
resourceName: string;
|
|
74
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
75
|
+
upload_protocol?: string;
|
|
76
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
77
|
+
uploadType?: string;
|
|
78
|
+
}): Request<GoogleBytestreamMedia>;
|
|
79
|
+
/** Uploads media. Upload is supported on the URI `/upload/media/{resource_name=**}?upload_type=media.` **Note**: Upload requests will not be successful without including `upload_type=media` query string. */
|
|
80
|
+
upload(request: {
|
|
81
|
+
/** V1 error format. */
|
|
82
|
+
'$.xgafv'?: string;
|
|
83
|
+
/** OAuth access token. */
|
|
84
|
+
access_token?: string;
|
|
85
|
+
/** Data format for response. */
|
|
86
|
+
alt?: string;
|
|
87
|
+
/** JSONP */
|
|
88
|
+
callback?: string;
|
|
89
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
90
|
+
fields?: string;
|
|
91
|
+
/** 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. */
|
|
92
|
+
key?: string;
|
|
93
|
+
/** OAuth 2.0 token for the current user. */
|
|
94
|
+
oauth_token?: string;
|
|
95
|
+
/** Returns response with indentations and line breaks. */
|
|
96
|
+
prettyPrint?: boolean;
|
|
97
|
+
/** 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. */
|
|
98
|
+
quotaUser?: string;
|
|
99
|
+
/** Name of the media that is being downloaded. See ReadRequest.resource_name. */
|
|
100
|
+
resourceName: string;
|
|
101
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
102
|
+
upload_protocol?: string;
|
|
103
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
104
|
+
uploadType?: string;
|
|
105
|
+
/** Request body */
|
|
106
|
+
resource: GoogleBytestreamMedia;
|
|
107
|
+
}): Request<GoogleBytestreamMedia>;
|
|
108
|
+
upload(
|
|
109
|
+
request: {
|
|
110
|
+
/** V1 error format. */
|
|
111
|
+
'$.xgafv'?: string;
|
|
112
|
+
/** OAuth access token. */
|
|
113
|
+
access_token?: string;
|
|
114
|
+
/** Data format for response. */
|
|
115
|
+
alt?: string;
|
|
116
|
+
/** JSONP */
|
|
117
|
+
callback?: string;
|
|
118
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
119
|
+
fields?: string;
|
|
120
|
+
/** 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. */
|
|
121
|
+
key?: string;
|
|
122
|
+
/** OAuth 2.0 token for the current user. */
|
|
123
|
+
oauth_token?: string;
|
|
124
|
+
/** Returns response with indentations and line breaks. */
|
|
125
|
+
prettyPrint?: boolean;
|
|
126
|
+
/** 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. */
|
|
127
|
+
quotaUser?: string;
|
|
128
|
+
/** Name of the media that is being downloaded. See ReadRequest.resource_name. */
|
|
129
|
+
resourceName: string;
|
|
130
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
131
|
+
upload_protocol?: string;
|
|
132
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
133
|
+
uploadType?: string;
|
|
134
|
+
},
|
|
135
|
+
body: GoogleBytestreamMedia
|
|
136
|
+
): Request<GoogleBytestreamMedia>;
|
|
137
|
+
}
|
|
138
|
+
interface OperationsResource {
|
|
139
|
+
/** Gets the latest state of an asynchronous SDF download task operation. Clients should poll this method at intervals of 30 seconds. */
|
|
140
|
+
get(request?: {
|
|
141
|
+
/** V1 error format. */
|
|
142
|
+
'$.xgafv'?: string;
|
|
143
|
+
/** OAuth access token. */
|
|
144
|
+
access_token?: string;
|
|
145
|
+
/** Data format for response. */
|
|
146
|
+
alt?: string;
|
|
147
|
+
/** JSONP */
|
|
148
|
+
callback?: string;
|
|
149
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
150
|
+
fields?: string;
|
|
151
|
+
/** 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. */
|
|
152
|
+
key?: string;
|
|
153
|
+
/** The name of the operation resource. */
|
|
154
|
+
name: string;
|
|
155
|
+
/** OAuth 2.0 token for the current user. */
|
|
156
|
+
oauth_token?: string;
|
|
157
|
+
/** Returns response with indentations and line breaks. */
|
|
158
|
+
prettyPrint?: boolean;
|
|
159
|
+
/** 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. */
|
|
160
|
+
quotaUser?: string;
|
|
161
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
162
|
+
upload_protocol?: string;
|
|
163
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
164
|
+
uploadType?: string;
|
|
165
|
+
}): Request<Operation>;
|
|
166
|
+
}
|
|
167
|
+
interface SdfdownloadtasksResource {
|
|
168
|
+
operations: OperationsResource;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const media: MediaResource;
|
|
172
|
+
|
|
173
|
+
const sdfdownloadtasks: SdfdownloadtasksResource;
|
|
174
|
+
}
|
|
175
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.displayvideo-v4",
|
|
3
|
+
"version": "0.0.20240118",
|
|
4
|
+
"description": "TypeScript typings for Display & Video 360 API v4",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"author": {
|
|
11
|
+
"name": "Maxim Mazurok",
|
|
12
|
+
"email": "maxim@mazurok.com",
|
|
13
|
+
"url": "https://maxim.mazurok.com"
|
|
14
|
+
},
|
|
15
|
+
"types": "index.d.ts",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@types/gapi.client": "*",
|
|
18
|
+
"@types/gapi.client.discovery-v1": "*"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# TypeScript typings for Display & Video 360 API v4
|
|
2
|
+
|
|
3
|
+
Display & Video 360 API allows users to automate complex Display & Video 360 workflows, such as creating insertion orders and setting targeting options for individual line items.
|
|
4
|
+
For detailed description please check [documentation](https://developers.google.com/display-video/).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Display & Video 360 API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.displayvideo-v4 --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(
|
|
29
|
+
'https://displayvideo.googleapis.com/$discovery/rest?version=v4',
|
|
30
|
+
() => {
|
|
31
|
+
// now we can use:
|
|
32
|
+
// gapi.client.displayvideo
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
|
|
39
|
+
gapi.client.load('displayvideo', 'v4', () => {
|
|
40
|
+
// now we can use:
|
|
41
|
+
// gapi.client.displayvideo
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Don't forget to authenticate your client before sending any request to resources:
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
// declare client_id registered in Google Developers Console
|
|
49
|
+
var client_id = '',
|
|
50
|
+
scope = [
|
|
51
|
+
// Create, see, edit, and permanently delete your Display & Video 360 entities and reports
|
|
52
|
+
'https://www.googleapis.com/auth/display-video',
|
|
53
|
+
|
|
54
|
+
// View and manage your reports in DoubleClick Bid Manager
|
|
55
|
+
'https://www.googleapis.com/auth/doubleclickbidmanager',
|
|
56
|
+
],
|
|
57
|
+
immediate = true;
|
|
58
|
+
// ...
|
|
59
|
+
|
|
60
|
+
gapi.auth.authorize(
|
|
61
|
+
{client_id: client_id, scope: scope, immediate: immediate},
|
|
62
|
+
authResult => {
|
|
63
|
+
if (authResult && !authResult.error) {
|
|
64
|
+
/* handle successful authorization */
|
|
65
|
+
} else {
|
|
66
|
+
/* handle authorization error */
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
After that you can use Display & Video 360 API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
/*
|
|
76
|
+
Downloads media. Download is supported on the URI `/download/{resource_name=**}?alt=media.` **Note**: Download requests will not be successful without including `alt=media` query string.
|
|
77
|
+
*/
|
|
78
|
+
await gapi.client.displayvideo.media.download({resourceName: 'resourceName'});
|
|
79
|
+
|
|
80
|
+
/*
|
|
81
|
+
Uploads media. Upload is supported on the URI `/upload/media/{resource_name=**}?upload_type=media.` **Note**: Upload requests will not be successful without including `upload_type=media` query string.
|
|
82
|
+
*/
|
|
83
|
+
await gapi.client.displayvideo.media.upload({resourceName: 'resourceName'});
|
|
84
|
+
```
|