aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/budget_service.proto
blob: cd43f9800ed9e1160c4592a72f7e1d34bdf8540f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
syntax = "proto3";

package yandex.cloud.billing.v1;

import "google/api/annotations.proto";

import "yandex/cloud/billing/v1/budget.proto";
import "yandex/cloud/api/operation.proto";
import "yandex/cloud/operation/operation.proto";
import "yandex/cloud/validation.proto";

option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/billing/v1;billing";
option java_package = "yandex.cloud.api.billing.v1";


// A set of methods for managing Budget resources.
service BudgetService {

    // Returns the specified budget.
    rpc Get(GetBudgetRequest) returns (Budget) {
        option (google.api.http) = { get: "/billing/v1/budgets/{id}" };
    };

    // Retrieves the list of budgets corresponding to the specified billing account.
    rpc List(ListBudgetsRequest) returns (ListBudgetsResponse) {
        option (google.api.http) = { get: "/billing/v1/budgets" };
    };

    // Creates a budget for the specified billing account.
    rpc Create(CreateBudgetRequest) returns (operation.Operation) {
        option (google.api.http) = { post: "/billing/v1/budgets" body: "*" };
        option (yandex.cloud.api.operation) = {
            metadata: "CreateBudgetMetadata"
            response: "Budget"
        };
    }
}

message GetBudgetRequest {
    // ID of the budget to return.
    // To get the budget ID, use [BudgetService.List] request.
    string id = 1 [(required) = true, (length) = "<=50"];
}

message ListBudgetsRequest {
    // ID of the billing account to list budgets corresponding to.
    // To get the billing account ID, use [BillingAccountService.List] request.
    string billing_account_id = 1 [(required) = true, (length) = "<=50"];

    // The maximum number of results per page to return. If the number of available
    // results is larger than [page_size],
    // the service returns a [ListBudgetsResponse.next_page_token]
    // that can be used to get the next page of results in subsequent list requests.
    int64 page_size = 2 [(value) = "<=1000"];

    // Page token. To get the next page of results,
    // set [page_token] to the [ListBudgetsResponse.next_page_token]
    // returned by a previous list request.
    string page_token = 3 [(length) = "<=100"];
}

message ListBudgetsResponse {

    // List of budgets.
    repeated Budget budgets = 1;

    // This token allows you to get the next page of results for list requests. If the number of results
    // is larger than [ListBudgetsRequest.page_size], use
    // [next_page_token] as the value
    // for the [ListBudgetsRequest.page_token] query parameter
    // in the next list request. Each subsequent list request will have its own
    // [next_page_token] to continue paging through the results.
    string next_page_token = 2;
}

message CreateBudgetRequest {

    // ID of the billing account to list budgets corresponding to.
    // To get the billing account ID, use [yandex.cloud.billing.v1.BillingAccountService.List] request.
    string billing_account_id = 1 [(required) = true, (length) = "<=50"];

    // Name of the budget.
    string name = 2 [(required) = true];

    // Specification of the budget.
    oneof budget_spec {
        option (exactly_one) = true;

        // Cost budget specification.
        CostBudgetSpec cost_budget_spec = 3;

        // Expense budget specification.
        ExpenseBudgetSpec expense_budget_spec = 4;

        // Balance budget specification.
        BalanceBudgetSpec balance_budget_spec = 5;
    }
}

message CreateBudgetMetadata {

    // ID of the budget.
    string budget_id = 1;
}