Review-Abrechnungsregel für ein Repository festlegen
curl --request PUT \
--url https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bill_to": {
"id": "<string>"
},
"repository": "<string>"
}
'import requests
url = "https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules"
payload = {
"bill_to": { "id": "<string>" },
"repository": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({bill_to: {id: '<string>'}, repository: '<string>'})
};
fetch('https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bill_to' => [
'id' => '<string>'
],
'repository' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules"
payload := strings.NewReader("{\n \"bill_to\": {\n \"id\": \"<string>\"\n },\n \"repository\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bill_to\": {\n \"id\": \"<string>\"\n },\n \"repository\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bill_to\": {\n \"id\": \"<string>\"\n },\n \"repository\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"bill_to": {
"id": "<string>",
"type": "organization"
},
"created_at": 123,
"id": "<string>",
"repository": "<string>",
"updated_at": 123
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}Abrechnungsregeln für Reviews (Enterprise) [Beta]
Review-Abrechnungsregel für ein Repository festlegen
Den künftigen Verbrauch durch Reviews in einem Repository einer Organisation oder einem Budget zuordnen.
PUT
/
v3beta1
/
enterprise
/
organizations
/
{org_id}
/
review-settings
/
repo-billing-rules
Review-Abrechnungsregel für ein Repository festlegen
curl --request PUT \
--url https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bill_to": {
"id": "<string>"
},
"repository": "<string>"
}
'import requests
url = "https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules"
payload = {
"bill_to": { "id": "<string>" },
"repository": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({bill_to: {id: '<string>'}, repository: '<string>'})
};
fetch('https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bill_to' => [
'id' => '<string>'
],
'repository' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules"
payload := strings.NewReader("{\n \"bill_to\": {\n \"id\": \"<string>\"\n },\n \"repository\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bill_to\": {\n \"id\": \"<string>\"\n },\n \"repository\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devin.ai/v3beta1/enterprise/organizations/{org_id}/review-settings/repo-billing-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bill_to\": {\n \"id\": \"<string>\"\n },\n \"repository\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"bill_to": {
"id": "<string>",
"type": "organization"
},
"created_at": 123,
"id": "<string>",
"repository": "<string>",
"updated_at": 123
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}{
"status": 123,
"title": "<string>",
"detail": "<string>",
"error_code": "<string>",
"errors": [
{}
],
"instance": "<string>",
"type": "about:blank"
}Erstellt oder ersetzt die Abrechnungsregel für ein bestimmtes Repository, sodass die künftige Nutzung von Devin Review in diesem Repository einer Organisation oder einem Budget in Rechnung gestellt wird. Vorhandene Regeln können Sie mit Abrechnungsregeln für Repositorys auflisten abrufen.
Berechtigungen
Erfordert einen Service-Benutzer oder ein persönliches Zugriffstoken mit der BerechtigungManageReview in der Organisation. Der Aufrufer kann Regeln nur für Repositories verwalten, die an diese Organisation delegiert sind, und Kosten nur über diese Organisation oder ein von ihr verwaltetes Budget abrechnen.
Verhalten
repositoryakzeptiertowner/repofür github.com,host/pathfür andere Anbieter oder eine vollständige Repository-URL. Es muss genau ein Repository bezeichnen. Wildcards werden mit422abgelehnt.- Ein Repository hat höchstens eine Regel. Wird ein Repository gesendet, für das bereits eine Regel existiert, wird nur der Kostenträger ersetzt; die
idder Regel bleibt unverändert. bill_to.typeistorganizationoderbudget, undbill_to.idist die entsprechende Organisations-ID bzw. Budget-ID. Für ein Ziel, das der Aufrufer nicht verwenden darf, wird400oder403zurückgegeben.- Die Regel gilt nur für künftige Reviews. Bereits abgerechnete Nutzung wird nicht umgebucht.
- Gibt
409zurück, wenn das Repository bereits über eine andere Git-Verbindung auf demselben Host zugeordnet ist oder wenn sich die Regel während der Anfrage geändert hat. Wiederholen Sie im zweiten Fall die Anfrage.
Body
application/json
Antwort
Erfolgreiche Antwort

