@maxim_mazurok/gapi.client.analyticsadmin-v1beta 0.0.20230105
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 +2504 -0
- package/package.json +20 -0
- package/readme.md +151 -0
- package/tests.ts +440 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.analyticsadmin-v1beta",
|
|
3
|
+
"version": "0.0.20230105",
|
|
4
|
+
"description": "TypeScript typings for Google Analytics Admin API v1beta",
|
|
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,151 @@
|
|
|
1
|
+
# TypeScript typings for Google Analytics Admin API v1beta
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
For detailed description please check [documentation](http://code.google.com/apis/analytics/docs/mgmt/home.html).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Google Analytics Admin API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.analyticsadmin-v1beta --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://analyticsadmin.googleapis.com/$discovery/rest?version=v1beta', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.analyticsadmin
|
|
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('analyticsadmin', 'v1beta', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.analyticsadmin
|
|
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
|
+
// Edit Google Analytics management entities
|
|
49
|
+
'https://www.googleapis.com/auth/analytics.edit',
|
|
50
|
+
|
|
51
|
+
// See and download your Google Analytics data
|
|
52
|
+
'https://www.googleapis.com/auth/analytics.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 Google Analytics Admin API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
|
|
72
|
+
/*
|
|
73
|
+
Marks target Account as soft-deleted (ie: "trashed") and returns it. This API does not have a method to restore soft-deleted accounts. However, they can be restored using the Trash Can UI. If the accounts are not restored before the expiration time, the account and all child resources (eg: Properties, GoogleAdsLinks, Streams, UserLinks) will be permanently purged. https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found.
|
|
74
|
+
*/
|
|
75
|
+
await gapi.client.analyticsadmin.accounts.delete({ name: "name", });
|
|
76
|
+
|
|
77
|
+
/*
|
|
78
|
+
Lookup for a single Account.
|
|
79
|
+
*/
|
|
80
|
+
await gapi.client.analyticsadmin.accounts.get({ name: "name", });
|
|
81
|
+
|
|
82
|
+
/*
|
|
83
|
+
Get data sharing settings on an account. Data sharing settings are singletons.
|
|
84
|
+
*/
|
|
85
|
+
await gapi.client.analyticsadmin.accounts.getDataSharingSettings({ name: "name", });
|
|
86
|
+
|
|
87
|
+
/*
|
|
88
|
+
Returns all accounts accessible by the caller. Note that these accounts might not currently have GA4 properties. Soft-deleted (ie: "trashed") accounts are excluded by default. Returns an empty list if no relevant accounts are found.
|
|
89
|
+
*/
|
|
90
|
+
await gapi.client.analyticsadmin.accounts.list({ });
|
|
91
|
+
|
|
92
|
+
/*
|
|
93
|
+
Updates an account.
|
|
94
|
+
*/
|
|
95
|
+
await gapi.client.analyticsadmin.accounts.patch({ name: "name", });
|
|
96
|
+
|
|
97
|
+
/*
|
|
98
|
+
Requests a ticket for creating an account.
|
|
99
|
+
*/
|
|
100
|
+
await gapi.client.analyticsadmin.accounts.provisionAccountTicket({ });
|
|
101
|
+
|
|
102
|
+
/*
|
|
103
|
+
Searches through all changes to an account or its children given the specified set of filters.
|
|
104
|
+
*/
|
|
105
|
+
await gapi.client.analyticsadmin.accounts.searchChangeHistoryEvents({ account: "account", });
|
|
106
|
+
|
|
107
|
+
/*
|
|
108
|
+
Returns summaries of all accounts accessible by the caller.
|
|
109
|
+
*/
|
|
110
|
+
await gapi.client.analyticsadmin.accountSummaries.list({ });
|
|
111
|
+
|
|
112
|
+
/*
|
|
113
|
+
Acknowledges the terms of user data collection for the specified property. This acknowledgement must be completed (either in the Google Analytics UI or via this API) before MeasurementProtocolSecret resources may be created.
|
|
114
|
+
*/
|
|
115
|
+
await gapi.client.analyticsadmin.properties.acknowledgeUserDataCollection({ property: "property", });
|
|
116
|
+
|
|
117
|
+
/*
|
|
118
|
+
Creates an "GA4" property with the specified location and attributes.
|
|
119
|
+
*/
|
|
120
|
+
await gapi.client.analyticsadmin.properties.create({ });
|
|
121
|
+
|
|
122
|
+
/*
|
|
123
|
+
Marks target Property as soft-deleted (ie: "trashed") and returns it. This API does not have a method to restore soft-deleted properties. However, they can be restored using the Trash Can UI. If the properties are not restored before the expiration time, the Property and all child resources (eg: GoogleAdsLinks, Streams, UserLinks) will be permanently purged. https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found, or is not a GA4 Property.
|
|
124
|
+
*/
|
|
125
|
+
await gapi.client.analyticsadmin.properties.delete({ name: "name", });
|
|
126
|
+
|
|
127
|
+
/*
|
|
128
|
+
Lookup for a single "GA4" Property.
|
|
129
|
+
*/
|
|
130
|
+
await gapi.client.analyticsadmin.properties.get({ name: "name", });
|
|
131
|
+
|
|
132
|
+
/*
|
|
133
|
+
Returns the singleton data retention settings for this property.
|
|
134
|
+
*/
|
|
135
|
+
await gapi.client.analyticsadmin.properties.getDataRetentionSettings({ name: "name", });
|
|
136
|
+
|
|
137
|
+
/*
|
|
138
|
+
Returns child Properties under the specified parent Account. Only "GA4" properties will be returned. Properties will be excluded if the caller does not have access. Soft-deleted (ie: "trashed") properties are excluded by default. Returns an empty list if no relevant properties are found.
|
|
139
|
+
*/
|
|
140
|
+
await gapi.client.analyticsadmin.properties.list({ });
|
|
141
|
+
|
|
142
|
+
/*
|
|
143
|
+
Updates a property.
|
|
144
|
+
*/
|
|
145
|
+
await gapi.client.analyticsadmin.properties.patch({ name: "name", });
|
|
146
|
+
|
|
147
|
+
/*
|
|
148
|
+
Updates the singleton data retention settings for this property.
|
|
149
|
+
*/
|
|
150
|
+
await gapi.client.analyticsadmin.properties.updateDataRetentionSettings({ name: "name", });
|
|
151
|
+
```
|
package/tests.ts
ADDED
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.analyticsadmin-v1beta 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: 20230105
|
|
7
|
+
|
|
8
|
+
gapi.load('client', async () => {
|
|
9
|
+
/** now we can use gapi.client */
|
|
10
|
+
|
|
11
|
+
await gapi.client.load('https://analyticsadmin.googleapis.com/$discovery/rest?version=v1beta');
|
|
12
|
+
/** now we can use gapi.client.analyticsadmin */
|
|
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
|
+
/** Edit Google Analytics management entities */
|
|
19
|
+
'https://www.googleapis.com/auth/analytics.edit',
|
|
20
|
+
/** See and download your Google Analytics data */
|
|
21
|
+
'https://www.googleapis.com/auth/analytics.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
|
+
/**
|
|
35
|
+
* Marks target Account as soft-deleted (ie: "trashed") and returns it. This API does not have a method to restore soft-deleted accounts. However, they can be restored using the Trash Can
|
|
36
|
+
* UI. If the accounts are not restored before the expiration time, the account and all child resources (eg: Properties, GoogleAdsLinks, Streams, UserLinks) will be permanently purged.
|
|
37
|
+
* https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found.
|
|
38
|
+
*/
|
|
39
|
+
await gapi.client.analyticsadmin.accounts.delete({
|
|
40
|
+
name: "Test string",
|
|
41
|
+
});
|
|
42
|
+
/** Lookup for a single Account. */
|
|
43
|
+
await gapi.client.analyticsadmin.accounts.get({
|
|
44
|
+
name: "Test string",
|
|
45
|
+
});
|
|
46
|
+
/** Get data sharing settings on an account. Data sharing settings are singletons. */
|
|
47
|
+
await gapi.client.analyticsadmin.accounts.getDataSharingSettings({
|
|
48
|
+
name: "Test string",
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* Returns all accounts accessible by the caller. Note that these accounts might not currently have GA4 properties. Soft-deleted (ie: "trashed") accounts are excluded by default. Returns
|
|
52
|
+
* an empty list if no relevant accounts are found.
|
|
53
|
+
*/
|
|
54
|
+
await gapi.client.analyticsadmin.accounts.list({
|
|
55
|
+
pageSize: 42,
|
|
56
|
+
pageToken: "Test string",
|
|
57
|
+
showDeleted: true,
|
|
58
|
+
});
|
|
59
|
+
/** Updates an account. */
|
|
60
|
+
await gapi.client.analyticsadmin.accounts.patch({
|
|
61
|
+
name: "Test string",
|
|
62
|
+
updateMask: "Test string",
|
|
63
|
+
}, {
|
|
64
|
+
createTime: "Test string",
|
|
65
|
+
deleted: true,
|
|
66
|
+
displayName: "Test string",
|
|
67
|
+
name: "Test string",
|
|
68
|
+
regionCode: "Test string",
|
|
69
|
+
updateTime: "Test string",
|
|
70
|
+
});
|
|
71
|
+
/** Requests a ticket for creating an account. */
|
|
72
|
+
await gapi.client.analyticsadmin.accounts.provisionAccountTicket({
|
|
73
|
+
}, {
|
|
74
|
+
account: {
|
|
75
|
+
createTime: "Test string",
|
|
76
|
+
deleted: true,
|
|
77
|
+
displayName: "Test string",
|
|
78
|
+
name: "Test string",
|
|
79
|
+
regionCode: "Test string",
|
|
80
|
+
updateTime: "Test string",
|
|
81
|
+
},
|
|
82
|
+
redirectUri: "Test string",
|
|
83
|
+
});
|
|
84
|
+
/** Searches through all changes to an account or its children given the specified set of filters. */
|
|
85
|
+
await gapi.client.analyticsadmin.accounts.searchChangeHistoryEvents({
|
|
86
|
+
account: "Test string",
|
|
87
|
+
}, {
|
|
88
|
+
action: [
|
|
89
|
+
"Test string"
|
|
90
|
+
],
|
|
91
|
+
actorEmail: [
|
|
92
|
+
"Test string"
|
|
93
|
+
],
|
|
94
|
+
earliestChangeTime: "Test string",
|
|
95
|
+
latestChangeTime: "Test string",
|
|
96
|
+
pageSize: 42,
|
|
97
|
+
pageToken: "Test string",
|
|
98
|
+
property: "Test string",
|
|
99
|
+
resourceType: [
|
|
100
|
+
"Test string"
|
|
101
|
+
],
|
|
102
|
+
});
|
|
103
|
+
/** Returns summaries of all accounts accessible by the caller. */
|
|
104
|
+
await gapi.client.analyticsadmin.accountSummaries.list({
|
|
105
|
+
pageSize: 42,
|
|
106
|
+
pageToken: "Test string",
|
|
107
|
+
});
|
|
108
|
+
/**
|
|
109
|
+
* Acknowledges the terms of user data collection for the specified property. This acknowledgement must be completed (either in the Google Analytics UI or via this API) before
|
|
110
|
+
* MeasurementProtocolSecret resources may be created.
|
|
111
|
+
*/
|
|
112
|
+
await gapi.client.analyticsadmin.properties.acknowledgeUserDataCollection({
|
|
113
|
+
property: "Test string",
|
|
114
|
+
}, {
|
|
115
|
+
acknowledgement: "Test string",
|
|
116
|
+
});
|
|
117
|
+
/** Creates an "GA4" property with the specified location and attributes. */
|
|
118
|
+
await gapi.client.analyticsadmin.properties.create({
|
|
119
|
+
}, {
|
|
120
|
+
account: "Test string",
|
|
121
|
+
createTime: "Test string",
|
|
122
|
+
currencyCode: "Test string",
|
|
123
|
+
deleteTime: "Test string",
|
|
124
|
+
displayName: "Test string",
|
|
125
|
+
expireTime: "Test string",
|
|
126
|
+
industryCategory: "Test string",
|
|
127
|
+
name: "Test string",
|
|
128
|
+
parent: "Test string",
|
|
129
|
+
propertyType: "Test string",
|
|
130
|
+
serviceLevel: "Test string",
|
|
131
|
+
timeZone: "Test string",
|
|
132
|
+
updateTime: "Test string",
|
|
133
|
+
});
|
|
134
|
+
/**
|
|
135
|
+
* Marks target Property as soft-deleted (ie: "trashed") and returns it. This API does not have a method to restore soft-deleted properties. However, they can be restored using the Trash
|
|
136
|
+
* Can UI. If the properties are not restored before the expiration time, the Property and all child resources (eg: GoogleAdsLinks, Streams, UserLinks) will be permanently purged.
|
|
137
|
+
* https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found, or is not a GA4 Property.
|
|
138
|
+
*/
|
|
139
|
+
await gapi.client.analyticsadmin.properties.delete({
|
|
140
|
+
name: "Test string",
|
|
141
|
+
});
|
|
142
|
+
/** Lookup for a single "GA4" Property. */
|
|
143
|
+
await gapi.client.analyticsadmin.properties.get({
|
|
144
|
+
name: "Test string",
|
|
145
|
+
});
|
|
146
|
+
/** Returns the singleton data retention settings for this property. */
|
|
147
|
+
await gapi.client.analyticsadmin.properties.getDataRetentionSettings({
|
|
148
|
+
name: "Test string",
|
|
149
|
+
});
|
|
150
|
+
/**
|
|
151
|
+
* Returns child Properties under the specified parent Account. Only "GA4" properties will be returned. Properties will be excluded if the caller does not have access. Soft-deleted (ie:
|
|
152
|
+
* "trashed") properties are excluded by default. Returns an empty list if no relevant properties are found.
|
|
153
|
+
*/
|
|
154
|
+
await gapi.client.analyticsadmin.properties.list({
|
|
155
|
+
filter: "Test string",
|
|
156
|
+
pageSize: 42,
|
|
157
|
+
pageToken: "Test string",
|
|
158
|
+
showDeleted: true,
|
|
159
|
+
});
|
|
160
|
+
/** Updates a property. */
|
|
161
|
+
await gapi.client.analyticsadmin.properties.patch({
|
|
162
|
+
name: "Test string",
|
|
163
|
+
updateMask: "Test string",
|
|
164
|
+
}, {
|
|
165
|
+
account: "Test string",
|
|
166
|
+
createTime: "Test string",
|
|
167
|
+
currencyCode: "Test string",
|
|
168
|
+
deleteTime: "Test string",
|
|
169
|
+
displayName: "Test string",
|
|
170
|
+
expireTime: "Test string",
|
|
171
|
+
industryCategory: "Test string",
|
|
172
|
+
name: "Test string",
|
|
173
|
+
parent: "Test string",
|
|
174
|
+
propertyType: "Test string",
|
|
175
|
+
serviceLevel: "Test string",
|
|
176
|
+
timeZone: "Test string",
|
|
177
|
+
updateTime: "Test string",
|
|
178
|
+
});
|
|
179
|
+
/** Updates the singleton data retention settings for this property. */
|
|
180
|
+
await gapi.client.analyticsadmin.properties.updateDataRetentionSettings({
|
|
181
|
+
name: "Test string",
|
|
182
|
+
updateMask: "Test string",
|
|
183
|
+
}, {
|
|
184
|
+
eventDataRetention: "Test string",
|
|
185
|
+
name: "Test string",
|
|
186
|
+
resetUserDataOnNewActivity: true,
|
|
187
|
+
});
|
|
188
|
+
/** Creates a conversion event with the specified attributes. */
|
|
189
|
+
await gapi.client.analyticsadmin.properties.conversionEvents.create({
|
|
190
|
+
parent: "Test string",
|
|
191
|
+
}, {
|
|
192
|
+
createTime: "Test string",
|
|
193
|
+
custom: true,
|
|
194
|
+
deletable: true,
|
|
195
|
+
eventName: "Test string",
|
|
196
|
+
name: "Test string",
|
|
197
|
+
});
|
|
198
|
+
/** Deletes a conversion event in a property. */
|
|
199
|
+
await gapi.client.analyticsadmin.properties.conversionEvents.delete({
|
|
200
|
+
name: "Test string",
|
|
201
|
+
});
|
|
202
|
+
/** Retrieve a single conversion event. */
|
|
203
|
+
await gapi.client.analyticsadmin.properties.conversionEvents.get({
|
|
204
|
+
name: "Test string",
|
|
205
|
+
});
|
|
206
|
+
/** Returns a list of conversion events in the specified parent property. Returns an empty list if no conversion events are found. */
|
|
207
|
+
await gapi.client.analyticsadmin.properties.conversionEvents.list({
|
|
208
|
+
pageSize: 42,
|
|
209
|
+
pageToken: "Test string",
|
|
210
|
+
parent: "Test string",
|
|
211
|
+
});
|
|
212
|
+
/** Archives a CustomDimension on a property. */
|
|
213
|
+
await gapi.client.analyticsadmin.properties.customDimensions.archive({
|
|
214
|
+
name: "Test string",
|
|
215
|
+
}, {
|
|
216
|
+
});
|
|
217
|
+
/** Creates a CustomDimension. */
|
|
218
|
+
await gapi.client.analyticsadmin.properties.customDimensions.create({
|
|
219
|
+
parent: "Test string",
|
|
220
|
+
}, {
|
|
221
|
+
description: "Test string",
|
|
222
|
+
disallowAdsPersonalization: true,
|
|
223
|
+
displayName: "Test string",
|
|
224
|
+
name: "Test string",
|
|
225
|
+
parameterName: "Test string",
|
|
226
|
+
scope: "Test string",
|
|
227
|
+
});
|
|
228
|
+
/** Lookup for a single CustomDimension. */
|
|
229
|
+
await gapi.client.analyticsadmin.properties.customDimensions.get({
|
|
230
|
+
name: "Test string",
|
|
231
|
+
});
|
|
232
|
+
/** Lists CustomDimensions on a property. */
|
|
233
|
+
await gapi.client.analyticsadmin.properties.customDimensions.list({
|
|
234
|
+
pageSize: 42,
|
|
235
|
+
pageToken: "Test string",
|
|
236
|
+
parent: "Test string",
|
|
237
|
+
});
|
|
238
|
+
/** Updates a CustomDimension on a property. */
|
|
239
|
+
await gapi.client.analyticsadmin.properties.customDimensions.patch({
|
|
240
|
+
name: "Test string",
|
|
241
|
+
updateMask: "Test string",
|
|
242
|
+
}, {
|
|
243
|
+
description: "Test string",
|
|
244
|
+
disallowAdsPersonalization: true,
|
|
245
|
+
displayName: "Test string",
|
|
246
|
+
name: "Test string",
|
|
247
|
+
parameterName: "Test string",
|
|
248
|
+
scope: "Test string",
|
|
249
|
+
});
|
|
250
|
+
/** Archives a CustomMetric on a property. */
|
|
251
|
+
await gapi.client.analyticsadmin.properties.customMetrics.archive({
|
|
252
|
+
name: "Test string",
|
|
253
|
+
}, {
|
|
254
|
+
});
|
|
255
|
+
/** Creates a CustomMetric. */
|
|
256
|
+
await gapi.client.analyticsadmin.properties.customMetrics.create({
|
|
257
|
+
parent: "Test string",
|
|
258
|
+
}, {
|
|
259
|
+
description: "Test string",
|
|
260
|
+
displayName: "Test string",
|
|
261
|
+
measurementUnit: "Test string",
|
|
262
|
+
name: "Test string",
|
|
263
|
+
parameterName: "Test string",
|
|
264
|
+
restrictedMetricType: [
|
|
265
|
+
"Test string"
|
|
266
|
+
],
|
|
267
|
+
scope: "Test string",
|
|
268
|
+
});
|
|
269
|
+
/** Lookup for a single CustomMetric. */
|
|
270
|
+
await gapi.client.analyticsadmin.properties.customMetrics.get({
|
|
271
|
+
name: "Test string",
|
|
272
|
+
});
|
|
273
|
+
/** Lists CustomMetrics on a property. */
|
|
274
|
+
await gapi.client.analyticsadmin.properties.customMetrics.list({
|
|
275
|
+
pageSize: 42,
|
|
276
|
+
pageToken: "Test string",
|
|
277
|
+
parent: "Test string",
|
|
278
|
+
});
|
|
279
|
+
/** Updates a CustomMetric on a property. */
|
|
280
|
+
await gapi.client.analyticsadmin.properties.customMetrics.patch({
|
|
281
|
+
name: "Test string",
|
|
282
|
+
updateMask: "Test string",
|
|
283
|
+
}, {
|
|
284
|
+
description: "Test string",
|
|
285
|
+
displayName: "Test string",
|
|
286
|
+
measurementUnit: "Test string",
|
|
287
|
+
name: "Test string",
|
|
288
|
+
parameterName: "Test string",
|
|
289
|
+
restrictedMetricType: [
|
|
290
|
+
"Test string"
|
|
291
|
+
],
|
|
292
|
+
scope: "Test string",
|
|
293
|
+
});
|
|
294
|
+
/** Creates a DataStream. */
|
|
295
|
+
await gapi.client.analyticsadmin.properties.dataStreams.create({
|
|
296
|
+
parent: "Test string",
|
|
297
|
+
}, {
|
|
298
|
+
androidAppStreamData: {
|
|
299
|
+
firebaseAppId: "Test string",
|
|
300
|
+
packageName: "Test string",
|
|
301
|
+
},
|
|
302
|
+
createTime: "Test string",
|
|
303
|
+
displayName: "Test string",
|
|
304
|
+
iosAppStreamData: {
|
|
305
|
+
bundleId: "Test string",
|
|
306
|
+
firebaseAppId: "Test string",
|
|
307
|
+
},
|
|
308
|
+
name: "Test string",
|
|
309
|
+
type: "Test string",
|
|
310
|
+
updateTime: "Test string",
|
|
311
|
+
webStreamData: {
|
|
312
|
+
defaultUri: "Test string",
|
|
313
|
+
firebaseAppId: "Test string",
|
|
314
|
+
measurementId: "Test string",
|
|
315
|
+
},
|
|
316
|
+
});
|
|
317
|
+
/** Deletes a DataStream on a property. */
|
|
318
|
+
await gapi.client.analyticsadmin.properties.dataStreams.delete({
|
|
319
|
+
name: "Test string",
|
|
320
|
+
});
|
|
321
|
+
/** Lookup for a single DataStream. */
|
|
322
|
+
await gapi.client.analyticsadmin.properties.dataStreams.get({
|
|
323
|
+
name: "Test string",
|
|
324
|
+
});
|
|
325
|
+
/** Lists DataStreams on a property. */
|
|
326
|
+
await gapi.client.analyticsadmin.properties.dataStreams.list({
|
|
327
|
+
pageSize: 42,
|
|
328
|
+
pageToken: "Test string",
|
|
329
|
+
parent: "Test string",
|
|
330
|
+
});
|
|
331
|
+
/** Updates a DataStream on a property. */
|
|
332
|
+
await gapi.client.analyticsadmin.properties.dataStreams.patch({
|
|
333
|
+
name: "Test string",
|
|
334
|
+
updateMask: "Test string",
|
|
335
|
+
}, {
|
|
336
|
+
androidAppStreamData: {
|
|
337
|
+
firebaseAppId: "Test string",
|
|
338
|
+
packageName: "Test string",
|
|
339
|
+
},
|
|
340
|
+
createTime: "Test string",
|
|
341
|
+
displayName: "Test string",
|
|
342
|
+
iosAppStreamData: {
|
|
343
|
+
bundleId: "Test string",
|
|
344
|
+
firebaseAppId: "Test string",
|
|
345
|
+
},
|
|
346
|
+
name: "Test string",
|
|
347
|
+
type: "Test string",
|
|
348
|
+
updateTime: "Test string",
|
|
349
|
+
webStreamData: {
|
|
350
|
+
defaultUri: "Test string",
|
|
351
|
+
firebaseAppId: "Test string",
|
|
352
|
+
measurementId: "Test string",
|
|
353
|
+
},
|
|
354
|
+
});
|
|
355
|
+
/** Creates a measurement protocol secret. */
|
|
356
|
+
await gapi.client.analyticsadmin.properties.dataStreams.measurementProtocolSecrets.create({
|
|
357
|
+
parent: "Test string",
|
|
358
|
+
}, {
|
|
359
|
+
displayName: "Test string",
|
|
360
|
+
name: "Test string",
|
|
361
|
+
secretValue: "Test string",
|
|
362
|
+
});
|
|
363
|
+
/** Deletes target MeasurementProtocolSecret. */
|
|
364
|
+
await gapi.client.analyticsadmin.properties.dataStreams.measurementProtocolSecrets.delete({
|
|
365
|
+
name: "Test string",
|
|
366
|
+
});
|
|
367
|
+
/** Lookup for a single "GA4" MeasurementProtocolSecret. */
|
|
368
|
+
await gapi.client.analyticsadmin.properties.dataStreams.measurementProtocolSecrets.get({
|
|
369
|
+
name: "Test string",
|
|
370
|
+
});
|
|
371
|
+
/** Returns child MeasurementProtocolSecrets under the specified parent Property. */
|
|
372
|
+
await gapi.client.analyticsadmin.properties.dataStreams.measurementProtocolSecrets.list({
|
|
373
|
+
pageSize: 42,
|
|
374
|
+
pageToken: "Test string",
|
|
375
|
+
parent: "Test string",
|
|
376
|
+
});
|
|
377
|
+
/** Updates a measurement protocol secret. */
|
|
378
|
+
await gapi.client.analyticsadmin.properties.dataStreams.measurementProtocolSecrets.patch({
|
|
379
|
+
name: "Test string",
|
|
380
|
+
updateMask: "Test string",
|
|
381
|
+
}, {
|
|
382
|
+
displayName: "Test string",
|
|
383
|
+
name: "Test string",
|
|
384
|
+
secretValue: "Test string",
|
|
385
|
+
});
|
|
386
|
+
/** Creates a FirebaseLink. Properties can have at most one FirebaseLink. */
|
|
387
|
+
await gapi.client.analyticsadmin.properties.firebaseLinks.create({
|
|
388
|
+
parent: "Test string",
|
|
389
|
+
}, {
|
|
390
|
+
createTime: "Test string",
|
|
391
|
+
name: "Test string",
|
|
392
|
+
project: "Test string",
|
|
393
|
+
});
|
|
394
|
+
/** Deletes a FirebaseLink on a property */
|
|
395
|
+
await gapi.client.analyticsadmin.properties.firebaseLinks.delete({
|
|
396
|
+
name: "Test string",
|
|
397
|
+
});
|
|
398
|
+
/** Lists FirebaseLinks on a property. Properties can have at most one FirebaseLink. */
|
|
399
|
+
await gapi.client.analyticsadmin.properties.firebaseLinks.list({
|
|
400
|
+
pageSize: 42,
|
|
401
|
+
pageToken: "Test string",
|
|
402
|
+
parent: "Test string",
|
|
403
|
+
});
|
|
404
|
+
/** Creates a GoogleAdsLink. */
|
|
405
|
+
await gapi.client.analyticsadmin.properties.googleAdsLinks.create({
|
|
406
|
+
parent: "Test string",
|
|
407
|
+
}, {
|
|
408
|
+
adsPersonalizationEnabled: true,
|
|
409
|
+
canManageClients: true,
|
|
410
|
+
createTime: "Test string",
|
|
411
|
+
creatorEmailAddress: "Test string",
|
|
412
|
+
customerId: "Test string",
|
|
413
|
+
name: "Test string",
|
|
414
|
+
updateTime: "Test string",
|
|
415
|
+
});
|
|
416
|
+
/** Deletes a GoogleAdsLink on a property */
|
|
417
|
+
await gapi.client.analyticsadmin.properties.googleAdsLinks.delete({
|
|
418
|
+
name: "Test string",
|
|
419
|
+
});
|
|
420
|
+
/** Lists GoogleAdsLinks on a property. */
|
|
421
|
+
await gapi.client.analyticsadmin.properties.googleAdsLinks.list({
|
|
422
|
+
pageSize: 42,
|
|
423
|
+
pageToken: "Test string",
|
|
424
|
+
parent: "Test string",
|
|
425
|
+
});
|
|
426
|
+
/** Updates a GoogleAdsLink on a property */
|
|
427
|
+
await gapi.client.analyticsadmin.properties.googleAdsLinks.patch({
|
|
428
|
+
name: "Test string",
|
|
429
|
+
updateMask: "Test string",
|
|
430
|
+
}, {
|
|
431
|
+
adsPersonalizationEnabled: true,
|
|
432
|
+
canManageClients: true,
|
|
433
|
+
createTime: "Test string",
|
|
434
|
+
creatorEmailAddress: "Test string",
|
|
435
|
+
customerId: "Test string",
|
|
436
|
+
name: "Test string",
|
|
437
|
+
updateTime: "Test string",
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
});
|
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
|
+
}
|