CodeRuleEvaluation
Operations
Every route this entity exposes. Each route links to its own reference on this page.
| Method | Route | SDK operation | Returns |
|---|---|---|---|
POST |
/api/v1/organizations/{org_slug}/repos/{repo_slug}/code_rules/evaluations |
create |
Advisory evaluation, including explicit incomplete coverage when disabled or unavailable |
Examples
One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.
Golang
Construct client as shown in the Golang setup, then call the operations:
created, err := client.CodeRuleEvaluation(nil).Create(map[string]any{"organization_id": "example", "repo_id": "example", "diff": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(created)
Lua
Construct client as shown in the Lua setup, then call the operations:
local created, err = client:CodeRuleEvaluation():create({ organization_id = "example", repo_id = "example", diff = "example" })
PHP
Construct client as shown in the PHP setup, then call the operations:
$created = $client->CodeRuleEvaluation()->create(["organization_id" => "example", "repo_id" => "example", "diff" => "example"]);
Python
Construct client as shown in the Python setup, then call the operations:
created = client.CodeRuleEvaluation().create({ "organization_id": "example", "repo_id": "example", "diff": "example" })
Ruby
Construct client as shown in the Ruby setup, then call the operations:
created = client.CodeRuleEvaluation.create({ "organization_id" => "example", "repo_id" => "example", "diff" => "example" })
TypeScript
Construct client as shown in the TypeScript setup, then call the operations:
const created = await client.CodeRuleEvaluation().create({ organization_id: "example", repo_id: "example", diff: "example" })
Fields
| Field | Type | Required | Description |
|---|---|---|---|
advisory |
boolean |
Yes | Advisory |
coverage |
object |
Yes | Coverage |
diff |
string |
Yes | UTF-8 complete unified patch using a/ old and b/ new prefixes; at most 1 MiB |
duration_ms |
integer |
Yes | Duration Ms |
evaluator_version |
string |
No | Evaluator Version |
input_digest |
one,string,null |
No | Input Digest |
limits |
object |
No | Limits |
model |
string |
No | Model |
requests |
object |
Yes | Requests |
schema_version |
integer |
Yes | Schema Version |
snapshot_digest |
one,string,null |
No | Snapshot Digest |
unchecked |
array |
Yes | Unchecked |
verdicts |
array |
Yes | Verdicts |
create
POST /api/v1/organizations/{org_slug}/repos/{repo_slug}/code_rules/evaluations
Operation ID: api_v1_code_rules_evaluations.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
org_slug |
path |
string |
Yes | |
repo_slug |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
diff |
string |
Yes | UTF-8 complete unified patch using a/ old and b/ new prefixes; at most 1 MiB |
Responses
200: Advisory evaluation, including explicit incomplete coverage when disabled or unavailable
application/json
| Property | Type | Required | Description |
|---|---|---|---|
advisory |
enum: true |
Yes | |
coverage |
object |
Yes | |
coverage.complete |
boolean |
Yes | |
coverage.evaluated |
integer |
Yes | |
coverage.unchecked |
integer |
Yes | |
duration_ms |
integer |
Yes | |
evaluator_version |
string |
No | |
input_digest |
string |
No | |
limits |
object |
No | |
model |
string |
No | |
requests |
object |
Yes | |
requests.attempted |
integer |
Yes | |
requests.bytes |
integer |
Yes | |
requests.completed |
integer |
Yes | |
schema_version |
enum: 1 |
Yes | |
snapshot_digest |
string |
No | |
unchecked |
array of object |
Yes | |
unchecked[].code |
string |
Yes | |
unchecked[].owner |
object |
No | |
unchecked[].owner.id |
string |
Yes | |
unchecked[].owner.root_path |
string |
Yes | |
unchecked[].owner.slug |
string |
Yes | Repository slug for owner-targeted code-rules show; virtual owner in Home mode |
unchecked[].owner.type |
string |
Yes | |
verdicts |
array of object |
Yes | |
verdicts[].owner |
object |
No | |
verdicts[].owner.id |
string |
Yes | |
verdicts[].owner.root_path |
string |
Yes | |
verdicts[].owner.slug |
string |
Yes | Repository slug for owner-targeted code-rules show; virtual owner in Home mode |
verdicts[].owner.type |
string |
Yes |