@maxim_mazurok/gapi.client.checks-v1alpha
v0.0.20241120
Published
TypeScript typings for Checks API v1alpha
Downloads
5,875
Readme
TypeScript typings for Checks API v1alpha
The Checks API contains powerful and easy-to-use privacy and compliance APIs that interact with the Checks product and its underlying technology. For detailed description please check documentation.
Installing
Install typings for Checks API:
npm install @types/gapi.client.checks-v1alpha --save-dev
Usage
You need to initialize Google API client in your code:
gapi.load('client', () => {
// now we can use gapi.client
// ...
});
Then load api client wrapper:
gapi.client.load(
'https://checks.googleapis.com/$discovery/rest?version=v1alpha',
() => {
// now we can use:
// gapi.client.checks
}
);
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
gapi.client.load('checks', 'v1alpha', () => {
// now we can use:
// gapi.client.checks
});
After that you can use Checks API resources:
/*
Analyze a piece of content with the provided set of policies.
*/
await gapi.client.checks.aisafety.classifyContent({ });
/*
Analyzes the uploaded app bundle and returns a google.longrunning.Operation containing the generated Report. ## Example (upload only) Send a regular POST request with the header `X-Goog-Upload-Protocol: raw`. ``` POST https://checks.googleapis.com/upload/v1alpha/{parent=accounts/*/apps/*}/reports:analyzeUpload HTTP/1.1 X-Goog-Upload-Protocol: raw Content-Length: Content-Type: application/octet-stream ``` ## Example (upload with metadata) Send a multipart POST request where the first body part contains the metadata JSON and the second body part contains the binary upload. Include the header `X-Goog-Upload-Protocol: multipart`. ``` POST https://checks.googleapis.com/upload/v1alpha/{parent=accounts/*/apps/*}/reports:analyzeUpload HTTP/1.1 X-Goog-Upload-Protocol: multipart Content-Length: ? Content-Type: multipart/related; boundary=BOUNDARY --BOUNDARY Content-Type: application/json {"code_reference_id":"db5bcc20f94055fb5bc08cbb9b0e7a5530308786"} --BOUNDARY --BOUNDARY-- ``` *Note:* Metadata-only requests are not supported.
*/
await gapi.client.checks.media.upload({ parent: "parent", });