aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/customer_service.proto
blob: f4ed9207ed4278dc31509e77140afd6e13a83a7a (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
syntax = "proto3";

package yandex.cloud.billing.v1;

import "google/api/annotations.proto";
import "yandex/cloud/api/operation.proto";
import "yandex/cloud/billing/v1/customer.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 Customer resources.
service CustomerService {
  // Retrieves the list of customers associated with the specified reseller.
  rpc List(ListCustomersRequest) returns (ListCustomersResponse) {
    option (google.api.http) = {get: "/billing/v1/customers"};
  }

  // Invites customer to the specified reseller.
  rpc Invite(InviteCustomerRequest) returns (operation.Operation) {
    option (google.api.http) = {
      post: "/billing/v1/customers:invite"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "CustomerMetadata"
      response: "Customer"
    };
  }

  // Creates new reseller-served customer.
  rpc CreateResellerServed(CreateResellerServedCustomerRequest) returns (operation.Operation) {
    option (google.api.http) = {
      post: "/billing/v1/customers:createResellerServedCustomer"
      body: "*"
    };
    option (yandex.cloud.api.operation) = {
      metadata: "CustomerMetadata"
      response: "Customer"
    };
  }

  // Activates specified customer. After customer is activated, he can use resources associated with his billing account.
  rpc Activate(ActivateCustomerRequest) returns (operation.Operation) {
    option (google.api.http) = {post: "/billing/v1/customers/{customer_id}:activate"};
    option (yandex.cloud.api.operation) = {
      metadata: "CustomerMetadata"
      response: "Customer"
    };
  }

  // Suspend specified customer. After customer is suspended, he can't use resources associated with his billing account.
  rpc Suspend(SuspendCustomerRequest) returns (operation.Operation) {
    option (google.api.http) = {post: "/billing/v1/customers/{customer_id}:suspend"};
    option (yandex.cloud.api.operation) = {
      metadata: "CustomerMetadata"
      response: "Customer"
    };
  }
}

message ListCustomersRequest {
  reserved 2;

  // ID of the reseller.
  string reseller_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 [ListCustomersResponse.next_page_token]
  // that can be used to get the next page of results in subsequent list requests.
  int64 page_size = 3 [(value) = "<=1000"];

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

message ListCustomersResponse {
  // List of customers.
  repeated Customer customers = 1;

  // This token allows you to get the next page of results for list requests. If the number of results
  // is larger than [ListCustomersRequest.page_size], use
  // [next_page_token] as the value
  // for the [ListCustomersRequest.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 InviteCustomerRequest {
  // ID of the reseller that customer will be associated with.
  string reseller_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

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

  // Customer email to send invitation to.
  string invitation_email = 3 [(required) = true];

  // Person of the customer.
  CustomerPerson person = 4 [(required) = true];
}

message CreateResellerServedCustomerRequest {
  // ID of the reseller that customer will be associated with.
  string reseller_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];

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

  // Person of the customer.
  CustomerPerson person = 3 [(required) = true];
}

message ActivateCustomerRequest {
  // ID of the customer.
  // To get the customer ID, use [CustomerService.List] request.
  string customer_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];
}

message SuspendCustomerRequest {
  // ID of the customer.
  // To get the customer ID, use [CustomerService.List] request.
  string customer_id = 1 [
    (required) = true,
    (length) = "<=50"
  ];
}

message CustomerMetadata {
  // ID of the reseller.
  string reseller_id = 1;

  // ID of the customer.
  string customer_id = 2;
}