RepoCodeRule
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 |
create |
Success |
GET |
/api/v1/organizations/{org_slug}/repos/{repo_slug}/code_rules |
list |
Code rules for the Repo |
GET |
/api/v1/organizations/{org_slug}/repos/{repo_slug}/code_rules/{rule} |
load |
The rule after the operation |
PATCH |
/api/v1/organizations/{org_slug}/repos/{repo_slug}/code_rules/{rule} |
patch |
The rule after the operation |
DELETE |
/api/v1/organizations/{org_slug}/repos/{repo_slug}/code_rules/{rule} |
remove |
The deleted rule identity and its canonical Repo |
DELETE |
/api/v1/organizations/{org_slug}/repos/{repo_slug}/code_rules/{rule}/activation |
remove |
The rule after the operation |
PUT |
/api/v1/organizations/{org_slug}/repos/{repo_slug}/code_rules/{rule} |
update |
The rule after the operation |
PUT |
/api/v1/organizations/{org_slug}/repos/{repo_slug}/code_rules/{rule}/activation |
update |
The rule after the operation |
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:
repo_code_rules, err := client.RepoCodeRule(nil).List(map[string]any{"organization_id": "example", "repo_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(repo_code_rules)
repo_code_rule, err := client.RepoCodeRule(nil).Load(map[string]any{"id": "example_id", "organization_id": "example", "repo_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(repo_code_rule)
created, err := client.RepoCodeRule(nil).Create(map[string]any{"organization_id": "example", "repo_id": "example", "definition": map[string]any{}}, nil)
if err != nil {
panic(err)
}
fmt.Println(created)
updated, err := client.RepoCodeRule(nil).Update(map[string]any{"id": "example_id", "organization_id": "example", "repo_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(updated)
patched, err := client.RepoCodeRule(nil).Patch(map[string]any{"id": "example_id", "organization_id": "example", "repo_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(patched)
removed, err := client.RepoCodeRule(nil).Remove(map[string]any{"id": "example_id", "organization_id": "example", "repo_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(removed)
Lua
Construct client as shown in the Lua setup, then call the operations:
local repo_code_rules, err = client:RepoCodeRule():list({ organization_id = "example", repo_id = "example" })
local repo_code_rule, err = client:RepoCodeRule():load({ id = "example_id", organization_id = "example", repo_id = "example" })
local created, err = client:RepoCodeRule():create({ organization_id = "example", repo_id = "example", definition = {} })
local updated, err = client:RepoCodeRule():update({ id = "example_id", organization_id = "example", repo_id = "example" })
local patched, err = client:RepoCodeRule():patch({ id = "example_id", organization_id = "example", repo_id = "example" })
local removed, err = client:RepoCodeRule():remove({ id = "example_id", organization_id = "example", repo_id = "example" })
PHP
Construct client as shown in the PHP setup, then call the operations:
$repo_code_rules = $client->RepoCodeRule()->list(["organization_id" => "example", "repo_id" => "example"]);
$repo_code_rule = $client->RepoCodeRule()->load(["id" => "example_id", "organization_id" => "example", "repo_id" => "example"]);
$created = $client->RepoCodeRule()->create(["organization_id" => "example", "repo_id" => "example", "definition" => []]);
$updated = $client->RepoCodeRule()->update(["id" => "example_id", "organization_id" => "example", "repo_id" => "example"]);
$patched = $client->RepoCodeRule()->patch(["id" => "example_id", "organization_id" => "example", "repo_id" => "example"]);
$client->RepoCodeRule()->remove(["id" => "example_id", "organization_id" => "example", "repo_id" => "example"]);
Python
Construct client as shown in the Python setup, then call the operations:
repo_code_rules = client.RepoCodeRule().list({"organization_id": "example", "repo_id": "example"})
repo_code_rule = client.RepoCodeRule().load({"id": "example_id", "organization_id": "example", "repo_id": "example"})
created = client.RepoCodeRule().create({ "organization_id": "example", "repo_id": "example", "definition": {} })
updated = client.RepoCodeRule().update({"id": "example_id", "organization_id": "example", "repo_id": "example"})
patched = client.RepoCodeRule().patch({"id": "example_id", "organization_id": "example", "repo_id": "example"})
client.RepoCodeRule().remove({"id": "example_id", "organization_id": "example", "repo_id": "example"})
Ruby
Construct client as shown in the Ruby setup, then call the operations:
repo_code_rules = client.RepoCodeRule.list({ "organization_id" => "example", "repo_id" => "example" })
repo_code_rule = client.RepoCodeRule.load({ "id" => "example_id", "organization_id" => "example", "repo_id" => "example" })
created = client.RepoCodeRule.create({ "organization_id" => "example", "repo_id" => "example", "definition" => {} })
updated = client.RepoCodeRule.update({ "id" => "example_id", "organization_id" => "example", "repo_id" => "example" })
patched = client.RepoCodeRule.patch({ "id" => "example_id", "organization_id" => "example", "repo_id" => "example" })
client.RepoCodeRule.remove({ "id" => "example_id", "organization_id" => "example", "repo_id" => "example" })
TypeScript
Construct client as shown in the TypeScript setup, then call the operations:
const repo_code_rules = await client.RepoCodeRule().list({ organization_id: "example", repo_id: "example" })
const repo_code_rule = await client.RepoCodeRule().load({ id: "example_id", organization_id: "example", repo_id: "example" })
const created = await client.RepoCodeRule().create({ organization_id: "example", repo_id: "example", definition: {} })
const updated = await client.RepoCodeRule().update({ id: "example_id", organization_id: "example", repo_id: "example" })
const patched = await client.RepoCodeRule().patch({ id: "example_id", organization_id: "example", repo_id: "example" })
await client.RepoCodeRule().remove({ id: "example_id", organization_id: "example", repo_id: "example" })
Fields
| Field | Type | Required | Description |
|---|---|---|---|
active_revision_number |
one,integer,null |
Yes | Active Revision Number |
capabilities |
object |
Yes | Capabilities |
code_rule |
any |
Yes | Code Rule |
created_at |
string |
Yes | Created At |
definition |
object |
Yes | Definition |
draft_pending |
boolean |
Yes | The latest revision is not the active one |
enabled |
boolean |
Yes | Enabled |
expected_version |
integer |
Yes | Expected Version |
id |
string |
Yes | Id |
latest_revision_number |
integer |
Yes | Latest Revision Number |
name |
string |
Yes | Name of the latest revision |
repository |
object |
Yes | Repository |
scope |
array |
Yes | Scope |
slug |
string |
Yes | Slug |
state_version |
integer |
Yes | Send back as expected_version on every mutation |
updated_at |
string |
Yes | Updated At |
web_url |
string |
Yes | Web Url |
create
POST /api/v1/organizations/{org_slug}/repos/{repo_slug}/code_rules
Operation ID: post_api_v1_organizations_org_slug_repos_repo_slug_code_rules.
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 |
|---|---|---|---|
definition |
object |
Yes | |
definition.description |
string |
No | |
definition.name |
string |
Yes | |
definition.question |
string |
Yes | |
definition.schema_version |
enum: 1 |
No | |
definition.scope |
array of string |
Yes | |
definition.slug |
string |
Yes | |
definition.source |
string |
No |
Responses
200: Success
application/json
The response is object.
201: The rule after the operation
application/json
| Property | Type | Required | Description |
|---|---|---|---|
capabilities |
object |
Yes | |
capabilities.can_manage |
boolean |
Yes | |
code_rule |
object and object |
Yes | |
repository |
object |
Yes | |
repository.backing_repository_id |
string |
Yes | |
repository.organization_slug |
string |
Yes | |
repository.owner_id |
string |
Yes | |
repository.owner_type |
enum: repository |
Yes | |
repository.root_path |
string |
Yes | Owner root relative to the backing repository; "." for a whole repository |
repository.slug |
string |
Yes | Canonical Repo slug |
repository.web_url |
string |
Yes |
401: Authentication required
403: Readable Repo but the caller may not manage rules
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
404: Repo or rule not accessible
409: Stale expected_version or duplicate slug
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
413: Request body over the documented limit
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
422: Invalid definition, unknown revision or rule limit
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
502: Bad gateway
list
GET /api/v1/organizations/{org_slug}/repos/{repo_slug}/code_rules
Operation ID: api_v1_code_rules.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
org_slug |
path |
string |
Yes | |
repo_slug |
path |
string |
Yes | |
rule |
query |
string |
No | Slug or code_rule ID of one rule to expand inline as selected_rule |
Responses
200: Code rules for the Repo
application/json
| Property | Type | Required | Description |
|---|---|---|---|
capabilities |
object |
Yes | |
capabilities.can_manage |
boolean |
Yes | |
code_rules |
array of object |
Yes | |
code_rules[].active_revision_number |
integer |
Yes | |
code_rules[].created_at |
string (date-time) |
Yes | |
code_rules[].draft_pending |
boolean |
Yes | The latest revision is not the active one |
code_rules[].enabled |
boolean |
Yes | |
code_rules[].id |
string |
Yes | |
code_rules[].latest_revision_number |
integer |
Yes | |
code_rules[].name |
string |
Yes | Name of the latest revision |
code_rules[].scope |
array of string |
Yes | |
code_rules[].slug |
string |
Yes | |
code_rules[].state_version |
integer |
Yes | Send back as expected_version on every mutation |
code_rules[].updated_at |
string (date-time) |
Yes | |
code_rules[].web_url |
string |
Yes | |
limits |
object |
Yes | |
limits.description_bytes |
integer |
Yes | |
limits.glob_bytes |
integer |
Yes | |
limits.name_length |
integer |
Yes | |
limits.question_bytes |
integer |
Yes | |
limits.request_bytes |
integer |
Yes | |
limits.rules_per_repository |
integer |
Yes | |
limits.scope_globs |
integer |
Yes | |
limits.slug_length |
integer |
Yes | |
limits.source_bytes |
integer |
Yes | |
repository |
object |
Yes | |
repository.backing_repository_id |
string |
Yes | |
repository.organization_slug |
string |
Yes | |
repository.owner_id |
string |
Yes | |
repository.owner_type |
enum: repository |
Yes | |
repository.root_path |
string |
Yes | Owner root relative to the backing repository; "." for a whole repository |
repository.slug |
string |
Yes | Canonical Repo slug |
repository.web_url |
string |
Yes | |
selected_rule |
object and object |
Yes | The requested rule expanded inline, or null when it does not exist in this Repo |
selected_rule_reference |
string |
Yes | The rule query parameter as received, when one was given |
401: Authentication required
403: Forbidden
404: Repo not accessible
422: Unprocessable entity
502: Bad gateway
load
GET /api/v1/organizations/{org_slug}/repos/{repo_slug}/code_rules/{rule}
Operation ID: api_v1_code_rule.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
org_slug |
path |
string |
Yes | |
repo_slug |
path |
string |
Yes | |
rule |
path |
string |
Yes |
Responses
200: The rule after the operation
application/json
| Property | Type | Required | Description |
|---|---|---|---|
capabilities |
object |
Yes | |
capabilities.can_manage |
boolean |
Yes | |
code_rule |
object and object |
Yes | |
repository |
object |
Yes | |
repository.backing_repository_id |
string |
Yes | |
repository.organization_slug |
string |
Yes | |
repository.owner_id |
string |
Yes | |
repository.owner_type |
enum: repository |
Yes | |
repository.root_path |
string |
Yes | Owner root relative to the backing repository; "." for a whole repository |
repository.slug |
string |
Yes | Canonical Repo slug |
repository.web_url |
string |
Yes |
401: Authentication required
403: Forbidden
404: Repo or rule not accessible
422: Unprocessable entity
502: Bad gateway
patch
PATCH /api/v1/organizations/{org_slug}/repos/{repo_slug}/code_rules/{rule}
Operation ID: patch_api_v1_organizations_org_slug_repos_repo_slug_code_rules_rule_.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
org_slug |
path |
string |
Yes | |
repo_slug |
path |
string |
Yes | |
rule |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
definition |
object |
Yes | |
definition.description |
string |
No | |
definition.name |
string |
Yes | |
definition.question |
string |
Yes | |
definition.schema_version |
enum: 1 |
No | |
definition.scope |
array of string |
Yes | |
definition.slug |
string |
Yes | |
definition.source |
string |
No | |
expected_version |
integer |
Yes |
Responses
200: The rule after the operation
application/json
| Property | Type | Required | Description |
|---|---|---|---|
capabilities |
object |
Yes | |
capabilities.can_manage |
boolean |
Yes | |
code_rule |
object and object |
Yes | |
repository |
object |
Yes | |
repository.backing_repository_id |
string |
Yes | |
repository.organization_slug |
string |
Yes | |
repository.owner_id |
string |
Yes | |
repository.owner_type |
enum: repository |
Yes | |
repository.root_path |
string |
Yes | Owner root relative to the backing repository; "." for a whole repository |
repository.slug |
string |
Yes | Canonical Repo slug |
repository.web_url |
string |
Yes |
401: Authentication required
403: Readable Repo but the caller may not manage rules
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
404: Repo or rule not accessible
409: Stale expected_version or duplicate slug
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
413: Request body over the documented limit
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
422: Invalid definition, unknown revision or rule limit
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
502: Bad gateway
remove
DELETE /api/v1/organizations/{org_slug}/repos/{repo_slug}/code_rules/{rule}
Operation ID: delete_api_v1_organizations_org_slug_repos_repo_slug_code_rules_rule_.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
org_slug |
path |
string |
Yes | |
repo_slug |
path |
string |
Yes | |
rule |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
expected_version |
integer |
Yes |
Responses
200: The deleted rule identity and its canonical Repo
application/json
| Property | Type | Required | Description |
|---|---|---|---|
capabilities |
object |
Yes | |
capabilities.can_manage |
boolean |
Yes | |
deleted |
object |
Yes | |
deleted.id |
string |
Yes | |
deleted.slug |
string |
Yes | |
repository |
object |
Yes | |
repository.backing_repository_id |
string |
Yes | |
repository.organization_slug |
string |
Yes | |
repository.owner_id |
string |
Yes | |
repository.owner_type |
enum: repository |
Yes | |
repository.root_path |
string |
Yes | Owner root relative to the backing repository; "." for a whole repository |
repository.slug |
string |
Yes | Canonical Repo slug |
repository.web_url |
string |
Yes |
401: Authentication required
403: Readable Repo but the caller may not manage rules
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
404: Repo or rule not accessible
409: Stale expected_version or duplicate slug
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
422: Invalid definition, unknown revision or rule limit
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
502: Bad gateway
DELETE /api/v1/organizations/{org_slug}/repos/{repo_slug}/code_rules/{rule}/activation
Operation ID: delete_api_v1_organizations_org_slug_repos_repo_slug_code_rules_rule_activation.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
org_slug |
path |
string |
Yes | |
repo_slug |
path |
string |
Yes | |
rule |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
expected_version |
integer |
Yes |
Responses
200: The rule after the operation
application/json
| Property | Type | Required | Description |
|---|---|---|---|
capabilities |
object |
Yes | |
capabilities.can_manage |
boolean |
Yes | |
code_rule |
object and object |
Yes | |
repository |
object |
Yes | |
repository.backing_repository_id |
string |
Yes | |
repository.organization_slug |
string |
Yes | |
repository.owner_id |
string |
Yes | |
repository.owner_type |
enum: repository |
Yes | |
repository.root_path |
string |
Yes | Owner root relative to the backing repository; "." for a whole repository |
repository.slug |
string |
Yes | Canonical Repo slug |
repository.web_url |
string |
Yes |
401: Authentication required
403: Readable Repo but the caller may not manage rules
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
404: Repo or rule not accessible
409: Stale expected_version or duplicate slug
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
422: Invalid definition, unknown revision or rule limit
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
502: Bad gateway
update
PUT /api/v1/organizations/{org_slug}/repos/{repo_slug}/code_rules/{rule}
Operation ID: put_api_v1_organizations_org_slug_repos_repo_slug_code_rules_rule_.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
org_slug |
path |
string |
Yes | |
repo_slug |
path |
string |
Yes | |
rule |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
definition |
object |
Yes | |
definition.description |
string |
No | |
definition.name |
string |
Yes | |
definition.question |
string |
Yes | |
definition.schema_version |
enum: 1 |
No | |
definition.scope |
array of string |
Yes | |
definition.slug |
string |
Yes | |
definition.source |
string |
No | |
expected_version |
integer |
Yes |
Responses
200: The rule after the operation
application/json
| Property | Type | Required | Description |
|---|---|---|---|
capabilities |
object |
Yes | |
capabilities.can_manage |
boolean |
Yes | |
code_rule |
object and object |
Yes | |
repository |
object |
Yes | |
repository.backing_repository_id |
string |
Yes | |
repository.organization_slug |
string |
Yes | |
repository.owner_id |
string |
Yes | |
repository.owner_type |
enum: repository |
Yes | |
repository.root_path |
string |
Yes | Owner root relative to the backing repository; "." for a whole repository |
repository.slug |
string |
Yes | Canonical Repo slug |
repository.web_url |
string |
Yes |
401: Authentication required
403: Readable Repo but the caller may not manage rules
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
404: Repo or rule not accessible
409: Stale expected_version or duplicate slug
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
422: Invalid definition, unknown revision or rule limit
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
502: Bad gateway
PUT /api/v1/organizations/{org_slug}/repos/{repo_slug}/code_rules/{rule}/activation
Operation ID: activation_api_v1_code_rule.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
org_slug |
path |
string |
Yes | |
repo_slug |
path |
string |
Yes | |
rule |
path |
string |
Yes |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
expected_version |
integer |
Yes | |
revision |
integer |
Yes |
Responses
200: The rule after the operation
application/json
| Property | Type | Required | Description |
|---|---|---|---|
capabilities |
object |
Yes | |
capabilities.can_manage |
boolean |
Yes | |
code_rule |
object and object |
Yes | |
repository |
object |
Yes | |
repository.backing_repository_id |
string |
Yes | |
repository.organization_slug |
string |
Yes | |
repository.owner_id |
string |
Yes | |
repository.owner_type |
enum: repository |
Yes | |
repository.root_path |
string |
Yes | Owner root relative to the backing repository; "." for a whole repository |
repository.slug |
string |
Yes | Canonical Repo slug |
repository.web_url |
string |
Yes |
401: Authentication required
403: Readable Repo but the caller may not manage rules
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
404: Repo or rule not accessible
409: Stale expected_version or duplicate slug
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |
422: Invalid definition, unknown revision or rule limit
application/json
| Property | Type | Required | Description |
|---|---|---|---|
code |
enum: forbidden, stale_version, duplicate_slug, limit_exceeded, revision_not_found, invalid_definition, ... |
No | |
current_version |
integer |
No | The rule's current state_version on a stale_version conflict |
details |
array of string |
No | |
error |
string |
Yes |