Skip to content

Commit afcce93

Browse files
yoshi-automationsofisl
authored andcommitted
feat(webrisk)!: update the API
BREAKING CHANGE: This release has breaking changes. #### webrisk:v1 The following keys were deleted: - resources.projects.resources.uris.methods.submit.description - resources.projects.resources.uris.methods.submit.flatPath - resources.projects.resources.uris.methods.submit.httpMethod - resources.projects.resources.uris.methods.submit.id - resources.projects.resources.uris.methods.submit.parameterOrder - resources.projects.resources.uris.methods.submit.parameters.parent.description - resources.projects.resources.uris.methods.submit.parameters.parent.location - resources.projects.resources.uris.methods.submit.parameters.parent.pattern - resources.projects.resources.uris.methods.submit.parameters.parent.required - resources.projects.resources.uris.methods.submit.parameters.parent.type - resources.projects.resources.uris.methods.submit.path - resources.projects.resources.uris.methods.submit.request.$ref - resources.projects.resources.uris.methods.submit.response.$ref - resources.projects.resources.uris.methods.submit.scopes - schemas.GoogleCloudWebriskV1Submission.properties.threatTypes.description - schemas.GoogleCloudWebriskV1Submission.properties.threatTypes.items.enum - schemas.GoogleCloudWebriskV1Submission.properties.threatTypes.items.enumDescriptions - schemas.GoogleCloudWebriskV1Submission.properties.threatTypes.items.type - schemas.GoogleCloudWebriskV1Submission.properties.threatTypes.type - schemas.GoogleCloudWebriskV1SubmitUriMetadata.description - schemas.GoogleCloudWebriskV1SubmitUriMetadata.id - schemas.GoogleCloudWebriskV1SubmitUriMetadata.properties.createTime.description - schemas.GoogleCloudWebriskV1SubmitUriMetadata.properties.createTime.format - schemas.GoogleCloudWebriskV1SubmitUriMetadata.properties.createTime.type - schemas.GoogleCloudWebriskV1SubmitUriMetadata.properties.state.description - schemas.GoogleCloudWebriskV1SubmitUriMetadata.properties.state.enum - schemas.GoogleCloudWebriskV1SubmitUriMetadata.properties.state.enumDescriptions - schemas.GoogleCloudWebriskV1SubmitUriMetadata.properties.state.type - schemas.GoogleCloudWebriskV1SubmitUriMetadata.properties.updateTime.description - schemas.GoogleCloudWebriskV1SubmitUriMetadata.properties.updateTime.format - schemas.GoogleCloudWebriskV1SubmitUriMetadata.properties.updateTime.type - schemas.GoogleCloudWebriskV1SubmitUriMetadata.type - schemas.GoogleCloudWebriskV1SubmitUriRequest.description - schemas.GoogleCloudWebriskV1SubmitUriRequest.id - schemas.GoogleCloudWebriskV1SubmitUriRequest.properties.submission.$ref - schemas.GoogleCloudWebriskV1SubmitUriRequest.properties.submission.description - schemas.GoogleCloudWebriskV1SubmitUriRequest.type The following keys were changed: - resources.projects.resources.operations.methods.list.description
1 parent f12ebab commit afcce93

File tree

2 files changed

+3
-306
lines changed

2 files changed

+3
-306
lines changed

discovery/webrisk-v1.json

