@maxim_mazurok/gapi.client.recommender-v1beta1 0.0.20220807
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 +2302 -0
- package/package.json +20 -0
- package/readme.md +68 -0
- package/tests.ts +421 -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.recommender-v1beta1",
|
|
3
|
+
"version": "0.0.20220807",
|
|
4
|
+
"description": "TypeScript typings for Recommender API v1beta1",
|
|
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,68 @@
|
|
|
1
|
+
# TypeScript typings for Recommender API v1beta1
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
For detailed description please check [documentation](https://cloud.google.com/recommender/docs/).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Recommender API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.recommender-v1beta1 --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://recommender.googleapis.com/$discovery/rest?version=v1beta1', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.recommender
|
|
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('recommender', 'v1beta1', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.recommender
|
|
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
|
+
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
|
49
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
50
|
+
],
|
|
51
|
+
immediate = true;
|
|
52
|
+
// ...
|
|
53
|
+
|
|
54
|
+
gapi.auth.authorize(
|
|
55
|
+
{ client_id: client_id, scope: scope, immediate: immediate },
|
|
56
|
+
authResult => {
|
|
57
|
+
if (authResult && !authResult.error) {
|
|
58
|
+
/* handle successful authorization */
|
|
59
|
+
} else {
|
|
60
|
+
/* handle authorization error */
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
After that you can use Recommender API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
```
|
package/tests.ts
ADDED
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.recommender-v1beta1 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: 20220807
|
|
7
|
+
|
|
8
|
+
gapi.load('client', async () => {
|
|
9
|
+
/** now we can use gapi.client */
|
|
10
|
+
|
|
11
|
+
await gapi.client.load('https://recommender.googleapis.com/$discovery/rest?version=v1beta1');
|
|
12
|
+
/** now we can use gapi.client.recommender */
|
|
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
|
+
/** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. */
|
|
19
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
20
|
+
];
|
|
21
|
+
const immediate = false;
|
|
22
|
+
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
|
23
|
+
if (authResult && !authResult.error) {
|
|
24
|
+
/** handle successful authorization */
|
|
25
|
+
run();
|
|
26
|
+
} else {
|
|
27
|
+
/** handle authorization error */
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
async function run() {
|
|
32
|
+
/** Gets the requested insight. Requires the recommender.*.get IAM permission for the specified insight type. */
|
|
33
|
+
await gapi.client.recommender.billingAccounts.locations.insightTypes.insights.get({
|
|
34
|
+
name: "Test string",
|
|
35
|
+
});
|
|
36
|
+
/** Lists insights for the specified Cloud Resource. Requires the recommender.*.list IAM permission for the specified insight type. */
|
|
37
|
+
await gapi.client.recommender.billingAccounts.locations.insightTypes.insights.list({
|
|
38
|
+
filter: "Test string",
|
|
39
|
+
pageSize: 42,
|
|
40
|
+
pageToken: "Test string",
|
|
41
|
+
parent: "Test string",
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* Marks the Insight State as Accepted. Users can use this method to indicate to the Recommender API that they have applied some action based on the insight. This stops the insight content
|
|
45
|
+
* from being updated. MarkInsightAccepted can be applied to insights in ACTIVE state. Requires the recommender.*.update IAM permission for the specified insight.
|
|
46
|
+
*/
|
|
47
|
+
await gapi.client.recommender.billingAccounts.locations.insightTypes.insights.markAccepted({
|
|
48
|
+
name: "Test string",
|
|
49
|
+
}, {
|
|
50
|
+
etag: "Test string",
|
|
51
|
+
stateMetadata: {
|
|
52
|
+
A: "Test string"
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
/** Gets the requested recommendation. Requires the recommender.*.get IAM permission for the specified recommender. */
|
|
56
|
+
await gapi.client.recommender.billingAccounts.locations.recommenders.recommendations.get({
|
|
57
|
+
name: "Test string",
|
|
58
|
+
});
|
|
59
|
+
/** Lists recommendations for the specified Cloud Resource. Requires the recommender.*.list IAM permission for the specified recommender. */
|
|
60
|
+
await gapi.client.recommender.billingAccounts.locations.recommenders.recommendations.list({
|
|
61
|
+
filter: "Test string",
|
|
62
|
+
pageSize: 42,
|
|
63
|
+
pageToken: "Test string",
|
|
64
|
+
parent: "Test string",
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* Marks the Recommendation State as Claimed. Users can use this method to indicate to the Recommender API that they are starting to apply the recommendation themselves. This stops the
|
|
68
|
+
* recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationClaimed can be applied to recommendations in CLAIMED or
|
|
69
|
+
* ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.
|
|
70
|
+
*/
|
|
71
|
+
await gapi.client.recommender.billingAccounts.locations.recommenders.recommendations.markClaimed({
|
|
72
|
+
name: "Test string",
|
|
73
|
+
}, {
|
|
74
|
+
etag: "Test string",
|
|
75
|
+
stateMetadata: {
|
|
76
|
+
A: "Test string"
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
/**
|
|
80
|
+
* Marks the Recommendation State as Failed. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation failed.
|
|
81
|
+
* This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to recommendations in
|
|
82
|
+
* ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.
|
|
83
|
+
*/
|
|
84
|
+
await gapi.client.recommender.billingAccounts.locations.recommenders.recommendations.markFailed({
|
|
85
|
+
name: "Test string",
|
|
86
|
+
}, {
|
|
87
|
+
etag: "Test string",
|
|
88
|
+
stateMetadata: {
|
|
89
|
+
A: "Test string"
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
/**
|
|
93
|
+
* Marks the Recommendation State as Succeeded. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation was
|
|
94
|
+
* successful. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationSucceeded can be applied to
|
|
95
|
+
* recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.
|
|
96
|
+
*/
|
|
97
|
+
await gapi.client.recommender.billingAccounts.locations.recommenders.recommendations.markSucceeded({
|
|
98
|
+
name: "Test string",
|
|
99
|
+
}, {
|
|
100
|
+
etag: "Test string",
|
|
101
|
+
stateMetadata: {
|
|
102
|
+
A: "Test string"
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
/** Gets the requested insight. Requires the recommender.*.get IAM permission for the specified insight type. */
|
|
106
|
+
await gapi.client.recommender.folders.locations.insightTypes.insights.get({
|
|
107
|
+
name: "Test string",
|
|
108
|
+
});
|
|
109
|
+
/** Lists insights for the specified Cloud Resource. Requires the recommender.*.list IAM permission for the specified insight type. */
|
|
110
|
+
await gapi.client.recommender.folders.locations.insightTypes.insights.list({
|
|
111
|
+
filter: "Test string",
|
|
112
|
+
pageSize: 42,
|
|
113
|
+
pageToken: "Test string",
|
|
114
|
+
parent: "Test string",
|
|
115
|
+
});
|
|
116
|
+
/**
|
|
117
|
+
* Marks the Insight State as Accepted. Users can use this method to indicate to the Recommender API that they have applied some action based on the insight. This stops the insight content
|
|
118
|
+
* from being updated. MarkInsightAccepted can be applied to insights in ACTIVE state. Requires the recommender.*.update IAM permission for the specified insight.
|
|
119
|
+
*/
|
|
120
|
+
await gapi.client.recommender.folders.locations.insightTypes.insights.markAccepted({
|
|
121
|
+
name: "Test string",
|
|
122
|
+
}, {
|
|
123
|
+
etag: "Test string",
|
|
124
|
+
stateMetadata: {
|
|
125
|
+
A: "Test string"
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
/** Gets the requested recommendation. Requires the recommender.*.get IAM permission for the specified recommender. */
|
|
129
|
+
await gapi.client.recommender.folders.locations.recommenders.recommendations.get({
|
|
130
|
+
name: "Test string",
|
|
131
|
+
});
|
|
132
|
+
/** Lists recommendations for the specified Cloud Resource. Requires the recommender.*.list IAM permission for the specified recommender. */
|
|
133
|
+
await gapi.client.recommender.folders.locations.recommenders.recommendations.list({
|
|
134
|
+
filter: "Test string",
|
|
135
|
+
pageSize: 42,
|
|
136
|
+
pageToken: "Test string",
|
|
137
|
+
parent: "Test string",
|
|
138
|
+
});
|
|
139
|
+
/**
|
|
140
|
+
* Marks the Recommendation State as Claimed. Users can use this method to indicate to the Recommender API that they are starting to apply the recommendation themselves. This stops the
|
|
141
|
+
* recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationClaimed can be applied to recommendations in CLAIMED or
|
|
142
|
+
* ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.
|
|
143
|
+
*/
|
|
144
|
+
await gapi.client.recommender.folders.locations.recommenders.recommendations.markClaimed({
|
|
145
|
+
name: "Test string",
|
|
146
|
+
}, {
|
|
147
|
+
etag: "Test string",
|
|
148
|
+
stateMetadata: {
|
|
149
|
+
A: "Test string"
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
/**
|
|
153
|
+
* Marks the Recommendation State as Failed. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation failed.
|
|
154
|
+
* This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to recommendations in
|
|
155
|
+
* ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.
|
|
156
|
+
*/
|
|
157
|
+
await gapi.client.recommender.folders.locations.recommenders.recommendations.markFailed({
|
|
158
|
+
name: "Test string",
|
|
159
|
+
}, {
|
|
160
|
+
etag: "Test string",
|
|
161
|
+
stateMetadata: {
|
|
162
|
+
A: "Test string"
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
/**
|
|
166
|
+
* Marks the Recommendation State as Succeeded. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation was
|
|
167
|
+
* successful. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationSucceeded can be applied to
|
|
168
|
+
* recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.
|
|
169
|
+
*/
|
|
170
|
+
await gapi.client.recommender.folders.locations.recommenders.recommendations.markSucceeded({
|
|
171
|
+
name: "Test string",
|
|
172
|
+
}, {
|
|
173
|
+
etag: "Test string",
|
|
174
|
+
stateMetadata: {
|
|
175
|
+
A: "Test string"
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
/** Gets the requested InsightTypeConfig. There is only one instance of the config for each InsightType. */
|
|
179
|
+
await gapi.client.recommender.organizations.locations.insightTypes.getConfig({
|
|
180
|
+
name: "Test string",
|
|
181
|
+
});
|
|
182
|
+
/** Updates an InsightTypeConfig change. This will create a new revision of the config. */
|
|
183
|
+
await gapi.client.recommender.organizations.locations.insightTypes.updateConfig({
|
|
184
|
+
name: "Test string",
|
|
185
|
+
updateMask: "Test string",
|
|
186
|
+
validateOnly: true,
|
|
187
|
+
}, {
|
|
188
|
+
annotations: {
|
|
189
|
+
A: "Test string"
|
|
190
|
+
},
|
|
191
|
+
displayName: "Test string",
|
|
192
|
+
etag: "Test string",
|
|
193
|
+
insightTypeGenerationConfig: {
|
|
194
|
+
params: {
|
|
195
|
+
A: 42
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
name: "Test string",
|
|
199
|
+
revisionId: "Test string",
|
|
200
|
+
updateTime: "Test string",
|
|
201
|
+
});
|
|
202
|
+
/** Gets the requested insight. Requires the recommender.*.get IAM permission for the specified insight type. */
|
|
203
|
+
await gapi.client.recommender.organizations.locations.insightTypes.insights.get({
|
|
204
|
+
name: "Test string",
|
|
205
|
+
});
|
|
206
|
+
/** Lists insights for the specified Cloud Resource. Requires the recommender.*.list IAM permission for the specified insight type. */
|
|
207
|
+
await gapi.client.recommender.organizations.locations.insightTypes.insights.list({
|
|
208
|
+
filter: "Test string",
|
|
209
|
+
pageSize: 42,
|
|
210
|
+
pageToken: "Test string",
|
|
211
|
+
parent: "Test string",
|
|
212
|
+
});
|
|
213
|
+
/**
|
|
214
|
+
* Marks the Insight State as Accepted. Users can use this method to indicate to the Recommender API that they have applied some action based on the insight. This stops the insight content
|
|
215
|
+
* from being updated. MarkInsightAccepted can be applied to insights in ACTIVE state. Requires the recommender.*.update IAM permission for the specified insight.
|
|
216
|
+
*/
|
|
217
|
+
await gapi.client.recommender.organizations.locations.insightTypes.insights.markAccepted({
|
|
218
|
+
name: "Test string",
|
|
219
|
+
}, {
|
|
220
|
+
etag: "Test string",
|
|
221
|
+
stateMetadata: {
|
|
222
|
+
A: "Test string"
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
/** Gets the requested Recommender Config. There is only one instance of the config for each Recommender. */
|
|
226
|
+
await gapi.client.recommender.organizations.locations.recommenders.getConfig({
|
|
227
|
+
name: "Test string",
|
|
228
|
+
});
|
|
229
|
+
/** Updates a Recommender Config. This will create a new revision of the config. */
|
|
230
|
+
await gapi.client.recommender.organizations.locations.recommenders.updateConfig({
|
|
231
|
+
name: "Test string",
|
|
232
|
+
updateMask: "Test string",
|
|
233
|
+
validateOnly: true,
|
|
234
|
+
}, {
|
|
235
|
+
annotations: {
|
|
236
|
+
A: "Test string"
|
|
237
|
+
},
|
|
238
|
+
displayName: "Test string",
|
|
239
|
+
etag: "Test string",
|
|
240
|
+
name: "Test string",
|
|
241
|
+
recommenderGenerationConfig: {
|
|
242
|
+
params: {
|
|
243
|
+
A: 42
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
revisionId: "Test string",
|
|
247
|
+
updateTime: "Test string",
|
|
248
|
+
});
|
|
249
|
+
/** Gets the requested recommendation. Requires the recommender.*.get IAM permission for the specified recommender. */
|
|
250
|
+
await gapi.client.recommender.organizations.locations.recommenders.recommendations.get({
|
|
251
|
+
name: "Test string",
|
|
252
|
+
});
|
|
253
|
+
/** Lists recommendations for the specified Cloud Resource. Requires the recommender.*.list IAM permission for the specified recommender. */
|
|
254
|
+
await gapi.client.recommender.organizations.locations.recommenders.recommendations.list({
|
|
255
|
+
filter: "Test string",
|
|
256
|
+
pageSize: 42,
|
|
257
|
+
pageToken: "Test string",
|
|
258
|
+
parent: "Test string",
|
|
259
|
+
});
|
|
260
|
+
/**
|
|
261
|
+
* Marks the Recommendation State as Claimed. Users can use this method to indicate to the Recommender API that they are starting to apply the recommendation themselves. This stops the
|
|
262
|
+
* recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationClaimed can be applied to recommendations in CLAIMED or
|
|
263
|
+
* ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.
|
|
264
|
+
*/
|
|
265
|
+
await gapi.client.recommender.organizations.locations.recommenders.recommendations.markClaimed({
|
|
266
|
+
name: "Test string",
|
|
267
|
+
}, {
|
|
268
|
+
etag: "Test string",
|
|
269
|
+
stateMetadata: {
|
|
270
|
+
A: "Test string"
|
|
271
|
+
},
|
|
272
|
+
});
|
|
273
|
+
/**
|
|
274
|
+
* Marks the Recommendation State as Failed. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation failed.
|
|
275
|
+
* This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to recommendations in
|
|
276
|
+
* ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.
|
|
277
|
+
*/
|
|
278
|
+
await gapi.client.recommender.organizations.locations.recommenders.recommendations.markFailed({
|
|
279
|
+
name: "Test string",
|
|
280
|
+
}, {
|
|
281
|
+
etag: "Test string",
|
|
282
|
+
stateMetadata: {
|
|
283
|
+
A: "Test string"
|
|
284
|
+
},
|
|
285
|
+
});
|
|
286
|
+
/**
|
|
287
|
+
* Marks the Recommendation State as Succeeded. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation was
|
|
288
|
+
* successful. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationSucceeded can be applied to
|
|
289
|
+
* recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.
|
|
290
|
+
*/
|
|
291
|
+
await gapi.client.recommender.organizations.locations.recommenders.recommendations.markSucceeded({
|
|
292
|
+
name: "Test string",
|
|
293
|
+
}, {
|
|
294
|
+
etag: "Test string",
|
|
295
|
+
stateMetadata: {
|
|
296
|
+
A: "Test string"
|
|
297
|
+
},
|
|
298
|
+
});
|
|
299
|
+
/** Gets the requested InsightTypeConfig. There is only one instance of the config for each InsightType. */
|
|
300
|
+
await gapi.client.recommender.projects.locations.insightTypes.getConfig({
|
|
301
|
+
name: "Test string",
|
|
302
|
+
});
|
|
303
|
+
/** Updates an InsightTypeConfig change. This will create a new revision of the config. */
|
|
304
|
+
await gapi.client.recommender.projects.locations.insightTypes.updateConfig({
|
|
305
|
+
name: "Test string",
|
|
306
|
+
updateMask: "Test string",
|
|
307
|
+
validateOnly: true,
|
|
308
|
+
}, {
|
|
309
|
+
annotations: {
|
|
310
|
+
A: "Test string"
|
|
311
|
+
},
|
|
312
|
+
displayName: "Test string",
|
|
313
|
+
etag: "Test string",
|
|
314
|
+
insightTypeGenerationConfig: {
|
|
315
|
+
params: {
|
|
316
|
+
A: 42
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
name: "Test string",
|
|
320
|
+
revisionId: "Test string",
|
|
321
|
+
updateTime: "Test string",
|
|
322
|
+
});
|
|
323
|
+
/** Gets the requested insight. Requires the recommender.*.get IAM permission for the specified insight type. */
|
|
324
|
+
await gapi.client.recommender.projects.locations.insightTypes.insights.get({
|
|
325
|
+
name: "Test string",
|
|
326
|
+
});
|
|
327
|
+
/** Lists insights for the specified Cloud Resource. Requires the recommender.*.list IAM permission for the specified insight type. */
|
|
328
|
+
await gapi.client.recommender.projects.locations.insightTypes.insights.list({
|
|
329
|
+
filter: "Test string",
|
|
330
|
+
pageSize: 42,
|
|
331
|
+
pageToken: "Test string",
|
|
332
|
+
parent: "Test string",
|
|
333
|
+
});
|
|
334
|
+
/**
|
|
335
|
+
* Marks the Insight State as Accepted. Users can use this method to indicate to the Recommender API that they have applied some action based on the insight. This stops the insight content
|
|
336
|
+
* from being updated. MarkInsightAccepted can be applied to insights in ACTIVE state. Requires the recommender.*.update IAM permission for the specified insight.
|
|
337
|
+
*/
|
|
338
|
+
await gapi.client.recommender.projects.locations.insightTypes.insights.markAccepted({
|
|
339
|
+
name: "Test string",
|
|
340
|
+
}, {
|
|
341
|
+
etag: "Test string",
|
|
342
|
+
stateMetadata: {
|
|
343
|
+
A: "Test string"
|
|
344
|
+
},
|
|
345
|
+
});
|
|
346
|
+
/** Gets the requested Recommender Config. There is only one instance of the config for each Recommender. */
|
|
347
|
+
await gapi.client.recommender.projects.locations.recommenders.getConfig({
|
|
348
|
+
name: "Test string",
|
|
349
|
+
});
|
|
350
|
+
/** Updates a Recommender Config. This will create a new revision of the config. */
|
|
351
|
+
await gapi.client.recommender.projects.locations.recommenders.updateConfig({
|
|
352
|
+
name: "Test string",
|
|
353
|
+
updateMask: "Test string",
|
|
354
|
+
validateOnly: true,
|
|
355
|
+
}, {
|
|
356
|
+
annotations: {
|
|
357
|
+
A: "Test string"
|
|
358
|
+
},
|
|
359
|
+
displayName: "Test string",
|
|
360
|
+
etag: "Test string",
|
|
361
|
+
name: "Test string",
|
|
362
|
+
recommenderGenerationConfig: {
|
|
363
|
+
params: {
|
|
364
|
+
A: 42
|
|
365
|
+
},
|
|
366
|
+
},
|
|
367
|
+
revisionId: "Test string",
|
|
368
|
+
updateTime: "Test string",
|
|
369
|
+
});
|
|
370
|
+
/** Gets the requested recommendation. Requires the recommender.*.get IAM permission for the specified recommender. */
|
|
371
|
+
await gapi.client.recommender.projects.locations.recommenders.recommendations.get({
|
|
372
|
+
name: "Test string",
|
|
373
|
+
});
|
|
374
|
+
/** Lists recommendations for the specified Cloud Resource. Requires the recommender.*.list IAM permission for the specified recommender. */
|
|
375
|
+
await gapi.client.recommender.projects.locations.recommenders.recommendations.list({
|
|
376
|
+
filter: "Test string",
|
|
377
|
+
pageSize: 42,
|
|
378
|
+
pageToken: "Test string",
|
|
379
|
+
parent: "Test string",
|
|
380
|
+
});
|
|
381
|
+
/**
|
|
382
|
+
* Marks the Recommendation State as Claimed. Users can use this method to indicate to the Recommender API that they are starting to apply the recommendation themselves. This stops the
|
|
383
|
+
* recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationClaimed can be applied to recommendations in CLAIMED or
|
|
384
|
+
* ACTIVE state. Requires the recommender.*.update IAM permission for the specified recommender.
|
|
385
|
+
*/
|
|
386
|
+
await gapi.client.recommender.projects.locations.recommenders.recommendations.markClaimed({
|
|
387
|
+
name: "Test string",
|
|
388
|
+
}, {
|
|
389
|
+
etag: "Test string",
|
|
390
|
+
stateMetadata: {
|
|
391
|
+
A: "Test string"
|
|
392
|
+
},
|
|
393
|
+
});
|
|
394
|
+
/**
|
|
395
|
+
* Marks the Recommendation State as Failed. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation failed.
|
|
396
|
+
* This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationFailed can be applied to recommendations in
|
|
397
|
+
* ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.
|
|
398
|
+
*/
|
|
399
|
+
await gapi.client.recommender.projects.locations.recommenders.recommendations.markFailed({
|
|
400
|
+
name: "Test string",
|
|
401
|
+
}, {
|
|
402
|
+
etag: "Test string",
|
|
403
|
+
stateMetadata: {
|
|
404
|
+
A: "Test string"
|
|
405
|
+
},
|
|
406
|
+
});
|
|
407
|
+
/**
|
|
408
|
+
* Marks the Recommendation State as Succeeded. Users can use this method to indicate to the Recommender API that they have applied the recommendation themselves, and the operation was
|
|
409
|
+
* successful. This stops the recommendation content from being updated. Associated insights are frozen and placed in the ACCEPTED state. MarkRecommendationSucceeded can be applied to
|
|
410
|
+
* recommendations in ACTIVE, CLAIMED, SUCCEEDED, or FAILED state. Requires the recommender.*.update IAM permission for the specified recommender.
|
|
411
|
+
*/
|
|
412
|
+
await gapi.client.recommender.projects.locations.recommenders.recommendations.markSucceeded({
|
|
413
|
+
name: "Test string",
|
|
414
|
+
}, {
|
|
415
|
+
etag: "Test string",
|
|
416
|
+
stateMetadata: {
|
|
417
|
+
A: "Test string"
|
|
418
|
+
},
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
});
|
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
|
+
}
|