@maxim_mazurok/gapi.client.admin-datatransfer_v1 0.0.20220809
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 +276 -0
- package/package.json +20 -0
- package/readme.md +96 -0
- package/tests.ts +83 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
/* Type definitions for non-npm package Admin SDK API datatransfer_v1 0.0 */
|
|
2
|
+
// Project: https://developers.google.com/admin-sdk/
|
|
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://admin.googleapis.com/$discovery/rest?version=datatransfer_v1
|
|
13
|
+
// Revision: 20220809
|
|
14
|
+
|
|
15
|
+
/// <reference types="gapi.client" />
|
|
16
|
+
|
|
17
|
+
declare namespace gapi.client {
|
|
18
|
+
/** Load Admin SDK API datatransfer_v1 */
|
|
19
|
+
function load(urlOrObject: "https://admin.googleapis.com/$discovery/rest?version=datatransfer_v1"): Promise<void>;
|
|
20
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
21
|
+
function load(name: "admin", version: "datatransfer_v1"): Promise<void>;
|
|
22
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
23
|
+
function load(name: "admin", version: "datatransfer_v1", callback: () => any): void;
|
|
24
|
+
|
|
25
|
+
namespace datatransfer {
|
|
26
|
+
interface Application {
|
|
27
|
+
/** Etag of the resource. */
|
|
28
|
+
etag?: string;
|
|
29
|
+
/** The application's ID. */
|
|
30
|
+
id?: string;
|
|
31
|
+
/** Identifies the resource as a DataTransfer Application Resource. */
|
|
32
|
+
kind?: string;
|
|
33
|
+
/** The application's name. */
|
|
34
|
+
name?: string;
|
|
35
|
+
/** The list of all possible transfer parameters for this application. These parameters can be used to select the data of the user in this application to be transferred. */
|
|
36
|
+
transferParams?: ApplicationTransferParam[];
|
|
37
|
+
}
|
|
38
|
+
interface ApplicationDataTransfer {
|
|
39
|
+
/** The application's ID. */
|
|
40
|
+
applicationId?: string;
|
|
41
|
+
/** The transfer parameters for the application. These parameters are used to select the data which will get transferred in context of this application. */
|
|
42
|
+
applicationTransferParams?: ApplicationTransferParam[];
|
|
43
|
+
/** Current status of transfer for this application. (Read-only) */
|
|
44
|
+
applicationTransferStatus?: string;
|
|
45
|
+
}
|
|
46
|
+
interface ApplicationsListResponse {
|
|
47
|
+
/** List of applications that support data transfer and are also installed for the customer. */
|
|
48
|
+
applications?: Application[];
|
|
49
|
+
/** ETag of the resource. */
|
|
50
|
+
etag?: string;
|
|
51
|
+
/** Identifies the resource as a collection of Applications. */
|
|
52
|
+
kind?: string;
|
|
53
|
+
/** Continuation token which will be used to specify next page in list API. */
|
|
54
|
+
nextPageToken?: string;
|
|
55
|
+
}
|
|
56
|
+
interface ApplicationTransferParam {
|
|
57
|
+
/** The type of the transfer parameter. eg: 'PRIVACY_LEVEL' */
|
|
58
|
+
key?: string;
|
|
59
|
+
/** The value of the corresponding transfer parameter. eg: 'PRIVATE' or 'SHARED' */
|
|
60
|
+
value?: string[];
|
|
61
|
+
}
|
|
62
|
+
interface DataTransfer {
|
|
63
|
+
/**
|
|
64
|
+
* List of per application data transfer resources. It contains data transfer details of the applications associated with this transfer resource. Note that this list is also used to
|
|
65
|
+
* specify the applications for which data transfer has to be done at the time of the transfer resource creation.
|
|
66
|
+
*/
|
|
67
|
+
applicationDataTransfers?: ApplicationDataTransfer[];
|
|
68
|
+
/** ETag of the resource. */
|
|
69
|
+
etag?: string;
|
|
70
|
+
/** The transfer's ID (Read-only). */
|
|
71
|
+
id?: string;
|
|
72
|
+
/** Identifies the resource as a DataTransfer request. */
|
|
73
|
+
kind?: string;
|
|
74
|
+
/** ID of the user to whom the data is being transferred. */
|
|
75
|
+
newOwnerUserId?: string;
|
|
76
|
+
/** ID of the user whose data is being transferred. */
|
|
77
|
+
oldOwnerUserId?: string;
|
|
78
|
+
/** Overall transfer status (Read-only). */
|
|
79
|
+
overallTransferStatusCode?: string;
|
|
80
|
+
/** The time at which the data transfer was requested (Read-only). */
|
|
81
|
+
requestTime?: string;
|
|
82
|
+
}
|
|
83
|
+
interface DataTransfersListResponse {
|
|
84
|
+
/** List of data transfer requests. */
|
|
85
|
+
dataTransfers?: DataTransfer[];
|
|
86
|
+
/** ETag of the resource. */
|
|
87
|
+
etag?: string;
|
|
88
|
+
/** Identifies the resource as a collection of data transfer requests. */
|
|
89
|
+
kind?: string;
|
|
90
|
+
/** Continuation token which will be used to specify next page in list API. */
|
|
91
|
+
nextPageToken?: string;
|
|
92
|
+
}
|
|
93
|
+
interface ApplicationsResource {
|
|
94
|
+
/** Retrieves information about an application for the given application ID. */
|
|
95
|
+
get(request?: {
|
|
96
|
+
/** V1 error format. */
|
|
97
|
+
"$.xgafv"?: string;
|
|
98
|
+
/** OAuth access token. */
|
|
99
|
+
access_token?: string;
|
|
100
|
+
/** Data format for response. */
|
|
101
|
+
alt?: string;
|
|
102
|
+
/** ID of the application resource to be retrieved. */
|
|
103
|
+
applicationId: string;
|
|
104
|
+
/** JSONP */
|
|
105
|
+
callback?: string;
|
|
106
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
107
|
+
fields?: string;
|
|
108
|
+
/** 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. */
|
|
109
|
+
key?: string;
|
|
110
|
+
/** OAuth 2.0 token for the current user. */
|
|
111
|
+
oauth_token?: string;
|
|
112
|
+
/** Returns response with indentations and line breaks. */
|
|
113
|
+
prettyPrint?: boolean;
|
|
114
|
+
/** 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. */
|
|
115
|
+
quotaUser?: string;
|
|
116
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
117
|
+
upload_protocol?: string;
|
|
118
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
119
|
+
uploadType?: string;
|
|
120
|
+
}): Request<Application>;
|
|
121
|
+
/** Lists the applications available for data transfer for a customer. */
|
|
122
|
+
list(request?: {
|
|
123
|
+
/** V1 error format. */
|
|
124
|
+
"$.xgafv"?: string;
|
|
125
|
+
/** OAuth access token. */
|
|
126
|
+
access_token?: string;
|
|
127
|
+
/** Data format for response. */
|
|
128
|
+
alt?: string;
|
|
129
|
+
/** JSONP */
|
|
130
|
+
callback?: string;
|
|
131
|
+
/** Immutable ID of the Google Workspace account. */
|
|
132
|
+
customerId?: string;
|
|
133
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
134
|
+
fields?: string;
|
|
135
|
+
/** 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. */
|
|
136
|
+
key?: string;
|
|
137
|
+
/** Maximum number of results to return. Default is 100. */
|
|
138
|
+
maxResults?: number;
|
|
139
|
+
/** OAuth 2.0 token for the current user. */
|
|
140
|
+
oauth_token?: string;
|
|
141
|
+
/** Token to specify next page in the list. */
|
|
142
|
+
pageToken?: string;
|
|
143
|
+
/** Returns response with indentations and line breaks. */
|
|
144
|
+
prettyPrint?: boolean;
|
|
145
|
+
/** 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. */
|
|
146
|
+
quotaUser?: string;
|
|
147
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
148
|
+
upload_protocol?: string;
|
|
149
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
150
|
+
uploadType?: string;
|
|
151
|
+
}): Request<ApplicationsListResponse>;
|
|
152
|
+
}
|
|
153
|
+
interface TransfersResource {
|
|
154
|
+
/** Retrieves a data transfer request by its resource ID. */
|
|
155
|
+
get(request?: {
|
|
156
|
+
/** V1 error format. */
|
|
157
|
+
"$.xgafv"?: string;
|
|
158
|
+
/** OAuth access token. */
|
|
159
|
+
access_token?: string;
|
|
160
|
+
/** Data format for response. */
|
|
161
|
+
alt?: string;
|
|
162
|
+
/** JSONP */
|
|
163
|
+
callback?: string;
|
|
164
|
+
/** ID of the resource to be retrieved. This is returned in the response from the insert method. */
|
|
165
|
+
dataTransferId: string;
|
|
166
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
167
|
+
fields?: string;
|
|
168
|
+
/** 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. */
|
|
169
|
+
key?: string;
|
|
170
|
+
/** OAuth 2.0 token for the current user. */
|
|
171
|
+
oauth_token?: string;
|
|
172
|
+
/** Returns response with indentations and line breaks. */
|
|
173
|
+
prettyPrint?: boolean;
|
|
174
|
+
/** 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. */
|
|
175
|
+
quotaUser?: string;
|
|
176
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
177
|
+
upload_protocol?: string;
|
|
178
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
179
|
+
uploadType?: string;
|
|
180
|
+
}): Request<DataTransfer>;
|
|
181
|
+
/** Inserts a data transfer request. */
|
|
182
|
+
insert(request: {
|
|
183
|
+
/** V1 error format. */
|
|
184
|
+
"$.xgafv"?: string;
|
|
185
|
+
/** OAuth access token. */
|
|
186
|
+
access_token?: string;
|
|
187
|
+
/** Data format for response. */
|
|
188
|
+
alt?: string;
|
|
189
|
+
/** JSONP */
|
|
190
|
+
callback?: string;
|
|
191
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
192
|
+
fields?: string;
|
|
193
|
+
/** 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. */
|
|
194
|
+
key?: string;
|
|
195
|
+
/** OAuth 2.0 token for the current user. */
|
|
196
|
+
oauth_token?: string;
|
|
197
|
+
/** Returns response with indentations and line breaks. */
|
|
198
|
+
prettyPrint?: boolean;
|
|
199
|
+
/** 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. */
|
|
200
|
+
quotaUser?: string;
|
|
201
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
202
|
+
upload_protocol?: string;
|
|
203
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
204
|
+
uploadType?: string;
|
|
205
|
+
/** Request body */
|
|
206
|
+
resource: DataTransfer;
|
|
207
|
+
}): Request<DataTransfer>;
|
|
208
|
+
insert(request: {
|
|
209
|
+
/** V1 error format. */
|
|
210
|
+
"$.xgafv"?: string;
|
|
211
|
+
/** OAuth access token. */
|
|
212
|
+
access_token?: string;
|
|
213
|
+
/** Data format for response. */
|
|
214
|
+
alt?: string;
|
|
215
|
+
/** JSONP */
|
|
216
|
+
callback?: string;
|
|
217
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
218
|
+
fields?: string;
|
|
219
|
+
/** 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. */
|
|
220
|
+
key?: string;
|
|
221
|
+
/** OAuth 2.0 token for the current user. */
|
|
222
|
+
oauth_token?: string;
|
|
223
|
+
/** Returns response with indentations and line breaks. */
|
|
224
|
+
prettyPrint?: boolean;
|
|
225
|
+
/** 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. */
|
|
226
|
+
quotaUser?: string;
|
|
227
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
228
|
+
upload_protocol?: string;
|
|
229
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
230
|
+
uploadType?: string;
|
|
231
|
+
},
|
|
232
|
+
body: DataTransfer): Request<DataTransfer>;
|
|
233
|
+
/** Lists the transfers for a customer by source user, destination user, or status. */
|
|
234
|
+
list(request?: {
|
|
235
|
+
/** V1 error format. */
|
|
236
|
+
"$.xgafv"?: string;
|
|
237
|
+
/** OAuth access token. */
|
|
238
|
+
access_token?: string;
|
|
239
|
+
/** Data format for response. */
|
|
240
|
+
alt?: string;
|
|
241
|
+
/** JSONP */
|
|
242
|
+
callback?: string;
|
|
243
|
+
/** Immutable ID of the Google Workspace account. */
|
|
244
|
+
customerId?: string;
|
|
245
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
246
|
+
fields?: string;
|
|
247
|
+
/** 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. */
|
|
248
|
+
key?: string;
|
|
249
|
+
/** Maximum number of results to return. Default is 100. */
|
|
250
|
+
maxResults?: number;
|
|
251
|
+
/** Destination user's profile ID. */
|
|
252
|
+
newOwnerUserId?: string;
|
|
253
|
+
/** OAuth 2.0 token for the current user. */
|
|
254
|
+
oauth_token?: string;
|
|
255
|
+
/** Source user's profile ID. */
|
|
256
|
+
oldOwnerUserId?: string;
|
|
257
|
+
/** Token to specify the next page in the list. */
|
|
258
|
+
pageToken?: string;
|
|
259
|
+
/** Returns response with indentations and line breaks. */
|
|
260
|
+
prettyPrint?: boolean;
|
|
261
|
+
/** 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. */
|
|
262
|
+
quotaUser?: string;
|
|
263
|
+
/** Status of the transfer. */
|
|
264
|
+
status?: string;
|
|
265
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
266
|
+
upload_protocol?: string;
|
|
267
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
268
|
+
uploadType?: string;
|
|
269
|
+
}): Request<DataTransfersListResponse>;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
const applications: ApplicationsResource;
|
|
273
|
+
|
|
274
|
+
const transfers: TransfersResource;
|
|
275
|
+
}
|
|
276
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.admin-datatransfer_v1",
|
|
3
|
+
"version": "0.0.20220809",
|
|
4
|
+
"description": "TypeScript typings for Admin SDK API datatransfer_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,96 @@
|
|
|
1
|
+
# TypeScript typings for Admin SDK API datatransfer_v1
|
|
2
|
+
|
|
3
|
+
Admin SDK lets administrators of enterprise domains to view and manage resources like user, groups etc. It also provides audit and usage reports of domain.
|
|
4
|
+
For detailed description please check [documentation](https://developers.google.com/admin-sdk/).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Admin SDK API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.admin-datatransfer_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://admin.googleapis.com/$discovery/rest?version=datatransfer_v1', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.datatransfer
|
|
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('admin', 'datatransfer_v1', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.datatransfer
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Don't forget to authenticate your client before sending any request to resources:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
// declare client_id registered in Google Developers Console
|
|
46
|
+
var client_id = '',
|
|
47
|
+
scope = [
|
|
48
|
+
// View and manage data transfers between users in your organization
|
|
49
|
+
'https://www.googleapis.com/auth/admin.datatransfer',
|
|
50
|
+
|
|
51
|
+
// View data transfers between users in your organization
|
|
52
|
+
'https://www.googleapis.com/auth/admin.datatransfer.readonly',
|
|
53
|
+
],
|
|
54
|
+
immediate = true;
|
|
55
|
+
// ...
|
|
56
|
+
|
|
57
|
+
gapi.auth.authorize(
|
|
58
|
+
{ client_id: client_id, scope: scope, immediate: immediate },
|
|
59
|
+
authResult => {
|
|
60
|
+
if (authResult && !authResult.error) {
|
|
61
|
+
/* handle successful authorization */
|
|
62
|
+
} else {
|
|
63
|
+
/* handle authorization error */
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
After that you can use Admin SDK API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
|
|
72
|
+
/*
|
|
73
|
+
Retrieves information about an application for the given application ID.
|
|
74
|
+
*/
|
|
75
|
+
await gapi.client.datatransfer.applications.get({ applicationId: "applicationId", });
|
|
76
|
+
|
|
77
|
+
/*
|
|
78
|
+
Lists the applications available for data transfer for a customer.
|
|
79
|
+
*/
|
|
80
|
+
await gapi.client.datatransfer.applications.list({ });
|
|
81
|
+
|
|
82
|
+
/*
|
|
83
|
+
Retrieves a data transfer request by its resource ID.
|
|
84
|
+
*/
|
|
85
|
+
await gapi.client.datatransfer.transfers.get({ dataTransferId: "dataTransferId", });
|
|
86
|
+
|
|
87
|
+
/*
|
|
88
|
+
Inserts a data transfer request.
|
|
89
|
+
*/
|
|
90
|
+
await gapi.client.datatransfer.transfers.insert({ });
|
|
91
|
+
|
|
92
|
+
/*
|
|
93
|
+
Lists the transfers for a customer by source user, destination user, or status.
|
|
94
|
+
*/
|
|
95
|
+
await gapi.client.datatransfer.transfers.list({ });
|
|
96
|
+
```
|
package/tests.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.admin-datatransfer_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: 20220809
|
|
7
|
+
|
|
8
|
+
gapi.load('client', async () => {
|
|
9
|
+
/** now we can use gapi.client */
|
|
10
|
+
|
|
11
|
+
await gapi.client.load('https://admin.googleapis.com/$discovery/rest?version=datatransfer_v1');
|
|
12
|
+
/** now we can use gapi.client.datatransfer */
|
|
13
|
+
|
|
14
|
+
/** don't forget to authenticate your client before sending any request to resources: */
|
|
15
|
+
/** declare client_id registered in Google Developers Console */
|
|
16
|
+
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
|
17
|
+
const scope = [
|
|
18
|
+
/** View and manage data transfers between users in your organization */
|
|
19
|
+
'https://www.googleapis.com/auth/admin.datatransfer',
|
|
20
|
+
/** View data transfers between users in your organization */
|
|
21
|
+
'https://www.googleapis.com/auth/admin.datatransfer.readonly',
|
|
22
|
+
];
|
|
23
|
+
const immediate = false;
|
|
24
|
+
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
|
25
|
+
if (authResult && !authResult.error) {
|
|
26
|
+
/** handle successful authorization */
|
|
27
|
+
run();
|
|
28
|
+
} else {
|
|
29
|
+
/** handle authorization error */
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
async function run() {
|
|
34
|
+
/** Retrieves information about an application for the given application ID. */
|
|
35
|
+
await gapi.client.datatransfer.applications.get({
|
|
36
|
+
applicationId: "Test string",
|
|
37
|
+
});
|
|
38
|
+
/** Lists the applications available for data transfer for a customer. */
|
|
39
|
+
await gapi.client.datatransfer.applications.list({
|
|
40
|
+
customerId: "Test string",
|
|
41
|
+
maxResults: 42,
|
|
42
|
+
pageToken: "Test string",
|
|
43
|
+
});
|
|
44
|
+
/** Retrieves a data transfer request by its resource ID. */
|
|
45
|
+
await gapi.client.datatransfer.transfers.get({
|
|
46
|
+
dataTransferId: "Test string",
|
|
47
|
+
});
|
|
48
|
+
/** Inserts a data transfer request. */
|
|
49
|
+
await gapi.client.datatransfer.transfers.insert({
|
|
50
|
+
}, {
|
|
51
|
+
applicationDataTransfers: [
|
|
52
|
+
{
|
|
53
|
+
applicationId: "Test string",
|
|
54
|
+
applicationTransferParams: [
|
|
55
|
+
{
|
|
56
|
+
key: "Test string",
|
|
57
|
+
value: [
|
|
58
|
+
"Test string"
|
|
59
|
+
],
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
applicationTransferStatus: "Test string",
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
etag: "Test string",
|
|
66
|
+
id: "Test string",
|
|
67
|
+
kind: "Test string",
|
|
68
|
+
newOwnerUserId: "Test string",
|
|
69
|
+
oldOwnerUserId: "Test string",
|
|
70
|
+
overallTransferStatusCode: "Test string",
|
|
71
|
+
requestTime: "Test string",
|
|
72
|
+
});
|
|
73
|
+
/** Lists the transfers for a customer by source user, destination user, or status. */
|
|
74
|
+
await gapi.client.datatransfer.transfers.list({
|
|
75
|
+
customerId: "Test string",
|
|
76
|
+
maxResults: 42,
|
|
77
|
+
newOwnerUserId: "Test string",
|
|
78
|
+
oldOwnerUserId: "Test string",
|
|
79
|
+
pageToken: "Test string",
|
|
80
|
+
status: "Test string",
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
});
|
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
|
+
}
|