diff options
author | iddqd <iddqd@yandex-team.com> | 2024-06-11 10:12:13 +0300 |
---|---|---|
committer | iddqd <iddqd@yandex-team.com> | 2024-06-11 10:22:43 +0300 |
commit | 07f57e35443ab7f09471caf2dbf1afbcced4d9f7 (patch) | |
tree | a4a7b66ead62e83fa988a2ec2ce6576311c1f4b1 /contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing | |
parent | 6db3b8ca95e44179e48306a58656fb1f9317d9c3 (diff) | |
download | ydb-07f57e35443ab7f09471caf2dbf1afbcced4d9f7.tar.gz |
add contrib/python/yandexcloud to import
03b7d3cad2237366b55b393e18d4dc5eb222798c
Diffstat (limited to 'contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing')
11 files changed, 994 insertions, 0 deletions
diff --git a/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/billable_object.proto b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/billable_object.proto new file mode 100644 index 0000000000..ba0a3993a9 --- /dev/null +++ b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/billable_object.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package yandex.cloud.billing.v1; + +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/billing/v1;billing"; +option java_package = "yandex.cloud.api.billing.v1"; + + +// Represents a link to an object in other service. +// This object is being billed in the scope of a billing account. +message BillableObject { + + // ID of the object in other service. + string id = 1; + + // Billable object type. Can be one of the following: + // * `cloud` + string type = 2; +} + + +// Represents a binding of the BillableObject to a BillingAccount. +message BillableObjectBinding { + + // Timestamp when binding was created. + google.protobuf.Timestamp effective_time = 1; + + // Object that is bound to billing account. + BillableObject billable_object = 2; +} diff --git a/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/billing_account.proto b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/billing_account.proto new file mode 100644 index 0000000000..464a3145e7 --- /dev/null +++ b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/billing_account.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; +package yandex.cloud.billing.v1; + +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/billing/v1;billing"; +option java_package = "yandex.cloud.api.billing.v1"; + + +// A BillingAccount resource. For more information, see [BillingAccount](/docs/billing/concepts/billing-account). +message BillingAccount { + // ID of the billing account. + string id = 1; + + // Name of the billing account. + string name = 2; + + // Creation timestamp. + google.protobuf.Timestamp created_at = 3; + + // ISO 3166-1 alpha-2 country code of the billing account. + string country_code = 4; + + // Currency of the billing account. + // Can be one of the following: + // * `RUB` + // * `USD` + // * `KZT` + string currency = 5; + + // Represents whether corresponding billable objects can be used or not. + bool active = 6; + + // Current balance of the billing account. + string balance = 7; +} diff --git a/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/billing_account_service.proto b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/billing_account_service.proto new file mode 100644 index 0000000000..8bafe1180c --- /dev/null +++ b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/billing_account_service.proto @@ -0,0 +1,140 @@ +syntax = "proto3"; + +package yandex.cloud.billing.v1; + +import "google/api/annotations.proto"; + +import "yandex/cloud/access/access.proto"; +import "yandex/cloud/billing/v1/billing_account.proto"; +import "yandex/cloud/billing/v1/billable_object.proto"; +import "yandex/cloud/operation/operation.proto"; +import "yandex/cloud/api/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 BillingAccount resources. +service BillingAccountService { + + // Returns the specified billing account. + rpc Get(GetBillingAccountRequest) returns (BillingAccount) { + option (google.api.http) = { get: "/billing/v1/billingAccounts/{id}" }; + }; + + // Retrieves the list of billing accounts available for current user. + rpc List(ListBillingAccountsRequest) returns (ListBillingAccountsResponse) { + option (google.api.http) = { get: "/billing/v1/billingAccounts" }; + }; + + // Retrieves the list of billable object bindings associated with the specified billing account. + rpc ListBillableObjectBindings(ListBillableObjectBindingsRequest) returns (ListBillableObjectBindingsResponse) { + option (google.api.http) = { get: "/billing/v1/billingAccounts/{billing_account_id}/billableObjectBindings" }; + }; + + // Binds billable object to the specified billing account. + rpc BindBillableObject(BindBillableObjectRequest) returns (operation.Operation) { + option (google.api.http) = { post: "/billing/v1/billingAccounts/{billing_account_id}/billableObjectBindings" body: "*" }; + option (yandex.cloud.api.operation) = { + metadata: "BindBillableObjectMetadata" + response: "BillableObjectBinding" + }; + } + + // Lists access bindings for the specified billing account. + rpc ListAccessBindings(access.ListAccessBindingsRequest) returns (access.ListAccessBindingsResponse) { + option (google.api.http) = { get: "/billing/v1/billingAccounts/{resource_id}:listAccessBindings" }; + }; + + // Updates access bindings for the specified billing account. + rpc UpdateAccessBindings(access.UpdateAccessBindingsRequest) returns (operation.Operation) { + option (google.api.http) = { patch: "/billing/v1/billingAccounts/{resource_id}:updateAccessBindings" body: "*" }; + option (yandex.cloud.api.operation) = { + metadata: "access.UpdateAccessBindingsMetadata" + response: "google.protobuf.Empty" + }; + } +} + + +message GetBillingAccountRequest { + // ID of the billing account to return. + // To get the billing account ID, use [BillingAccountService.List] request. + string id = 1 [(required) = true, (length) = "<=50"]; +} + + +message ListBillingAccountsRequest { + + // The maximum number of results per page to return. If the number of available + // results is larger than [page_size], + // the service returns a [ListBillingAccountsResponse.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 [ListBillingAccountsResponse.next_page_token] + // returned by a previous list request. + string page_token = 3 [(length) = "<=100"]; +} + +message ListBillingAccountsResponse { + // List of billing accounts. + repeated BillingAccount billing_accounts = 1; + + // This token allows you to get the next page of results for list requests. If the number of results + // is larger than [ListBillingAccountsRequest.page_size], use + // [next_page_token] as the value + // for the [ListBillingAccountsRequest.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 ListBillableObjectBindingsRequest { + // ID of the billing account to list associated billable object bindings. + // 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 [ListBillableObjectBindingsResponse.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 [ListBillableObjectBindingsResponse.next_page_token] + // returned by a previous list request. + string page_token = 3 [(length) = "<=100"]; +} + +message ListBillableObjectBindingsResponse { + // List of billable object bindings. + repeated BillableObjectBinding billable_object_bindings = 1; + + // This token allows you to get the next page of results for list requests. If the number of results + // is larger than [ListBillableObjectBindingsRequest.page_size], use + // [next_page_token] as the value + // for the [ListBillableObjectBindingsRequest.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 BindBillableObjectRequest { + + // ID of the billing account to bind billable object. + // To get the billing account ID, use [BillingAccountService.List] request. + string billing_account_id = 1 [(required) = true, (length) = "<=50"]; + + // [yandex.cloud.billing.v1.BillableObject] to bind with billing account. + BillableObject billable_object = 2; +} + +message BindBillableObjectMetadata { + + // ID of the [yandex.cloud.billing.v1.BillableObject] that was bound to billing account. + string billable_object_id = 1; +} diff --git a/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/budget.proto b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/budget.proto new file mode 100644 index 0000000000..edd26d053d --- /dev/null +++ b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/budget.proto @@ -0,0 +1,221 @@ +syntax = "proto3"; + +package yandex.cloud.billing.v1; + +import "google/protobuf/timestamp.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 Budget resource. For more information, see [/docs/billing/concepts/budget]. +message Budget { + + // ID of the budget. + string id = 1; + + // Name of the budget. + string name = 2; + + // Creation timestamp. + google.protobuf.Timestamp created_at = 3; + + // ID of the billing account that the budget belongs to. + string billing_account_id = 4; + + // Status of the budget. + BudgetStatus status = 5; + + + // Specification of the budget. + oneof budget_spec { + option (exactly_one) = true; + + // Cost budget specification. + CostBudgetSpec cost_budget = 6; + + // Expense budget specification. + ExpenseBudgetSpec expense_budget = 7; + + // Balance budget specification. + BalanceBudgetSpec balance_budget = 8; + } +} + +enum BudgetStatus { + BUDGET_STATUS_UNSPECIFIED = 0; + + // The budget is being created. + CREATING = 1; + + // The budget is active. + ACTIVE = 2; + + // The budget is finished. + FINISHED = 3; +} + + +// Cost budget specification describes budget that can be used to control cost of cloud resources usage. +message CostBudgetSpec { + + // Max cost threshold of the budget. Amount currency is the same as corresponding [yandex.cloud.billing.v1.BillingAccount.currency]. + string amount = 1 [(required) = true]; + + // IDs of the [yandex.cloud.iam.v1.UserAccount]. + // Specified users will be be notified if the budget exceeds. + repeated string notification_user_account_ids = 2 [(size) = ">=1"]; + + // List of the [ThresholdRule]. + // Rules define intermediate cost thresholds of the budget. + repeated ThresholdRule threshold_rules = 3; + + // Filter that can be used for specific resources selection. Only consumption cost of selected resources are used for the budget calculation. + ConsumptionFilter filter = 4; + + // Start type of the budget. + oneof start_type { + option (exactly_one) = true; + + // Periodic start type that resets budget after specified period is finished. + // First time budget is calculated in the current period, i.e. current month, quarter or year. + ResetPeriodType reset_period = 5; + + // Custom start date of the budget. + // Must be the first day of a month and must be formatted like YYYY-MM-DD. + string start_date = 6; + } + + // End date of the budget. + // Must be the last day of a month and must be formatted like YYYY-MM-DD. + string end_date = 7 [(required) = true]; +} + +// Expense budget specification describes budget that can be used to control expense of cloud resources usage. +message ExpenseBudgetSpec { + + // Max expense threshold of the budget. Amount currency is the same as corresponding [yandex.cloud.billing.v1.BillingAccount.currency]. + string amount = 1 [(required) = true]; + + // IDs of the [yandex.cloud.iam.v1.UserAccount]. + // Specified users will be be notified if the budget exceeds. + repeated string notification_user_account_ids = 2 [(size) = ">=1"]; + + // List of the [ThresholdRule]. + // Rules define intermediate expense thresholds of the budget. + repeated ThresholdRule threshold_rules = 3; + + // Filter that can be used for specific resources selection. Only consumption expense of selected resources are used for the budget calculation. + ConsumptionFilter filter = 4; + + // Start type of the budget. + oneof start_type { + option (exactly_one) = true; + + // Periodic start type that resets budget after specified period is finished. + // First time budget is calculated in the current period, i.e. current month, quarter or year. + ResetPeriodType reset_period = 5; + + // Custom start date of the budget. + // Must be the first day of a month and must be formatted like YYYY-MM-DD. + string start_date = 6; + } + + // End date of the budget. + // Must be the last day of a month and must be formatted like YYYY-MM-DD. + string end_date = 7 [(required) = true]; +} + + +// Balance budget specification describes budget that can be used to control [yandex.cloud.billing.v1.BillingAccount.balance]. +message BalanceBudgetSpec { + + // Max balance threshold of the budget. Amount currency is the same as corresponding [yandex.cloud.billing.v1.BillingAccount.currency]. + string amount = 1 [(required) = true]; + + // IDs of the [yandex.cloud.iam.v1.UserAccount]. + // Specified users will be be notified if the budget exceeds. + repeated string notification_user_account_ids = 2 [(size) = ">=1"]; + + // List of the [ThresholdRule]. + // Rules define intermediate balance thresholds of the budget. + repeated ThresholdRule threshold_rules = 3; + + // Start_date of the budget. + // Must be the first day of a month and must be formatted like YYYY-MM-DD. + string start_date = 4; + + // End date of the budget. + // Must be the last day of a month and must be formatted like YYYY-MM-DD. + string end_date = 5 [(required) = true]; +} + +enum ResetPeriodType { + RESET_PERIOD_TYPE_UNSPECIFIED = 0; + + // Reset budget every month. + MONTHLY = 1; + + // Reset budget every quarter. + QUARTER = 2; + + // Reset budget every year. + ANNUALLY = 3; +} + + +// Filter that can be used for specific resources selection. +message ConsumptionFilter { + + // IDs of the [yandex.cloud.billing.v1.Service]. + // Only consumption of resources corresponding to the given services is used for the budget calculation. + // Empty sequence means no services filters. + repeated string service_ids = 1; + + // Cloud and folders consumption filter. + // Only consumption within specified clouds and folders is used for the budget calculation. + // Empty sequence means no cloud and folders filters. + repeated CloudFoldersConsumptionFilter cloud_folders_filters = 2; +} + + +// Filter that can be used for specific cloud and its folders selection. +message CloudFoldersConsumptionFilter { + + // ID of the [yandex.cloud.resourcemanager.v1.Cloud]. + // Only consumption within specified cloud is used for the budget calculation. + string cloud_id = 1; + + // IDs of the [yandex.cloud.resourcemanager.v1.Folder]. + // Only consumption within specified folders of the given cloud is used for the budget calculation. + // Empty sequence means no folders filters and the whole cloud consumption will be used. + repeated string folder_ids = 2; +} + +// Rules that define intermediate cost thresholds of the budget. +message ThresholdRule { + + // Type of the rule. + ThresholdType type = 1 [(required) = true]; + + // Amount of the rule. + // * Must be less than 100 if type is PERCENT. + // * Must be less than budget's amount if type is AMOUNT. + string amount = 2 [(required) = true]; + + // IDs of the [yandex.cloud.iam.v1.UserAccount]. + // Specified users will be be notified if the threshold exceeds. + repeated string notification_user_account_ids = 3; +} + +// Define the unit of the [ThesholdRule.amount]. +enum ThresholdType { + THRESHOLD_TYPE_UNSPECIFIED = 0; + + // Percent. + PERCENT = 1; + + // The same as budget amount. + AMOUNT = 2; +} diff --git a/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/budget_service.proto b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/budget_service.proto new file mode 100644 index 0000000000..cd43f9800e --- /dev/null +++ b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/budget_service.proto @@ -0,0 +1,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; +} diff --git a/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/customer.proto b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/customer.proto new file mode 100644 index 0000000000..bf52d826d7 --- /dev/null +++ b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/customer.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; +package yandex.cloud.billing.v1; + +option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/billing/v1;billing"; +option java_package = "yandex.cloud.api.billing.v1"; + + +// A Customer resource. +message Customer { + + // ID of the customer. + string id = 1; + + // ID of the [yandex.cloud.billing.v1.BillingAccount] assigned to the customer. + string billing_account_id = 2; +} + +// Person of the customer. Contains legal information. +message CustomerPerson { + + // Name of the person. + string name = 1; + + // Long name of the person. + string longname = 2; + + // Phone of the person. + string phone = 3; + + // Email of the person. + string email = 4; + + // Post code of the person. + string post_code = 5; + + // Post address of the person. + string post_address = 6; + + // Legal address of the person. + string legal_address = 7; + + // Tax identification number of the person. + string tin = 8; +} diff --git a/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/customer_service.proto b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/customer_service.proto new file mode 100644 index 0000000000..f4ed9207ed --- /dev/null +++ b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/customer_service.proto @@ -0,0 +1,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; +} diff --git a/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/service.proto b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/service.proto new file mode 100644 index 0000000000..c4120038d9 --- /dev/null +++ b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/service.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package yandex.cloud.billing.v1; + +option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/billing/v1;billing"; +option java_package = "yandex.cloud.api.billing.v1"; + + +// A Service resource. +message Service { + + // ID of the service. + string id = 1; + + // Name of the service, e.g. `Compute Cloud`, `VPC`. + string name = 2; + + // Description of the service. + string description = 3; +} diff --git a/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/service_service.proto b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/service_service.proto new file mode 100644 index 0000000000..bd6f54a67b --- /dev/null +++ b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/service_service.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; + +package yandex.cloud.billing.v1; + +import "google/api/annotations.proto"; + +import "yandex/cloud/billing/v1/service.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 Service resources. +service ServiceService { + + // Returns the specified service. + rpc Get(GetServiceRequest) returns (Service) { + option (google.api.http) = { get: "/billing/v1/services/{id}" }; + }; + + // Retrieves the list of services. + rpc List(ListServicesRequest) returns (ListServicesResponse){ + option (google.api.http) = { get: "/billing/v1/services" }; + }; + +} + +message GetServiceRequest { + // ID of the service to return. + // To get the service ID, use [ServiceService.List] request. + string id = 1 [(required) = true, (length) = "<=50"]; +} + +message ListServicesRequest { + + // A filter expression that filters resources listed in the response. + // The expression must specify: + // 1. The field name. Currently you can use filtering only on the [yandex.cloud.billing.v1.Service.id] field. + // 2. An `=` operator. + // 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-z][-a-z0-9]{1,61}[a-z0-9]`. + string filter = 1 [(length) = "<=1000"]; + + // The maximum number of results per page to return. If the number of available + // results is larger than [page_size], + // the service returns a [ListServicesResponse.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 [ListServicesResponse.next_page_token] + // returned by a previous list request. + string page_token = 3 [(length) = "<=100"]; +} + +message ListServicesResponse { + + // List of services. + repeated Service services = 1; + + // This token allows you to get the next page of results for list requests. If the number of results + // is larger than [ListServicesRequest.page_size], use + // [next_page_token] as the value + // for the [ListServicesRequest.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; +} diff --git a/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/sku.proto b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/sku.proto new file mode 100644 index 0000000000..d7b268ca5c --- /dev/null +++ b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/sku.proto @@ -0,0 +1,85 @@ +syntax = "proto3"; +package yandex.cloud.billing.v1; + +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/billing/v1;billing"; +option java_package = "yandex.cloud.api.billing.v1"; + + +// A Stock keeping unit resource. +message Sku { + + // ID of the SKU. + string id = 1; + + // Name of the SKU. + string name = 2; + + // Description of the sku. + string description = 3; + + // ID of the service that sku belongs to. + string service_id = 4; + + // Pricing unit of the SKU, e.g. `core*hour`, `gbyte*hour`. + string pricing_unit = 5; + + // List of pricing versions. + repeated PricingVersion pricing_versions = 6; +} + + +// Pricing version of the SKU. +// Defines current and past prices for the sku. +message PricingVersion { + + // Type of the pricing version. + PricingVersionType type = 1; + + // Timestamp pricing version is active since inclusive. + // The pricing version is active until next pricing version effective time exclusive. + google.protobuf.Timestamp effective_time = 2; + + // List of pricing expressions. + repeated PricingExpression pricing_expressions = 3; +} + + +// Type of the pricing version. +enum PricingVersionType { + + PRICING_VERSION_TYPE_UNSPECIFIED = 0; + + // Regular price. + STREET_PRICE = 1; + + // Price is overridden by a contract. Defined in the scope of a billing account. + CONTRACT_PRICE = 2; +} + +// Pricing expression of the pricing version. +// Defines price for the sku. +message PricingExpression { + + // List of rates. + repeated Rate rates = 2; +} + +// Rate of the pricing expression. +// Define unit price for pricing quantity interval. +message Rate { + + // Start of the pricing quantity interval. The end of the interval is the start pricing quantity of the next rate. + string start_pricing_quantity = 1; + + // Unit price for the pricing quantity interval. + string unit_price = 2; + + // Currency of the unit price. + // Can be one of the following: + // * `RUB` + // * `USD` + // * `KZT` + string currency = 3; +} diff --git a/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/sku_service.proto b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/sku_service.proto new file mode 100644 index 0000000000..176a1922bd --- /dev/null +++ b/contrib/libs/yandex-cloud-api-protos/yandex/cloud/billing/v1/sku_service.proto @@ -0,0 +1,93 @@ +syntax = "proto3"; + +package yandex.cloud.billing.v1; + +import "google/api/annotations.proto"; + +import "yandex/cloud/billing/v1/sku.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 Sku resources. +service SkuService { + + // Returns the specified SKU. + rpc Get(GetSkuRequest) returns (Sku) { + option (google.api.http) = { get: "/billing/v1/skus/{id}" }; + }; + + // Retrieves the list of SKUs. + rpc List(ListSkusRequest) returns (ListSkusResponse) { + option (google.api.http) = { get: "/billing/v1/skus" }; + }; +} + +message GetSkuRequest { + + // ID of the SKU to return. + // To get the SKU ID, use [SkuService.List] request. + string id = 1 [(required) = true, (length) = "<=50"]; + + // Currency of the SKU. + // Can be one of the following: + // * `RUB` + // * `USD` + // * `KZT` + string currency = 2 [(required) = true]; + + // Optional ID of the billing account. + // If specified, contract prices for a particular billing account are included in the response. + // To get the billing account ID, use [BillingAccountService.List] request. + string billing_account_id = 3; +} + +message ListSkusRequest { + + // Currency of the prices. + // Can be one of the following: + // * `RUB` + // * `USD` + // * `KZT` + string currency = 1 [(required) = true]; + + // Optional ID of the billing account. + // If specified, contract prices for a particular billing account are included in the response. + // To get the billing account ID, use [BillingAccountService.List] request. + string billing_account_id = 2; + + // A filter expression that filters resources listed in the response. + // The expression must specify: + // 1. The field name. Currently you can use filtering only on the [yandex.cloud.billing.v1.Sku.id] and [yandex.cloud.billing.v1.Sku.service_id] field. + // 2. An `=` operator. + // 3. The value in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-z][-a-z0-9]{1,61}[a-z0-9]`. + string filter = 3 [(length) = "<=1000"]; + + + // The maximum number of results per page to return. If the number of available + // results is larger than [page_size], + // the service returns a [ListSkusResponse.next_page_token] + // that can be used to get the next page of results in subsequent list requests. + int64 page_size = 4 [(value) = "<=1000"]; + + // Page token. To get the next page of results, + // set [page_token] to the [ListSkusResponse.next_page_token] + // returned by a previous list request. + string page_token = 5 [(length) = "<=100"]; +} + +message ListSkusResponse { + + // List of skus. + repeated Sku skus = 1; + + // This token allows you to get the next page of results for list requests. If the number of results + // is larger than [ListSkusRequest.page_size], use + // [next_page_token] as the value + // for the [ListSkusRequest.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; +} |