Method: accounts.repos.scans.generate
Stay organized with collections
Save and categorize content based on your preferences.
Uploads the results of local Code Compliance analysis and generates a scan of privacy issues. Returns a google.longrunning.Operation
containing analysis and findings.
HTTP request
POST https://checks.googleapis.com/v1alpha/{parent=accounts/*/repos/*}/scans:generate
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
parent |
string
Required. Resource name of the repo. Example: accounts/123/repos/456
|
Request body
The request body contains data with the following structure:
JSON representation |
{
"cliAnalysis": {
object (CliAnalysis )
},
"localScanPath": string,
"cliVersion": string,
"scmMetadata": {
object (ScmMetadata )
}
} |
Fields |
cliAnalysis |
object (CliAnalysis )
Required. CLI analysis results.
|
localScanPath |
string
Required. Local scan path.
|
cliVersion |
string
Required. CLI version.
|
scmMetadata |
object (ScmMetadata )
Required. SCM metadata.
|
Response body
If successful, the response body contains an instance of Operation
.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/checks
For more information, see the OAuth 2.0 Overview.
CliAnalysis
The results of a Code Compliance CLI analysis.
JSON representation |
{
"sources": [
{
object (Source )
}
],
"codeScans": [
{
object (CodeScan )
}
]
} |
Fields |
sources[] |
object (Source )
Optional. Data sources detected in the scan.
|
codeScans[] |
object (CodeScan )
Optional. Requested code scans resulting from preliminary CLI analysis.
|
CodeScan
A requested analysis of source code. Contains the source code and processing state.
Fields |
sourceCode |
object (SourceCode )
Required. Source code to analyze.
|
dataTypeClassifications[] |
object (DataTypeClassification )
Optional. Data type classification requests.
|
SourceCode
Contains source code from a repo.
JSON representation |
{
"code": string,
"path": string,
"startLine": integer,
"endLine": integer
} |
Fields |
code |
string
Required. Source code.
|
path |
string
Required. Path of the file.
|
startLine |
integer
Required. Start line number (1-based).
|
endLine |
integer
Required. End line number (1-based).
|
DataTypeClassification
A request to classify data types.
JSON representation |
{
"dataType": enum (DataType ),
"lineNumber": integer
} |
Fields |
dataType |
enum (DataType )
Required. Candidate data type.
|
lineNumber |
integer
Required. Line number (1-based).
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-20 UTC."],[[["\u003cp\u003eUploads local Code Compliance analysis results and initiates a privacy issue scan, returning an Operation containing analysis and findings.\u003c/p\u003e\n"],["\u003cp\u003eRequires a POST request to the specified endpoint with path parameters, request body including CLI analysis results, local scan path, CLI version, and SCM metadata.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes OAuth scope \u003ccode\u003ehttps://www.googleapis.com/auth/checks\u003c/code\u003e for authorization.\u003c/p\u003e\n"],["\u003cp\u003eThe response body contains an Operation object upon successful completion.\u003c/p\u003e\n"],["\u003cp\u003eIncludes definitions for CliAnalysis, CodeScan, SourceCode, and DataTypeClassification objects with their respective JSON representations and field descriptions.\u003c/p\u003e\n"]]],[],null,["# Method: accounts.repos.scans.generate\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [CliAnalysis](#CliAnalysis)\n - [JSON representation](#CliAnalysis.SCHEMA_REPRESENTATION)\n- [CodeScan](#CodeScan)\n - [JSON representation](#CodeScan.SCHEMA_REPRESENTATION)\n- [SourceCode](#SourceCode)\n - [JSON representation](#SourceCode.SCHEMA_REPRESENTATION)\n- [DataTypeClassification](#DataTypeClassification)\n - [JSON representation](#DataTypeClassification.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nUploads the results of local Code Compliance analysis and generates a scan of privacy issues. Returns a [google.longrunning.Operation](/checks/reference/rest/v1alpha/accounts.apps.operations#Operation) containing analysis and findings.\n\n### HTTP request\n\n`POST https://checks.googleapis.com/v1alpha/{parent=accounts/*/repos/*}/scans:generate`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|---------------------------------------------------------------------------------|\n| `parent` | `string` Required. Resource name of the repo. Example: `accounts/123/repos/456` |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"cliAnalysis\": { object (/checks/reference/rest/v1alpha/accounts.repos.scans/generate#CliAnalysis) }, \"localScanPath\": string, \"cliVersion\": string, \"scmMetadata\": { object (/checks/reference/rest/v1alpha/accounts.repos.scans#ScmMetadata) } } ``` |\n\n| Fields ||\n|---------------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| `cli``Analysis` | `object (`[CliAnalysis](/checks/reference/rest/v1alpha/accounts.repos.scans/generate#CliAnalysis)`)` Required. CLI analysis results. |\n| `local``Scan``Path` | `string` Required. Local scan path. |\n| `cli``Version` | `string` Required. CLI version. |\n| `scm``Metadata` | `object (`[ScmMetadata](/checks/reference/rest/v1alpha/accounts.repos.scans#ScmMetadata)`)` Required. SCM metadata. |\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/checks/reference/rest/v1alpha/accounts.apps.operations#Operation).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/checks`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2).\n\nCliAnalysis\n-----------\n\nThe results of a Code Compliance CLI analysis.\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"sources\": [ { object (/checks/reference/rest/v1alpha/accounts.repos.scans#Source) } ], \"codeScans\": [ { object (/checks/reference/rest/v1alpha/accounts.repos.scans/generate#CodeScan) } ] } ``` |\n\n| Fields ||\n|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `sources[]` | `object (`[Source](/checks/reference/rest/v1alpha/accounts.repos.scans#Source)`)` Optional. Data sources detected in the scan. |\n| `code``Scans[]` | `object (`[CodeScan](/checks/reference/rest/v1alpha/accounts.repos.scans/generate#CodeScan)`)` Optional. Requested code scans resulting from preliminary CLI analysis. |\n\nCodeScan\n--------\n\nA requested analysis of source code. Contains the source code and processing state.\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"sourceCode\": { object (/checks/reference/rest/v1alpha/accounts.repos.scans/generate#SourceCode) }, \"dataTypeClassifications\": [ { object (/checks/reference/rest/v1alpha/accounts.repos.scans/generate#DataTypeClassification) } ] } ``` |\n\n| Fields ||\n|---------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `source``Code` | `object (`[SourceCode](/checks/reference/rest/v1alpha/accounts.repos.scans/generate#SourceCode)`)` Required. Source code to analyze. |\n| `data``Type``Classifications[]` | `object (`[DataTypeClassification](/checks/reference/rest/v1alpha/accounts.repos.scans/generate#DataTypeClassification)`)` Optional. Data type classification requests. |\n\nSourceCode\n----------\n\nContains source code from a repo.\n\n| JSON representation |\n|--------------------------------------------------------------------------------------|\n| ``` { \"code\": string, \"path\": string, \"startLine\": integer, \"endLine\": integer } ``` |\n\n| Fields ||\n|---------------|--------------------------------------------------|\n| `code` | `string` Required. Source code. |\n| `path` | `string` Required. Path of the file. |\n| `start``Line` | `integer` Required. Start line number (1-based). |\n| `end``Line` | `integer` Required. End line number (1-based). |\n\nDataTypeClassification\n----------------------\n\nA request to classify data types.\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------|\n| ``` { \"dataType\": enum (/checks/reference/rest/v1alpha/accounts.repos.scans#DataType), \"lineNumber\": integer } ``` |\n\n| Fields ||\n|----------------|--------------------------------------------------------------------------------------------------------------------|\n| `data``Type` | `enum (`[DataType](/checks/reference/rest/v1alpha/accounts.repos.scans#DataType)`)` Required. Candidate data type. |\n| `line``Number` | `integer` Required. Line number (1-based). |"]]