Lines changed: 2 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@
228228
]
229229
},
230230
"list": {
231-
"description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.",
231+
"description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.",
232232
"flatPath": "v1/projects/{projectsId}/operations",
233233
"httpMethod": "GET",
234234
"id": "webrisk.projects.operations.list",
@@ -298,38 +298,6 @@
298298
]
299299
}
300300
}
301-
},
302-
"uris": {
303-
"methods": {
304-
"submit": {
305-
"description": "Submits a URI suspected of containing malicious content to be reviewed. Returns a google.longrunning.Operation which, once the review is complete, is updated with its result. You can use the [Pub/Sub API] (https://cloud.google.com/pubsub) to receive notifications for the returned Operation. If the result verifies the existence of malicious content, the site will be added to the [Google's Social Engineering lists] (https://support.google.com/webmasters/answer/6350487/) in order to protect users that could get exposed to this threat in the future. Only allowlisted projects can use this method during Early Access. Please reach out to Sales or your customer engineer to obtain access.",
306-
"flatPath": "v1/projects/{projectsId}/uris:submit",
307-
"httpMethod": "POST",
308-
"id": "webrisk.projects.uris.submit",
309-
"parameterOrder": [
310-
"parent"
311-
],
312-
"parameters": {
313-
"parent": {
314-
"description": "Required. The name of the project that is making the submission. This string is in the format \"projects/{project_number}\".",
315-
"location": "path",
316-
"pattern": "^projects/[^/]+$",
317-
"required": true,
318-
"type": "string"
319-
}
320-
},
321-
"path": "v1/{+parent}/uris:submit",
322-
"request": {
323-
"$ref": "GoogleCloudWebriskV1SubmitUriRequest"
324-
},
325-
"response": {
326-
"$ref": "GoogleLongrunningOperation"
327-
},
328-
"scopes": [
329-
"https://www.googleapis.com/auth/cloud-platform"
330-
]
331-
}
332-
}
333301
}
334302
}
335303
},
@@ -452,7 +420,7 @@
452420
}
453421
}
454422
},
455-
"revision": "20221023",
423+
"revision": "20230319",
456424
"rootUrl": "https://webrisk.googleapis.com/",
457425
"schemas": {
458426
"GoogleCloudWebriskV1ComputeThreatListDiffResponse": {
@@ -671,82 +639,13 @@
671639
"description": "Wraps a URI that might be displaying malicious content.",
672640
"id": "GoogleCloudWebriskV1Submission",
673641
"properties": {
674-
"threatTypes": {
675-
"description": "ThreatTypes found to be associated with the submitted URI after reviewing it. This might be empty if the URI was not added to any list.",
676-
"items": {
677-
"enum": [
678-
"THREAT_TYPE_UNSPECIFIED",
679-
"MALWARE",
680-
"SOCIAL_ENGINEERING",
681-
"UNWANTED_SOFTWARE",
682-
"SOCIAL_ENGINEERING_EXTENDED_COVERAGE"
683-
],
684-
"enumDescriptions": [
685-
"No entries should match this threat type. This threat type is unused.",
686-
"Malware targeting any platform.",
687-
"Social engineering targeting any platform.",
688-
"Unwanted software targeting any platform.",
689-
"A list of extended coverage social engineering URIs targeting any platform."
690-
],
691-
"type": "string"
692-
},
693-
"type": "array"
694-
},
695642
"uri": {
696643
"description": "Required. The URI that is being reported for malicious content to be analyzed.",
697644
"type": "string"
698645
}
699646
},
700647
"type": "object"
701648
},
702-
"GoogleCloudWebriskV1SubmitUriMetadata": {
703-
"description": "Metadata for the Submit URI long-running operation.",
704-
"id": "GoogleCloudWebriskV1SubmitUriMetadata",
705-
"properties": {
706-
"createTime": {
707-
"description": "Creation time of the operation.",
708-
"format": "google-datetime",
709-
"type": "string"
710-
},
711-
"state": {
712-
"description": "The state of the operation.",
713-
"enum": [
714-
"STATE_UNSPECIFIED",
715-
"RUNNING",
716-
"SUCCEEDED",
717-
"CANCELLED",
718-
"FAILED",
719-
"CLOSED"
720-
],
721-
"enumDescriptions": [
722-
"Default unspecified state.",
723-
"The operation is currently running.",
724-
"The operation finished with a success status.",
725-
"The operation was cancelled.",
726-
"The operation finished with a failure status.",
727-
"The operation was closed with no action taken."
728-
],
729-
"type": "string"
730-
},
731-
"updateTime": {
732-
"description": "Latest update time of the operation.",
733-
"format": "google-datetime",
734-
"type": "string"
735-
}
736-
},
737-
"type": "object"
738-
},
739-
"GoogleCloudWebriskV1SubmitUriRequest": {
740-
"description": "Request to send a potentially malicious URI to WebRisk.",
741-
"id": "GoogleCloudWebriskV1SubmitUriRequest",
742-
"properties": {
743-
"submission": {
744-
"$ref": "GoogleCloudWebriskV1Submission",
745-
"description": "Required. The submission that contains the URI to be scanned."
746-
}
747-
},
748-
"type": "object"
749-
},
750649
"GoogleCloudWebriskV1ThreatEntryAdditions": {
751650
"description": "Contains the set of entries to add to a local database. May contain a combination of compressed and raw data in a single response.",
752651
"id": "GoogleCloudWebriskV1ThreatEntryAdditions",

src/apis/webrisk/v1.ts

Lines changed: 1 addition & 203 deletions
Original file line numberDiff line numberDiff line change
@@ -258,41 +258,11 @@ export namespace webrisk_v1 {
258258
* Wraps a URI that might be displaying malicious content.
259259
*/
260260
export interface Schema$GoogleCloudWebriskV1Submission {
261-
/**
262-
* ThreatTypes found to be associated with the submitted URI after reviewing it. This might be empty if the URI was not added to any list.
263-
*/
264-
threatTypes?: string[] | null;
265261
/**
266262
* Required. The URI that is being reported for malicious content to be analyzed.
267263
*/
268264
uri?: string | null;
269265
}
270-
/**
271-
* Metadata for the Submit URI long-running operation.
272-
*/
273-
export interface Schema$GoogleCloudWebriskV1SubmitUriMetadata {
274-
/**
275-
* Creation time of the operation.
276-
*/
277-
createTime?: string | null;
278-
/**
279-
* The state of the operation.
280-
*/
281-
state?: string | null;
282-
/**
283-
* Latest update time of the operation.
284-
*/
285-
updateTime?: string | null;
286-
}
287-
/**
288-
* Request to send a potentially malicious URI to WebRisk.
289-
*/
290-
export interface Schema$GoogleCloudWebriskV1SubmitUriRequest {
291-
/**
292-
* Required. The submission that contains the URI to be scanned.
293-
*/
294-
submission?: Schema$GoogleCloudWebriskV1Submission;
295-
}
296266
/**
297267
* Contains the set of entries to add to a local database. May contain a combination of compressed and raw data in a single response.
298268
*/
@@ -542,12 +512,10 @@ export namespace webrisk_v1 {
542512
context: APIRequestContext;
543513
operations: Resource$Projects$Operations;
544514
submissions: Resource$Projects$Submissions;
545-
uris: Resource$Projects$Uris;
546515
constructor(context: APIRequestContext) {
547516
this.context = context;
548517
this.operations = new Resource$Projects$Operations(this.context);
549518
this.submissions = new Resource$Projects$Submissions(this.context);
550-
this.uris = new Resource$Projects$Uris(this.context);
551519
}
552520
}
553521

@@ -955,7 +923,7 @@ export namespace webrisk_v1 {
955923
}
956924

957925
/**
958-
* Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/x/operations`. To override the binding, API services can add a binding such as `"/v1/{name=users/x\}/operations"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.
926+
* Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
959927
* @example
960928
* ```js
961929
* // Before running the sample:
@@ -1186,7 +1154,6 @@ export namespace webrisk_v1 {
11861154
* requestBody: {
11871155
* // request body parameters
11881156
* // {
1189-
* // "threatTypes": [],
11901157
* // "uri": "my_uri"
11911158
* // }
11921159
* },
@@ -1195,7 +1162,6 @@ export namespace webrisk_v1 {
11951162
*
11961163
* // Example response
11971164
* // {
1198-
* // "threatTypes": [],
11991165
* // "uri": "my_uri"
12001166
* // }
12011167
* }
@@ -1314,174 +1280,6 @@ export namespace webrisk_v1 {
13141280
requestBody?: Schema$GoogleCloudWebriskV1Submission;
13151281
}
13161282

1317-
export class Resource$Projects$Uris {
1318-
context: APIRequestContext;
1319-
constructor(context: APIRequestContext) {
1320-
this.context = context;
1321-
}
1322-
1323-
/**
1324-
* Submits a URI suspected of containing malicious content to be reviewed. Returns a google.longrunning.Operation which, once the review is complete, is updated with its result. You can use the [Pub/Sub API] (https://cloud.google.com/pubsub) to receive notifications for the returned Operation. If the result verifies the existence of malicious content, the site will be added to the [Google's Social Engineering lists] (https://support.google.com/webmasters/answer/6350487/) in order to protect users that could get exposed to this threat in the future. Only allowlisted projects can use this method during Early Access. Please reach out to Sales or your customer engineer to obtain access.
1325-
* @example
1326-
* ```js
1327-
* // Before running the sample:
1328-
* // - Enable the API at:
1329-
* // https://console.developers.google.com/apis/api/webrisk.googleapis.com
1330-
* // - Login into gcloud by running:
1331-
* // `$ gcloud auth application-default login`
1332-
* // - Install the npm module by running:
1333-
* // `$ npm install googleapis`
1334-
*
1335-
* const {google} = require('googleapis');
1336-
* const webrisk = google.webrisk('v1');
1337-
*
1338-
* async function main() {
1339-
* const auth = new google.auth.GoogleAuth({
1340-
* // Scopes can be specified either as an array or as a single, space-delimited string.
1341-
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1342-
* });
1343-
*
1344-
* // Acquire an auth client, and bind it to all future calls
1345-
* const authClient = await auth.getClient();
1346-
* google.options({auth: authClient});
1347-
*
1348-
* // Do the magic
1349-
* const res = await webrisk.projects.uris.submit({
1350-
* // Required. The name of the project that is making the submission. This string is in the format "projects/{project_number\}".
1351-
* parent: 'projects/my-project',
1352-
*
1353-
* // Request body metadata
1354-
* requestBody: {
1355-
* // request body parameters
1356-
* // {
1357-
* // "submission": {}
1358-
* // }
1359-
* },
1360-
* });
1361-
* console.log(res.data);
1362-
*
1363-
* // Example response
1364-
* // {
1365-
* // "done": false,
1366-
* // "error": {},
1367-
* // "metadata": {},
1368-
* // "name": "my_name",
1369-
* // "response": {}
1370-
* // }
1371-
* }
1372-
*
1373-
* main().catch(e => {
1374-
* console.error(e);
1375-
* throw e;
1376-
* });
1377-
*
1378-
* ```
1379-
*
1380-
* @param params - Parameters for request
1381-
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
1382-
* @param callback - Optional callback that handles the response.
1383-
* @returns A promise if used with async/await, or void if used with a callback.
1384-
*/
1385-
submit(
1386-
params: Params$Resource$Projects$Uris$Submit,
1387-
options: StreamMethodOptions
1388-
): GaxiosPromise<Readable>;
1389-
submit(
1390-
params?: Params$Resource$Projects$Uris$Submit,
1391-
options?: MethodOptions
1392-
): GaxiosPromise<Schema$GoogleLongrunningOperation>;
1393-
submit(
1394-
params: Params$Resource$Projects$Uris$Submit,
1395-
options: StreamMethodOptions | BodyResponseCallback<Readable>,
1396-
callback: BodyResponseCallback<Readable>
1397-
): void;
1398-
submit(
1399-
params: Params$Resource$Projects$Uris$Submit,
1400-
options:
1401-
| MethodOptions
1402-
| BodyResponseCallback<Schema$GoogleLongrunningOperation>,
1403-
callback: BodyResponseCallback<Schema$GoogleLongrunningOperation>
1404-
): void;
1405-
submit(
1406-
params: Params$Resource$Projects$Uris$Submit,
1407-
callback: BodyResponseCallback<Schema$GoogleLongrunningOperation>
1408-
): void;
1409-
submit(
1410-
callback: BodyResponseCallback<Schema$GoogleLongrunningOperation>
1411-
): void;
1412-
submit(
1413-
paramsOrCallback?:
1414-
| Params$Resource$Projects$Uris$Submit
1415-
| BodyResponseCallback<Schema$GoogleLongrunningOperation>
1416-
| BodyResponseCallback<Readable>,
1417-
optionsOrCallback?:
1418-
| MethodOptions
1419-
| StreamMethodOptions
1420-
| BodyResponseCallback<Schema$GoogleLongrunningOperation>
1421-
| BodyResponseCallback<Readable>,
1422-
callback?:
1423-
| BodyResponseCallback<Schema$GoogleLongrunningOperation>
1424-
| BodyResponseCallback<Readable>
1425-
):
1426-
| void
1427-
| GaxiosPromise<Schema$GoogleLongrunningOperation>
1428-
| GaxiosPromise<Readable> {
1429-
let params = (paramsOrCallback ||
1430-
{}) as Params$Resource$Projects$Uris$Submit;
1431-
let options = (optionsOrCallback || {}) as MethodOptions;
1432-
1433-
if (typeof paramsOrCallback === 'function') {
1434-
callback = paramsOrCallback;
1435-
params = {} as Params$Resource$Projects$Uris$Submit;
1436-
options = {};
1437-
}
1438-
1439-
if (typeof optionsOrCallback === 'function') {
1440-
callback = optionsOrCallback;
1441-
options = {};
1442-
}
1443-
1444-
const rootUrl = options.rootUrl || 'https://webrisk.googleapis.com/';
1445-
const parameters = {
1446-
options: Object.assign(
1447-
{
1448-
url: (rootUrl + '/v1/{+parent}/uris:submit').replace(
1449-
/([^:]\/)\/+/g,
1450-
'$1'
1451-
),
1452-
method: 'POST',
1453-
},
1454-
options
1455-
),
1456-
params,
1457-
requiredParams: ['parent'],
1458-
pathParams: ['parent'],
1459-
context: this.context,
1460-
};
1461-
if (callback) {
1462-
createAPIRequest<Schema$GoogleLongrunningOperation>(
1463-
parameters,
1464-
callback as BodyResponseCallback<unknown>
1465-
);
1466-
} else {
1467-
return createAPIRequest<Schema$GoogleLongrunningOperation>(parameters);
1468-
}
1469-
}
1470-
}
1471-
1472-
export interface Params$Resource$Projects$Uris$Submit
1473-
extends StandardParameters {
1474-
/**
1475-
* Required. The name of the project that is making the submission. This string is in the format "projects/{project_number\}".
1476-
*/
1477-
parent?: string;
1478-
1479-
/**
1480-
* Request body metadata
1481-
*/
1482-
requestBody?: Schema$GoogleCloudWebriskV1SubmitUriRequest;
1483-
}
1484-
14851283
export class Resource$Threatlists {
14861284
context: APIRequestContext;
14871285
constructor(context: APIRequestContext) {

0 commit comments

Comments
 (0)